summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore7
-rw-r--r--application/config/autoload.php26
-rw-r--r--application/config/config.php38
-rw-r--r--application/config/constants.php37
-rw-r--r--application/config/database.php36
-rw-r--r--application/config/doctypes.php28
-rw-r--r--application/config/foreign_chars.php30
-rw-r--r--application/config/hooks.php26
-rw-r--r--application/config/memcached.php46
-rw-r--r--application/config/migration.php134
-rw-r--r--application/config/mimes.php84
-rw-r--r--application/config/profiler.php26
-rw-r--r--application/config/routes.php28
-rw-r--r--application/config/smileys.php28
-rw-r--r--application/config/user_agents.php332
-rw-r--r--application/controllers/welcome.php27
-rw-r--r--application/errors/error_404.php29
-rw-r--r--application/errors/error_db.php29
-rw-r--r--application/errors/error_general.php29
-rw-r--r--application/errors/error_php.php45
-rw-r--r--application/views/welcome_message.php30
-rw-r--r--index.php85
-rw-r--r--license.rst245
-rw-r--r--license.txt223
-rw-r--r--license_afl.rst245
-rw-r--r--license_afl.txt172
-rw-r--r--readme.rst196
-rwxr-xr-xsystem/core/Benchmark.php37
-rwxr-xr-xsystem/core/CodeIgniter.php64
-rw-r--r--system/core/Common.php168
-rwxr-xr-xsystem/core/Config.php132
-rw-r--r--system/core/Controller.php34
-rwxr-xr-xsystem/core/Exceptions.php97
-rwxr-xr-xsystem/core/Hooks.php59
-rwxr-xr-xsystem/core/Input.php210
-rwxr-xr-xsystem/core/Lang.php44
-rw-r--r--system/core/Loader.php143
-rwxr-xr-xsystem/core/Model.php37
-rwxr-xr-xsystem/core/Output.php171
-rwxr-xr-xsystem/core/Router.php123
-rwxr-xr-xsystem/core/Security.php340
-rwxr-xr-xsystem/core/URI.php210
-rw-r--r--system/core/Utf8.php69
-rwxr-xr-xsystem/database/DB.php73
-rw-r--r--system/database/DB_active_rec.php786
-rw-r--r--system/database/DB_cache.php65
-rw-r--r--system/database/DB_driver.php146
-rw-r--r--system/database/DB_forge.php151
-rw-r--r--system/database/DB_result.php99
-rw-r--r--system/database/DB_utility.php177
-rw-r--r--system/database/drivers/cubrid/cubrid_driver.php20
-rw-r--r--system/database/drivers/cubrid/cubrid_forge.php20
-rw-r--r--system/database/drivers/cubrid/cubrid_result.php20
-rw-r--r--system/database/drivers/cubrid/cubrid_utility.php20
-rw-r--r--system/database/drivers/mssql/mssql_driver.php41
-rw-r--r--system/database/drivers/mssql/mssql_forge.php20
-rw-r--r--system/database/drivers/mssql/mssql_result.php20
-rw-r--r--system/database/drivers/mssql/mssql_utility.php20
-rw-r--r--system/database/drivers/mysql/mysql_driver.php363
-rw-r--r--system/database/drivers/mysql/mysql_forge.php147
-rw-r--r--system/database/drivers/mysql/mysql_result.php73
-rw-r--r--system/database/drivers/mysql/mysql_utility.php91
-rw-r--r--system/database/drivers/mysqli/mysqli_driver.php366
-rw-r--r--system/database/drivers/mysqli/mysqli_forge.php153
-rw-r--r--system/database/drivers/mysqli/mysqli_result.php73
-rw-r--r--system/database/drivers/mysqli/mysqli_utility.php50
-rw-r--r--system/database/drivers/oci8/oci8_driver.php32
-rw-r--r--system/database/drivers/oci8/oci8_forge.php20
-rw-r--r--system/database/drivers/oci8/oci8_result.php26
-rw-r--r--system/database/drivers/oci8/oci8_utility.php20
-rw-r--r--system/database/drivers/odbc/odbc_driver.php20
-rw-r--r--system/database/drivers/odbc/odbc_forge.php20
-rw-r--r--system/database/drivers/odbc/odbc_result.php20
-rw-r--r--system/database/drivers/odbc/odbc_utility.php20
-rw-r--r--system/database/drivers/pdo/pdo_driver.php298
-rw-r--r--system/database/drivers/pdo/pdo_forge.php28
-rw-r--r--system/database/drivers/pdo/pdo_result.php83
-rw-r--r--system/database/drivers/pdo/pdo_utility.php16
-rw-r--r--system/database/drivers/postgre/postgre_driver.php20
-rw-r--r--system/database/drivers/postgre/postgre_forge.php129
-rw-r--r--system/database/drivers/postgre/postgre_result.php20
-rw-r--r--system/database/drivers/postgre/postgre_utility.php20
-rw-r--r--system/database/drivers/sqlite/sqlite_driver.php20
-rw-r--r--system/database/drivers/sqlite/sqlite_forge.php20
-rw-r--r--system/database/drivers/sqlite/sqlite_result.php20
-rw-r--r--system/database/drivers/sqlite/sqlite_utility.php20
-rw-r--r--system/database/drivers/sqlsrv/sqlsrv_driver.php43
-rw-r--r--system/database/drivers/sqlsrv/sqlsrv_forge.php20
-rw-r--r--system/database/drivers/sqlsrv/sqlsrv_result.php20
-rw-r--r--system/database/drivers/sqlsrv/sqlsrv_utility.php20
-rw-r--r--system/helpers/array_helper.php20
-rw-r--r--system/helpers/captcha_helper.php22
-rw-r--r--system/helpers/cookie_helper.php20
-rw-r--r--system/helpers/date_helper.php244
-rw-r--r--system/helpers/directory_helper.php20
-rw-r--r--system/helpers/download_helper.php46
-rw-r--r--system/helpers/email_helper.php27
-rw-r--r--system/helpers/file_helper.php98
-rw-r--r--system/helpers/form_helper.php95
-rw-r--r--system/helpers/html_helper.php86
-rw-r--r--system/helpers/inflector_helper.php154
-rw-r--r--system/helpers/language_helper.php25
-rw-r--r--system/helpers/number_helper.php25
-rw-r--r--system/helpers/path_helper.php36
-rw-r--r--system/helpers/security_helper.php39
-rw-r--r--system/helpers/smiley_helper.php22
-rw-r--r--system/helpers/string_helper.php29
-rw-r--r--system/helpers/text_helper.php20
-rw-r--r--system/helpers/typography_helper.php29
-rw-r--r--system/helpers/url_helper.php156
-rw-r--r--system/helpers/xml_helper.php42
-rw-r--r--system/language/english/calendar_lang.php25
-rw-r--r--system/language/english/date_lang.php33
-rw-r--r--system/language/english/db_lang.php25
-rw-r--r--system/language/english/email_lang.php25
-rw-r--r--system/language/english/form_validation_lang.php27
-rw-r--r--system/language/english/ftp_lang.php25
-rw-r--r--system/language/english/imglib_lang.php25
-rw-r--r--system/language/english/migration_lang.php27
-rw-r--r--system/language/english/number_lang.php25
-rw-r--r--system/language/english/profiler_lang.php25
-rw-r--r--system/language/english/unit_test_lang.php25
-rw-r--r--system/language/english/upload_lang.php25
-rw-r--r--system/libraries/Cache/Cache.php54
-rw-r--r--system/libraries/Cache/drivers/Cache_apc.php45
-rw-r--r--system/libraries/Cache/drivers/Cache_dummy.php24
-rw-r--r--system/libraries/Cache/drivers/Cache_file.php75
-rw-r--r--system/libraries/Cache/drivers/Cache_memcached.php107
-rw-r--r--system/libraries/Calendar.php163
-rw-r--r--system/libraries/Cart.php205
-rw-r--r--system/libraries/Driver.php29
-rw-r--r--system/libraries/Email.php520
-rw-r--r--system/libraries/Encrypt.php231
-rw-r--r--system/libraries/Form_validation.php282
-rw-r--r--system/libraries/Ftp.php118
-rw-r--r--system/libraries/Image_lib.php824
-rw-r--r--system/libraries/Javascript.php174
-rw-r--r--system/libraries/Log.php53
-rw-r--r--system/libraries/Migration.php83
-rw-r--r--system/libraries/Pagination.php201
-rw-r--r--system/libraries/Parser.php56
-rw-r--r--system/libraries/Profiler.php247
-rw-r--r--system/libraries/Session.php341
-rw-r--r--system/libraries/Sha1.php251
-rw-r--r--system/libraries/Table.php136
-rw-r--r--system/libraries/Trackback.php138
-rw-r--r--system/libraries/Typography.php121
-rw-r--r--system/libraries/Unit_test.php122
-rw-r--r--system/libraries/Upload.php82
-rw-r--r--system/libraries/User_agent.php123
-rw-r--r--system/libraries/Xmlrpc.php451
-rw-r--r--system/libraries/Xmlrpcs.php160
-rw-r--r--system/libraries/Zip.php26
-rw-r--r--system/libraries/javascript/Jquery.php433
-rw-r--r--user_guide/changelog.html1465
-rw-r--r--user_guide/database/active_record.html824
-rw-r--r--user_guide/database/caching.html220
-rw-r--r--user_guide/database/call_function.html118
-rw-r--r--user_guide/database/configuration.html164
-rw-r--r--user_guide/database/connecting.html188
-rw-r--r--user_guide/database/examples.html217
-rw-r--r--user_guide/database/fields.html163
-rw-r--r--user_guide/database/forge.html234
-rw-r--r--user_guide/database/helpers.html151
-rw-r--r--user_guide/database/index.html99
-rw-r--r--user_guide/database/queries.html158
-rw-r--r--user_guide/database/results.html259
-rw-r--r--user_guide/database/table_data.html113
-rw-r--r--user_guide/database/transactions.html200
-rw-r--r--user_guide/database/utilities.html314
-rw-r--r--user_guide/doc_style/index.html87
-rw-r--r--user_guide/doc_style/template.html128
-rw-r--r--user_guide/general/alternative_php.html147
-rw-r--r--user_guide/general/ancillary_classes.html117
-rw-r--r--user_guide/general/autoloader.html100
-rw-r--r--user_guide/general/caching.html115
-rw-r--r--user_guide/general/cli.html150
-rw-r--r--user_guide/general/common_functions.html127
-rw-r--r--user_guide/general/controllers.html388
-rw-r--r--user_guide/general/core_classes.html186
-rw-r--r--user_guide/general/creating_drivers.html100
-rw-r--r--user_guide/general/creating_libraries.html293
-rw-r--r--user_guide/general/credits.html87
-rw-r--r--user_guide/general/drivers.html104
-rw-r--r--user_guide/general/environments.html126
-rw-r--r--user_guide/general/errors.html140
-rw-r--r--user_guide/general/helpers.html185
-rw-r--r--user_guide/general/hooks.html165
-rw-r--r--user_guide/general/libraries.html98
-rw-r--r--user_guide/general/managing_apps.html133
-rw-r--r--user_guide/general/models.html251
-rw-r--r--user_guide/general/profiling.html181
-rw-r--r--user_guide/general/quick_reference.html77
-rw-r--r--user_guide/general/requirements.html82
-rw-r--r--user_guide/general/reserved_names.html128
-rw-r--r--user_guide/general/routing.html171
-rw-r--r--user_guide/general/security.html164
-rw-r--r--user_guide/general/styleguide.html679
-rw-r--r--user_guide/general/urls.html151
-rw-r--r--user_guide/general/views.html274
-rw-r--r--user_guide/helpers/array_helper.html170
-rw-r--r--user_guide/helpers/captcha_helper.html195
-rw-r--r--user_guide/helpers/cookie_helper.html107
-rw-r--r--user_guide/helpers/date_helper.html408
-rw-r--r--user_guide/helpers/directory_helper.html143
-rw-r--r--user_guide/helpers/download_helper.html112
-rw-r--r--user_guide/helpers/email_helper.html102
-rw-r--r--user_guide/helpers/file_helper.html179
-rw-r--r--user_guide/helpers/form_helper.html484
-rw-r--r--user_guide/helpers/html_helper.html390
-rw-r--r--user_guide/helpers/inflector_helper.html151
-rw-r--r--user_guide/helpers/language_helper.html98
-rw-r--r--user_guide/helpers/number_helper.html113
-rw-r--r--user_guide/helpers/path_helper.html106
-rw-r--r--user_guide/helpers/security_helper.html132
-rw-r--r--user_guide/helpers/smiley_helper.html215
-rw-r--r--user_guide/helpers/string_helper.html189
-rw-r--r--user_guide/helpers/text_helper.html211
-rw-r--r--user_guide/helpers/typography_helper.html112
-rw-r--r--user_guide/helpers/url_helper.html302
-rw-r--r--user_guide/helpers/xml_helper.html105
-rw-r--r--user_guide/images/appflowchart.gifbin12363 -> 0 bytes
-rw-r--r--user_guide/images/codeigniter_1.7.1_helper_reference.pdfbin499096 -> 0 bytes
-rw-r--r--user_guide/images/codeigniter_1.7.1_library_reference.pngbin111747 -> 0 bytes
-rw-r--r--user_guide/images/nav_bg_darker.jpgbin445 -> 0 bytes
-rw-r--r--user_guide/images/nav_separator_darker.jpgbin304 -> 0 bytes
-rw-r--r--user_guide/images/nav_toggle_darker.jpgbin1917 -> 0 bytes
-rwxr-xr-xuser_guide/images/reactor-bullet.pngbin781 -> 0 bytes
-rw-r--r--user_guide/images/transparent.gifbin43 -> 0 bytes
-rw-r--r--user_guide/index.html98
-rw-r--r--user_guide/installation/downloads.html115
-rw-r--r--user_guide/installation/index.html108
-rw-r--r--user_guide/installation/troubleshooting.html90
-rw-r--r--user_guide/installation/upgrade_120.html92
-rw-r--r--user_guide/installation/upgrade_130.html203
-rw-r--r--user_guide/installation/upgrade_131.html102
-rw-r--r--user_guide/installation/upgrade_132.html100
-rw-r--r--user_guide/installation/upgrade_133.html112
-rw-r--r--user_guide/installation/upgrade_140.html145
-rw-r--r--user_guide/installation/upgrade_141.html148
-rw-r--r--user_guide/installation/upgrade_150.html178
-rw-r--r--user_guide/installation/upgrade_152.html111
-rw-r--r--user_guide/installation/upgrade_153.html100
-rw-r--r--user_guide/installation/upgrade_154.html116
-rw-r--r--user_guide/installation/upgrade_160.html125
-rw-r--r--user_guide/installation/upgrade_161.html98
-rw-r--r--user_guide/installation/upgrade_162.html106
-rw-r--r--user_guide/installation/upgrade_163.html99
-rw-r--r--user_guide/installation/upgrade_170.html121
-rw-r--r--user_guide/installation/upgrade_171.html98
-rw-r--r--user_guide/installation/upgrade_172.html109
-rw-r--r--user_guide/installation/upgrade_200.html131
-rw-r--r--user_guide/installation/upgrade_201.html105
-rw-r--r--user_guide/installation/upgrade_202.html97
-rw-r--r--user_guide/installation/upgrade_203.html121
-rw-r--r--user_guide/installation/upgrade_210.html89
-rw-r--r--user_guide/installation/upgrade_b11.html144
-rw-r--r--user_guide/installation/upgrading.html106
-rw-r--r--user_guide/libraries/benchmark.html198
-rw-r--r--user_guide/libraries/caching.html193
-rw-r--r--user_guide/libraries/calendar.html249
-rw-r--r--user_guide/libraries/cart.html346
-rw-r--r--user_guide/libraries/config.html222
-rw-r--r--user_guide/libraries/email.html307
-rw-r--r--user_guide/libraries/encryption.html224
-rw-r--r--user_guide/libraries/file_uploading.html451
-rw-r--r--user_guide/libraries/form_validation.html1250
-rw-r--r--user_guide/libraries/ftp.html315
-rw-r--r--user_guide/libraries/image_lib.html667
-rw-r--r--user_guide/libraries/input.html295
-rw-r--r--user_guide/libraries/javascript.html247
-rw-r--r--user_guide/libraries/language.html137
-rw-r--r--user_guide/libraries/loader.html273
-rw-r--r--user_guide/libraries/migration.html176
-rw-r--r--user_guide/libraries/output.html177
-rw-r--r--user_guide/libraries/pagination.html233
-rw-r--r--user_guide/libraries/parser.html212
-rw-r--r--user_guide/libraries/security.html135
-rw-r--r--user_guide/libraries/sessions.html341
-rw-r--r--user_guide/libraries/table.html315
-rw-r--r--user_guide/libraries/trackback.html246
-rw-r--r--user_guide/libraries/typography.html160
-rw-r--r--user_guide/libraries/unit_testing.html226
-rw-r--r--user_guide/libraries/uri.html252
-rw-r--r--user_guide/libraries/user_agent.html226
-rw-r--r--user_guide/libraries/xmlrpc.html519
-rw-r--r--user_guide/libraries/zip.html288
-rw-r--r--user_guide/license.html107
-rw-r--r--user_guide/nav/hacks.txt10
-rwxr-xr-xuser_guide/nav/moo.fx.js83
-rw-r--r--user_guide/nav/nav.js156
-rwxr-xr-xuser_guide/nav/prototype.lite.js127
-rw-r--r--user_guide/nav/user_guide_menu.js4
-rw-r--r--user_guide/overview/appflow.html95
-rw-r--r--user_guide/overview/at_a_glance.html162
-rw-r--r--user_guide/overview/cheatsheets.html83
-rw-r--r--user_guide/overview/features.html118
-rw-r--r--user_guide/overview/getting_started.html92
-rw-r--r--user_guide/overview/goals.html98
-rw-r--r--user_guide/overview/index.html84
-rw-r--r--user_guide/overview/mvc.html100
-rw-r--r--user_guide/toc.html229
-rw-r--r--user_guide/tutorial/conclusion.html91
-rw-r--r--user_guide/tutorial/create_news_items.html179
-rw-r--r--user_guide/tutorial/hard_coded_pages.html158
-rw-r--r--user_guide/tutorial/index.html101
-rw-r--r--user_guide/tutorial/news_section.html230
-rw-r--r--user_guide/tutorial/static_pages.html206
-rw-r--r--user_guide/userguide.css415
-rw-r--r--user_guide_src/Makefile130
-rw-r--r--user_guide_src/README.rst63
-rw-r--r--user_guide_src/cilexer/README22
-rw-r--r--user_guide_src/cilexer/cilexer/__init__.py1
-rw-r--r--user_guide_src/cilexer/cilexer/cilexer.py46
-rw-r--r--user_guide_src/cilexer/setup.py23
-rw-r--r--user_guide_src/source/_themes/eldocs/layout.html172
-rw-r--r--user_guide_src/source/_themes/eldocs/static/asset/css/common.css313
-rw-r--r--user_guide_src/source/_themes/eldocs/static/asset/img/ci-logo.gifbin0 -> 773 bytes
-rw-r--r--user_guide_src/source/_themes/eldocs/static/asset/img/ee-logo.gifbin0 -> 962 bytes
-rw-r--r--user_guide_src/source/_themes/eldocs/static/asset/img/grades.gifbin0 -> 184 bytes
-rw-r--r--user_guide_src/source/_themes/eldocs/static/asset/img/mm-logo.gifbin0 -> 746 bytes
-rw-r--r--user_guide_src/source/_themes/eldocs/static/asset/img/paper-ico.gifbin0 -> 58 bytes
-rwxr-xr-xuser_guide_src/source/_themes/eldocs/static/asset/js/jquery-ui-min.js789
-rw-r--r--user_guide_src/source/_themes/eldocs/static/jquery.js18
-rw-r--r--user_guide_src/source/_themes/eldocs/static/pygments.css60
-rw-r--r--user_guide_src/source/_themes/eldocs/theme.conf3
-rw-r--r--user_guide_src/source/changelog.rst2295
-rw-r--r--user_guide_src/source/conf.py257
-rw-r--r--user_guide_src/source/database/active_record.rst1008
-rw-r--r--user_guide_src/source/database/caching.rst162
-rw-r--r--user_guide_src/source/database/call_function.rst39
-rw-r--r--user_guide_src/source/database/configuration.rst173
-rw-r--r--user_guide_src/source/database/connecting.rst153
-rw-r--r--user_guide_src/source/database/examples.rst136
-rw-r--r--user_guide_src/source/database/fields.rst80
-rw-r--r--user_guide_src/source/database/forge.rst268
-rw-r--r--user_guide_src/source/database/helpers.rst98
-rw-r--r--user_guide_src/source/database/index.rst25
-rw-r--r--user_guide_src/source/database/queries.rst114
-rw-r--r--user_guide_src/source/database/results.rst186
-rw-r--r--user_guide_src/source/database/table_data.rst31
-rw-r--r--user_guide_src/source/database/transactions.rst127
-rw-r--r--user_guide_src/source/database/utilities.rst224
-rw-r--r--user_guide_src/source/documentation/ELDocs.tmbundle.zipbin0 -> 3932 bytes
-rw-r--r--user_guide_src/source/documentation/index.rst195
-rw-r--r--user_guide_src/source/general/alternative_php.rst76
-rw-r--r--user_guide_src/source/general/ancillary_classes.rst49
-rw-r--r--user_guide_src/source/general/autoloader.rst23
-rw-r--r--user_guide_src/source/general/caching.rst58
-rw-r--r--user_guide_src/source/general/cli.rst78
-rw-r--r--user_guide_src/source/general/common_functions.rst81
-rw-r--r--user_guide_src/source/general/controllers.rst324
-rw-r--r--user_guide_src/source/general/core_classes.rst120
-rw-r--r--user_guide_src/source/general/creating_drivers.rst20
-rw-r--r--user_guide_src/source/general/creating_libraries.rst226
-rw-r--r--user_guide_src/source/general/credits.rst19
-rw-r--r--user_guide_src/source/general/drivers.rst40
-rw-r--r--user_guide_src/source/general/environments.rst46
-rw-r--r--user_guide_src/source/general/errors.rst84
-rw-r--r--user_guide_src/source/general/helpers.rst143
-rw-r--r--user_guide_src/source/general/hooks.rst118
-rw-r--r--user_guide_src/source/general/index.rst32
-rw-r--r--user_guide_src/source/general/libraries.rst31
-rw-r--r--user_guide_src/source/general/managing_apps.rst65
-rw-r--r--user_guide_src/source/general/models.rst184
-rw-r--r--user_guide_src/source/general/profiling.rst83
-rw-r--r--user_guide_src/source/general/quick_reference.rst11
-rw-r--r--user_guide_src/source/general/requirements.rst8
-rw-r--r--user_guide_src/source/general/reserved_names.rst66
-rw-r--r--user_guide_src/source/general/routing.rst133
-rw-r--r--user_guide_src/source/general/security.rst90
-rw-r--r--user_guide_src/source/general/styleguide.rst668
-rw-r--r--user_guide_src/source/general/urls.rst97
-rw-r--r--user_guide_src/source/general/views.rst216
-rw-r--r--user_guide_src/source/helpers/array_helper.rst139
-rw-r--r--user_guide_src/source/helpers/captcha_helper.rst156
-rw-r--r--user_guide_src/source/helpers/cookie_helper.rst78
-rw-r--r--user_guide_src/source/helpers/date_helper.rst458
-rw-r--r--user_guide_src/source/helpers/directory_helper.rst80
-rw-r--r--user_guide_src/source/helpers/download_helper.rst42
-rw-r--r--user_guide_src/source/helpers/email_helper.rst49
-rw-r--r--user_guide_src/source/helpers/file_helper.rst135
-rw-r--r--user_guide_src/source/helpers/form_helper.rst506
-rw-r--r--user_guide_src/source/helpers/html_helper.rst348
-rw-r--r--user_guide_src/source/helpers/index.rst9
-rw-r--r--user_guide_src/source/helpers/inflector_helper.rst85
-rw-r--r--user_guide_src/source/helpers/language_helper.rst33
-rw-r--r--user_guide_src/source/helpers/number_helper.rst45
-rw-r--r--user_guide_src/source/helpers/path_helper.rst37
-rw-r--r--user_guide_src/source/helpers/security_helper.rst67
-rw-r--r--user_guide_src/source/helpers/smiley_helper.rst160
-rw-r--r--user_guide_src/source/helpers/string_helper.rst167
-rw-r--r--user_guide_src/source/helpers/text_helper.rst169
-rw-r--r--user_guide_src/source/helpers/typography_helper.rst48
-rw-r--r--user_guide_src/source/helpers/url_helper.rst314
-rw-r--r--user_guide_src/source/helpers/xml_helper.rst38
-rw-r--r--user_guide_src/source/images/appflowchart.gifbin0 -> 25276 bytes
-rw-r--r--user_guide_src/source/images/arrow.gif (renamed from user_guide/images/arrow.gif)bin123 -> 123 bytes
-rw-r--r--user_guide_src/source/images/ci_logo.jpg (renamed from user_guide/images/ci_logo.jpg)bin5602 -> 5602 bytes
-rw-r--r--user_guide_src/source/images/ci_logo_flame.jpg (renamed from user_guide/images/ci_logo_flame.jpg)bin8589 -> 8589 bytes
-rw-r--r--user_guide_src/source/images/ci_quick_ref.png (renamed from user_guide/images/ci_quick_ref.png)bin94476 -> 94476 bytes
-rw-r--r--user_guide_src/source/images/codeigniter_1.7.1_helper_reference.pdfbin0 -> 499087 bytes
-rw-r--r--user_guide_src/source/images/codeigniter_1.7.1_helper_reference.png (renamed from user_guide/images/codeigniter_1.7.1_helper_reference.png)bin67388 -> 67388 bytes
-rw-r--r--user_guide_src/source/images/codeigniter_1.7.1_library_reference.pdf (renamed from user_guide/images/codeigniter_1.7.1_library_reference.pdf)bin666918 -> 666910 bytes
-rw-r--r--user_guide_src/source/images/codeigniter_1.7.1_library_reference.pngbin0 -> 111744 bytes
-rw-r--r--user_guide_src/source/images/file.gif (renamed from user_guide/images/file.gif)bin370 -> 370 bytes
-rw-r--r--user_guide_src/source/images/folder.gif (renamed from user_guide/images/folder.gif)bin570 -> 570 bytes
-rw-r--r--user_guide_src/source/images/smile.gif (renamed from user_guide/images/smile.gif)bin1156 -> 1156 bytes
-rw-r--r--user_guide_src/source/index.rst49
-rw-r--r--user_guide_src/source/installation/downloads.rst69
-rw-r--r--user_guide_src/source/installation/index.rst54
-rw-r--r--user_guide_src/source/installation/troubleshooting.rst19
-rw-r--r--user_guide_src/source/installation/upgrade_120.rst20
-rw-r--r--user_guide_src/source/installation/upgrade_130.rst125
-rw-r--r--user_guide_src/source/installation/upgrade_131.rst30
-rw-r--r--user_guide_src/source/installation/upgrade_132.rst28
-rw-r--r--user_guide_src/source/installation/upgrade_133.rst44
-rw-r--r--user_guide_src/source/installation/upgrade_140.rst72
-rw-r--r--user_guide_src/source/installation/upgrade_141.rst71
-rw-r--r--user_guide_src/source/installation/upgrade_150.rst100
-rw-r--r--user_guide_src/source/installation/upgrade_152.rst39
-rw-r--r--user_guide_src/source/installation/upgrade_153.rst28
-rw-r--r--user_guide_src/source/installation/upgrade_154.rst56
-rw-r--r--user_guide_src/source/installation/upgrade_160.rst87
-rw-r--r--user_guide_src/source/installation/upgrade_161.rst27
-rw-r--r--user_guide_src/source/installation/upgrade_162.rst45
-rw-r--r--user_guide_src/source/installation/upgrade_163.rst27
-rw-r--r--user_guide_src/source/installation/upgrade_170.rst56
-rw-r--r--user_guide_src/source/installation/upgrade_171.rst27
-rw-r--r--user_guide_src/source/installation/upgrade_172.rst48
-rw-r--r--user_guide_src/source/installation/upgrade_200.rst142
-rw-r--r--user_guide_src/source/installation/upgrade_201.rst39
-rw-r--r--user_guide_src/source/installation/upgrade_202.rst33
-rw-r--r--user_guide_src/source/installation/upgrade_203.rst63
-rw-r--r--user_guide_src/source/installation/upgrade_210.rst22
-rw-r--r--user_guide_src/source/installation/upgrade_300.rst33
-rw-r--r--user_guide_src/source/installation/upgrade_b11.rst78
-rw-r--r--user_guide_src/source/installation/upgrading.rst32
-rw-r--r--user_guide_src/source/libraries/benchmark.rst122
-rw-r--r--user_guide_src/source/libraries/caching.rst220
-rw-r--r--user_guide_src/source/libraries/calendar.rst174
-rw-r--r--user_guide_src/source/libraries/cart.rst302
-rw-r--r--user_guide_src/source/libraries/config.rst181
-rw-r--r--user_guide_src/source/libraries/email.rst261
-rw-r--r--user_guide_src/source/libraries/encryption.rst164
-rw-r--r--user_guide_src/source/libraries/file_uploading.rst327
-rw-r--r--user_guide_src/source/libraries/form_validation.rst1014
-rw-r--r--user_guide_src/source/libraries/ftp.rst250
-rw-r--r--user_guide_src/source/libraries/image_lib.rst426
-rw-r--r--user_guide_src/source/libraries/index.rst9
-rw-r--r--user_guide_src/source/libraries/input.rst300
-rw-r--r--user_guide_src/source/libraries/javascript.rst301
-rw-r--r--user_guide_src/source/libraries/language.rst90
-rw-r--r--user_guide_src/source/libraries/loader.rst284
-rw-r--r--user_guide_src/source/libraries/migration.rst5
-rw-r--r--user_guide_src/source/libraries/output.rst138
-rw-r--r--user_guide_src/source/libraries/pagination.rst256
-rw-r--r--user_guide_src/source/libraries/parser.rst149
-rw-r--r--user_guide_src/source/libraries/security.rst97
-rw-r--r--user_guide_src/source/libraries/sessions.rst306
-rw-r--r--user_guide_src/source/libraries/table.rst267
-rw-r--r--user_guide_src/source/libraries/trackback.rst201
-rw-r--r--user_guide_src/source/libraries/typography.rst105
-rw-r--r--user_guide_src/source/libraries/unit_testing.rst164
-rw-r--r--user_guide_src/source/libraries/uri.rst188
-rw-r--r--user_guide_src/source/libraries/user_agent.rst200
-rw-r--r--user_guide_src/source/libraries/xmlrpc.rst536
-rw-r--r--user_guide_src/source/libraries/zip.rst208
-rw-r--r--user_guide_src/source/license.rst245
-rw-r--r--user_guide_src/source/overview/appflow.rst23
-rw-r--r--user_guide_src/source/overview/at_a_glance.rst114
-rw-r--r--user_guide_src/source/overview/cheatsheets.rst16
-rw-r--r--user_guide_src/source/overview/features.rst46
-rw-r--r--user_guide_src/source/overview/getting_started.rst24
-rw-r--r--user_guide_src/source/overview/goals.rst32
-rw-r--r--user_guide_src/source/overview/index.rst16
-rw-r--r--user_guide_src/source/overview/mvc.rst27
-rw-r--r--user_guide_src/source/tutorial/conclusion.rst26
-rw-r--r--user_guide_src/source/tutorial/create_news_items.rst153
-rw-r--r--user_guide_src/source/tutorial/index.rst46
-rw-r--r--user_guide_src/source/tutorial/news_section.rst214
-rw-r--r--user_guide_src/source/tutorial/static_pages.rst170
482 files changed, 32246 insertions, 36107 deletions
diff --git a/.gitignore b/.gitignore
index d740c498f..11fb6d67c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,4 +6,9 @@ application/cache/*
application/logs/*
!application/logs/index.html
-!application/logs/.htaccess \ No newline at end of file
+!application/logs/.htaccess
+
+user_guide_src/build/*
+user_guide_src/cilexer/build/*
+user_guide_src/cilexer/dist/*
+user_guide_src/cilexer/pycilexer.egg-info/* \ No newline at end of file
diff --git a/application/config/autoload.php b/application/config/autoload.php
index 53129c9c6..db49ca109 100644
--- a/application/config/autoload.php
+++ b/application/config/autoload.php
@@ -1,4 +1,30 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Academic Free License version 3.0
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0) that is
+ * bundled with this package in the files license_afl.txt / license_afl.rst.
+ * It is also available through the world wide web at this URL:
+ * http://opensource.org/licenses/AFL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
+
/*
| -------------------------------------------------------------------
| AUTO-LOADER
diff --git a/application/config/config.php b/application/config/config.php
index 1ec65435e..17b854b29 100644
--- a/application/config/config.php
+++ b/application/config/config.php
@@ -1,4 +1,29 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Academic Free License version 3.0
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0) that is
+ * bundled with this package in the files license_afl.txt / license_afl.rst.
+ * It is also available through the world wide web at this URL:
+ * http://opensource.org/licenses/AFL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
/*
|--------------------------------------------------------------------------
@@ -79,6 +104,8 @@ $config['language'] = 'english';
| This determines which character set is used by default in various methods
| that require a character set to be provided.
|
+| See http://php.net/htmlspecialchars for a list of supported charsets.
+|
*/
$config['charset'] = 'UTF-8';
@@ -176,6 +203,10 @@ $config['directory_trigger'] = 'd'; // experimental not currently in use
| 3 = Informational Messages
| 4 = All Messages
|
+| You can also pass in a array with threshold levels to show individual error types
+|
+| array(2) = Debug Messages, without Error Messages
+|
| For a live site you'll usually only enable Errors (1) to be logged otherwise
| your log files will fill up very fast.
|
@@ -222,6 +253,9 @@ $config['cache_path'] = '';
|
| If you use the Encryption class or the Session class you
| MUST set an encryption key. See the user guide for info.
+|
+| http://codeigniter.com/user_guide/libraries/encryption.html
+| http://codeigniter.com/user_guide/libraries/sessions.html
|
*/
$config['encryption_key'] = '';
@@ -292,11 +326,15 @@ $config['global_xss_filtering'] = FALSE;
| 'csrf_token_name' = The token name
| 'csrf_cookie_name' = The cookie name
| 'csrf_expire' = The number in seconds the token should expire.
+| 'csrf_regenerate' = Regenerate token on every submission
+| 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks
*/
$config['csrf_protection'] = FALSE;
$config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200;
+$config['csrf_regenerate'] = TRUE;
+$config['csrf_exclude_uris'] = array();
/*
|--------------------------------------------------------------------------
diff --git a/application/config/constants.php b/application/config/constants.php
index 4a879d360..c7203e47d 100644
--- a/application/config/constants.php
+++ b/application/config/constants.php
@@ -1,4 +1,29 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Academic Free License version 3.0
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0) that is
+ * bundled with this package in the files license_afl.txt / license_afl.rst.
+ * It is also available through the world wide web at this URL:
+ * http://opensource.org/licenses/AFL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
/*
|--------------------------------------------------------------------------
@@ -36,6 +61,18 @@ define('FOPEN_READ_WRITE_CREATE', 'a+b');
define('FOPEN_WRITE_CREATE_STRICT', 'xb');
define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
+/*
+|--------------------------------------------------------------------------
+| Display Debug backtrace
+|--------------------------------------------------------------------------
+|
+| If set to TRUE, a backtrace will be displayed along with php errors. If
+| error_reporting is disabled, the backtrace will not display, regardless
+| of this setting
+|
+*/
+define('SHOW_DEBUG_BACKTRACE', TRUE);
+
/* End of file constants.php */
/* Location: ./application/config/constants.php */ \ No newline at end of file
diff --git a/application/config/database.php b/application/config/database.php
index b4b34bf66..bd68db1d8 100644
--- a/application/config/database.php
+++ b/application/config/database.php
@@ -1,4 +1,29 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Academic Free License version 3.0
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0) that is
+ * bundled with this package in the files license_afl.txt / license_afl.rst.
+ * It is also available through the world wide web at this URL:
+ * http://opensource.org/licenses/AFL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
@@ -12,12 +37,13 @@
| EXPLANATION OF VARIABLES
| -------------------------------------------------------------------
|
+| ['dsn'] The full DSN string describe a connection to the database.
| ['hostname'] The hostname of your database server.
| ['username'] The username used to connect to the database
| ['password'] The password used to connect to the database
| ['database'] The name of the database you want to connect to
-| ['dbdriver'] The database type. ie: mysql. Currently supported:
- mysql, mysqli, postgre, odbc, mssql, sqlite, oci8
+| ['dbdriver'] The database type. e.g.: mysql. Currently supported:
+ mysql, mysqli, pdo, postgre, odbc, mssql, sqlite, oci8
| ['dbprefix'] You can add an optional prefix, which will be added
| to the table name when using the Active Record class
| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
@@ -37,6 +63,7 @@
| ['autoinit'] Whether or not to automatically initialize the database.
| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
| - good for ensuring strict SQL while developing
+| ['failover'] array - A array with 0 or more data for connections if the main should fail.
|
| The $active_group variable lets you choose which connection group to
| make active. By default there is only one group (the 'default' group).
@@ -48,13 +75,14 @@
$active_group = 'default';
$active_record = TRUE;
+$db['default']['dsn'] = '';
$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']['pconnect'] = FALSE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
@@ -63,7 +91,7 @@ $db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
-
+$db['default']['failover'] = array();
/* End of file database.php */
/* Location: ./application/config/database.php */ \ No newline at end of file
diff --git a/application/config/doctypes.php b/application/config/doctypes.php
index f7e1d19a2..984da5965 100644
--- a/application/config/doctypes.php
+++ b/application/config/doctypes.php
@@ -1,10 +1,36 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Academic Free License version 3.0
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0) that is
+ * bundled with this package in the files license_afl.txt / license_afl.rst.
+ * It is also available through the world wide web at this URL:
+ * http://opensource.org/licenses/AFL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
$_doctypes = array(
'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
'xhtml1-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
'xhtml1-trans' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
'xhtml1-frame' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
+ 'xhtml-basic11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">',
'html5' => '<!DOCTYPE html>',
'html4-strict' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
'html4-trans' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
diff --git a/application/config/foreign_chars.php b/application/config/foreign_chars.php
index 14b0d7373..1ae0cef5f 100644
--- a/application/config/foreign_chars.php
+++ b/application/config/foreign_chars.php
@@ -1,4 +1,30 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Academic Free License version 3.0
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0) that is
+ * bundled with this package in the files license_afl.txt / license_afl.rst.
+ * It is also available through the world wide web at this URL:
+ * http://opensource.org/licenses/AFL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
+
/*
| -------------------------------------------------------------------
| Foreign Characters
@@ -18,8 +44,8 @@ $foreign_characters = array(
'/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª/' => 'a',
'/Ç|Ć|Ĉ|Ċ|Č/' => 'C',
'/ç|ć|ĉ|ċ|č/' => 'c',
- '/Ð|Ď|Đ/' => 'D',
- '/ð|ď|đ/' => 'd',
+ '/Ð|Ď|Đ/' => 'Dj',
+ '/ð|ď|đ/' => 'dj',
'/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě/' => 'E',
'/è|é|ê|ë|ē|ĕ|ė|ę|ě/' => 'e',
'/Ĝ|Ğ|Ġ|Ģ/' => 'G',
diff --git a/application/config/hooks.php b/application/config/hooks.php
index a4ad2be6d..80269df59 100644
--- a/application/config/hooks.php
+++ b/application/config/hooks.php
@@ -1,4 +1,30 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Academic Free License version 3.0
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0) that is
+ * bundled with this package in the files license_afl.txt / license_afl.rst.
+ * It is also available through the world wide web at this URL:
+ * http://opensource.org/licenses/AFL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
+
/*
| -------------------------------------------------------------------------
| Hooks
diff --git a/application/config/memcached.php b/application/config/memcached.php
new file mode 100644
index 000000000..2b1a77266
--- /dev/null
+++ b/application/config/memcached.php
@@ -0,0 +1,46 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Academic Free License version 3.0
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0) that is
+ * bundled with this package in the files license_afl.txt / license_afl.rst.
+ * It is also available through the world wide web at this URL:
+ * http://opensource.org/licenses/AFL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 2.0
+ * @filesource
+ */
+
+/*
+| -------------------------------------------------------------------------
+| Memcached settings
+| -------------------------------------------------------------------------
+| Your Memcached servers can be specified below.
+|
+| See: http://codeigniter.com/user_guide/libraries/caching.html#memcached
+|
+*/
+$config = array(
+ 'default' => array(
+ 'hostname' => '127.0.0.1',
+ 'port' => '11211',
+ 'weight' => '1',
+ ),
+);
+
+/* End of file memcached.php */
+/* Location: ./application/config/memcached.php */ \ No newline at end of file
diff --git a/application/config/migration.php b/application/config/migration.php
index afa264562..668c35740 100644
--- a/application/config/migration.php
+++ b/application/config/migration.php
@@ -1,41 +1,93 @@
-<?php defined('BASEPATH') OR exit('No direct script access allowed');
-/*
-|--------------------------------------------------------------------------
-| Enable/Disable Migrations
-|--------------------------------------------------------------------------
-|
-| Migrations are disabled by default but should be enabled
-| whenever you intend to do a schema migration.
-|
-*/
-$config['migration_enabled'] = FALSE;
-
-
-/*
-|--------------------------------------------------------------------------
-| Migrations version
-|--------------------------------------------------------------------------
-|
-| This is used to set migration version that the file system should be on.
-| If you run $this->migration->latest() this is the version that schema will
-| be upgraded / downgraded to.
-|
-*/
-$config['migration_version'] = 0;
-
-
-/*
-|--------------------------------------------------------------------------
-| Migrations Path
-|--------------------------------------------------------------------------
-|
-| Path to your migrations folder.
-| Typically, it will be within your application path.
-| Also, writing permission is required within the migrations path.
-|
-*/
-$config['migration_path'] = APPPATH . 'migrations/';
-
-
-/* End of file migration.php */
-/* Location: ./application/config/migration.php */ \ No newline at end of file
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Academic Free License version 3.0
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0) that is
+ * bundled with this package in the files license_afl.txt / license_afl.rst.
+ * It is also available through the world wide web at this URL:
+ * http://opensource.org/licenses/AFL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
+
+/*
+|--------------------------------------------------------------------------
+| Enable/Disable Migrations
+|--------------------------------------------------------------------------
+|
+| Migrations are disabled by default for security reasons.
+| You should enable migrations whenever you intend to do a schema migration
+| and disable it back when you're done.
+|
+*/
+$config['migration_enabled'] = FALSE;
+
+/*
+|--------------------------------------------------------------------------
+| Migrations table
+|--------------------------------------------------------------------------
+|
+| This is the name of the table that will store the current migrations state.
+| When migrations runs it will store in a database table which migration
+| level the system is at. It then compares the migration level in the this
+| table to the $config['migration_version'] if they are not the same it
+| will migrate up. This must be set.
+|
+*/
+$config['migration_table'] = 'migrations';
+
+/*
+|--------------------------------------------------------------------------
+| Auto Migrate To Latest
+|--------------------------------------------------------------------------
+|
+| If this is set to TRUE when you load the migrations class and have
+| $config['migration_enabled'] set to TRUE the system will auto migrate
+| to your latest migration (whatever $config['migration_version'] is
+| set to). This way you do not have to call migrations anywhere else
+| in your code to have the latest migration.
+|
+*/
+$config['migration_auto_latest'] = FALSE;
+
+/*
+|--------------------------------------------------------------------------
+| Migrations version
+|--------------------------------------------------------------------------
+|
+| This is used to set migration version that the file system should be on.
+| If you run $this->migration->current() this is the version that schema will
+| be upgraded / downgraded to.
+|
+*/
+$config['migration_version'] = 0;
+
+/*
+|--------------------------------------------------------------------------
+| Migrations Path
+|--------------------------------------------------------------------------
+|
+| Path to your migrations folder.
+| Typically, it will be within your application path.
+| Also, writing permission is required within the migrations path.
+|
+*/
+$config['migration_path'] = APPPATH . 'migrations/';
+
+
+/* End of file migration.php */ \ No newline at end of file
diff --git a/application/config/mimes.php b/application/config/mimes.php
index 100f7d442..2a68ce9e1 100644
--- a/application/config/mimes.php
+++ b/application/config/mimes.php
@@ -1,4 +1,30 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Academic Free License version 3.0
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0) that is
+ * bundled with this package in the files license_afl.txt / license_afl.rst.
+ * It is also available through the world wide web at this URL:
+ * http://opensource.org/licenses/AFL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
+
/*
| -------------------------------------------------------------------
| MIME TYPES
@@ -8,10 +34,10 @@
|
*/
-$mimes = array( 'hqx' => 'application/mac-binhex40',
+$mimes = array('hqx' => array('application/mac-binhex40', 'application/mac-binhex', 'application/x-binhex40', 'application/x-mac-binhex40'),
'cpt' => 'application/mac-compactpro',
'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel'),
- 'bin' => 'application/macbinary',
+ 'bin' => array('application/macbinary', 'application/mac-binary', 'application/octet-stream', 'application/x-binary', 'application/x-macbinary'),
'dms' => 'application/octet-stream',
'lha' => 'application/octet-stream',
'lzh' => 'application/octet-stream',
@@ -31,6 +57,7 @@ $mimes = array( 'hqx' => 'application/mac-binhex40',
'mif' => 'application/vnd.mif',
'xls' => array('application/excel', 'application/vnd.ms-excel', 'application/msexcel'),
'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint'),
+ 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'wbxml' => 'application/wbxml',
'wmlc' => 'application/wmlc',
'dcr' => 'application/x-director',
@@ -39,6 +66,7 @@ $mimes = array( 'hqx' => 'application/mac-binhex40',
'dvi' => 'application/x-dvi',
'gtar' => 'application/x-gtar',
'gz' => 'application/x-gzip',
+ 'gzip' => 'application/x-gzip',
'php' => 'application/x-httpd-php',
'php4' => 'application/x-httpd-php',
'php3' => 'application/x-httpd-php',
@@ -51,14 +79,14 @@ $mimes = array( 'hqx' => 'application/mac-binhex40',
'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'),
+ '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',
+ 'aif' => array('audio/x-aiff', 'audio/aiff'),
+ 'aiff' => array('audio/x-aiff', 'audio/aiff'),
'aifc' => 'audio/x-aiff',
'ram' => 'audio/x-pn-realaudio',
'rm' => 'audio/x-pn-realaudio',
@@ -83,14 +111,14 @@ $mimes = array( 'hqx' => 'application/mac-binhex40',
'log' => array('text/plain', 'text/x-log'),
'rtx' => 'text/richtext',
'rtf' => 'text/rtf',
- 'xml' => 'text/xml',
- 'xsl' => 'text/xml',
+ 'xml' => array('application/xml', 'text/xml'),
+ 'xsl' => array('application/xml', 'text/xsl', 'text/xml'),
'mpeg' => 'video/mpeg',
'mpg' => 'video/mpeg',
'mpe' => 'video/mpeg',
'qt' => 'video/quicktime',
'mov' => 'video/quicktime',
- 'avi' => 'video/x-msvideo',
+ 'avi' => array('video/x-msvideo', 'video/msvideo', 'video/avi', 'application/x-troff-msvideo'),
'movie' => 'video/x-sgi-movie',
'doc' => 'application/msword',
'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip'),
@@ -98,9 +126,43 @@ $mimes = array( 'hqx' => 'application/mac-binhex40',
'word' => array('application/msword', 'application/octet-stream'),
'xl' => 'application/excel',
'eml' => 'message/rfc822',
- 'json' => array('application/json', 'text/json')
+ 'json' => array('application/json', 'text/json'),
+ 'pem' => array('application/x-x509-user-cert', 'application/x-pem-file', 'application/octet-stream'),
+ 'p10' => array('application/x-pkcs10', 'application/pkcs10'),
+ 'p12' => 'application/x-pkcs12',
+ 'p7a' => 'application/x-pkcs7-signature',
+ 'p7c' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
+ 'p7m' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
+ 'p7r' => 'application/x-pkcs7-certreqresp',
+ 'p7s' => 'application/pkcs7-signature',
+ 'crt' => array('application/x-x509-ca-cert', 'application/x-x509-user-cert', 'application/pkix-cert'),
+ 'crl' => array('application/pkix-crl', 'application/pkcs-crl'),
+ 'der' => 'application/x-x509-ca-cert',
+ 'kdb' => 'application/octet-stream',
+ 'pgp' => 'application/pgp',
+ 'gpg' => 'application/gpg-keys',
+ 'sst' => 'application/octet-stream',
+ 'csr' => 'application/octet-stream',
+ 'rsa' => 'application/x-pkcs7',
+ 'cer' => array('application/pkix-cert', 'application/x-x509-ca-cert'),
+ '3g2' => 'video/3gpp2',
+ '3gp' => 'video/3gp',
+ 'mp4' => 'video/mp4',
+ 'm4a' => 'audio/x-m4a',
+ 'f4v' => 'video/mp4',
+ 'aac' => 'audio/x-acc',
+ 'm4u' => 'application/vnd.mpegurl',
+ 'm3u' => 'text/plain',
+ 'xspf' => 'application/xspf+xml',
+ 'vlc' => 'application/videolan',
+ 'wmv' => 'video/x-ms-wmv',
+ 'au' => 'audio/x-au',
+ 'ac3' => 'audio/ac3',
+ 'flac' => 'audio/x-flac',
+ 'ogg' => 'audio/ogg',
+ 'kmz' => array('application/vnd.google-earth.kmz', 'application/zip', 'application/x-zip'),
+ 'kml' => array('application/vnd.google-earth.kml+xml', 'application/xml', 'text/xml')
);
-
/* End of file mimes.php */
/* Location: ./application/config/mimes.php */
diff --git a/application/config/profiler.php b/application/config/profiler.php
index f8a5b1a1e..f95614241 100644
--- a/application/config/profiler.php
+++ b/application/config/profiler.php
@@ -1,4 +1,30 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Academic Free License version 3.0
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0) that is
+ * bundled with this package in the files license_afl.txt / license_afl.rst.
+ * It is also available through the world wide web at this URL:
+ * http://opensource.org/licenses/AFL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
+
/*
| -------------------------------------------------------------------------
| Profiler Sections
diff --git a/application/config/routes.php b/application/config/routes.php
index 5f9a58343..53fc7e799 100644
--- a/application/config/routes.php
+++ b/application/config/routes.php
@@ -1,4 +1,30 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Academic Free License version 3.0
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0) that is
+ * bundled with this package in the files license_afl.txt / license_afl.rst.
+ * It is also available through the world wide web at this URL:
+ * http://opensource.org/licenses/AFL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
+
/*
| -------------------------------------------------------------------------
| URI ROUTING
@@ -23,7 +49,7 @@
| RESERVED ROUTES
| -------------------------------------------------------------------------
|
-| There area two reserved routes:
+| There are two reserved routes:
|
| $route['default_controller'] = 'welcome';
|
diff --git a/application/config/smileys.php b/application/config/smileys.php
index 25d28b2c4..4132aed2f 100644
--- a/application/config/smileys.php
+++ b/application/config/smileys.php
@@ -1,4 +1,30 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Academic Free License version 3.0
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0) that is
+ * bundled with this package in the files license_afl.txt / license_afl.rst.
+ * It is also available through the world wide web at this URL:
+ * http://opensource.org/licenses/AFL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
+
/*
| -------------------------------------------------------------------
| SMILEYS
@@ -60,7 +86,7 @@ $smileys = array(
':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
index e2d3c3af0..e7a689402 100644
--- a/application/config/user_agents.php
+++ b/application/config/user_agents.php
@@ -1,4 +1,30 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Academic Free License version 3.0
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0) that is
+ * bundled with this package in the files license_afl.txt / license_afl.rst.
+ * It is also available through the world wide web at this URL:
+ * http://opensource.org/licenses/AFL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
+
/*
| -------------------------------------------------------------------
| USER AGENT TYPES
@@ -11,168 +37,178 @@
*/
$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'
- );
+ 'windows nt 6.1' => 'Windows 7',
+ 'windows nt 6.0' => 'Windows Vista',
+ 'windows nt 5.2' => 'Windows 2003',
+ 'windows nt 5.1' => 'Windows XP',
+ 'windows nt 5.0' => 'Windows 2000',
+ 'windows nt 4.0' => 'Windows NT 4.0',
+ 'winnt4.0' => 'Windows NT 4.0',
+ 'winnt 4.0' => 'Windows NT',
+ 'winnt' => 'Windows NT',
+ 'windows 98' => 'Windows 98',
+ 'win98' => 'Windows 98',
+ 'windows 95' => 'Windows 95',
+ 'win95' => 'Windows 95',
+ 'windows' => 'Unknown Windows OS',
+ 'os x' => 'Mac OS X',
+ 'ppc mac' => 'Power PC Mac',
+ 'freebsd' => 'FreeBSD',
+ 'ppc' => 'Macintosh',
+ 'linux' => 'Linux',
+ 'debian' => 'Debian',
+ 'sunos' => 'Sun Solaris',
+ 'beos' => 'BeOS',
+ 'apachebench' => 'ApacheBench',
+ 'aix' => 'AIX',
+ 'irix' => 'Irix',
+ 'osf' => 'DEC OSF',
+ 'hp-ux' => 'HP-UX',
+ 'netbsd' => 'NetBSD',
+ 'bsdi' => 'BSDi',
+ 'openbsd' => 'OpenBSD',
+ 'gnu' => 'GNU/Linux',
+ 'unix' => 'Unknown Unix OS'
+);
// The order of this array should NOT be changed. Many browsers return
// multiple browser types so we want to identify the sub-type first.
$browsers = array(
- 'Flock' => 'Flock',
- 'Chrome' => 'Chrome',
- 'Opera' => 'Opera',
- 'MSIE' => 'Internet Explorer',
- 'Internet Explorer' => 'Internet Explorer',
- 'Shiira' => 'Shiira',
- 'Firefox' => 'Firefox',
- 'Chimera' => 'Chimera',
- 'Phoenix' => 'Phoenix',
- 'Firebird' => 'Firebird',
- 'Camino' => 'Camino',
- 'Netscape' => 'Netscape',
- 'OmniWeb' => 'OmniWeb',
- 'Safari' => 'Safari',
- 'Mozilla' => 'Mozilla',
- 'Konqueror' => 'Konqueror',
- 'icab' => 'iCab',
- 'Lynx' => 'Lynx',
- 'Links' => 'Links',
- 'hotjava' => 'HotJava',
- 'amaya' => 'Amaya',
- 'IBrowse' => 'IBrowse'
- );
+ 'Flock' => 'Flock',
+ 'Chrome' => 'Chrome',
+ 'Opera' => 'Opera',
+ 'MSIE' => 'Internet Explorer',
+ 'Internet Explorer' => 'Internet Explorer',
+ 'Shiira' => 'Shiira',
+ 'Firefox' => 'Firefox',
+ 'Chimera' => 'Chimera',
+ 'Phoenix' => 'Phoenix',
+ 'Firebird' => 'Firebird',
+ 'Camino' => 'Camino',
+ 'Netscape' => 'Netscape',
+ 'OmniWeb' => 'OmniWeb',
+ 'Safari' => 'Safari',
+ 'Mozilla' => 'Mozilla',
+ 'Konqueror' => 'Konqueror',
+ 'icab' => 'iCab',
+ 'Lynx' => 'Lynx',
+ 'Links' => 'Links',
+ 'hotjava' => 'HotJava',
+ 'amaya' => 'Amaya',
+ 'IBrowse' => 'IBrowse'
+);
$mobiles = array(
- // legacy array, old values commented out
- 'mobileexplorer' => 'Mobile Explorer',
-// 'openwave' => 'Open Wave',
-// 'opera mini' => 'Opera Mini',
-// 'operamini' => 'Opera Mini',
-// 'elaine' => 'Palm',
- 'palmsource' => 'Palm',
-// 'digital paths' => 'Palm',
-// 'avantgo' => 'Avantgo',
-// 'xiino' => 'Xiino',
- 'palmscape' => 'Palmscape',
-// 'nokia' => 'Nokia',
-// 'ericsson' => 'Ericsson',
-// 'blackberry' => 'BlackBerry',
-// 'motorola' => 'Motorola'
+ // legacy array, old values commented out
+ 'mobileexplorer' => 'Mobile Explorer',
+// 'openwave' => 'Open Wave',
+// 'opera mini' => 'Opera Mini',
+// 'operamini' => 'Opera Mini',
+// 'elaine' => 'Palm',
+ 'palmsource' => 'Palm',
+// 'digital paths' => 'Palm',
+// 'avantgo' => 'Avantgo',
+// 'xiino' => 'Xiino',
+ 'palmscape' => 'Palmscape',
+// 'nokia' => 'Nokia',
+// 'ericsson' => 'Ericsson',
+// 'blackberry' => 'BlackBerry',
+// 'motorola' => 'Motorola'
- // Phones and Manufacturers
- 'motorola' => "Motorola",
- 'nokia' => "Nokia",
- 'palm' => "Palm",
- 'iphone' => "Apple iPhone",
- 'ipad' => "iPad",
- 'ipod' => "Apple iPod Touch",
- 'sony' => "Sony Ericsson",
- 'ericsson' => "Sony Ericsson",
- 'blackberry' => "BlackBerry",
- 'cocoon' => "O2 Cocoon",
- 'blazer' => "Treo",
- 'lg' => "LG",
- 'amoi' => "Amoi",
- 'xda' => "XDA",
- 'mda' => "MDA",
- 'vario' => "Vario",
- 'htc' => "HTC",
- 'samsung' => "Samsung",
- 'sharp' => "Sharp",
- 'sie-' => "Siemens",
- 'alcatel' => "Alcatel",
- 'benq' => "BenQ",
- 'ipaq' => "HP iPaq",
- 'mot-' => "Motorola",
- 'playstation portable' => "PlayStation Portable",
- 'hiptop' => "Danger Hiptop",
- 'nec-' => "NEC",
- 'panasonic' => "Panasonic",
- 'philips' => "Philips",
- 'sagem' => "Sagem",
- 'sanyo' => "Sanyo",
- 'spv' => "SPV",
- 'zte' => "ZTE",
- 'sendo' => "Sendo",
+ // Phones and Manufacturers
+ 'motorola' => "Motorola",
+ 'nokia' => "Nokia",
+ 'palm' => "Palm",
+ 'iphone' => "Apple iPhone",
+ 'ipad' => "iPad",
+ 'ipod' => "Apple iPod Touch",
+ 'sony' => "Sony Ericsson",
+ 'ericsson' => "Sony Ericsson",
+ 'blackberry' => "BlackBerry",
+ 'cocoon' => "O2 Cocoon",
+ 'blazer' => "Treo",
+ 'lg' => "LG",
+ 'amoi' => "Amoi",
+ 'xda' => "XDA",
+ 'mda' => "MDA",
+ 'vario' => "Vario",
+ 'htc' => "HTC",
+ 'samsung' => "Samsung",
+ 'sharp' => "Sharp",
+ 'sie-' => "Siemens",
+ 'alcatel' => "Alcatel",
+ 'benq' => "BenQ",
+ 'ipaq' => "HP iPaq",
+ 'mot-' => "Motorola",
+ 'playstation portable' => "PlayStation Portable",
+ 'hiptop' => "Danger Hiptop",
+ 'nec-' => "NEC",
+ 'panasonic' => "Panasonic",
+ 'philips' => "Philips",
+ 'sagem' => "Sagem",
+ 'sanyo' => "Sanyo",
+ 'spv' => "SPV",
+ 'zte' => "ZTE",
+ 'sendo' => "Sendo",
+ 'dsi' => "Nintendo DSi",
+ 'ds' => "Nintendo DS",
+ 'wii' => "Nintendo Wii",
+ '3ds' => "Nintendo 3DS",
+ 'open web' => "Open Web",
+ 'openweb' => "OpenWeb",
- // Operating Systems
- 'symbian' => "Symbian",
- 'SymbianOS' => "SymbianOS",
- 'elaine' => "Palm",
- 'palm' => "Palm",
- 'series60' => "Symbian S60",
- 'windows ce' => "Windows CE",
+ // Operating Systems
+ 'android' => "Android",
+ 'symbian' => "Symbian",
+ 'SymbianOS' => "SymbianOS",
+ 'elaine' => "Palm",
+ 'palm' => "Palm",
+ 'series60' => "Symbian S60",
+ 'windows ce' => "Windows CE",
- // Browsers
- 'obigo' => "Obigo",
- 'netfront' => "Netfront Browser",
- 'openwave' => "Openwave Browser",
- 'mobilexplorer' => "Mobile Explorer",
- 'operamini' => "Opera Mini",
- 'opera mini' => "Opera Mini",
+ // Browsers
+ 'obigo' => "Obigo",
+ 'netfront' => "Netfront Browser",
+ 'openwave' => "Openwave Browser",
+ 'mobilexplorer' => "Mobile Explorer",
+ 'operamini' => "Opera Mini",
+ 'opera mini' => "Opera Mini",
+ 'opera mobi' => "Opera Mobile",
- // Other
- 'digital paths' => "Digital Paths",
- 'avantgo' => "AvantGo",
- 'xiino' => "Xiino",
- 'novarra' => "Novarra Transcoder",
- 'vodafone' => "Vodafone",
- 'docomo' => "NTT DoCoMo",
- 'o2' => "O2",
+ // Other
+ 'digital paths' => "Digital Paths",
+ 'avantgo' => "AvantGo",
+ 'xiino' => "Xiino",
+ 'novarra' => "Novarra Transcoder",
+ 'vodafone' => "Vodafone",
+ 'docomo' => "NTT DoCoMo",
+ 'o2' => "O2",
- // Fallback
- 'mobile' => "Generic Mobile",
- 'wireless' => "Generic Mobile",
- 'j2me' => "Generic Mobile",
- 'midp' => "Generic Mobile",
- 'cldc' => "Generic Mobile",
- 'up.link' => "Generic Mobile",
- 'up.browser' => "Generic Mobile",
- 'smartphone' => "Generic Mobile",
- 'cellphone' => "Generic Mobile"
- );
+ // Fallback
+ 'mobile' => "Generic Mobile",
+ 'wireless' => "Generic Mobile",
+ 'j2me' => "Generic Mobile",
+ 'midp' => "Generic Mobile",
+ 'cldc' => "Generic Mobile",
+ 'up.link' => "Generic Mobile",
+ 'up.browser' => "Generic Mobile",
+ 'smartphone' => "Generic Mobile",
+ 'cellphone' => "Generic Mobile"
+);
// There are hundreds of bots but these are the most common.
$robots = array(
- 'googlebot' => 'Googlebot',
- 'msnbot' => 'MSNBot',
- 'slurp' => 'Inktomi Slurp',
- 'yahoo' => 'Yahoo',
- 'askjeeves' => 'AskJeeves',
- 'fastcrawler' => 'FastCrawler',
- 'infoseek' => 'InfoSeek Robot 1.0',
- 'lycos' => 'Lycos'
- );
+ 'googlebot' => 'Googlebot',
+ 'msnbot' => 'MSNBot',
+ 'bingbot' => 'Bing',
+ 'slurp' => 'Inktomi Slurp',
+ 'yahoo' => 'Yahoo',
+ 'askjeeves' => 'AskJeeves',
+ 'fastcrawler' => 'FastCrawler',
+ 'infoseek' => 'InfoSeek Robot 1.0',
+ 'lycos' => 'Lycos'
+);
/* End of file user_agents.php */
-/* Location: ./application/config/user_agents.php */ \ No newline at end of file
+/* Location: ./application/config/user_agents.php */
diff --git a/application/controllers/welcome.php b/application/controllers/welcome.php
index 21bef43d9..5eb0e9625 100644
--- a/application/controllers/welcome.php
+++ b/application/controllers/welcome.php
@@ -1,4 +1,29 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Academic Free License version 3.0
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0) that is
+ * bundled with this package in the files license_afl.txt / license_afl.rst.
+ * It is also available through the world wide web at this URL:
+ * http://opensource.org/licenses/AFL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
class Welcome extends CI_Controller {
diff --git a/application/errors/error_404.php b/application/errors/error_404.php
index 792726a67..4dd8fc407 100644
--- a/application/errors/error_404.php
+++ b/application/errors/error_404.php
@@ -1,6 +1,35 @@
+<?php
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Academic Free License version 3.0
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0) that is
+ * bundled with this package in the files license_afl.txt / license_afl.rst.
+ * It is also available through the world wide web at this URL:
+ * http://opensource.org/licenses/AFL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
+?>
+
<!DOCTYPE html>
<html lang="en">
<head>
+<meta charset="utf-8">
<title>404 Page Not Found</title>
<style type="text/css">
diff --git a/application/errors/error_db.php b/application/errors/error_db.php
index b396cda9f..130ffc11d 100644
--- a/application/errors/error_db.php
+++ b/application/errors/error_db.php
@@ -1,6 +1,35 @@
+<?php
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Academic Free License version 3.0
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0) that is
+ * bundled with this package in the files license_afl.txt / license_afl.rst.
+ * It is also available through the world wide web at this URL:
+ * http://opensource.org/licenses/AFL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
+?>
+
<!DOCTYPE html>
<html lang="en">
<head>
+<meta charset="utf-8">
<title>Database Error</title>
<style type="text/css">
diff --git a/application/errors/error_general.php b/application/errors/error_general.php
index fd63ce2c5..2a844a8e2 100644
--- a/application/errors/error_general.php
+++ b/application/errors/error_general.php
@@ -1,6 +1,35 @@
+<?php
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Academic Free License version 3.0
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0) that is
+ * bundled with this package in the files license_afl.txt / license_afl.rst.
+ * It is also available through the world wide web at this URL:
+ * http://opensource.org/licenses/AFL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
+?>
+
<!DOCTYPE html>
<html lang="en">
<head>
+<meta charset="utf-8">
<title>Error</title>
<style type="text/css">
diff --git a/application/errors/error_php.php b/application/errors/error_php.php
index f085c2037..8e293cd5e 100644
--- a/application/errors/error_php.php
+++ b/application/errors/error_php.php
@@ -1,3 +1,31 @@
+<?php
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Academic Free License version 3.0
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0) that is
+ * bundled with this package in the files license_afl.txt / license_afl.rst.
+ * It is also available through the world wide web at this URL:
+ * http://opensource.org/licenses/AFL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
+?>
+
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
@@ -7,4 +35,21 @@
<p>Filename: <?php echo $filepath; ?></p>
<p>Line Number: <?php echo $line; ?></p>
+<?php if(defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?>
+
+ <p>Backtrace: </p>
+ <?php foreach(debug_backtrace() as $error): ?>
+
+ <?php if(isset($error['file']) && ! stristr($error['file'], SYSDIR)): ?>
+ <p style="margin-left:10px">
+ File: <?php echo $error['file'] ?><br />
+ Line: <?php echo $error['line'] ?><br />
+ Function: <?php echo $error['function'] ?>
+ </p>
+ <?php endif ?>
+
+ <?php endforeach ?></p>
+
+<?php endif ?>
+
</div> \ No newline at end of file
diff --git a/application/views/welcome_message.php b/application/views/welcome_message.php
index 0bf5a8d2e..acc36b6d4 100644
--- a/application/views/welcome_message.php
+++ b/application/views/welcome_message.php
@@ -1,3 +1,31 @@
+<?php
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Academic Free License version 3.0
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0) that is
+ * bundled with this package in the files license_afl.txt / license_afl.rst.
+ * It is also available through the world wide web at this URL:
+ * http://opensource.org/licenses/AFL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
+?>
+
<!DOCTYPE html>
<html lang="en">
<head>
@@ -81,7 +109,7 @@
<p>If you are exploring CodeIgniter for the very first time, you should start by reading the <a href="user_guide/">User Guide</a>.</p>
</div>
- <p class="footer">Page rendered in <strong>{elapsed_time}</strong> seconds</p>
+ <p class="footer">Page rendered in <strong>{elapsed_time}</strong> seconds. <?php echo (ENVIRONMENT == 'development') ? 'CodeIgniter Version <strong>' . CI_VERSION . '</strong>' : '' ?></p>
</div>
</body>
diff --git a/index.php b/index.php
index f4ac11a72..a37826690 100644
--- a/index.php
+++ b/index.php
@@ -1,4 +1,29 @@
<?php
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
/*
*---------------------------------------------------------------
@@ -16,7 +41,6 @@
* production
*
* NOTE: If you change these, also change the error_reporting() code below
- *
*/
define('ENVIRONMENT', 'development');
/*
@@ -33,14 +57,12 @@ if (defined('ENVIRONMENT'))
switch (ENVIRONMENT)
{
case 'development':
- error_reporting(E_ALL);
+ error_reporting(-1);
break;
-
case 'testing':
case 'production':
error_reporting(0);
break;
-
default:
exit('The application environment is not set correctly.');
}
@@ -54,7 +76,6 @@ if (defined('ENVIRONMENT'))
* This variable must contain the name of your "system" folder.
* Include the path if the folder is not in the same directory
* as this file.
- *
*/
$system_path = 'system';
@@ -65,34 +86,48 @@ if (defined('ENVIRONMENT'))
*
* 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 renamed or relocated anywhere on your server. If
+ * can also be renamed or relocated anywhere on your server. If
* you do, use a full server path. For more info please see the user guide:
* http://codeigniter.com/user_guide/general/managing_apps.html
*
* NO TRAILING SLASH!
- *
*/
$application_folder = 'application';
/*
+ *---------------------------------------------------------------
+ * VIEW FOLDER NAME
+ *---------------------------------------------------------------
+ *
+ * If you want to move the view folder out of the application
+ * folder set the path to the folder here. The folder can be renamed
+ * and relocated anywhere on your server. If blank, it will default
+ * to the standard location inside your application folder. If you
+ * do move this, use the full server path to this folder.
+ *
+ * NO TRAILING SLASH!
+ */
+ $view_folder = '';
+
+
+/*
* --------------------------------------------------------------------
* DEFAULT CONTROLLER
* --------------------------------------------------------------------
*
* Normally you will set your default controller in the routes.php file.
* You can, however, force a custom routing by hard-coding a
- * specific controller class/function here. For most applications, you
+ * specific controller class/function here. For most applications, you
* WILL NOT set your routing here, but it's an option for those
* special instances where you might want to override the standard
* routing in a specific front controller that shares a common CI installation.
*
- * IMPORTANT: If you set the routing here, NO OTHER controller will be
+ * IMPORTANT: If you set the routing here, NO OTHER controller will be
* callable. In essence, this preference limits your application to ONE
- * specific controller. Leave the function name blank if you need
+ * specific controller. Leave the function name blank if you need
* to call functions dynamically via the URI.
*
* Un-comment the $routing array below to use this feature
- *
*/
// The directory name, relative to the "controllers" folder. Leave blank
// if your controller is not in a sub-folder within the "controllers" folder
@@ -118,7 +153,6 @@ if (defined('ENVIRONMENT'))
* config values.
*
* Un-comment the $assign_to_config array below to use this feature
- *
*/
// $assign_to_config['name_of_config_item'] = 'value of config item';
@@ -151,7 +185,7 @@ if (defined('ENVIRONMENT'))
// 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));
+ exit('Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME));
}
/*
@@ -167,7 +201,7 @@ if (defined('ENVIRONMENT'))
define('EXT', '.php');
// Path to the system folder
- define('BASEPATH', str_replace("\\", "/", $system_path));
+ define('BASEPATH', str_replace('\\', '/', $system_path));
// Path to the front controller (this file)
define('FCPATH', str_replace(SELF, '', __FILE__));
@@ -175,7 +209,6 @@ if (defined('ENVIRONMENT'))
// Name of the "system folder"
define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
-
// The path to the "application" folder
if (is_dir($application_folder))
{
@@ -185,21 +218,37 @@ if (defined('ENVIRONMENT'))
{
if ( ! is_dir(BASEPATH.$application_folder.'/'))
{
- exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
+ header('HTTP/1.1 503 Service Unavailable.', TRUE, '503');
+ exit('Your application folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF);
}
define('APPPATH', BASEPATH.$application_folder.'/');
}
+ // The path to the "views" folder
+ if (is_dir($view_folder))
+ {
+ define ('VIEWPATH', $view_folder .'/');
+ }
+ else
+ {
+ if ( ! is_dir(APPPATH.'views/'))
+ {
+ header('HTTP/1.1 503 Service Unavailable.', TRUE, '503');
+ exit('Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF);
+ }
+
+ define ('VIEWPATH', APPPATH.'views/' );
+ }
+
/*
* --------------------------------------------------------------------
* LOAD THE BOOTSTRAP FILE
* --------------------------------------------------------------------
*
* And away we go...
- *
*/
require_once BASEPATH.'core/CodeIgniter.php';
/* End of file index.php */
-/* Location: ./index.php */ \ No newline at end of file
+/* Location: ./index.php */
diff --git a/license.rst b/license.rst
new file mode 100644
index 000000000..17179a95c
--- /dev/null
+++ b/license.rst
@@ -0,0 +1,245 @@
+###################################
+Open Software License ("OSL") v 3.0
+###################################
+
+This Open Software License (the "License") applies to any original work of
+authorship (the "Original Work") whose owner (the "Licensor") has placed the
+following licensing notice adjacent to the copyright notice for the Original
+Work:
+
+*Licensed under the Open Software License version 3.0*
+
+
+*****************************
+1) Grant of Copyright License
+*****************************
+
+Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable
+license, for the duration of the copyright, to do the following:
+
+ *a)* to reproduce the Original Work in copies, either alone or as part of
+ a collective work;
+
+ *b)* to translate, adapt, alter, transform, modify, or arrange the
+ Original Work, thereby creating derivative works ("Derivative Works")
+ based upon the Original Work;
+
+ *c)* to distribute or communicate copies of the Original Work and
+ Derivative Works to the public, *with the proviso that copies of Original
+ Work or Derivative Works that You distribute or communicate shall be
+ licensed under this Open Software License*;
+
+ *d)* to perform the Original Work publicly; and
+
+ *e)* to display the Original Work publicly.
+
+
+**************************
+2) Grant of Patent License
+**************************
+
+Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable
+license, under patent claims owned or controlled by the Licensor that are
+embodied in the Original Work as furnished by the Licensor, for the duration
+of the patents, to make, use, sell, offer for sale, have made, and import the
+Original Work and Derivative Works.
+
+
+*******************************
+3) Grant of Source Code License
+*******************************
+
+The term "Source Code" means the preferred form of the Original Work for
+making modifications to it and all available documentation describing how to
+modify the Original Work. Licensor agrees to provide a machine-readable copy
+of the Source Code of the Original Work along with each copy of the Original
+Work that Licensor distributes. Licensor reserves the right to satisfy this
+obligation by placing a machine-readable copy of the Source Code in an
+information repository reasonably calculated to permit inexpensive and
+convenient access by You for as long as Licensor continues to distribute the
+Original Work.
+
+
+********************************
+4) Exclusions From License Grant
+********************************
+
+Neither the names of Licensor, nor the names of any contributors to the
+Original Work, nor any of their trademarks or service marks, may be used to
+endorse or promote products derived from this Original Work without express
+prior permission of the Licensor. Except as expressly stated herein, nothing
+in this License grants any license to Licensor's trademarks, copyrights,
+patents, trade secrets or any other intellectual property. No patent license
+is granted to make, use, sell, offer for sale, have made, or import
+embodiments of any patent claims other than the licensed claims defined in
+Section 2) No license is granted to the trademarks of Licensor even if such
+marks are included in the Original Work. Nothing in this License shall be
+interpreted to prohibit Licensor from licensing under terms different from
+this License any Original Work that Licensor otherwise would have a right to
+license.
+
+
+**********************
+5) External Deployment
+**********************
+
+The term "External Deployment" means the use, distribution, or communication
+of the Original Work or Derivative Works in any way such that the Original
+Work or Derivative Works may be used by anyone other than You, whether those
+works are distributed or communicated to those persons or made available as an
+application intended for use over a network. As an express condition for the
+grants of license hereunder, You must treat any External Deployment by You of
+the Original Work or a Derivative Work as a distribution under section 1(c).
+
+
+*********************
+6) Attribution Rights
+*********************
+
+You must retain, in the Source Code of any Derivative Works that You create,
+all copyright, patent, or trademark notices from the Source Code of the
+Original Work, as well as any notices of licensing and any descriptive text
+identified therein as an "Attribution Notice." You must cause the Source Code
+for any Derivative Works that You create to carry a prominent Attribution
+Notice reasonably calculated to inform recipients that You have modified the
+Original Work.
+
+
+****************************************************
+7) Warranty of Provenance and Disclaimer of Warranty
+****************************************************
+
+Licensor warrants that the copyright in and to the Original Work and the
+patent rights granted herein by Licensor are owned by the Licensor or are
+sublicensed to You under the terms of this License with the permission of the
+contributor(s) of those copyrights and patent rights. Except as expressly
+stated in the immediately preceding sentence, the Original Work is provided
+under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or
+implied, including, without limitation, the warranties of non-infringement,
+merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE
+QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY
+constitutes an essential part of this License. No license to the Original Work
+is granted by this License except under this disclaimer.
+
+
+**************************
+8) Limitation of Liability
+**************************
+
+Under no circumstances and under no legal theory, whether in tort (including
+negligence), contract, or otherwise, shall the Licensor be liable to anyone
+for any indirect, special, incidental, or consequential damages of any
+character arising as a result of this License or the use of the Original Work
+including, without limitation, damages for loss of goodwill, work stoppage,
+computer failure or malfunction, or any and all other commercial damages or
+losses. This limitation of liability shall not apply to the extent applicable
+law prohibits such limitation.
+
+
+*****************************
+9) Acceptance and Termination
+*****************************
+
+If, at any time, You expressly assented to this License, that assent indicates
+your clear and irrevocable acceptance of this License and all of its terms and
+conditions. If You distribute or communicate copies of the Original Work or a
+Derivative Work, You must make a reasonable effort under the circumstances to
+obtain the express assent of recipients to the terms of this License. This
+License conditions your rights to undertake the activities listed in Section
+1, including your right to create Derivative Works based upon the Original
+Work, and doing so without honoring these terms and conditions is prohibited
+by copyright law and international treaty. Nothing in this License is intended
+to affect copyright exceptions and limitations (including "fair use" or "fair
+dealing"). This License shall terminate immediately and You may no longer
+exercise any of the rights granted to You by this License upon your failure to
+honor the conditions in Section 1(c).
+
+
+*********************************
+10) Termination for Patent Action
+*********************************
+
+This License shall terminate automatically and You may no longer exercise any
+of the rights granted to You by this License as of the date You commence an
+action, including a cross-claim or counterclaim, against Licensor or any
+licensee alleging that the Original Work infringes a patent. This termination
+provision shall not apply for an action alleging patent infringement by
+combinations of the Original Work with other software or hardware.
+
+
+*****************************************
+11) Jurisdiction, Venue and Governing Law
+*****************************************
+
+Any action or suit relating to this License may be brought only in the courts
+of a jurisdiction wherein the Licensor resides or in which Licensor conducts
+its primary business, and under the laws of that jurisdiction excluding its
+conflict-of-law provisions. The application of the United Nations Convention
+on Contracts for the International Sale of Goods is expressly excluded. Any
+use of the Original Work outside the scope of this License or after its
+termination shall be subject to the requirements and penalties of copyright or
+patent law in the appropriate jurisdiction. This section shall survive the
+termination of this License.
+
+
+*******************
+12) Attorneys' Fees
+*******************
+
+In any action to enforce the terms of this License or seeking damages relating
+thereto, the prevailing party shall be entitled to recover its costs and
+expenses, including, without limitation, reasonable attorneys' fees and costs
+incurred in connection with such action, including any appeal of such action.
+This section shall survive the termination of this License.
+
+
+*****************
+13) Miscellaneous
+*****************
+
+If any provision of this License is held to be unenforceable, such provision
+shall be reformed only to the extent necessary to make it enforceable.
+
+
+***************************************
+14) Definition of "You" in This License
+***************************************
+
+"You" throughout this License, whether in upper or lower case, means an
+individual or a legal entity exercising rights under, and complying with all
+of the terms of, this License. For legal entities, "You" includes any entity
+that controls, is controlled by, or is under common control with you. For
+purposes of this definition, "control" means (i) the power, direct or
+indirect, to cause the direction or management of such entity, whether by
+contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
+outstanding shares, or (iii) beneficial ownership of such entity.
+
+
+****************
+15) Right to Use
+****************
+
+You may use the Original Work in all ways not otherwise restricted or
+conditioned by this License or by law, and Licensor promises not to interfere
+with or be responsible for such uses by You.
+
+
+********************************
+16) Modification of This License
+********************************
+
+This License is Copyright © 2005 Lawrence Rosen. Permission is granted to
+copy, distribute, or communicate this License without modification. Nothing in
+this License permits You to modify this License as applied to the Original
+Work or to Derivative Works. However, You may modify the text of this License
+and copy, distribute or communicate your modified version (the "Modified
+License") and apply it to other original works of authorship subject to the
+following conditions: (i) You may not indicate in any way that your Modified
+License is the "Open Software License" or "OSL" and you may not use those
+names in the name of your Modified License; (ii) You must replace the notice
+specified in the first paragraph above with the notice "Licensed under <insert
+your license name here>" or with a notice of your own that is not confusingly
+similar to the notice in this License; and (iii) You may not claim that your
+original works are open source software unless your Modified License has been
+approved by Open Source Initiative (OSI) and You comply with its license
+review and certification process. \ No newline at end of file
diff --git a/license.txt b/license.txt
index 061cdb9db..395dcc3a0 100644
--- a/license.txt
+++ b/license.txt
@@ -1,51 +1,172 @@
-Copyright (c) 2008 - 2011, EllisLab, Inc.
-All rights reserved.
-
-This license is a legal agreement between you and EllisLab Inc. for the use
-of CodeIgniter Software (the "Software"). By obtaining the Software you
-agree to comply with the terms and conditions of this license.
-
-PERMITTED USE
-You are permitted to use, copy, modify, and distribute the Software and its
-documentation, with or without modification, for any purpose, provided that
-the following conditions are met:
-
-1. A copy of this license agreement must be included with the distribution.
-
-2. Redistributions of source code must retain the above copyright notice in
- all source code files.
-
-3. Redistributions in binary form must reproduce the above copyright notice
- in the documentation and/or other materials provided with the distribution.
-
-4. Any files that have been modified must carry notices stating the nature
- of the change and the names of those who changed them.
-
-5. Products derived from the Software must include an acknowledgment that
- they are derived from CodeIgniter in their documentation and/or other
- materials provided with the distribution.
-
-6. Products derived from the Software may not be called "CodeIgniter",
- nor may "CodeIgniter" appear in their name, without prior written
- permission from EllisLab, Inc.
-
-INDEMNITY
-You agree to indemnify and hold harmless the authors of the Software and
-any contributors for any direct, indirect, incidental, or consequential
-third-party claims, actions or suits, as well as any related expenses,
-liabilities, damages, settlements or fees arising from your use or misuse
-of the Software, or a violation of any terms of this license.
-
-DISCLAIMER OF WARRANTY
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR
-IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF QUALITY, PERFORMANCE,
-NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
-
-LIMITATIONS OF LIABILITY
-YOU ASSUME ALL RISK ASSOCIATED WITH THE INSTALLATION AND USE OF THE SOFTWARE.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS OF THE SOFTWARE BE LIABLE
-FOR CLAIMS, DAMAGES OR OTHER LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION
-WITH THE SOFTWARE. LICENSE HOLDERS ARE SOLELY RESPONSIBLE FOR DETERMINING THE
-APPROPRIATENESS OF USE AND ASSUME ALL RISKS ASSOCIATED WITH ITS USE, INCLUDING
-BUT NOT LIMITED TO THE RISKS OF PROGRAM ERRORS, DAMAGE TO EQUIPMENT, LOSS OF
-DATA OR SOFTWARE PROGRAMS, OR UNAVAILABILITY OR INTERRUPTION OF OPERATIONS.
+Open Software License ("OSL") v 3.0
+
+This Open Software License (the "License") applies to any original work of
+authorship (the "Original Work") whose owner (the "Licensor") has placed the
+following licensing notice adjacent to the copyright notice for the Original
+Work:
+
+Licensed under the Open Software License version 3.0
+
+1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free,
+non-exclusive, sublicensable license, for the duration of the copyright, to do
+the following:
+
+ a) to reproduce the Original Work in copies, either alone or as part of a
+ collective work;
+
+ b) to translate, adapt, alter, transform, modify, or arrange the Original
+ Work, thereby creating derivative works ("Derivative Works") based
+ upon the Original Work;
+
+ c) to distribute or communicate copies of the Original Work and Derivative
+ Works to the public, with the proviso that copies of Original Work or
+ Derivative Works that You distribute or communicate shall be licensed
+ under this Open Software License;
+
+ d) to perform the Original Work publicly; and
+
+ e) to display the Original Work publicly.
+
+2) Grant of Patent License. Licensor grants You a worldwide, royalty-free,
+non-exclusive, sublicensable license, under patent claims owned or controlled
+by the Licensor that are embodied in the Original Work as furnished by the
+Licensor, for the duration of the patents, to make, use, sell, offer for sale,
+have made, and import the Original Work and Derivative Works.
+
+3) Grant of Source Code License. The term "Source Code" means the preferred
+form of the Original Work for making modifications to it and all available
+documentation describing how to modify the Original Work. Licensor agrees to
+provide a machine-readable copy of the Source Code of the Original Work along
+with each copy of the Original Work that Licensor distributes. Licensor
+reserves the right to satisfy this obligation by placing a machine-readable
+copy of the Source Code in an information repository reasonably calculated to
+permit inexpensive and convenient access by You for as long as Licensor
+continues to distribute the Original Work.
+
+4) Exclusions From License Grant. Neither the names of Licensor, nor the names
+of any contributors to the Original Work, nor any of their trademarks or
+service marks, may be used to endorse or promote products derived from this
+Original Work without express prior permission of the Licensor. Except as
+expressly stated herein, nothing in this License grants any license to
+Licensor's trademarks, copyrights, patents, trade secrets or any other
+intellectual property. No patent license is granted to make, use, sell, offer
+for sale, have made, or import embodiments of any patent claims other than the
+licensed claims defined in Section 2. No license is granted to the trademarks
+of Licensor even if such marks are included in the Original Work. Nothing in
+this License shall be interpreted to prohibit Licensor from licensing under
+terms different from this License any Original Work that Licensor otherwise
+would have a right to license.
+
+5) External Deployment. The term "External Deployment" means the use,
+distribution, or communication of the Original Work or Derivative Works in any
+way such that the Original Work or Derivative Works may be used by anyone
+other than You, whether those works are distributed or communicated to those
+persons or made available as an application intended for use over a network.
+As an express condition for the grants of license hereunder, You must treat
+any External Deployment by You of the Original Work or a Derivative Work as a
+distribution under section 1(c).
+
+6) Attribution Rights. You must retain, in the Source Code of any Derivative
+Works that You create, all copyright, patent, or trademark notices from the
+Source Code of the Original Work, as well as any notices of licensing and any
+descriptive text identified therein as an "Attribution Notice." You must cause
+the Source Code for any Derivative Works that You create to carry a prominent
+Attribution Notice reasonably calculated to inform recipients that You have
+modified the Original Work.
+
+7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that
+the copyright in and to the Original Work and the patent rights granted herein
+by Licensor are owned by the Licensor or are sublicensed to You under the
+terms of this License with the permission of the contributor(s) of those
+copyrights and patent rights. Except as expressly stated in the immediately
+preceding sentence, the Original Work is provided under this License on an "AS
+IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without
+limitation, the warranties of non-infringement, merchantability or fitness for
+a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK
+IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this
+License. No license to the Original Work is granted by this License except
+under this disclaimer.
+
+8) Limitation of Liability. Under no circumstances and under no legal theory,
+whether in tort (including negligence), contract, or otherwise, shall the
+Licensor be liable to anyone for any indirect, special, incidental, or
+consequential damages of any character arising as a result of this License or
+the use of the Original Work including, without limitation, damages for loss
+of goodwill, work stoppage, computer failure or malfunction, or any and all
+other commercial damages or losses. This limitation of liability shall not
+apply to the extent applicable law prohibits such limitation.
+
+9) Acceptance and Termination. If, at any time, You expressly assented to this
+License, that assent indicates your clear and irrevocable acceptance of this
+License and all of its terms and conditions. If You distribute or communicate
+copies of the Original Work or a Derivative Work, You must make a reasonable
+effort under the circumstances to obtain the express assent of recipients to
+the terms of this License. This License conditions your rights to undertake
+the activities listed in Section 1, including your right to create Derivative
+Works based upon the Original Work, and doing so without honoring these terms
+and conditions is prohibited by copyright law and international treaty.
+Nothing in this License is intended to affect copyright exceptions and
+limitations (including "fair use" or "fair dealing"). This License shall
+terminate immediately and You may no longer exercise any of the rights granted
+to You by this License upon your failure to honor the conditions in Section
+1(c).
+
+10) Termination for Patent Action. This License shall terminate automatically
+and You may no longer exercise any of the rights granted to You by this
+License as of the date You commence an action, including a cross-claim or
+counterclaim, against Licensor or any licensee alleging that the Original Work
+infringes a patent. This termination provision shall not apply for an action
+alleging patent infringement by combinations of the Original Work with other
+software or hardware.
+
+11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this
+License may be brought only in the courts of a jurisdiction wherein the
+Licensor resides or in which Licensor conducts its primary business, and under
+the laws of that jurisdiction excluding its conflict-of-law provisions. The
+application of the United Nations Convention on Contracts for the
+International Sale of Goods is expressly excluded. Any use of the Original
+Work outside the scope of this License or after its termination shall be
+subject to the requirements and penalties of copyright or patent law in the
+appropriate jurisdiction. This section shall survive the termination of this
+License.
+
+12) Attorneys' Fees. In any action to enforce the terms of this License or
+seeking damages relating thereto, the prevailing party shall be entitled to
+recover its costs and expenses, including, without limitation, reasonable
+attorneys' fees and costs incurred in connection with such action, including
+any appeal of such action. This section shall survive the termination of this
+License.
+
+13) Miscellaneous. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent necessary
+to make it enforceable.
+
+14) Definition of "You" in This License. "You" throughout this License,
+whether in upper or lower case, means an individual or a legal entity
+exercising rights under, and complying with all of the terms of, this License.
+For legal entities, "You" includes any entity that controls, is controlled by,
+or is under common control with you. For purposes of this definition,
+"control" means (i) the power, direct or indirect, to cause the direction or
+management of such entity, whether by contract or otherwise, or (ii) ownership
+of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial
+ownership of such entity.
+
+15) Right to Use. You may use the Original Work in all ways not otherwise
+restricted or conditioned by this License or by law, and Licensor promises not
+to interfere with or be responsible for such uses by You.
+
+16) Modification of This License. This License is Copyright © 2005 Lawrence
+Rosen. Permission is granted to copy, distribute, or communicate this License
+without modification. Nothing in this License permits You to modify this
+License as applied to the Original Work or to Derivative Works. However, You
+may modify the text of this License and copy, distribute or communicate your
+modified version (the "Modified License") and apply it to other original works
+of authorship subject to the following conditions: (i) You may not indicate in
+any way that your Modified License is the "Open Software License" or "OSL" and
+you may not use those names in the name of your Modified License; (ii) You
+must replace the notice specified in the first paragraph above with the notice
+"Licensed under <insert your license name here>" or with a notice of your own
+that is not confusingly similar to the notice in this License; and (iii) You
+may not claim that your original works are open source software unless your
+Modified License has been approved by Open Source Initiative (OSI) and You
+comply with its license review and certification process. \ No newline at end of file
diff --git a/license_afl.rst b/license_afl.rst
new file mode 100644
index 000000000..ca39be9b6
--- /dev/null
+++ b/license_afl.rst
@@ -0,0 +1,245 @@
+###################################
+Academic Free License ("AFL") v 3.0
+###################################
+
+This Academic Free License (the "License") applies to any original work of
+authorship (the "Original Work") whose owner (the "Licensor") has placed the
+following licensing notice adjacent to the copyright notice for the Original
+Work:
+
+*Licensed under the Academic Free License version 3.0*
+
+
+*****************************
+1) Grant of Copyright License
+*****************************
+
+Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable
+license, for the duration of the copyright, to do the following:
+
+ *a)* to reproduce the Original Work in copies, either alone or as part of
+ a collective work;
+
+ *b)* to translate, adapt, alter, transform, modify, or arrange the
+ Original Work, thereby creating derivative works ("Derivative Works")
+ based upon the Original Work;
+
+ *c)* to distribute or communicate copies of the Original Work and
+ Derivative Works to the public, *under any license of your choice that
+ does not contradict the terms and conditions, including Licensor's
+ reserved rights and remedies, in this Academic Free License*;
+
+ *d)* to perform the Original Work publicly; and
+
+ *e)* to display the Original Work publicly.
+
+
+**************************
+2) Grant of Patent License
+**************************
+
+Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable
+license, under patent claims owned or controlled by the Licensor that are
+embodied in the Original Work as furnished by the Licensor, for the duration
+of the patents, to make, use, sell, offer for sale, have made, and import the
+Original Work and Derivative Works.
+
+
+*******************************
+3) Grant of Source Code License
+*******************************
+
+The term "Source Code" means the preferred form of the Original Work for
+making modifications to it and all available documentation describing how to
+modify the Original Work. Licensor agrees to provide a machine-readable copy
+of the Source Code of the Original Work along with each copy of the Original
+Work that Licensor distributes. Licensor reserves the right to satisfy this
+obligation by placing a machine-readable copy of the Source Code in an
+information repository reasonably calculated to permit inexpensive and
+convenient access by You for as long as Licensor continues to distribute the
+Original Work.
+
+
+********************************
+4) Exclusions From License Grant
+********************************
+
+Neither the names of Licensor, nor the names of any contributors to the
+Original Work, nor any of their trademarks or service marks, may be used to
+endorse or promote products derived from this Original Work without express
+prior permission of the Licensor. Except as expressly stated herein, nothing
+in this License grants any license to Licensor's trademarks, copyrights,
+patents, trade secrets or any other intellectual property. No patent license
+is granted to make, use, sell, offer for sale, have made, or import
+embodiments of any patent claims other than the licensed claims defined in
+Section 2) No license is granted to the trademarks of Licensor even if such
+marks are included in the Original Work. Nothing in this License shall be
+interpreted to prohibit Licensor from licensing under terms different from
+this License any Original Work that Licensor otherwise would have a right to
+license.
+
+
+**********************
+5) External Deployment
+**********************
+
+The term "External Deployment" means the use, distribution, or communication
+of the Original Work or Derivative Works in any way such that the Original
+Work or Derivative Works may be used by anyone other than You, whether those
+works are distributed or communicated to those persons or made available as an
+application intended for use over a network. As an express condition for the
+grants of license hereunder, You must treat any External Deployment by You of
+the Original Work or a Derivative Work as a distribution under section 1(c).
+
+
+*********************
+6) Attribution Rights
+*********************
+
+You must retain, in the Source Code of any Derivative Works that You create,
+all copyright, patent, or trademark notices from the Source Code of the
+Original Work, as well as any notices of licensing and any descriptive text
+identified therein as an "Attribution Notice." You must cause the Source Code
+for any Derivative Works that You create to carry a prominent Attribution
+Notice reasonably calculated to inform recipients that You have modified the
+Original Work.
+
+
+****************************************************
+7) Warranty of Provenance and Disclaimer of Warranty
+****************************************************
+
+Licensor warrants that the copyright in and to the Original Work and the
+patent rights granted herein by Licensor are owned by the Licensor or are
+sublicensed to You under the terms of this License with the permission of the
+contributor(s) of those copyrights and patent rights. Except as expressly
+stated in the immediately preceding sentence, the Original Work is provided
+under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or
+implied, including, without limitation, the warranties of non-infringement,
+merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE
+QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY
+constitutes an essential part of this License. No license to the Original Work
+is granted by this License except under this disclaimer.
+
+
+**************************
+8) Limitation of Liability
+**************************
+
+Under no circumstances and under no legal theory, whether in tort (including
+negligence), contract, or otherwise, shall the Licensor be liable to anyone
+for any indirect, special, incidental, or consequential damages of any
+character arising as a result of this License or the use of the Original Work
+including, without limitation, damages for loss of goodwill, work stoppage,
+computer failure or malfunction, or any and all other commercial damages or
+losses. This limitation of liability shall not apply to the extent applicable
+law prohibits such limitation.
+
+
+*****************************
+9) Acceptance and Termination
+*****************************
+
+If, at any time, You expressly assented to this License, that assent indicates
+your clear and irrevocable acceptance of this License and all of its terms and
+conditions. If You distribute or communicate copies of the Original Work or a
+Derivative Work, You must make a reasonable effort under the circumstances to
+obtain the express assent of recipients to the terms of this License. This
+License conditions your rights to undertake the activities listed in Section
+1, including your right to create Derivative Works based upon the Original
+Work, and doing so without honoring these terms and conditions is prohibited
+by copyright law and international treaty. Nothing in this License is intended
+to affect copyright exceptions and limitations (including "fair use" or "fair
+dealing"). This License shall terminate immediately and You may no longer
+exercise any of the rights granted to You by this License upon your failure to
+honor the conditions in Section 1(c).
+
+
+*********************************
+10) Termination for Patent Action
+*********************************
+
+This License shall terminate automatically and You may no longer exercise any
+of the rights granted to You by this License as of the date You commence an
+action, including a cross-claim or counterclaim, against Licensor or any
+licensee alleging that the Original Work infringes a patent. This termination
+provision shall not apply for an action alleging patent infringement by
+combinations of the Original Work with other software or hardware.
+
+
+*****************************************
+11) Jurisdiction, Venue and Governing Law
+*****************************************
+
+Any action or suit relating to this License may be brought only in the courts
+of a jurisdiction wherein the Licensor resides or in which Licensor conducts
+its primary business, and under the laws of that jurisdiction excluding its
+conflict-of-law provisions. The application of the United Nations Convention
+on Contracts for the International Sale of Goods is expressly excluded. Any
+use of the Original Work outside the scope of this License or after its
+termination shall be subject to the requirements and penalties of copyright or
+patent law in the appropriate jurisdiction. This section shall survive the
+termination of this License.
+
+
+*******************
+12) Attorneys' Fees
+*******************
+
+In any action to enforce the terms of this License or seeking damages relating
+thereto, the prevailing party shall be entitled to recover its costs and
+expenses, including, without limitation, reasonable attorneys' fees and costs
+incurred in connection with such action, including any appeal of such action.
+This section shall survive the termination of this License.
+
+
+*****************
+13) Miscellaneous
+*****************
+
+If any provision of this License is held to be unenforceable, such provision
+shall be reformed only to the extent necessary to make it enforceable.
+
+
+***************************************
+14) Definition of "You" in This License
+***************************************
+
+"You" throughout this License, whether in upper or lower case, means an
+individual or a legal entity exercising rights under, and complying with all
+of the terms of, this License. For legal entities, "You" includes any entity
+that controls, is controlled by, or is under common control with you. For
+purposes of this definition, "control" means (i) the power, direct or
+indirect, to cause the direction or management of such entity, whether by
+contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
+outstanding shares, or (iii) beneficial ownership of such entity.
+
+
+****************
+15) Right to Use
+****************
+
+You may use the Original Work in all ways not otherwise restricted or
+conditioned by this License or by law, and Licensor promises not to interfere
+with or be responsible for such uses by You.
+
+
+********************************
+16) Modification of This License
+********************************
+
+This License is Copyright © 2005 Lawrence Rosen. Permission is granted to
+copy, distribute, or communicate this License without modification. Nothing in
+this License permits You to modify this License as applied to the Original
+Work or to Derivative Works. However, You may modify the text of this License
+and copy, distribute or communicate your modified version (the "Modified
+License") and apply it to other original works of authorship subject to the
+following conditions: (i) You may not indicate in any way that your Modified
+License is the "Academic Free License" or "AFL" and you may not use those
+names in the name of your Modified License; (ii) You must replace the notice
+specified in the first paragraph above with the notice "Licensed under <insert
+your license name here>" or with a notice of your own that is not confusingly
+similar to the notice in this License; and (iii) You may not claim that your
+original works are open source software unless your Modified License has been
+approved by Open Source Initiative (OSI) and You comply with its license
+review and certification process. \ No newline at end of file
diff --git a/license_afl.txt b/license_afl.txt
new file mode 100644
index 000000000..6fc164c1e
--- /dev/null
+++ b/license_afl.txt
@@ -0,0 +1,172 @@
+Academic Free License ("AFL") v 3.0
+
+This Academic Free License (the "License") applies to any original work of
+authorship (the "Original Work") whose owner (the "Licensor") has placed the
+following licensing notice adjacent to the copyright notice for the Original
+Work:
+
+Licensed under the Academic Free License version 3.0
+
+1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free,
+non-exclusive, sublicensable license, for the duration of the copyright, to do
+the following:
+
+ a) to reproduce the Original Work in copies, either alone or as part of a
+ collective work;
+
+ b) to translate, adapt, alter, transform, modify, or arrange the Original
+ Work, thereby creating derivative works ("Derivative Works") based
+ upon the Original Work;
+
+ c) to distribute or communicate copies of the Original Work and Derivative
+ Works to the public, under any license of your choice that does not
+ contradict the terms and conditions, including Licensor's reserved
+ rights and remedies, in this Academic Free License;
+
+ d) to perform the Original Work publicly; and
+
+ e) to display the Original Work publicly.
+
+2) Grant of Patent License. Licensor grants You a worldwide, royalty-free,
+non-exclusive, sublicensable license, under patent claims owned or controlled
+by the Licensor that are embodied in the Original Work as furnished by the
+Licensor, for the duration of the patents, to make, use, sell, offer for sale,
+have made, and import the Original Work and Derivative Works.
+
+3) Grant of Source Code License. The term "Source Code" means the preferred
+form of the Original Work for making modifications to it and all available
+documentation describing how to modify the Original Work. Licensor agrees to
+provide a machine-readable copy of the Source Code of the Original Work along
+with each copy of the Original Work that Licensor distributes. Licensor
+reserves the right to satisfy this obligation by placing a machine-readable
+copy of the Source Code in an information repository reasonably calculated to
+permit inexpensive and convenient access by You for as long as Licensor
+continues to distribute the Original Work.
+
+4) Exclusions From License Grant. Neither the names of Licensor, nor the names
+of any contributors to the Original Work, nor any of their trademarks or
+service marks, may be used to endorse or promote products derived from this
+Original Work without express prior permission of the Licensor. Except as
+expressly stated herein, nothing in this License grants any license to
+Licensor's trademarks, copyrights, patents, trade secrets or any other
+intellectual property. No patent license is granted to make, use, sell, offer
+for sale, have made, or import embodiments of any patent claims other than the
+licensed claims defined in Section 2. No license is granted to the trademarks
+of Licensor even if such marks are included in the Original Work. Nothing in
+this License shall be interpreted to prohibit Licensor from licensing under
+terms different from this License any Original Work that Licensor otherwise
+would have a right to license.
+
+5) External Deployment. The term "External Deployment" means the use,
+distribution, or communication of the Original Work or Derivative Works in any
+way such that the Original Work or Derivative Works may be used by anyone
+other than You, whether those works are distributed or communicated to those
+persons or made available as an application intended for use over a network.
+As an express condition for the grants of license hereunder, You must treat
+any External Deployment by You of the Original Work or a Derivative Work as a
+distribution under section 1(c).
+
+6) Attribution Rights. You must retain, in the Source Code of any Derivative
+Works that You create, all copyright, patent, or trademark notices from the
+Source Code of the Original Work, as well as any notices of licensing and any
+descriptive text identified therein as an "Attribution Notice." You must cause
+the Source Code for any Derivative Works that You create to carry a prominent
+Attribution Notice reasonably calculated to inform recipients that You have
+modified the Original Work.
+
+7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that
+the copyright in and to the Original Work and the patent rights granted herein
+by Licensor are owned by the Licensor or are sublicensed to You under the
+terms of this License with the permission of the contributor(s) of those
+copyrights and patent rights. Except as expressly stated in the immediately
+preceding sentence, the Original Work is provided under this License on an "AS
+IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without
+limitation, the warranties of non-infringement, merchantability or fitness for
+a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK
+IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this
+License. No license to the Original Work is granted by this License except
+under this disclaimer.
+
+8) Limitation of Liability. Under no circumstances and under no legal theory,
+whether in tort (including negligence), contract, or otherwise, shall the
+Licensor be liable to anyone for any indirect, special, incidental, or
+consequential damages of any character arising as a result of this License or
+the use of the Original Work including, without limitation, damages for loss
+of goodwill, work stoppage, computer failure or malfunction, or any and all
+other commercial damages or losses. This limitation of liability shall not
+apply to the extent applicable law prohibits such limitation.
+
+9) Acceptance and Termination. If, at any time, You expressly assented to this
+License, that assent indicates your clear and irrevocable acceptance of this
+License and all of its terms and conditions. If You distribute or communicate
+copies of the Original Work or a Derivative Work, You must make a reasonable
+effort under the circumstances to obtain the express assent of recipients to
+the terms of this License. This License conditions your rights to undertake
+the activities listed in Section 1, including your right to create Derivative
+Works based upon the Original Work, and doing so without honoring these terms
+and conditions is prohibited by copyright law and international treaty.
+Nothing in this License is intended to affect copyright exceptions and
+limitations (including "fair use" or "fair dealing"). This License shall
+terminate immediately and You may no longer exercise any of the rights granted
+to You by this License upon your failure to honor the conditions in Section
+1(c).
+
+10) Termination for Patent Action. This License shall terminate automatically
+and You may no longer exercise any of the rights granted to You by this
+License as of the date You commence an action, including a cross-claim or
+counterclaim, against Licensor or any licensee alleging that the Original Work
+infringes a patent. This termination provision shall not apply for an action
+alleging patent infringement by combinations of the Original Work with other
+software or hardware.
+
+11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this
+License may be brought only in the courts of a jurisdiction wherein the
+Licensor resides or in which Licensor conducts its primary business, and under
+the laws of that jurisdiction excluding its conflict-of-law provisions. The
+application of the United Nations Convention on Contracts for the
+International Sale of Goods is expressly excluded. Any use of the Original
+Work outside the scope of this License or after its termination shall be
+subject to the requirements and penalties of copyright or patent law in the
+appropriate jurisdiction. This section shall survive the termination of this
+License.
+
+12) Attorneys' Fees. In any action to enforce the terms of this License or
+seeking damages relating thereto, the prevailing party shall be entitled to
+recover its costs and expenses, including, without limitation, reasonable
+attorneys' fees and costs incurred in connection with such action, including
+any appeal of such action. This section shall survive the termination of this
+License.
+
+13) Miscellaneous. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent necessary
+to make it enforceable.
+
+14) Definition of "You" in This License. "You" throughout this License,
+whether in upper or lower case, means an individual or a legal entity
+exercising rights under, and complying with all of the terms of, this License.
+For legal entities, "You" includes any entity that controls, is controlled by,
+or is under common control with you. For purposes of this definition,
+"control" means (i) the power, direct or indirect, to cause the direction or
+management of such entity, whether by contract or otherwise, or (ii) ownership
+of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial
+ownership of such entity.
+
+15) Right to Use. You may use the Original Work in all ways not otherwise
+restricted or conditioned by this License or by law, and Licensor promises not
+to interfere with or be responsible for such uses by You.
+
+16) Modification of This License. This License is Copyright © 2005 Lawrence
+Rosen. Permission is granted to copy, distribute, or communicate this License
+without modification. Nothing in this License permits You to modify this
+License as applied to the Original Work or to Derivative Works. However, You
+may modify the text of this License and copy, distribute or communicate your
+modified version (the "Modified License") and apply it to other original works
+of authorship subject to the following conditions: (i) You may not indicate in
+any way that your Modified License is the "Academic Free License" or "AFL" and
+you may not use those names in the name of your Modified License; (ii) You
+must replace the notice specified in the first paragraph above with the notice
+"Licensed under <insert your license name here>" or with a notice of your own
+that is not confusingly similar to the notice in this License; and (iii) You
+may not claim that your original works are open source software unless your
+Modified License has been approved by Open Source Initiative (OSI) and You
+comply with its license review and certification process. \ No newline at end of file
diff --git a/readme.rst b/readme.rst
new file mode 100644
index 000000000..2369a8ddb
--- /dev/null
+++ b/readme.rst
@@ -0,0 +1,196 @@
+###################
+What is CodeIgniter
+###################
+
+CodeIgniter is an Application Development Framework - a toolkit - for people
+who build web sites using PHP. Its goal is to enable you to develop projects
+much faster than you could if you were writing code from scratch, by providing
+a rich set of libraries for commonly needed tasks, as well as a simple
+interface and logical structure to access these libraries. CodeIgniter lets
+you creatively focus on your project by minimizing the amount of code needed
+for a given task.
+
+*******************
+Release Information
+*******************
+
+This repo contains in development code for future releases. To download the
+latest stable release please visit the `CodeIgniter Downloads
+<http://codeigniter.com/downloads/>`_ page.
+
+**************************
+Changelog and New Features
+**************************
+
+You can find a list of all changes for each release in the `user
+guide change log <https://github.com/EllisLab/CodeIgniter/blob/develop/user_guide_src/source/changelog.rst>`_.
+
+*******************
+Server Requirements
+*******************
+
+- PHP version 5.1.6 or newer.
+
+************
+Installation
+************
+
+Please see the `installation section <http://codeigniter.com/user_guide/installation/index.html>`_
+of the CodeIgniter User Guide.
+
+************
+Contributing
+************
+
+CodeIgniter is a community driven project and accepts contributions of code
+and documentation from the community. These contributions are made in the form
+of Issues or `Pull Requests <http://help.github.com/send-pull-requests/>`_ on
+the `EllisLab CodeIgniter repository
+<https://github.com/EllisLab/CodeIgniter>`_ on GitHub.
+
+Issues are a quick way to point out a bug. If you find a bug or documentation
+error in CodeIgniter then please check a few things first:
+
+- There is not already an open Issue
+- The issue has already been fixed (check the develop branch, or look for
+ closed Issues)
+- Is it something really obvious that you fix it yourself?
+
+Reporting issues is helpful but an even better approach is to send a Pull
+Request, which is done by "Forking" the main repository and committing to your
+own copy. This will require you to use the version control system called Git.
+
+**********
+Guidelines
+**********
+
+Before we look into how, here are the guidelines. If your Pull Requests fail
+to pass these guidelines it will be declined and you will need to re-submit
+when you’ve made the changes. This might sound a bit tough, but it is required
+for us to maintain quality of the code-base.
+
+PHP Style
+=========
+
+All code must meet the `Style Guide
+<http://codeigniter.com/user_guide/general/styleguide.html>`_, which is
+essentially the `Allman indent style
+<http://en.wikipedia.org/wiki/Indent_style#Allman_style>`_, underscores and
+readable operators. This makes certain that all code is the same format as the
+existing code and means it will be as readable as possible.
+
+Documentation
+=============
+
+If you change anything that requires a change to documentation then you will
+need to add it. New classes, methods, parameters, changing default values, etc
+are all things that will require a change to documentation. The change-log
+must also be updated for every change. Also PHPDoc blocks must be maintained.
+
+Compatibility
+=============
+
+CodeIgniter is compatible with PHP 5.1.6 so all code supplied must stick to
+this requirement. If PHP 5.2 or 5.3 functions or features are used then there
+must be a fallback for PHP 5.1.6.
+
+Branching
+=========
+
+CodeIgniter uses the `Git-Flow
+<http://nvie.com/posts/a-successful-git-branching-model/>`_ branching model
+which requires all pull requests to be sent to the "develop" branch. This is
+where the next planned version will be developed. The "master" branch will
+always contain the latest stable version and is kept clean so a "hotfix" (e.g:
+an emergency security patch) can be applied to master to create a new version,
+without worrying about other features holding it up. For this reason all
+commits need to be made to "develop" and any sent to "master" will be closed
+automatically. If you have multiple changes to submit, please place all
+changes into their own branch on your fork.
+
+One thing at a time: A pull request should only contain one change. That does
+not mean only one commit, but one change - however many commits it took. The
+reason for this is that if you change X and Y but send a pull request for both
+at the same time, we might really want X but disagree with Y, meaning we
+cannot merge the request. Using the Git-Flow branching model you can create
+new branches for both of these features and send two requests.
+
+************
+How-to Guide
+************
+
+There are two ways to make changes, the easy way and the hard way. Either way
+you will need to `create a GitHub account <https://github.com/signup/free>`_.
+
+Easy way GitHub allows in-line editing of files for making simple typo changes
+and quick-fixes. This is not the best way as you are unable to test the code
+works. If you do this you could be introducing syntax errors, etc, but for a
+Git-phobic user this is good for a quick-fix.
+
+Hard way The best way to contribute is to "clone" your fork of CodeIgniter to
+your development area. That sounds like some jargon, but "forking" on GitHub
+means "making a copy of that repo to your account" and "cloning" means
+"copying that code to your environment so you can work on it".
+
+#. Set up Git (Windows, Mac & Linux)
+#. Go to the CodeIgniter repo
+#. Fork it
+#. Clone your CodeIgniter repo: git@github.com:<your-name>/CodeIgniter.git
+#. Checkout the "develop" branch At this point you are ready to start making
+ changes.
+#. Fix existing bugs on the Issue tracker after taking a look to see nobody
+ else is working on them.
+#. Commit the files
+#. Push your develop branch to your fork
+#. Send a pull request http://help.github.com/send-pull-requests/
+
+The Reactor Engineers will now be alerted about the change and at least one of
+the team will respond. If your change fails to meet the guidelines it will be
+bounced, or feedback will be provided to help you improve it.
+
+Once the Reactor Engineer handling your pull request is happy with it they
+will post it to the internal EllisLab discussion area to be double checked by
+the other Engineers and EllisLab developers. If nobody has a problem with the
+change then it will be merged into develop and will be part of the next
+release. Keeping your fork up-to-date
+
+Unlike systems like Subversion, Git can have multiple remotes. A remote is the
+name for a URL of a Git repository. By default your fork will have a remote
+named "origin" which points to your fork, but you can add another remote named
+"codeigniter" which points to git://github.com/EllisLab/CodeIgniter.git. This
+is a read-only remote but you can pull from this develop branch to update your
+own.
+
+If you are using command-line you can do the following:
+
+#. git remote add codeigniter git://github.com/EllisLab/CodeIgniter.git
+#. git pull codeigniter develop
+#. git push origin develop
+
+Now your fork is up to date. This should be done regularly, or before you send
+a pull request at least.
+
+*******
+License
+*******
+
+Please see the `license
+agreement <http://codeigniter.com/user_guide/license.html>`_
+
+*********
+Resources
+*********
+
+- `User Guide <http://codeigniter.com/user_guide/>`_
+- `Community Forums <http://codeigniter.com/forums/>`_
+- `User
+ Voice <http://codeigniter.uservoice.com/forums/40508-codeigniter-reactor>`_
+- `Community Wiki <http://codeigniter.com/wiki/>`_
+- `Community IRC <http://codeigniter.com/irc/>`_
+
+***************
+Acknowledgement
+***************
+
+The EllisLab team and The Reactor Engineers would like to thank all the
+contributors to the CodeIgniter project and you, the CodeIgniter user.
diff --git a/system/core/Benchmark.php b/system/core/Benchmark.php
index a200727ab..f4dfd3dab 100755
--- a/system/core/Benchmark.php
+++ b/system/core/Benchmark.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -24,7 +36,7 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Libraries
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/benchmark.html
*/
class CI_Benchmark {
@@ -34,7 +46,7 @@ class CI_Benchmark {
*
* @var array
*/
- var $marker = array();
+ public $marker = array();
// --------------------------------------------------------------------
@@ -44,11 +56,10 @@ class CI_Benchmark {
* Multiple calls to this function can be made so that several
* execution points can be timed
*
- * @access public
* @param string $name name of the marker
* @return void
*/
- function mark($name)
+ public function mark($name)
{
$this->marker[$name] = microtime();
}
@@ -63,13 +74,12 @@ class CI_Benchmark {
* 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)
+ public function elapsed_time($point1 = '', $point2 = '', $decimals = 4)
{
if ($point1 == '')
{
@@ -102,17 +112,14 @@ class CI_Benchmark {
* 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()
+ public function memory_usage()
{
return '{memory_usage}';
}
}
-// END CI_Benchmark class
-
/* End of file Benchmark.php */
-/* Location: ./system/core/Benchmark.php */ \ No newline at end of file
+/* Location: ./system/core/Benchmark.php */
diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php
index db1aee574..7af3c485d 100755
--- a/system/core/CodeIgniter.php
+++ b/system/core/CodeIgniter.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -23,7 +35,7 @@
* @package CodeIgniter
* @subpackage codeigniter
* @category Front-controller
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/
*/
@@ -33,15 +45,7 @@
* @var string
*
*/
- define('CI_VERSION', '2.1.0');
-
-/**
- * CodeIgniter Branch (Core = TRUE, Reactor = FALSE)
- *
- * @var boolean
- *
- */
- define('CI_CORE', FALSE);
+ define('CI_VERSION', '3.0-dev');
/*
* ------------------------------------------------------
@@ -55,7 +59,7 @@
* Load the framework constants
* ------------------------------------------------------
*/
- if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/constants.php'))
+ if (defined('ENVIRONMENT') && file_exists(APPPATH.'config/'.ENVIRONMENT.'/constants.php'))
{
require(APPPATH.'config/'.ENVIRONMENT.'/constants.php');
}
@@ -87,12 +91,12 @@
* "libraries" folder. Since CI allows config items to be
* overriden via data set in the main index. php file,
* before proceeding we need to know if a subclass_prefix
- * override exists. If so, we will set this value now,
+ * override exists. If so, we will set this value now,
* before any classes are loaded
* Note: Since the config file data is cached it doesn't
* hurt to load it here.
*/
- if (isset($assign_to_config['subclass_prefix']) AND $assign_to_config['subclass_prefix'] != '')
+ if (isset($assign_to_config['subclass_prefix']) && $assign_to_config['subclass_prefix'] != '')
{
get_config(array('subclass_prefix' => $assign_to_config['subclass_prefix']));
}
@@ -102,7 +106,8 @@
* Set a liberal script execution time limit
* ------------------------------------------------------
*/
- if (function_exists("set_time_limit") == TRUE AND @ini_get("safe_mode") == 0)
+ if (function_exists('set_time_limit') && @ini_get('safe_mode') == 0
+ && php_sapi_name() !== 'cli') // Do not override the Time Limit value if running from Command Line
{
@set_time_limit(300);
}
@@ -154,7 +159,6 @@
* after the Config class is instantiated.
*
*/
-
$UNI =& load_class('Utf8', 'core');
/*
@@ -187,15 +191,13 @@
/*
* ------------------------------------------------------
- * Is there a valid cache file? If so, we're done...
+ * Is there a valid cache file? If so, we're done...
* ------------------------------------------------------
*/
- if ($EXT->_call_hook('cache_override') === FALSE)
+ if ($EXT->_call_hook('cache_override') === FALSE
+ && $OUT->_display_cache($CFG, $URI) == TRUE)
{
- if ($OUT->_display_cache($CFG, $URI) == TRUE)
- {
- exit;
- }
+ exit;
}
/*
@@ -265,13 +267,13 @@
$method = $RTR->fetch_method();
if ( ! class_exists($class)
- OR strncmp($method, '_', 1) == 0
+ OR strpos($method, '_') === 0
OR in_array(strtolower($method), array_map('strtolower', get_class_methods('CI_Controller')))
)
{
if ( ! empty($RTR->routes['404_override']))
{
- $x = explode('/', $RTR->routes['404_override']);
+ $x = explode('/', $RTR->routes['404_override'], 2);
$class = $x[0];
$method = (isset($x[1]) ? $x[1] : 'index');
if ( ! class_exists($class))
@@ -333,7 +335,7 @@
// Check and see if we are using a 404 override and use it.
if ( ! empty($RTR->routes['404_override']))
{
- $x = explode('/', $RTR->routes['404_override']);
+ $x = explode('/', $RTR->routes['404_override'], 2);
$class = $x[0];
$method = (isset($x[1]) ? $x[1] : 'index');
if ( ! class_exists($class))
@@ -359,7 +361,6 @@
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');
@@ -392,11 +393,10 @@
* Close the DB connection if one exists
* ------------------------------------------------------
*/
- if (class_exists('CI_DB') AND isset($CI->db))
+ if (class_exists('CI_DB') && isset($CI->db))
{
$CI->db->close();
}
-
/* End of file CodeIgniter.php */
-/* Location: ./system/core/CodeIgniter.php */ \ No newline at end of file
+/* Location: ./system/core/CodeIgniter.php */
diff --git a/system/core/Common.php b/system/core/Common.php
index d79375475..491979350 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -23,7 +35,7 @@
* @package CodeIgniter
* @subpackage codeigniter
* @category Common Functions
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/
*/
@@ -44,7 +56,7 @@ if ( ! function_exists('is_php'))
function is_php($version = '5.0.0')
{
static $_is_php;
- $version = (string)$version;
+ $version = (string) $version;
if ( ! isset($_is_php[$version]))
{
@@ -61,10 +73,10 @@ if ( ! function_exists('is_php'))
* Tests for file writability
*
* is_writable() returns TRUE on Windows servers when you really can't write to
- * the file, based on the read-only attribute. is_writable() is also unreliable
+ * the file, based on the read-only attribute. is_writable() is also unreliable
* on Unix servers if safe_mode is on.
*
- * @access private
+ * @access public
* @return void
*/
if ( ! function_exists('is_really_writable'))
@@ -72,17 +84,17 @@ 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
- if (DIRECTORY_SEPARATOR == '/' AND @ini_get("safe_mode") == FALSE)
+ if (DIRECTORY_SEPARATOR === '/' && (bool) @ini_get('safe_mode') === FALSE)
{
return is_writable($file);
}
- // For windows servers and safe_mode "on" installations we'll actually
- // write a file then read it. Bah...
+ /* For Windows servers and safe_mode "on" installations we'll actually
+ * write a file then read it. Bah...
+ */
if (is_dir($file))
{
$file = rtrim($file, '/').'/'.md5(mt_rand(1,100).mt_rand(1,100));
-
if (($fp = @fopen($file, FOPEN_WRITE_CREATE)) === FALSE)
{
return FALSE;
@@ -108,7 +120,7 @@ if ( ! function_exists('is_really_writable'))
/**
* Class registry
*
-* This function acts as a singleton. If the requested class does not
+* This function acts as a singleton. If the requested class does not
* exist it is instantiated and set to a static variable. If it has
* previously been instantiated the variable is returned.
*
@@ -124,7 +136,7 @@ if ( ! function_exists('load_class'))
{
static $_classes = array();
- // Does the class exist? If so, we're done...
+ // Does the class exist? If so, we're done...
if (isset($_classes[$class]))
{
return $_classes[$class];
@@ -149,7 +161,7 @@ if ( ! function_exists('load_class'))
}
}
- // Is the request a class extension? If so we load it too
+ // Is the request a class extension? If so we load it too
if (file_exists(APPPATH.$directory.'/'.config_item('subclass_prefix').$class.'.php'))
{
$name = config_item('subclass_prefix').$class;
@@ -165,6 +177,7 @@ if ( ! function_exists('load_class'))
{
// Note: We use exit() rather then show_error() in order to avoid a
// self-referencing loop with the Excptions class
+ set_status_header(503);
exit('Unable to locate the specified class: '.$class.'.php');
}
@@ -179,7 +192,7 @@ if ( ! function_exists('load_class'))
// --------------------------------------------------------------------
/**
-* Keeps track of which libraries have been loaded. This function is
+* Keeps track of which libraries have been loaded. This function is
* called by the load_class() function above
*
* @access public
@@ -187,7 +200,7 @@ if ( ! function_exists('load_class'))
*/
if ( ! function_exists('is_loaded'))
{
- function is_loaded($class = '')
+ function &is_loaded($class = '')
{
static $_is_loaded = array();
@@ -231,6 +244,7 @@ if ( ! function_exists('get_config'))
// Fetch the config file
if ( ! file_exists($file_path))
{
+ set_status_header(503);
exit('The configuration file does not exist.');
}
@@ -239,6 +253,7 @@ if ( ! function_exists('get_config'))
// Does the $config array exist in the file?
if ( ! isset($config) OR ! is_array($config))
{
+ set_status_header(503);
exit('Your config file does not appear to be formatted correctly.');
}
@@ -375,75 +390,76 @@ if ( ! function_exists('set_status_header'))
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'
- );
+ 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',
+ 422 => 'Unprocessable Entity',
+
+ 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 == '')
+ if (isset($stati[$code]) && $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);
+ show_error('No status text available. Please check your status code number or supply your own message text.', 500);
}
- $server_protocol = (isset($_SERVER['SERVER_PROTOCOL'])) ? $_SERVER['SERVER_PROTOCOL'] : FALSE;
+ $server_protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : FALSE;
- if (substr(php_sapi_name(), 0, 3) == 'cgi')
+ if (strpos(php_sapi_name(), 'cgi') === 0)
{
- header("Status: {$code} {$text}", TRUE);
+ header('Status: '.$code.' '.$text, TRUE);
}
- elseif ($server_protocol == 'HTTP/1.1' OR $server_protocol == 'HTTP/1.0')
+ elseif ($server_protocol === 'HTTP/1.0')
{
- header($server_protocol." {$code} {$text}", TRUE, $code);
+ header('HTTP/1.0 '.$code.' '.$text, TRUE, $code);
}
else
{
- header("HTTP/1.1 {$code} {$text}", TRUE, $code);
+ header('HTTP/1.1 '.$code.' '.$text, TRUE, $code);
}
}
}
@@ -514,16 +530,15 @@ if ( ! function_exists('remove_invisible_characters'))
function remove_invisible_characters($str, $url_encoded = TRUE)
{
$non_displayables = array();
-
- // every control character except newline (dec 10)
- // carriage return (dec 13), and horizontal tab (dec 09)
-
+
+ // every control character except newline (dec 10),
+ // carriage return (dec 13) and horizontal tab (dec 09)
if ($url_encoded)
{
$non_displayables[] = '/%0[0-8bcef]/'; // url encoded 00-08, 11, 12, 14, 15
$non_displayables[] = '/%1[0-9a-f]/'; // url encoded 16-31
}
-
+
$non_displayables[] = '/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S'; // 00-08, 11, 12, 14-31, 127
do
@@ -549,16 +564,11 @@ if ( ! function_exists('html_escape'))
{
function html_escape($var)
{
- if (is_array($var))
- {
- return array_map('html_escape', $var);
- }
- else
- {
- return htmlspecialchars($var, ENT_QUOTES, config_item('charset'));
- }
+ return is_array($var)
+ ? array_map('html_escape', $var)
+ : htmlspecialchars($var, ENT_QUOTES, config_item('charset'));
}
}
/* End of file Common.php */
-/* Location: ./system/core/Common.php */ \ No newline at end of file
+/* Location: ./system/core/Common.php */
diff --git a/system/core/Config.php b/system/core/Config.php
index 714c4667b..68417435d 100755
--- a/system/core/Config.php
+++ b/system/core/Config.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -23,7 +35,7 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Libraries
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/config.html
*/
class CI_Config {
@@ -33,46 +45,45 @@ class CI_Config {
*
* @var array
*/
- var $config = array();
+ public $config = array();
/**
* List of all loaded config files
*
* @var array
*/
- var $is_loaded = array();
+ public $is_loaded = array();
/**
- * List of paths to search when trying to load a config file
+ * List of paths to search when trying to load a config file.
+ * This must be public as it's used by the Loader class.
*
* @var array
*/
- var $_config_paths = array(APPPATH);
+ public $_config_paths = array(APPPATH);
/**
* Constructor
*
* Sets the $config data from the primary config.php file as a class variable
*
- * @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 __construct()
+ public function __construct()
{
$this->config =& get_config();
- log_message('debug', "Config Class Initialized");
+ log_message('debug', 'Config Class Initialized');
// Set the base_url automatically if none was provided
if ($this->config['base_url'] == '')
{
if (isset($_SERVER['HTTP_HOST']))
{
- $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 = ! empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ? 'https' : 'http';
+ $base_url .= '://'. $_SERVER['HTTP_HOST']
+ . str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
}
-
else
{
$base_url = 'http://localhost/';
@@ -87,17 +98,15 @@ class CI_Config {
/**
* Load Config File
*
- * @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
+ * @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 loaded correctly
*/
- function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)
+ public function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)
{
$file = ($file == '') ? 'config' : str_replace('.php', '', $file);
- $found = FALSE;
- $loaded = FALSE;
+ $found = $loaded = FALSE;
foreach ($this->_config_paths as $path)
{
@@ -180,39 +189,19 @@ class CI_Config {
* 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 = '')
+ public 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 isset($this->config[$item]) ? $this->config[$item] : FALSE;
}
- return $pref;
+ return isset($this->config[$index], $this->config[$index][$item]) ? $this->config[$index][$item] : FALSE;
}
// --------------------------------------------------------------------
@@ -220,18 +209,17 @@ class CI_Config {
/**
* Fetch a config file item - adds slash after item (if item is not empty)
*
- * @access public
* @param string the config item name
* @param bool
* @return string
*/
- function slash_item($item)
+ public function slash_item($item)
{
if ( ! isset($this->config[$item]))
{
return FALSE;
}
- if( trim($this->config[$item]) == '')
+ elseif (trim($this->config[$item]) == '')
{
return '';
}
@@ -245,11 +233,10 @@ class CI_Config {
* Site URL
* Returns base_url . index_page [. uri_string]
*
- * @access public
* @param string the URI string
* @return string
*/
- function site_url($uri = '')
+ public function site_url($uri = '')
{
if ($uri == '')
{
@@ -273,11 +260,10 @@ class CI_Config {
* Base URL
* Returns base_url [. uri_string]
*
- * @access public
* @param string $uri
* @return string
*/
- function base_url($uri = '')
+ public function base_url($uri = '')
{
return $this->slash_item('base_url').ltrim($this->_uri_string($uri),'/');
}
@@ -287,8 +273,7 @@ class CI_Config {
/**
* Build URI string for use in Config::site_url() and Config::base_url()
*
- * @access protected
- * @param $uri
+ * @param mixed $uri
* @return string
*/
protected function _uri_string($uri)
@@ -299,24 +284,22 @@ class CI_Config {
{
$uri = implode('/', $uri);
}
- $uri = trim($uri, '/');
+ return trim($uri, '/');
}
- else
+ elseif (is_array($uri))
{
- if (is_array($uri))
+ $i = 0;
+ $str = '';
+ foreach ($uri as $key => $val)
{
- $i = 0;
- $str = '';
- foreach ($uri as $key => $val)
- {
- $prefix = ($i == 0) ? '' : '&';
- $str .= $prefix.$key.'='.$val;
- $i++;
- }
- $uri = $str;
+ $prefix = ($i === 0) ? '' : '&';
+ $str .= $prefix.$key.'='.$val;
+ $i++;
}
+ return $str;
}
- return $uri;
+
+ return $uri;
}
// --------------------------------------------------------------------
@@ -324,12 +307,11 @@ class CI_Config {
/**
* System URL
*
- * @access public
* @return string
*/
- function system_url()
+ public function system_url()
{
- $x = explode("/", preg_replace("|/*(.+?)/*$|", "\\1", BASEPATH));
+ $x = explode('/', preg_replace('|/*(.+?)/*$|', '\\1', BASEPATH));
return $this->slash_item('base_url').end($x).'/';
}
@@ -338,12 +320,11 @@ class CI_Config {
/**
* 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)
+ public function set_item($item, $value)
{
$this->config[$item] = $value;
}
@@ -354,14 +335,13 @@ class CI_Config {
* Assign to Config
*
* This function is called by the front controller (CodeIgniter.php)
- * after the Config class is instantiated. It permits config items
+ * after the Config class is instantiated. It permits config items
* to be assigned or overriden by variables contained in the index.php file
*
- * @access private
* @param array
* @return void
*/
- function _assign_to_config($items = array())
+ public function _assign_to_config($items = array())
{
if (is_array($items))
{
@@ -373,7 +353,5 @@ class CI_Config {
}
}
-// END CI_Config class
-
/* End of file Config.php */
/* Location: ./system/core/Config.php */
diff --git a/system/core/Controller.php b/system/core/Controller.php
index fddb81e19..0dc131701 100644
--- a/system/core/Controller.php
+++ b/system/core/Controller.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -24,20 +36,17 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Libraries
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/general/controllers.html
*/
class CI_Controller {
private static $instance;
- /**
- * Constructor
- */
public function __construct()
{
self::$instance =& $this;
-
+
// Assign all the class objects that were instantiated by the
// bootstrap file (CodeIgniter.php) to local class variables
// so that CI can run as one big super object.
@@ -47,10 +56,8 @@ class CI_Controller {
}
$this->load =& load_class('Loader', 'core');
-
$this->load->initialize();
-
- log_message('debug', "Controller Class Initialized");
+ log_message('debug', 'Controller Class Initialized');
}
public static function &get_instance()
@@ -58,7 +65,6 @@ class CI_Controller {
return self::$instance;
}
}
-// END Controller class
/* End of file Controller.php */
-/* Location: ./system/core/Controller.php */ \ No newline at end of file
+/* Location: ./system/core/Controller.php */
diff --git a/system/core/Exceptions.php b/system/core/Exceptions.php
index 869739a5a..bf9901252 100755
--- a/system/core/Exceptions.php
+++ b/system/core/Exceptions.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,53 +33,48 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Exceptions
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/exceptions.html
*/
class CI_Exceptions {
- var $action;
- var $severity;
- var $message;
- var $filename;
- var $line;
+
+ public $action;
+ public $severity;
+ public $message;
+ public $filename;
+ public $line;
/**
* Nesting level of the output buffering mechanism
*
* @var int
- * @access public
*/
- var $ob_level;
+ public $ob_level;
/**
* List if available error levels
*
* @var array
- * @access public
*/
- var $levels = array(
- E_ERROR => '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'
- );
-
+ public $levels = array(
+ E_ERROR => '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
- */
public function __construct()
{
$this->ob_level = ob_get_level();
- // Note: Do not log messages from this constructor.
+ // Note: Do not log messages from this constructor.
}
// --------------------------------------------------------------------
@@ -77,17 +84,15 @@ class CI_Exceptions {
*
* 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
+ * @return void
*/
- function log_exception($severity, $message, $filepath, $line)
+ public 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);
}
@@ -96,15 +101,14 @@ class CI_Exceptions {
/**
* 404 Page Not Found Handler
*
- * @access private
* @param string the page
* @param bool log error yes/no
* @return string
*/
- function show_404($page = '', $log_error = TRUE)
+ public function show_404($page = '', $log_error = TRUE)
{
- $heading = "404 Page Not Found";
- $message = "The page you requested was not found.";
+ $heading = '404 Page Not Found';
+ $message = 'The page you requested was not found.';
// By default we log this, but allow a dev to skip it
if ($log_error)
@@ -125,14 +129,13 @@ class CI_Exceptions {
* (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
* @param int the status code
* @return string
*/
- function show_error($heading, $message, $template = 'error_general', $status_code = 500)
+ public function show_error($heading, $message, $template = 'error_general', $status_code = 500)
{
set_status_header($status_code);
@@ -154,7 +157,6 @@ class CI_Exceptions {
/**
* Native PHP error handler
*
- * @access private
* @param string the error severity
* @param string the error string
* @param string the error filepath
@@ -164,8 +166,7 @@ class CI_Exceptions {
function show_php_error($severity, $message, $filepath, $line)
{
$severity = ( ! isset($this->levels[$severity])) ? $severity : $this->levels[$severity];
-
- $filepath = str_replace("\\", "/", $filepath);
+ $filepath = str_replace('\\', '/', $filepath);
// For safety reasons we do not show the full file path
if (FALSE !== strpos($filepath, '/'))
@@ -179,15 +180,13 @@ class CI_Exceptions {
ob_end_flush();
}
ob_start();
- include(APPPATH.'errors/error_php.php');
+ include(APPPATH.'errors/'.'error_php.php');
$buffer = ob_get_contents();
ob_end_clean();
echo $buffer;
}
-
}
-// END Exceptions Class
/* End of file Exceptions.php */
-/* Location: ./system/core/Exceptions.php */ \ No newline at end of file
+/* Location: ./system/core/Exceptions.php */
diff --git a/system/core/Hooks.php b/system/core/Hooks.php
index 33f1c034c..e1ac58e6e 100755
--- a/system/core/Hooks.php
+++ b/system/core/Hooks.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -23,7 +35,7 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Libraries
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/encryption.html
*/
class CI_Hooks {
@@ -33,28 +45,24 @@ class CI_Hooks {
*
* @var bool
*/
- var $enabled = FALSE;
+ public $enabled = FALSE;
/**
* List of all hooks set in config/hooks.php
*
* @var array
*/
- var $hooks = array();
+ public $hooks = array();
/**
* Determines wether hook is in progress, used to prevent infinte loops
*
* @var bool
*/
- var $in_progress = FALSE;
+ public $in_progress = FALSE;
- /**
- * Constructor
- *
- */
- function __construct()
+ public function __construct()
{
$this->_initialize();
- log_message('debug', "Hooks Class Initialized");
+ log_message('debug', 'Hooks Class Initialized');
}
// --------------------------------------------------------------------
@@ -62,34 +70,30 @@ class CI_Hooks {
/**
* Initialize the Hooks Preferences
*
- * @access private
* @return void
*/
- function _initialize()
+ private function _initialize()
{
$CFG =& load_class('Config', 'core');
// If hooks are not enabled in the config file
// there is nothing else to do
-
if ($CFG->item('enable_hooks') == FALSE)
{
return;
}
// Grab the "hooks" definition file.
- // If there are no hooks, we're done.
-
if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/hooks.php'))
{
- include(APPPATH.'config/'.ENVIRONMENT.'/hooks.php');
+ include(APPPATH.'config/'.ENVIRONMENT.'/hooks.php');
}
elseif (is_file(APPPATH.'config/hooks.php'))
{
include(APPPATH.'config/hooks.php');
}
-
+ // If there are no hooks, we're done.
if ( ! isset($hook) OR ! is_array($hook))
{
return;
@@ -104,13 +108,12 @@ class CI_Hooks {
/**
* Call Hook
*
- * Calls a particular hook
+ * Calls a particular hook. Called by CodeIgniter.php.
*
- * @access private
* @param string the hook name
* @return mixed
*/
- function _call_hook($which = '')
+ public function _call_hook($which = '')
{
if ( ! $this->enabled OR ! isset($this->hooks[$which]))
{
@@ -139,11 +142,10 @@ class CI_Hooks {
*
* Runs a particular hook
*
- * @access private
* @param array the hook details
* @return bool
*/
- function _run_hook($data)
+ protected function _run_hook($data)
{
if ( ! is_array($data))
{
@@ -156,7 +158,6 @@ class CI_Hooks {
// If the script being called happens to have the same
// hook call within it a loop can happen
-
if ($this->in_progress == TRUE)
{
return;
@@ -242,7 +243,5 @@ class CI_Hooks {
}
-// END CI_Hooks class
-
/* End of file Hooks.php */
-/* Location: ./system/core/Hooks.php */ \ No newline at end of file
+/* Location: ./system/core/Hooks.php */
diff --git a/system/core/Input.php b/system/core/Input.php
index 9bfb5f1fb..ee15f4013 100755
--- a/system/core/Input.php
+++ b/system/core/Input.php
@@ -1,20 +1,30 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* Input Class
*
@@ -23,7 +33,7 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Input
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/input.html
*/
class CI_Input {
@@ -33,39 +43,39 @@ class CI_Input {
*
* @var string
*/
- var $ip_address = FALSE;
+ public $ip_address = FALSE;
/**
* user agent (web browser) being used by the current user
*
* @var string
*/
- var $user_agent = FALSE;
+ public $user_agent = FALSE;
/**
* If FALSE, then $_GET will be set to an empty array
*
* @var bool
*/
- var $_allow_get_array = TRUE;
+ protected $_allow_get_array = TRUE;
/**
* If TRUE, then newlines are standardized
*
* @var bool
*/
- var $_standardize_newlines = TRUE;
+ protected $_standardize_newlines = TRUE;
/**
* 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;
+ protected $_enable_xss = FALSE;
/**
* Enables a CSRF cookie token to be set.
* Set automatically based on config setting
*
* @var bool
*/
- var $_enable_csrf = FALSE;
+ protected $_enable_csrf = FALSE;
/**
* List of all HTTP request headers
*
@@ -73,21 +83,19 @@ class CI_Input {
*/
protected $headers = array();
-
/**
* Constructor
*
* Sets whether to globally enable the XSS processing
* and whether to allow the $_GET array
- *
*/
public function __construct()
{
- log_message('debug', "Input Class Initialized");
+ log_message('debug', 'Input Class Initialized');
$this->_allow_get_array = (config_item('allow_get_array') === TRUE);
- $this->_enable_xss = (config_item('global_xss_filtering') === TRUE);
- $this->_enable_csrf = (config_item('csrf_protection') === TRUE);
+ $this->_enable_xss = (config_item('global_xss_filtering') === TRUE);
+ $this->_enable_csrf = (config_item('csrf_protection') === TRUE);
global $SEC;
$this->security =& $SEC;
@@ -110,13 +118,12 @@ class CI_Input {
*
* 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)
+ protected function _fetch_from_array(&$array, $index = '', $xss_clean = FALSE)
{
if ( ! isset($array[$index]))
{
@@ -136,15 +143,14 @@ class CI_Input {
/**
* Fetch an item from the GET array
*
- * @access public
* @param string
* @param bool
* @return string
*/
- function get($index = NULL, $xss_clean = FALSE)
+ public function get($index = NULL, $xss_clean = FALSE)
{
// Check if a field has been provided
- if ($index === NULL AND ! empty($_GET))
+ if ($index === NULL && ! empty($_GET))
{
$get = array();
@@ -164,15 +170,14 @@ class CI_Input {
/**
* Fetch an item from the POST array
*
- * @access public
* @param string
* @param bool
* @return string
*/
- function post($index = NULL, $xss_clean = FALSE)
+ public function post($index = NULL, $xss_clean = FALSE)
{
// Check if a field has been provided
- if ($index === NULL AND ! empty($_POST))
+ if ($index === NULL && ! empty($_POST))
{
$post = array();
@@ -193,21 +198,15 @@ class CI_Input {
/**
* 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)
+ public function get_post($index = '', $xss_clean = FALSE)
{
- if ( ! isset($_POST[$index]) )
- {
- return $this->get($index, $xss_clean);
- }
- else
- {
- return $this->post($index, $xss_clean);
- }
+ return isset($_POST[$index])
+ ? $this->post($index, $xss_clean)
+ : $this->get($index, $xss_clean);
}
// --------------------------------------------------------------------
@@ -215,12 +214,11 @@ class CI_Input {
/**
* Fetch an item from the COOKIE array
*
- * @access public
* @param string
* @param bool
* @return string
*/
- function cookie($index = '', $xss_clean = FALSE)
+ public function cookie($index = '', $xss_clean = FALSE)
{
return $this->_fetch_from_array($_COOKIE, $index, $xss_clean);
}
@@ -233,7 +231,6 @@ class CI_Input {
* Accepts six parameter, or you can submit an associative
* array in the first parameter containing all the values.
*
- * @access public
* @param mixed
* @param string the value of the cookie
* @param string the number of seconds until expiration
@@ -243,7 +240,7 @@ class CI_Input {
* @param bool true makes the cookie secure
* @return void
*/
- function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE)
+ public function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE)
{
if (is_array($name))
{
@@ -257,19 +254,19 @@ class CI_Input {
}
}
- if ($prefix == '' AND config_item('cookie_prefix') != '')
+ if ($prefix == '' && config_item('cookie_prefix') != '')
{
$prefix = config_item('cookie_prefix');
}
- if ($domain == '' AND config_item('cookie_domain') != '')
+ if ($domain == '' && config_item('cookie_domain') != '')
{
$domain = config_item('cookie_domain');
}
- if ($path == '/' AND config_item('cookie_path') != '/')
+ if ($path == '/' && config_item('cookie_path') !== '/')
{
$path = config_item('cookie_path');
}
- if ($secure == FALSE AND config_item('cookie_secure') != FALSE)
+ if ($secure == FALSE && config_item('cookie_secure') != FALSE)
{
$secure = config_item('cookie_secure');
}
@@ -291,12 +288,11 @@ class CI_Input {
/**
* Fetch an item from the SERVER array
*
- * @access public
* @param string
* @param bool
* @return string
*/
- function server($index = '', $xss_clean = FALSE)
+ public function server($index = '', $xss_clean = FALSE)
{
return $this->_fetch_from_array($_SERVER, $index, $xss_clean);
}
@@ -306,10 +302,9 @@ class CI_Input {
/**
* Fetch the IP Address
*
- * @access public
* @return string
*/
- function ip_address()
+ public function ip_address()
{
if ($this->ip_address !== FALSE)
{
@@ -323,13 +318,13 @@ class CI_Input {
$this->ip_address = in_array($_SERVER['REMOTE_ADDR'], $proxies) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
}
- elseif ($this->server('REMOTE_ADDR') AND $this->server('HTTP_CLIENT_IP'))
+ elseif ( ! $this->server('HTTP_CLIENT_IP') && $this->server('REMOTE_ADDR'))
{
- $this->ip_address = $_SERVER['HTTP_CLIENT_IP'];
+ $this->ip_address = $_SERVER['REMOTE_ADDR'];
}
- elseif ($this->server('REMOTE_ADDR'))
+ elseif ($this->server('REMOTE_ADDR') && $this->server('HTTP_CLIENT_IP'))
{
- $this->ip_address = $_SERVER['REMOTE_ADDR'];
+ $this->ip_address = $_SERVER['HTTP_CLIENT_IP'];
}
elseif ($this->server('HTTP_CLIENT_IP'))
{
@@ -342,8 +337,7 @@ class CI_Input {
if ($this->ip_address === FALSE)
{
- $this->ip_address = '0.0.0.0';
- return $this->ip_address;
+ return $this->ip_address = '0.0.0.0';
}
if (strpos($this->ip_address, ',') !== FALSE)
@@ -354,7 +348,7 @@ class CI_Input {
if ( ! $this->valid_ip($this->ip_address))
{
- $this->ip_address = '0.0.0.0';
+ return $this->ip_address = '0.0.0.0';
}
return $this->ip_address;
@@ -367,16 +361,21 @@ class CI_Input {
*
* Updated version suggested by Geert De Deckere
*
- * @access public
* @param string
- * @return string
+ * @return bool
*/
- function valid_ip($ip)
+ public function valid_ip($ip)
{
+ // if php version >= 5.2, use filter_var to check validate ip.
+ if (function_exists('filter_var'))
+ {
+ return (bool) filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);
+ }
+
$ip_segments = explode('.', $ip);
// Always 4 segments needed
- if (count($ip_segments) != 4)
+ if (count($ip_segments) !== 4)
{
return FALSE;
}
@@ -390,7 +389,7 @@ class CI_Input {
{
// 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)
+ if ($segment == '' OR preg_match('/[^0-9]/', $segment) OR $segment > 255 OR strlen($segment) > 3)
{
return FALSE;
}
@@ -404,19 +403,16 @@ class CI_Input {
/**
* User Agent
*
- * @access public
* @return string
*/
- function user_agent()
+ public 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;
+ return $this->user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : FALSE;
}
// --------------------------------------------------------------------
@@ -426,22 +422,20 @@ class CI_Input {
*
* 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
+ * - 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()
+ protected function _sanitize_globals()
{
// It would 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');
+ '_SESSION', '_ENV', 'GLOBALS', 'HTTP_RAW_POST_DATA',
+ 'system_folder', 'application_folder', 'BM', 'EXT',
+ 'CFG', 'URI', 'RTR', 'OUT', 'IN'
+ );
// Unset globals for securiy.
// This is effectively the same as register_globals = off
@@ -473,19 +467,16 @@ class CI_Input {
{
$_GET = array();
}
- else
+ elseif (is_array($_GET) && count($_GET) > 0)
{
- if (is_array($_GET) AND count($_GET) > 0)
+ foreach ($_GET as $key => $val)
{
- foreach ($_GET as $key => $val)
- {
- $_GET[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);
- }
+ $_GET[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);
}
}
// Clean $_POST Data
- if (is_array($_POST) AND count($_POST) > 0)
+ if (is_array($_POST) && count($_POST) > 0)
{
foreach ($_POST as $key => $val)
{
@@ -494,7 +485,7 @@ class CI_Input {
}
// Clean $_COOKIE Data
- if (is_array($_COOKIE) AND count($_COOKIE) > 0)
+ if (is_array($_COOKIE) && count($_COOKIE) > 0)
{
// 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
@@ -514,14 +505,13 @@ class CI_Input {
// Sanitize PHP_SELF
$_SERVER['PHP_SELF'] = strip_tags($_SERVER['PHP_SELF']);
-
// CSRF Protection check
if ($this->_enable_csrf == TRUE)
{
$this->security->csrf_verify();
}
- log_message('debug', "Global POST and COOKIE data sanitized");
+ log_message('debug', 'Global POST and COOKIE data sanitized');
}
// --------------------------------------------------------------------
@@ -532,11 +522,10 @@ class CI_Input {
* 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)
+ protected function _clean_input_data($str)
{
if (is_array($str))
{
@@ -574,12 +563,9 @@ class CI_Input {
}
// Standardize newlines if needed
- if ($this->_standardize_newlines == TRUE)
+ if ($this->_standardize_newlines == TRUE && strpos($str, "\r") !== FALSE)
{
- if (strpos($str, "\r") !== FALSE)
- {
- $str = str_replace(array("\r\n", "\r", "\r\n\n"), PHP_EOL, $str);
- }
+ return str_replace(array("\r\n", "\r", "\r\n\n"), PHP_EOL, $str);
}
return $str;
@@ -594,21 +580,21 @@ class CI_Input {
* 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)
+ protected function _clean_input_keys($str)
{
- if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str))
+ if ( ! preg_match('/^[a-z0-9:_\/-]+$/i', $str))
{
+ set_status_header(503);
exit('Disallowed Key Characters.');
}
// Clean UTF-8 if supported
if (UTF8_ENABLED === TRUE)
{
- $str = $this->uni->clean_string($str);
+ return $this->uni->clean_string($str);
}
return $str;
@@ -623,8 +609,7 @@ class CI_Input {
* people running other webservers the function is undefined.
*
* @param bool XSS cleaning
- *
- * @return array
+ * @return array
*/
public function request_headers($xss_clean = FALSE)
{
@@ -635,11 +620,11 @@ class CI_Input {
}
else
{
- $headers['Content-Type'] = (isset($_SERVER['CONTENT_TYPE'])) ? $_SERVER['CONTENT_TYPE'] : @getenv('CONTENT_TYPE');
+ $headers['Content-Type'] = isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : @getenv('CONTENT_TYPE');
foreach ($_SERVER as $key => $val)
{
- if (strncmp($key, 'HTTP_', 5) === 0)
+ if (strpos($key, 'HTTP_') === 0)
{
$headers[substr($key, 5)] = $this->_fetch_from_array($_SERVER, $key, $xss_clean);
}
@@ -665,9 +650,9 @@ class CI_Input {
*
* Returns the value of a single member of the headers class member
*
- * @param string array key for $this->headers
- * @param boolean XSS Clean or not
- * @return mixed FALSE on failure, string on success
+ * @param string array key for $this->headers
+ * @param bool XSS Clean or not
+ * @return mixed FALSE on failure, string on success
*/
public function get_request_header($index, $xss_clean = FALSE)
{
@@ -681,12 +666,9 @@ class CI_Input {
return FALSE;
}
- if ($xss_clean === TRUE)
- {
- return $this->security->xss_clean($this->headers[$index]);
- }
-
- return $this->headers[$index];
+ return ($xss_clean === TRUE)
+ ? $this->security->xss_clean($this->headers[$index])
+ : $this->headers[$index];
}
// --------------------------------------------------------------------
@@ -696,11 +678,11 @@ class CI_Input {
*
* Test to see if a request contains the HTTP_X_REQUESTED_WITH header
*
- * @return boolean
+ * @return bool
*/
public function is_ajax_request()
{
- return ($this->server('HTTP_X_REQUESTED_WITH') === 'XMLHttpRequest');
+ return ( ! empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest');
}
// --------------------------------------------------------------------
@@ -710,14 +692,14 @@ class CI_Input {
*
* Test to see if a request was made from the command line
*
- * @return boolean
+ * @return bool
*/
public function is_cli_request()
{
- return (php_sapi_name() == 'cli') or defined('STDIN');
+ return (php_sapi_name() === 'cli' OR defined('STDIN'));
}
}
/* End of file Input.php */
-/* Location: ./system/core/Input.php */ \ No newline at end of file
+/* Location: ./system/core/Input.php */
diff --git a/system/core/Lang.php b/system/core/Lang.php
index 5ac671838..c40a6856e 100755
--- a/system/core/Lang.php
+++ b/system/core/Lang.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Language
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/language.html
*/
class CI_Lang {
@@ -31,22 +43,17 @@ class CI_Lang {
*
* @var array
*/
- var $language = array();
+ public $language = array();
/**
* List of loaded language files
*
* @var array
*/
- var $is_loaded = array();
+ public $is_loaded = array();
- /**
- * Constructor
- *
- * @access public
- */
- function __construct()
+ public function __construct()
{
- log_message('debug', "Language Class Initialized");
+ log_message('debug', 'Language Class Initialized');
}
// --------------------------------------------------------------------
@@ -54,7 +61,6 @@ class CI_Lang {
/**
* Load a language file
*
- * @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
@@ -62,7 +68,7 @@ class CI_Lang {
* @param string alternative path to look for language file
* @return mixed
*/
- function load($langfile = '', $idiom = '', $return = FALSE, $add_suffix = TRUE, $alt_path = '')
+ public function load($langfile = '', $idiom = '', $return = FALSE, $add_suffix = TRUE, $alt_path = '')
{
$langfile = str_replace('.php', '', $langfile);
@@ -112,7 +118,7 @@ class CI_Lang {
}
- if ( ! isset($lang))
+ if ( ! isset($lang) OR ! is_array($lang))
{
log_message('error', 'Language file contains no data: language/'.$idiom.'/'.$langfile);
return;
@@ -136,11 +142,10 @@ class CI_Lang {
/**
* Fetch a single line of text from the language array
*
- * @access public
* @param string $line the language line
* @return string
*/
- function line($line = '')
+ public function line($line = '')
{
$value = ($line == '' OR ! isset($this->language[$line])) ? FALSE : $this->language[$line];
@@ -154,7 +159,6 @@ class CI_Lang {
}
}
-// END Language Class
/* End of file Lang.php */
/* Location: ./system/core/Lang.php */
diff --git a/system/core/Loader.php b/system/core/Loader.php
index 6b7ee0c28..12daaa928 100644
--- a/system/core/Loader.php
+++ b/system/core/Loader.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -22,7 +34,7 @@
*
* @package CodeIgniter
* @subpackage Libraries
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @category Loader
* @link http://codeigniter.com/user_guide/libraries/loader.html
*/
@@ -33,88 +45,77 @@ class CI_Loader {
* 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();
/**
* List of class name mappings
*
* @var array
- * @access protected
*/
- protected $_ci_varmap = array('unit_test' => 'unit',
- 'user_agent' => 'agent');
+ protected $_ci_varmap = array(
+ 'unit_test' => 'unit',
+ 'user_agent' => 'agent'
+ );
/**
* Constructor
@@ -127,9 +128,9 @@ class CI_Loader {
$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);
+ $this->_ci_view_paths = array(VIEWPATH => TRUE);
- log_message('debug', "Loader Class Initialized");
+ log_message('debug', 'Loader Class Initialized');
}
// --------------------------------------------------------------------
@@ -150,7 +151,6 @@ class CI_Loader {
$this->_base_classes =& is_loaded();
$this->_ci_autoloader();
-
return $this;
}
@@ -250,10 +250,10 @@ class CI_Loader {
if (($last_slash = strrpos($model, '/')) !== FALSE)
{
// The path is in front of the last slash
- $path = substr($model, 0, $last_slash + 1);
+ $path = substr($model, 0, ++$last_slash);
// And the model name behind it
- $model = substr($model, $last_slash + 1);
+ $model = substr($model, $last_slash);
}
if ($name == '')
@@ -299,9 +299,7 @@ class CI_Loader {
require_once($mod_path.'models/'.$path.$model.'.php');
$model = ucfirst($model);
-
$CI->$name = new $model();
-
$this->_ci_models[] = $name;
return;
}
@@ -338,7 +336,7 @@ class CI_Loader {
return DB($params, $active_record);
}
- // Initialize the db variable. Needed to prevent
+ // Initialize the db variable. Needed to prevent
// reference errors with some configurations
$CI->db = '';
@@ -483,6 +481,20 @@ class CI_Loader {
// --------------------------------------------------------------------
/**
+ * Get Variables
+ *
+ * Retrieve all loaded variables
+ *
+ * @return array
+ */
+ public function get_vars()
+ {
+ return $this->_ci_cached_vars;
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Load Helper
*
* This function loads the specified helper file.
@@ -690,11 +702,11 @@ class CI_Loader {
if ($path == '')
{
- $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);
+ array_shift($this->_ci_library_paths);
+ array_shift($this->_ci_model_paths);
+ array_shift($this->_ci_helper_paths);
+ array_shift($this->_ci_view_paths);
+ array_shift($config->_config_paths);
}
else
{
@@ -782,7 +794,6 @@ class CI_Loader {
// This allows anything loaded using $this->load (views, files, etc.)
// to become accessible from within the Controller and Model functions.
-
$_ci_CI =& get_instance();
foreach (get_object_vars($_ci_CI) as $_ci_key => $_ci_var)
{
@@ -811,22 +822,20 @@ class CI_Loader {
*
* 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.
+ * 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('<?=', '<?php echo ', file_get_contents($_ci_path))));
+ echo eval('?>'.preg_replace('/;*\s*\?>/', '; ?>', str_replace('<?=', '<?php echo ', file_get_contents($_ci_path))));
}
else
{
@@ -851,7 +860,6 @@ class CI_Loader {
* 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->_ci_ob_level + 1)
{
@@ -889,10 +897,10 @@ class CI_Loader {
if (($last_slash = strrpos($class, '/')) !== FALSE)
{
// Extract the path
- $subdir = substr($class, 0, $last_slash + 1);
+ $subdir = substr($class, 0, ++$last_slash);
// Get the filename from the path
- $class = substr($class, $last_slash + 1);
+ $class = substr($class, $last_slash);
}
// We'll test for both lowercase and capitalized versions of the file name
@@ -907,15 +915,15 @@ class CI_Loader {
if ( ! file_exists($baseclass))
{
- log_message('error', "Unable to load the requested class: ".$class);
- show_error("Unable to load the requested class: ".$class);
+ 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?
+ // Safety: Was the class already loaded by a previous call?
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
+ // if a custom object name is being supplied. If so, we'll
// return a new instance of the object
if ( ! is_null($object_name))
{
@@ -927,7 +935,7 @@ class CI_Loader {
}
$is_duplicate = TRUE;
- log_message('debug', $class." class already loaded. Second attempt ignored.");
+ log_message('debug', $class.' class already loaded. Second attempt ignored.');
return;
}
@@ -944,17 +952,17 @@ class CI_Loader {
{
$filepath = $path.'libraries/'.$subdir.$class.'.php';
- // Does the file exist? No? Bummer...
+ // Does the file exist? No? Bummer...
if ( ! file_exists($filepath))
{
continue;
}
- // Safety: Was the class already loaded by a previous call?
+ // Safety: Was the class already loaded by a previous call?
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
+ // if a custom object name is being supplied. If so, we'll
// return a new instance of the object
if ( ! is_null($object_name))
{
@@ -966,7 +974,7 @@ class CI_Loader {
}
$is_duplicate = TRUE;
- log_message('debug', $class." class already loaded. Second attempt ignored.");
+ log_message('debug', $class.' class already loaded. Second attempt ignored.');
return;
}
@@ -977,7 +985,7 @@ class CI_Loader {
} // END FOREACH
- // One last attempt. Maybe the library is in a subdirectory, but it wasn't specified?
+ // One last attempt. Maybe the library is in a subdirectory, but it wasn't specified?
if ($subdir == '')
{
$path = strtolower($class).'/'.$class;
@@ -988,8 +996,8 @@ class CI_Loader {
// 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);
+ log_message('error', 'Unable to load the requested class: '.$class);
+ show_error('Unable to load the requested class: '.$class);
}
}
@@ -1068,12 +1076,12 @@ class CI_Loader {
// Is the class name valid?
if ( ! class_exists($name))
{
- log_message('error', "Non-existent class: ".$name);
- show_error("Non-existent 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
- // Was a custom class name supplied? If so we'll use it
+ // Was a custom class name supplied? If so we'll use it
$class = strtolower($class);
if (is_null($object_name))
@@ -1111,7 +1119,7 @@ class CI_Loader {
* @param array
* @return void
*/
- private function _ci_autoloader()
+ protected function _ci_autoloader()
{
if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/autoload.php'))
{
@@ -1155,13 +1163,6 @@ class CI_Loader {
}
}
- // A little tweak to remain backward compatible
- // The $autoload['core'] item was deprecated
- if ( ! isset($autoload['libraries']) AND isset($autoload['core']))
- {
- $autoload['libraries'] = $autoload['core'];
- }
-
// Load libraries
if (isset($autoload['libraries']) AND count($autoload['libraries']) > 0)
{
@@ -1230,13 +1231,13 @@ class CI_Loader {
{
if ( ! is_array($filename))
{
- return array(strtolower(str_replace('.php', '', str_replace($extension, '', $filename)).$extension));
+ return array(strtolower(str_replace(array($extension, '.php'), '', $filename).$extension));
}
else
{
foreach ($filename as $key => $val)
{
- $filename[$key] = strtolower(str_replace('.php', '', str_replace($extension, '', $val)).$extension);
+ $filename[$key] = strtolower(str_replace(array($extension, '.php'), '', $val).$extension);
}
return $filename;
@@ -1245,4 +1246,4 @@ class CI_Loader {
}
/* End of file Loader.php */
-/* Location: ./system/core/Loader.php */ \ No newline at end of file
+/* Location: ./system/core/Loader.php */
diff --git a/system/core/Model.php b/system/core/Model.php
index e15ffbebc..a595a6ae2 100755
--- a/system/core/Model.php
+++ b/system/core/Model.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,19 +33,14 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Libraries
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/config.html
*/
class CI_Model {
- /**
- * Constructor
- *
- * @access public
- */
- function __construct()
+ public function __construct()
{
- log_message('debug', "Model Class Initialized");
+ log_message('debug', 'Model Class Initialized');
}
/**
@@ -43,15 +50,13 @@ class CI_Model {
* syntax as controllers.
*
* @param string
- * @access private
*/
- function __get($key)
+ public function __get($key)
{
$CI =& get_instance();
return $CI->$key;
}
}
-// END Model Class
/* End of file Model.php */
-/* Location: ./system/core/Model.php */ \ No newline at end of file
+/* Location: ./system/core/Model.php */
diff --git a/system/core/Output.php b/system/core/Output.php
index ccecafd2b..abd8a0ea9 100755
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -23,7 +35,7 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Output
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/output.html
*/
class CI_Output {
@@ -32,71 +44,59 @@ 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();
/**
* 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();
/**
* Whether or not to parse variables like {elapsed_time} and {memory_usage}
*
* @var bool
- * @access protected
*/
protected $parse_exec_vars = TRUE;
- /**
- * Constructor
- *
- */
- function __construct()
+ public 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.php'))
{
- include APPPATH.'config/'.ENVIRONMENT.'/mimes.php';
+ include APPPATH.'config/'.ENVIRONMENT.'/mimes.php';
}
else
{
@@ -105,8 +105,7 @@ class CI_Output {
$this->mime_types = $mimes;
-
- log_message('debug', "Output Class Initialized");
+ log_message('debug', 'Output Class Initialized');
}
// --------------------------------------------------------------------
@@ -116,10 +115,9 @@ class CI_Output {
*
* Returns the current output string
*
- * @access public
* @return string
*/
- function get_output()
+ public function get_output()
{
return $this->final_output;
}
@@ -131,14 +129,12 @@ class CI_Output {
*
* Sets the output string
*
- * @access public
* @param string
* @return void
*/
- function set_output($output)
+ public function set_output($output)
{
$this->final_output = $output;
-
return $this;
}
@@ -149,11 +145,10 @@ class CI_Output {
*
* Appends data onto the output string
*
- * @access public
* @param string
* @return void
*/
- function append_output($output)
+ public function append_output($output)
{
if ($this->final_output == '')
{
@@ -177,25 +172,22 @@ class CI_Output {
* 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
* @param bool
* @return void
*/
- function set_header($header, $replace = TRUE)
+ public 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);
-
return $this;
}
@@ -204,11 +196,10 @@ class CI_Output {
/**
* Set Content Type Header
*
- * @access public
* @param string extension of the file we're outputting
* @return void
*/
- function set_content_type($mime_type)
+ public function set_content_type($mime_type)
{
if (strpos($mime_type, '/') === FALSE)
{
@@ -229,7 +220,6 @@ class CI_Output {
$header = 'Content-Type: '.$mime_type;
$this->headers[] = array($header, TRUE);
-
return $this;
}
@@ -239,15 +229,13 @@ class CI_Output {
* Set HTTP Status Header
* moved to Common procedural functions in 1.7.2
*
- * @access public
* @param int the status code
* @param string
* @return void
*/
- function set_status_header($code = 200, $text = '')
+ public function set_status_header($code = 200, $text = '')
{
set_status_header($code, $text);
-
return $this;
}
@@ -256,14 +244,12 @@ class CI_Output {
/**
* Enable/disable Profiler
*
- * @access public
* @param bool
* @return void
*/
- function enable_profiler($val = TRUE)
+ public function enable_profiler($val = TRUE)
{
$this->enable_profiler = (is_bool($val)) ? $val : TRUE;
-
return $this;
}
@@ -274,11 +260,10 @@ class CI_Output {
*
* Allows override of default / config settings for Profiler section display
*
- * @access public
* @param array
* @return void
*/
- function set_profiler_sections($sections)
+ public function set_profiler_sections($sections)
{
foreach ($sections as $section => $enable)
{
@@ -293,14 +278,12 @@ class CI_Output {
/**
* Set Cache
*
- * @access public
* @param integer
* @return void
*/
- function cache($time)
+ public function cache($time)
{
$this->cache_expiration = ( ! is_numeric($time)) ? 0 : $time;
-
return $this;
}
@@ -317,11 +300,10 @@ class CI_Output {
* 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
* @param string
* @return mixed
*/
- function _display($output = '')
+ public 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,
@@ -363,22 +345,17 @@ class CI_Output {
{
$memory = ( ! function_exists('memory_get_usage')) ? '0' : round(memory_get_usage()/1024/1024, 2).'MB';
- $output = str_replace('{elapsed_time}', $elapsed, $output);
- $output = str_replace('{memory_usage}', $memory, $output);
+ $output = str_replace(array('{elapsed_time}', '{memory_usage}'), array($elapsed, $memory), $output);
}
// --------------------------------------------------------------------
// Is compression requested?
- if ($CFG->item('compress_output') === TRUE && $this->_zlib_oc == FALSE)
+ if ($CFG->item('compress_output') === TRUE && $this->_zlib_oc == FALSE
+ && extension_loaded('zlib')
+ && isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE)
{
- if (extension_loaded('zlib'))
- {
- if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) AND strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE)
- {
- ob_start('ob_gzhandler');
- }
- }
+ ob_start('ob_gzhandler');
}
// --------------------------------------------------------------------
@@ -400,8 +377,8 @@ class CI_Output {
if ( ! isset($CI))
{
echo $output;
- log_message('debug', "Final output sent to browser");
- log_message('debug', "Total execution time: ".$elapsed);
+ log_message('debug', 'Final output sent to browser');
+ log_message('debug', 'Total execution time: '.$elapsed);
return TRUE;
}
@@ -412,7 +389,6 @@ class CI_Output {
if ($this->enable_profiler == TRUE)
{
$CI->load->library('profiler');
-
if ( ! empty($this->_profiler_sections))
{
$CI->profiler->set_sections($this->_profiler_sections);
@@ -420,20 +396,13 @@ class CI_Output {
// If the output data contains closing </body> and </html> tags
// we will remove them and add them back after we insert the profile data
- if (preg_match("|</body>.*?</html>|is", $output))
+ $output = preg_replace('|</body>.*?</html>|is', '', $output, -1, $count).$CI->profiler->run();
+ if ($count > 0)
{
- $output = preg_replace("|</body>.*?</html>|is", '', $output);
- $output .= $CI->profiler->run();
$output .= '</body></html>';
}
- 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'))
@@ -442,11 +411,11 @@ class CI_Output {
}
else
{
- echo $output; // Send it to the browser!
+ echo $output; // Send it to the browser!
}
- log_message('debug', "Final output sent to browser");
- log_message('debug', "Total execution time: ".$elapsed);
+ log_message('debug', 'Final output sent to browser');
+ log_message('debug', 'Total execution time: '.$elapsed);
}
// --------------------------------------------------------------------
@@ -454,20 +423,18 @@ class CI_Output {
/**
* Write a Cache File
*
- * @access public
* @param string
* @return void
*/
- function _write_cache($output)
+ public function _write_cache($output)
{
$CI =& get_instance();
$path = $CI->config->item('cache_path');
-
$cache_path = ($path == '') ? APPPATH.'cache/' : $path;
if ( ! is_dir($cache_path) OR ! is_really_writable($cache_path))
{
- log_message('error', "Unable to write cache file: ".$cache_path);
+ log_message('error', 'Unable to write cache file: '.$cache_path);
return;
}
@@ -479,7 +446,7 @@ class CI_Output {
if ( ! $fp = @fopen($cache_path, FOPEN_WRITE_CREATE_DESTRUCTIVE))
{
- log_message('error', "Unable to write cache file: ".$cache_path);
+ log_message('error', 'Unable to write cache file: '.$cache_path);
return;
}
@@ -492,13 +459,13 @@ class CI_Output {
}
else
{
- log_message('error', "Unable to secure a file lock for file at: ".$cache_path);
+ log_message('error', 'Unable to secure a file lock for file at: '.$cache_path);
return;
}
fclose($fp);
@chmod($cache_path, FILE_WRITE_MODE);
- log_message('debug', "Cache file written: ".$cache_path);
+ log_message('debug', 'Cache file written: '.$cache_path);
}
// --------------------------------------------------------------------
@@ -506,69 +473,51 @@ class CI_Output {
/**
* Update/serve a cached file
*
- * @access public
* @param object config class
* @param object uri class
* @return void
*/
- function _display_cache(&$CFG, &$URI)
+ public function _display_cache(&$CFG, &$URI)
{
$cache_path = ($CFG->item('cache_path') == '') ? APPPATH.'cache/' : $CFG->item('cache_path');
- // Build the file path. The file name is an MD5 hash of the full URI
- $uri = $CFG->item('base_url').
- $CFG->item('index_page').
- $URI->uri_string;
-
+ // Build the file path. The file name is an MD5 hash of the full URI
+ $uri = $CFG->item('base_url').$CFG->item('index_page').$URI->uri_string;
$filepath = $cache_path.md5($uri);
- if ( ! @file_exists($filepath))
- {
- return FALSE;
- }
-
- if ( ! $fp = @fopen($filepath, FOPEN_READ))
+ if ( ! @file_exists($filepath) OR ! $fp = @fopen($filepath, FOPEN_READ))
{
return FALSE;
}
flock($fp, LOCK_SH);
- $cache = '';
- if (filesize($filepath) > 0)
- {
- $cache = fread($fp, filesize($filepath));
- }
+ $cache = (filesize($filepath) > 0) ? fread($fp, filesize($filepath)) : '';
flock($fp, LOCK_UN);
fclose($fp);
// Strip out the embedded timestamp
- if ( ! preg_match("/(\d+TS--->)/", $cache, $match))
+ 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'])))
+ if (time() >= trim(str_replace('TS--->', '', $match[1])) && is_really_writable($cache_path))
{
- if (is_really_writable($cache_path))
- {
- @unlink($filepath);
- log_message('debug', "Cache file has expired. File deleted");
- return FALSE;
- }
+ @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.");
+ $this->_display(str_replace($match[0], '', $cache));
+ log_message('debug', 'Cache file is current. Sending it to browser.');
return TRUE;
}
-
}
-// END Output Class
/* End of file Output.php */
-/* Location: ./system/core/Output.php */ \ No newline at end of file
+/* Location: ./system/core/Output.php */
diff --git a/system/core/Router.php b/system/core/Router.php
index 6da667472..d21319565 100755
--- a/system/core/Router.php
+++ b/system/core/Router.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -22,7 +34,7 @@
*
* @package CodeIgniter
* @subpackage Libraries
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @category Libraries
* @link http://codeigniter.com/user_guide/general/routing.html
*/
@@ -32,62 +44,55 @@ class CI_Router {
* Config class
*
* @var object
- * @access public
*/
- var $config;
+ public $config;
/**
* List of routes
*
* @var array
- * @access public
*/
- var $routes = array();
+ public $routes = array();
/**
* List of error routes
*
* @var array
- * @access public
*/
- var $error_routes = array();
+ public $error_routes = array();
/**
* Current class name
*
* @var string
- * @access public
*/
- var $class = '';
+ public $class = '';
/**
* Current method name
*
* @var string
- * @access public
*/
- var $method = 'index';
+ public $method = 'index';
/**
* Sub-directory that contains the requested controller class
*
* @var string
- * @access public
*/
- var $directory = '';
+ public $directory = '';
/**
* Default controller (and method if specific)
*
* @var string
- * @access public
*/
- var $default_controller;
+ public $default_controller;
/**
* Constructor
*
* Runs the route mapping function.
*/
- function __construct()
+ public function __construct()
{
$this->config =& load_class('Config', 'core');
$this->uri =& load_class('URI', 'core');
- log_message('debug', "Router Class Initialized");
+ log_message('debug', 'Router Class Initialized');
}
// --------------------------------------------------------------------
@@ -98,12 +103,11 @@ class CI_Router {
* 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_routing()
+ public function _set_routing()
{
- // Are query strings enabled in the config file? Normally CI doesn't utilize query strings
+ // Are query strings enabled in the config file? Normally CI doesn't utilize query strings
// since URI segments are more search-engine friendly, but they can optionally be used.
// If this feature is enabled, we will gather the directory/class/method a little differently
$segments = array();
@@ -145,7 +149,7 @@ class CI_Router {
// 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']);
- // Were there any query string segments? If so, we'll validate them and bail out since we're done.
+ // Were there any query string segments? If so, we'll validate them and bail out since we're done.
if (count($segments) > 0)
{
return $this->_validate_request($segments);
@@ -160,17 +164,10 @@ class CI_Router {
return $this->_set_default_controller();
}
- // Do we need to remove the URL suffix?
- $this->uri->_remove_url_suffix();
-
- // 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->uri->_reindex_segments();
+ $this->uri->_remove_url_suffix(); // Remove the URL suffix
+ $this->uri->_explode_segments(); // Compile the segments into an array
+ $this->_parse_routes(); // Parse any custom routing that may exist
+ $this->uri->_reindex_segments(); // Re-index the segment array so that it starts with 1 rather than 0
}
// --------------------------------------------------------------------
@@ -178,20 +175,18 @@ class CI_Router {
/**
* Set the default controller
*
- * @access private
* @return void
*/
- function _set_default_controller()
+ protected function _set_default_controller()
{
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.");
+ show_error('Unable to determine what should be displayed. A default route has not been specified in the routing file.');
}
// Is the method being specified?
if (strpos($this->default_controller, '/') !== FALSE)
{
$x = explode('/', $this->default_controller);
-
$this->set_class($x[0]);
$this->set_method($x[1]);
$this->_set_request($x);
@@ -206,7 +201,7 @@ class CI_Router {
// 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.");
+ log_message('debug', 'No URI present. Default controller set.');
}
// --------------------------------------------------------------------
@@ -217,16 +212,15 @@ class CI_Router {
* This function takes an array of URI segments as
* input, and sets the current class/method
*
- * @access private
* @param array
* @param bool
* @return void
*/
- function _set_request($segments = array())
+ protected function _set_request($segments = array())
{
$segments = $this->_validate_request($segments);
- if (count($segments) == 0)
+ if (count($segments) === 0)
{
return $this->_set_default_controller();
}
@@ -257,13 +251,12 @@ class CI_Router {
* Validates the supplied segments. Attempts to determine the path to
* the controller.
*
- * @access private
* @param array
* @return array
*/
- function _validate_request($segments)
+ protected function _validate_request($segments)
{
- if (count($segments) == 0)
+ if (count($segments) === 0)
{
return $segments;
}
@@ -289,7 +282,6 @@ class CI_Router {
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');
@@ -308,7 +300,6 @@ class CI_Router {
if (strpos($this->default_controller, '/') !== FALSE)
{
$x = explode('/', $this->default_controller);
-
$this->set_class($x[0]);
$this->set_method($x[1]);
}
@@ -332,18 +323,16 @@ class CI_Router {
// If we've gotten this far it means that the URI does not correlate to a valid
- // controller class. We will now see if there is an override
+ // controller class. We will now see if there is an override
if ( ! empty($this->routes['404_override']))
{
$x = explode('/', $this->routes['404_override']);
-
$this->set_class($x[0]);
$this->set_method(isset($x[1]) ? $x[1] : 'index');
return $x;
}
-
// Nothing else to do at this point but show a 404
show_404($segments[0]);
}
@@ -357,10 +346,9 @@ class CI_Router {
* 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()
+ protected function _parse_routes()
{
// Turn the segment array into a URI string
$uri = implode('/', $this->uri->segments);
@@ -375,7 +363,7 @@ class CI_Router {
foreach ($this->routes as $key => $val)
{
// Convert wild-cards to RegEx
- $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));
+ $key = str_replace(array(':any', ':num'), array('.+', '[0-9]+'), $key);
// Does the RegEx match?
if (preg_match('#^'.$key.'$#', $uri))
@@ -400,11 +388,10 @@ class CI_Router {
/**
* Set the class name
*
- * @access public
* @param string
* @return void
*/
- function set_class($class)
+ public function set_class($class)
{
$this->class = str_replace(array('/', '.'), '', $class);
}
@@ -414,10 +401,9 @@ class CI_Router {
/**
* Fetch the current class
*
- * @access public
* @return string
*/
- function fetch_class()
+ public function fetch_class()
{
return $this->class;
}
@@ -427,11 +413,10 @@ class CI_Router {
/**
* Set the method name
*
- * @access public
* @param string
* @return void
*/
- function set_method($method)
+ public function set_method($method)
{
$this->method = $method;
}
@@ -441,10 +426,9 @@ class CI_Router {
/**
* Fetch the current method
*
- * @access public
* @return string
*/
- function fetch_method()
+ public function fetch_method()
{
if ($this->method == $this->fetch_class())
{
@@ -459,11 +443,10 @@ class CI_Router {
/**
* Set the directory name
*
- * @access public
* @param string
* @return void
*/
- function set_directory($dir)
+ public function set_directory($dir)
{
$this->directory = str_replace(array('/', '.'), '', $dir).'/';
}
@@ -473,10 +456,9 @@ class CI_Router {
/**
* Fetch the sub-directory (if any) that contains the requested controller class
*
- * @access public
* @return string
*/
- function fetch_directory()
+ public function fetch_directory()
{
return $this->directory;
}
@@ -486,11 +468,10 @@ class CI_Router {
/**
* Set the controller overrides
*
- * @access public
* @param array
* @return null
*/
- function _set_overrides($routing)
+ public function _set_overrides($routing)
{
if ( ! is_array($routing))
{
@@ -514,9 +495,7 @@ class CI_Router {
}
}
-
}
-// END Router Class
/* End of file Router.php */
-/* Location: ./system/core/Router.php */ \ No newline at end of file
+/* Location: ./system/core/Router.php */
diff --git a/system/core/Security.php b/system/core/Security.php
index a3e227437..1007f61f4 100755
--- a/system/core/Security.php
+++ b/system/core/Security.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Security
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/security.html
*/
class CI_Security {
@@ -30,74 +42,68 @@ 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 = '';
+
/**
* 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';
+ protected $_csrf_cookie_name = 'ci_csrf_token';
+
/**
* List of never allowed strings
*
* @var array
- * @access protected
*/
protected $_never_allowed_str = array(
- 'document.cookie' => '[removed]',
- 'document.write' => '[removed]',
- '.parentNode' => '[removed]',
- '.innerHTML' => '[removed]',
- 'window.location' => '[removed]',
- '-moz-binding' => '[removed]',
- '<!--' => '&lt;!--',
- '-->' => '--&gt;',
- '<![CDATA[' => '&lt;![CDATA[',
- '<comment>' => '&lt;comment&gt;'
- );
-
- /* never allowed, regex replacement */
+ 'document.cookie' => '[removed]',
+ 'document.write' => '[removed]',
+ '.parentNode' => '[removed]',
+ '.innerHTML' => '[removed]',
+ 'window.location' => '[removed]',
+ '-moz-binding' => '[removed]',
+ '<!--' => '&lt;!--',
+ '-->' => '--&gt;',
+ '<![CDATA[' => '&lt;![CDATA[',
+ '<comment>' => '&lt;comment&gt;'
+ );
+
/**
* 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]'
- );
+ 'javascript\s*:',
+ 'expression\s*(\(|&\#40;)', // CSS and IE
+ 'vbscript\s*:', // IE, surprise!
+ 'Redirect\s+302'
+ );
- /**
- * Constructor
- */
public function __construct()
{
// CSRF config
@@ -118,7 +124,7 @@ class CI_Security {
// Set the CSRF hash
$this->_csrf_set_hash();
- log_message('debug', "Security Class Initialized");
+ log_message('debug', 'Security Class Initialized');
}
// --------------------------------------------------------------------
@@ -131,35 +137,43 @@ class CI_Security {
public function csrf_verify()
{
// If no POST data exists we will set the CSRF cookie
- if (count($_POST) == 0)
+ 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_cookie_name]))
+ // Check if URI has been whitelisted from CSRF checks
+ if ($exclude_uris = config_item('csrf_exclude_uris'))
{
- $this->csrf_show_error();
+ $uri = load_class('URI', 'core');
+ if (in_array($uri->uri_string(), $exclude_uris))
+ {
+ return $this;
+ }
}
- // Do the tokens match?
- if ($_POST[$this->_csrf_token_name] != $_COOKIE[$this->_csrf_cookie_name])
+ // Do the tokens exist in both the _POST and _COOKIE arrays?
+ if ( ! isset($_POST[$this->_csrf_token_name]) OR ! isset($_COOKIE[$this->_csrf_cookie_name])
+ OR $_POST[$this->_csrf_token_name] != $_COOKIE[$this->_csrf_cookie_name]) // Do the tokens match?
{
$this->csrf_show_error();
}
- // We kill this since we're done and we don't want to
- // polute the _POST array
+ // 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]);
+ // Regenerate on every submission?
+ if (config_item('csrf_regenerate'))
+ {
+ // Nothing should last forever
+ unset($_COOKIE[$this->_csrf_cookie_name]);
+ $this->_csrf_hash = '';
+ }
+
$this->_csrf_set_hash();
$this->csrf_set_cookie();
- log_message('debug', "CSRF token verified ");
-
+ log_message('debug', 'CSRF token verified');
return $this;
}
@@ -173,21 +187,15 @@ class CI_Security {
public function csrf_set_cookie()
{
$expire = time() + $this->_csrf_expire;
- $secure_cookie = (config_item('cookie_secure') === TRUE) ? 1 : 0;
+ $secure_cookie = (bool) config_item('cookie_secure');
- if ($secure_cookie)
+ if ($secure_cookie && ( ! isset($_SERVER['HTTPS']) OR $_SERVER['HTTPS'] == 'off' OR ! $_SERVER['HTTPS']))
{
- $req = isset($_SERVER['HTTPS']) ? $_SERVER['HTTPS'] : FALSE;
-
- if ( ! $req OR $req == 'off')
- {
- return FALSE;
- }
+ return FALSE;
}
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");
+ log_message('debug', 'CRSF cookie Set');
return $this;
}
@@ -225,7 +233,7 @@ class CI_Security {
*
* Getter Method
*
- * @return string self::csrf_token_name
+ * @return string self::_csrf_token_name
*/
public function get_csrf_token_name()
{
@@ -245,7 +253,7 @@ class CI_Security {
* 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
@@ -262,10 +270,7 @@ class CI_Security {
*/
public function xss_clean($str, $is_image = FALSE)
{
- /*
- * Is the string an array?
- *
- */
+ // Is the string an array?
if (is_array($str))
{
while (list($key) = each($str))
@@ -276,13 +281,8 @@ class CI_Security {
return $str;
}
- /*
- * Remove Invisible Characters
- */
- $str = remove_invisible_characters($str);
-
- // Validate Entities in URLs
- $str = $this->_validate_entities($str);
+ // Remove Invisible Characters and validate entities in URLs
+ $str = $this->_validate_entities(remove_invisible_characters($str));
/*
* URL Decode
@@ -292,7 +292,6 @@ class CI_Security {
* <a href="http://%77%77%77%2E%67%6F%6F%67%6C%65%2E%63%6F%6D">Google</a>
*
* Note: Use rawurldecode() so it does not remove plus signs
- *
*/
$str = rawurldecode($str);
@@ -302,16 +301,11 @@ class CI_Security {
* 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);
- $str = preg_replace_callback("/<\w+.*?(?=>|<|$)/si", array($this, '_decode_entity'), $str);
-
- /*
- * Remove Invisible Characters Again!
- */
+ // Remove Invisible Characters Again!
$str = remove_invisible_characters($str);
/*
@@ -322,15 +316,9 @@ class CI_Security {
* 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);
- if (strpos($str, "\t") !== FALSE)
- {
- $str = str_replace("\t", ' ', $str);
- }
-
- /*
- * Capture converted string for later comparison
- */
+ // Capture converted string for later comparison
$converted_string = $str;
// Remove Strings that are never allowed
@@ -350,7 +338,7 @@ class CI_Security {
// 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', "&lt;?\\1", $str);
+ $str = preg_replace('/<\?(php)/i', '&lt;?\\1', $str);
}
else
{
@@ -370,16 +358,11 @@ class CI_Security {
foreach ($words as $word)
{
- $temp = '';
-
- for ($i = 0, $wordlen = strlen($word); $i < $wordlen; $i++)
- {
- $temp .= substr($word, $i, 1)."\s*";
- }
+ $word = implode("\s*", str_split($word)) . "\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);
+ $str = preg_replace_callback('#('.substr($word, 0, -3).')(\W)#is', array($this, '_compact_exploded_words'), $str);
}
/*
@@ -392,19 +375,19 @@ class CI_Security {
{
$original = $str;
- if (preg_match("/<a/i", $str))
+ if (preg_match('/<a/i', $str))
{
- $str = preg_replace_callback("#<a\s+([^>]*?)(>|$)#si", array($this, '_js_link_removal'), $str);
+ $str = preg_replace_callback('#<a\s+([^>]*?)(>|$)#si', array($this, '_js_link_removal'), $str);
}
- if (preg_match("/<img/i", $str))
+ if (preg_match('/<img/i', $str))
{
- $str = preg_replace_callback("#<img\s+([^>]*?)(\s?/?>|$)#si", array($this, '_js_img_removal'), $str);
+ $str = preg_replace_callback('#<img\s+([^>]*?)(\s?/?>|$)#si', array($this, '_js_img_removal'), $str);
}
- if (preg_match("/script/i", $str) OR preg_match("/xss/i", $str))
+ if (preg_match('/(script|xss)/i', $str))
{
- $str = preg_replace("#<(/*)(script|xss)(.*?)\>#si", '[removed]', $str);
+ $str = preg_replace('#<(/*)(script|xss)(.*?)\>#si', '[removed]', $str);
}
}
while($original != $str);
@@ -431,14 +414,16 @@ class CI_Security {
*
* Similar to above, only instead of looking for
* tags it looks for PHP and JavaScript commands
- * that are disallowed. Rather than removing the
+ * 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&#40;'some code'&#41;
+ * Becomes: eval&#40;'some code'&#41;
*/
- $str = preg_replace('#(alert|cmd|passthru|eval|exec|expression|system|fopen|fsockopen|file|file_get_contents|readfile|unlink)(\s*)\((.*?)\)#si', "\\1\\2&#40;\\3&#41;", $str);
+ $str = preg_replace('#(alert|cmd|passthru|eval|exec|expression|system|fopen|fsockopen|file|file_get_contents|readfile|unlink)(\s*)\((.*?)\)#si',
+ '\\1\\2&#40;\\3&#41;',
+ $str);
// Final clean up
@@ -455,13 +440,12 @@ class CI_Security {
* string post-removal of XSS, then it fails, as there was unwanted XSS
* code found and removed/changed during processing.
*/
-
if ($is_image === TRUE)
{
- return ($str == $converted_string) ? TRUE: FALSE;
+ return ($str === $converted_string);
}
- log_message('debug', "XSS Filtering completed");
+ log_message('debug', 'XSS Filtering completed');
return $str;
}
@@ -493,20 +477,25 @@ class CI_Security {
* 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
+ * correctly. html_entity_decode() does not convert entities without
* semicolons, so we are left with our own little solution here. Bummer.
*
* @param string
* @param string
* @return string
*/
- public function entity_decode($str, $charset='UTF-8')
+ public function entity_decode($str, $charset = NULL)
{
- if (stristr($str, '&') === FALSE)
+ if (strpos($str, '&') === FALSE)
{
return $str;
}
+ if (empty($charset))
+ {
+ $charset = config_item('charset');
+ }
+
$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);
@@ -524,38 +513,23 @@ class CI_Security {
public function sanitize_filename($str, $relative_path = FALSE)
{
$bad = array(
- "../",
- "<!--",
- "-->",
- "<",
- ">",
- "'",
- '"',
- '&',
- '$',
- '#',
- '{',
- '}',
- '[',
- ']',
- '=',
- ';',
- '?',
- "%20",
- "%22",
- "%3c", // <
- "%253c", // <
- "%3e", // >
- "%0e", // >
- "%28", // (
- "%29", // )
- "%2528", // (
- "%26", // &
- "%24", // $
- "%3f", // ?
- "%3b", // ;
- "%3d" // =
- );
+ '../', '<!--', '-->', '<', '>',
+ "'", '"', '&', '$', '#',
+ '{', '}', '[', ']', '=',
+ ';', '?', '%20', '%22',
+ '%3c', // <
+ '%253c', // <
+ '%3e', // >
+ '%0e', // >
+ '%28', // (
+ '%29', // )
+ '%2528', // (
+ '%26', // &
+ '%24', // $
+ '%3f', // ?
+ '%3b', // ;
+ '%3d' // =
+ );
if ( ! $relative_path)
{
@@ -608,26 +582,26 @@ class CI_Security {
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 {
$count = 0;
$attribs = array();
-
+
// find occurrences of illegal attribute strings without quotes
- preg_match_all("/(".implode('|', $evil_attributes).")\s*=\s*([^\s]*)/is", $str, $matches, PREG_SET_ORDER);
-
+ preg_match_all('/('.implode('|', $evil_attributes).')\s*=\s*([^\s]*)/is', $str, $matches, PREG_SET_ORDER);
+
foreach ($matches as $attr)
{
$attribs[] = preg_quote($attr[0], '/');
}
-
+
// find occurrences of illegal attribute strings with quotes (042 and 047 are octal quotes)
- preg_match_all("/(".implode('|', $evil_attributes).")\s*=\s*(\042|\047)([^\\2]*?)(\\2)/is", $str, $matches, PREG_SET_ORDER);
+ preg_match_all('/('.implode('|', $evil_attributes).')\s*=\s*(\042|\047)([^\\2]*?)(\\2)/is', $str, $matches, PREG_SET_ORDER);
foreach ($matches as $attr)
{
@@ -637,11 +611,11 @@ class CI_Security {
// replace illegal attribute strings that are inside an html tag
if (count($attribs) > 0)
{
- $str = preg_replace("/<(\/?[^><]+?)([^A-Za-z\-])(".implode('|', $attribs).")([\s><])([><]*)/i", '<$1$2$4$5', $str, -1, $count);
+ $str = preg_replace('/<(\/?[^><]+?)([^A-Za-z\-])('.implode('|', $attribs).')([\s><])([><]*)/i', '<$1$2$4$5', $str, -1, $count);
}
-
+
} while ($count);
-
+
return $str;
}
@@ -657,14 +631,9 @@ class CI_Security {
*/
protected function _sanitize_naughty_html($matches)
{
- // encode opening brace
- $str = '&lt;'.$matches[1].$matches[2].$matches[3];
-
- // encode captured opening or closing brace to prevent recursive vectors
- $str .= str_replace(array('>', '<'), array('&gt;', '&lt;'),
- $matches[4]);
-
- return $str;
+ return '&lt;'.$matches[1].$matches[2].$matches[3] // encode opening brace
+ // encode captured opening or closing brace to prevent recursive vectors:
+ . str_replace(array('>', '<'), array('&gt;', '&lt;'), $matches[4]);
}
// --------------------------------------------------------------------
@@ -682,9 +651,12 @@ class CI_Security {
*/
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|<script|<xss|base64\s*,)#si", "", $attributes), $match[0]);
+ return str_replace($match[1],
+ preg_replace('#href=.*?(alert\(|alert&\#40;|javascript\:|livescript\:|mocha\:|charset\=|window\.|document\.|\.cookie|<script|<xss|base64\s*,)#si',
+ '',
+ $this->_filter_attributes(str_replace(array('<', '>'), '', $match[1]))
+ ),
+ $match[0]);
}
// --------------------------------------------------------------------
@@ -702,9 +674,12 @@ class CI_Security {
*/
protected function _js_img_removal($match)
{
- $attributes = $this->_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|<script|<xss|base64\s*,)#si", "", $attributes), $match[0]);
+ return str_replace($match[1],
+ preg_replace('#src=.*?(alert\(|alert&\#40;|javascript\:|livescript\:|mocha\:|charset\=|window\.|document\.|\.cookie|<script|<xss|base64\s*,)#si',
+ '',
+ $this->_filter_attributes(str_replace(array('<', '>'), '', $match[1]))
+ ),
+ $match[0]);
}
// --------------------------------------------------------------------
@@ -735,12 +710,11 @@ class CI_Security {
protected 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);
+ $out .= preg_replace('#/\*.*?\*/#s', '', $match);
}
}
@@ -778,33 +752,28 @@ class CI_Security {
* Protect GET variables in URLs
*/
- // 901119URL5918AMP18930PROTECT8198
-
- $str = preg_replace('|\&([a-z\_0-9\-]+)\=([a-z\_0-9\-]+)|i', $this->xss_hash()."\\1=\\2", $str);
+ // 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);
+ $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);
+ $str = preg_replace('#(&\#x?)([0-9A-F]+);?#i', '\\1\\2;', $str);
/*
* Un-Protect GET variables in URLs
*/
- $str = str_replace($this->xss_hash(), '&', $str);
-
- return $str;
+ return str_replace($this->xss_hash(), '&', $str);
}
// ----------------------------------------------------------------------
@@ -819,14 +788,11 @@ class CI_Security {
*/
protected function _do_never_allowed($str)
{
- foreach ($this->_never_allowed_str as $key => $val)
- {
- $str = str_replace($key, $val, $str);
- }
+ $str = str_replace(array_keys($this->_never_allowed_str), $this->_never_allowed_str, $str);
- foreach ($this->_never_allowed_regex as $key => $val)
+ foreach ($this->_never_allowed_regex as $regex)
{
- $str = preg_replace("#".$key."#i", $val, $str);
+ $str = preg_replace('#'.$regex.'#i', '[removed]', $str);
}
return $str;
@@ -853,14 +819,14 @@ class CI_Security {
return $this->_csrf_hash = $_COOKIE[$this->_csrf_cookie_name];
}
- return $this->_csrf_hash = md5(uniqid(rand(), TRUE));
+ $this->_csrf_hash = md5(uniqid(rand(), TRUE));
+ $this->csrf_set_cookie();
}
return $this->_csrf_hash;
}
}
-// END Security Class
/* End of file Security.php */
-/* Location: ./system/libraries/Security.php */
+/* Location: ./system/core/Security.php */
diff --git a/system/core/URI.php b/system/core/URI.php
index a3ae20cc3..b28ee198b 100755
--- a/system/core/URI.php
+++ b/system/core/URI.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -23,7 +35,7 @@
* @package CodeIgniter
* @subpackage Libraries
* @category URI
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/uri.html
*/
class CI_URI {
@@ -32,62 +44,56 @@ class CI_URI {
* List of cached uri segments
*
* @var array
- * @access public
*/
- var $keyval = array();
+ public $keyval = array();
/**
* Current uri string
*
* @var string
- * @access public
*/
- var $uri_string;
+ public $uri_string;
/**
* List of uri segments
*
* @var array
- * @access public
*/
- var $segments = array();
+ public $segments = array();
/**
* Re-indexed list of uri segments
* Starts at 1 instead of 0
*
* @var array
- * @access public
*/
- var $rsegments = array();
+ public $rsegments = array();
/**
* Constructor
*
- * Simply globalizes the $RTR object. The front
+ * Simply globalizes the $RTR object. The front
* loads the Router class early on so it's not available
* normally as other classes are.
- *
- * @access public
*/
- function __construct()
+ public function __construct()
{
$this->config =& load_class('Config', 'core');
- log_message('debug', "URI Class Initialized");
+ log_message('debug', 'URI Class Initialized');
}
-
// --------------------------------------------------------------------
/**
* Get the URI String
*
- * @access private
- * @return string
+ * Called by CI_Router
+ *
+ * @return void
*/
- function _fetch_uri_string()
+ public function _fetch_uri_string()
{
- if (strtoupper($this->config->item('uri_protocol')) == 'AUTO')
+ if (strtoupper($this->config->item('uri_protocol')) === 'AUTO')
{
// Is the request coming from the command line?
- if (php_sapi_name() == 'cli' or defined('STDIN'))
+ if (php_sapi_name() === 'cli' OR defined('STDIN'))
{
$this->_set_uri_string($this->_parse_cli_args());
return;
@@ -103,14 +109,14 @@ class CI_URI {
// 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)
+ if (trim($path, '/') != '' && $path !== '/'.SELF)
{
$this->_set_uri_string($path);
return;
}
// No PATH_INFO?... What about QUERY_STRING?
- $path = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING');
+ $path = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING');
if (trim($path, '/') != '')
{
$this->_set_uri_string($path);
@@ -118,7 +124,7 @@ class CI_URI {
}
// As a last ditch effort lets try using the $_GET array
- if (is_array($_GET) && count($_GET) == 1 && trim(key($_GET), '/') != '')
+ if (is_array($_GET) && count($_GET) === 1 && trim(key($_GET), '/') != '')
{
$this->_set_uri_string(key($_GET));
return;
@@ -131,12 +137,12 @@ class CI_URI {
$uri = strtoupper($this->config->item('uri_protocol'));
- if ($uri == 'REQUEST_URI')
+ if ($uri === 'REQUEST_URI')
{
$this->_set_uri_string($this->_detect_uri());
return;
}
- elseif ($uri == 'CLI')
+ elseif ($uri === 'CLI')
{
$this->_set_uri_string($this->_parse_cli_args());
return;
@@ -151,17 +157,16 @@ class CI_URI {
/**
* Set the URI String
*
- * @access public
* @param string
- * @return string
+ * @return void
*/
- function _set_uri_string($str)
+ public 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;
+ $this->uri_string = ($str === '/') ? '' : $str;
}
// --------------------------------------------------------------------
@@ -172,10 +177,9 @@ class CI_URI {
* This function will detect the URI automatically and fix the query string
* if necessary.
*
- * @access private
* @return string
*/
- private function _detect_uri()
+ protected function _detect_uri()
{
if ( ! isset($_SERVER['REQUEST_URI']) OR ! isset($_SERVER['SCRIPT_NAME']))
{
@@ -211,7 +215,7 @@ class CI_URI {
$_GET = array();
}
- if ($uri == '/' || empty($uri))
+ if ($uri == '/' OR empty($uri))
{
return '/';
}
@@ -229,13 +233,11 @@ class CI_URI {
*
* Take each command line argument and assume it is a URI segment.
*
- * @access private
* @return string
*/
- private function _parse_cli_args()
+ protected function _parse_cli_args()
{
$args = array_slice($_SERVER['argv'], 1);
-
return $args ? '/' . implode('/', $args) : '';
}
@@ -244,27 +246,28 @@ class CI_URI {
/**
* Filter segments for malicious characters
*
- * @access private
+ * Called by CI_Router
+ *
* @param string
* @return string
*/
- function _filter_uri($str)
+ public function _filter_uri($str)
{
if ($str != '' && $this->config->item('permitted_uri_chars') != '' && $this->config->item('enable_query_strings') == FALSE)
{
// 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))
+ 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);
}
}
- // Convert programatic characters to entities
- $bad = array('$', '(', ')', '%28', '%29');
- $good = array('&#36;', '&#40;', '&#41;', '&#40;', '&#41;');
-
- return str_replace($bad, $good, $str);
+ // Convert programatic characters to entities and return
+ return str_replace(
+ array('$', '(', ')', '%28', '%29'), // Bad
+ array('&#36;', '&#40;', '&#41;', '&#40;', '&#41;'), // Good
+ $str);
}
// --------------------------------------------------------------------
@@ -272,14 +275,15 @@ class CI_URI {
/**
* Remove the suffix from the URL if needed
*
- * @access private
+ * Called by CI_Router
+ *
* @return void
*/
- function _remove_url_suffix()
+ public function _remove_url_suffix()
{
- if ($this->config->item('url_suffix') != "")
+ if ($this->config->item('url_suffix') != '')
{
- $this->uri_string = preg_replace("|".preg_quote($this->config->item('url_suffix'))."$|", "", $this->uri_string);
+ $this->uri_string = preg_replace('|'.preg_quote($this->config->item('url_suffix')).'$|', '', $this->uri_string);
}
}
@@ -289,12 +293,13 @@ class CI_URI {
* Explode the URI Segments. The individual segments will
* be stored in the $this->segments array.
*
- * @access private
+ * Called by CI_Router
+ *
* @return void
*/
- function _explode_segments()
+ public function _explode_segments()
{
- foreach (explode("/", preg_replace("|/*(.+?)/*$|", "\\1", $this->uri_string)) as $val)
+ foreach (explode('/', preg_replace('|/*(.+?)/*$|', '\\1', $this->uri_string)) as $val)
{
// Filter segments for security
$val = trim($this->_filter_uri($val));
@@ -311,14 +316,15 @@ class CI_URI {
* 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
+ * 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
+ * Called by CI_Router
+ *
* @return void
*/
- function _reindex_segments()
+ public function _reindex_segments()
{
array_unshift($this->segments, NULL);
array_unshift($this->rsegments, NULL);
@@ -333,12 +339,11 @@ class CI_URI {
*
* 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)
+ public function segment($n, $no_result = FALSE)
{
return ( ! isset($this->segments[$n])) ? $no_result : $this->segments[$n];
}
@@ -352,12 +357,11 @@ class CI_URI {
* 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)
+ public function rsegment($n, $no_result = FALSE)
{
return ( ! isset($this->rsegments[$n])) ? $no_result : $this->rsegments[$n];
}
@@ -380,25 +384,22 @@ class CI_URI {
* 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())
+ public 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
*
- * @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())
+ public function ruri_to_assoc($n = 3, $default = array())
{
return $this->_uri_to_assoc($n, $default, 'rsegment');
}
@@ -408,25 +409,13 @@ class CI_URI {
/**
* 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')
+ protected 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;
@@ -437,23 +426,30 @@ class CI_URI {
return $this->keyval[$n];
}
+ if ($which === 'segment')
+ {
+ $total_segments = 'total_segments';
+ $segment_array = 'segment_array';
+ }
+ else
+ {
+ $total_segments = 'total_rsegments';
+ $segment_array = 'rsegment_array';
+ }
+
if ($this->$total_segments() < $n)
{
- if (count($default) == 0)
+ if (count($default) === 0)
{
return array();
}
- $retval = array();
- foreach ($default as $val)
- {
- $retval[$val] = FALSE;
- }
- return $retval;
+ return function_exists('array_fill_keys')
+ ? array_fill_keys($default, FALSE)
+ : array_combine($default, array_fill(0, count($default), FALSE));
}
$segments = array_slice($this->$segment_array(), ($n - 1));
-
$i = 0;
$lastval = '';
$retval = array();
@@ -494,11 +490,10 @@ class CI_URI {
* 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)
+ public function assoc_to_uri($array)
{
$temp = array();
foreach ((array)$array as $key => $val)
@@ -515,12 +510,11 @@ class CI_URI {
/**
* Fetch a URI Segment and add a trailing slash
*
- * @access public
* @param integer
* @param string
* @return string
*/
- function slash_segment($n, $where = 'trailing')
+ public function slash_segment($n, $where = 'trailing')
{
return $this->_slash_segment($n, $where, 'segment');
}
@@ -530,12 +524,11 @@ class CI_URI {
/**
* Fetch a URI Segment and add a trailing slash
*
- * @access public
* @param integer
* @param string
* @return string
*/
- function slash_rsegment($n, $where = 'trailing')
+ public function slash_rsegment($n, $where = 'trailing')
{
return $this->_slash_segment($n, $where, 'rsegment');
}
@@ -545,22 +538,20 @@ class CI_URI {
/**
* 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')
+ protected function _slash_segment($n, $where = 'trailing', $which = 'segment')
{
- $leading = '/';
- $trailing = '/';
+ $leading = $trailing = '/';
- if ($where == 'trailing')
+ if ($where === 'trailing')
{
$leading = '';
}
- elseif ($where == 'leading')
+ elseif ($where === 'leading')
{
$trailing = '';
}
@@ -573,10 +564,9 @@ class CI_URI {
/**
* Segment Array
*
- * @access public
* @return array
*/
- function segment_array()
+ public function segment_array()
{
return $this->segments;
}
@@ -586,10 +576,9 @@ class CI_URI {
/**
* Routed Segment Array
*
- * @access public
* @return array
*/
- function rsegment_array()
+ public function rsegment_array()
{
return $this->rsegments;
}
@@ -599,10 +588,9 @@ class CI_URI {
/**
* Total number of segments
*
- * @access public
* @return integer
*/
- function total_segments()
+ public function total_segments()
{
return count($this->segments);
}
@@ -612,10 +600,9 @@ class CI_URI {
/**
* Total number of routed segments
*
- * @access public
* @return integer
*/
- function total_rsegments()
+ public function total_rsegments()
{
return count($this->rsegments);
}
@@ -625,10 +612,9 @@ class CI_URI {
/**
* Fetch the entire URI string
*
- * @access public
* @return string
*/
- function uri_string()
+ public function uri_string()
{
return $this->uri_string;
}
@@ -639,16 +625,14 @@ class CI_URI {
/**
* Fetch the entire Re-routed URI string
*
- * @access public
* @return string
*/
- function ruri_string()
+ public function ruri_string()
{
return '/'.implode('/', $this->rsegment_array());
}
}
-// END URI Class
/* End of file URI.php */
-/* Location: ./system/core/URI.php */ \ No newline at end of file
+/* Location: ./system/core/URI.php */
diff --git a/system/core/Utf8.php b/system/core/Utf8.php
index 2a27d1f35..0e180d36f 100644
--- a/system/core/Utf8.php
+++ b/system/core/Utf8.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 2.0
* @filesource
@@ -23,7 +35,7 @@
* @package CodeIgniter
* @subpackage Libraries
* @category UTF-8
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/utf8.html
*/
class CI_Utf8 {
@@ -32,24 +44,22 @@ class CI_Utf8 {
* Constructor
*
* Determines if UTF-8 support is to be enabled
- *
*/
- function __construct()
+ public function __construct()
{
- log_message('debug', "Utf8 Class Initialized");
+ log_message('debug', 'Utf8 Class Initialized');
global $CFG;
if (
- preg_match('/./u', 'é') === 1 // PCRE must support UTF-8
- AND function_exists('iconv') // iconv must be installed
- AND ini_get('mbstring.func_overload') != 1 // Multibyte string function overloading cannot be enabled
- AND $CFG->item('charset') == 'UTF-8' // Application charset must be UTF-8
+ @preg_match('/./u', 'é') === 1 // PCRE must support UTF-8
+ && function_exists('iconv') // iconv must be installed
+ && @ini_get('mbstring.func_overload') != 1 // Multibyte string function overloading cannot be enabled
+ && $CFG->item('charset') === 'UTF-8' // Application charset must be UTF-8
)
{
- log_message('debug', "UTF-8 Support Enabled");
-
define('UTF8_ENABLED', TRUE);
+ log_message('debug', 'UTF-8 Support Enabled');
// set internal encoding for multibyte string functions if necessary
// and set a flag so we don't have to repeatedly use extension_loaded()
@@ -66,8 +76,8 @@ class CI_Utf8 {
}
else
{
- log_message('debug', "UTF-8 Support Disabled");
define('UTF8_ENABLED', FALSE);
+ log_message('debug', 'UTF-8 Support Disabled');
}
}
@@ -78,11 +88,10 @@ class CI_Utf8 {
*
* Ensures strings are UTF-8
*
- * @access public
* @param string
* @return string
*/
- function clean_string($str)
+ public function clean_string($str)
{
if ($this->_is_ascii($str) === FALSE)
{
@@ -101,11 +110,10 @@ class CI_Utf8 {
* line feeds, and carriage returns, as all others can cause
* problems in XML
*
- * @access public
* @param string
* @return string
*/
- function safe_ascii_for_xml($str)
+ public function safe_ascii_for_xml($str)
{
return remove_invisible_characters($str, FALSE);
}
@@ -117,27 +125,22 @@ class CI_Utf8 {
*
* Attempts to convert a string to UTF-8
*
- * @access public
* @param string
* @param string - input encoding
* @return string
*/
- function convert_to_utf8($str, $encoding)
+ public function convert_to_utf8($str, $encoding)
{
if (function_exists('iconv'))
{
- $str = @iconv($encoding, 'UTF-8', $str);
+ return @iconv($encoding, 'UTF-8', $str);
}
elseif (function_exists('mb_convert_encoding'))
{
- $str = @mb_convert_encoding($str, 'UTF-8', $encoding);
- }
- else
- {
- return FALSE;
+ return @mb_convert_encoding($str, 'UTF-8', $encoding);
}
- return $str;
+ return FALSE;
}
// --------------------------------------------------------------------
@@ -147,19 +150,15 @@ class CI_Utf8 {
*
* Tests if a string is standard 7-bit ASCII or not
*
- * @access public
* @param string
* @return bool
*/
- function _is_ascii($str)
+ protected function _is_ascii($str)
{
- return (preg_match('/[^\x00-\x7F]/S', $str) == 0);
+ return (preg_match('/[^\x00-\x7F]/S', $str) === 0);
}
- // --------------------------------------------------------------------
-
}
-// End Utf8 Class
/* End of file Utf8.php */
-/* Location: ./system/core/Utf8.php */ \ No newline at end of file
+/* Location: ./system/core/Utf8.php */
diff --git a/system/database/DB.php b/system/database/DB.php
index 8314d3b97..d06ffb40e 100755
--- a/system/database/DB.php
+++ b/system/database/DB.php
@@ -1,25 +1,35 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* Initialize the database
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
* @param string
* @param bool Determines if active record should be used or not
@@ -30,17 +40,15 @@ 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.php'))
+ if (( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/database.php'))
+ AND ! file_exists($file_path = APPPATH.'config/database.php'))
{
- if ( ! file_exists($file_path = APPPATH.'config/database.php'))
- {
- show_error('The configuration file database.php does not exist.');
- }
+ show_error('The configuration file database.php does not exist.');
}
include($file_path);
- if ( ! isset($db) OR count($db) == 0)
+ if ( ! isset($db) OR count($db) === 0)
{
show_error('No database connection settings were found in the database config file.');
}
@@ -66,33 +74,32 @@ function &DB($params = '', $active_record_override = NULL)
* parameter. DSNs must have this prototype:
* $dsn = 'driver://username:password@hostname/database';
*/
-
if (($dns = @parse_url($params)) === FALSE)
{
show_error('Invalid DB Connection String');
}
$params = array(
- 'dbdriver' => $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)) : ''
- );
+ 'dbdriver' => $dns['scheme'],
+ 'hostname' => (isset($dns['host'])) ? rawurldecode($dns['host']) : '',
+ 'port' => (isset($dns['port'])) ? rawurldecode($dns['port']) : '',
+ '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")
+ if (strtoupper($val) === 'TRUE')
{
$val = TRUE;
}
- elseif (strtoupper($val) == "FALSE")
+ elseif (strtoupper($val) === 'FALSE')
{
$val = FALSE;
}
@@ -102,17 +109,15 @@ function &DB($params = '', $active_record_override = NULL)
}
}
- // No DB specified yet? Beat them senseless...
+ // 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
+ // 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 !== NULL)
{
$active_record = $active_record_override;
@@ -123,18 +128,14 @@ function &DB($params = '', $active_record_override = NULL)
if ( ! isset($active_record) OR $active_record == TRUE)
{
require_once(BASEPATH.'database/DB_active_rec.php');
-
if ( ! class_exists('CI_DB'))
{
- eval('class CI_DB extends CI_DB_active_record { }');
+ class CI_DB extends CI_DB_active_record { }
}
}
- else
+ elseif ( ! class_exists('CI_DB'))
{
- if ( ! class_exists('CI_DB'))
- {
- eval('class CI_DB extends CI_DB_driver { }');
- }
+ class CI_DB extends CI_DB_driver { }
}
require_once(BASEPATH.'database/drivers/'.$params['dbdriver'].'/'.$params['dbdriver'].'_driver.php');
@@ -156,7 +157,5 @@ function &DB($params = '', $active_record_override = NULL)
return $DB;
}
-
-
/* End of file DB.php */
-/* Location: ./system/database/DB.php */ \ No newline at end of file
+/* Location: ./system/database/DB.php */
diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php
index 7bab729f5..424735157 100644
--- a/system/database/DB_active_rec.php
+++ b/system/database/DB_active_rec.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -23,46 +35,49 @@
* @package CodeIgniter
* @subpackage Drivers
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_active_record extends CI_DB_driver {
- var $ar_select = array();
- var $ar_distinct = FALSE;
- var $ar_from = array();
- var $ar_join = array();
- var $ar_where = array();
- var $ar_like = array();
- var $ar_groupby = array();
- var $ar_having = array();
- var $ar_keys = array();
- var $ar_limit = FALSE;
- var $ar_offset = FALSE;
- var $ar_order = FALSE;
- var $ar_orderby = array();
- var $ar_set = array();
- var $ar_wherein = array();
- var $ar_aliased_tables = array();
- var $ar_store_array = array();
+ protected $return_delete_sql = FALSE;
+ protected $reset_delete_data = FALSE;
+
+ protected $ar_select = array();
+ protected $ar_distinct = FALSE;
+ protected $ar_from = array();
+ protected $ar_join = array();
+ protected $ar_where = array();
+ protected $ar_like = array();
+ protected $ar_groupby = array();
+ protected $ar_having = array();
+ protected $ar_keys = array();
+ protected $ar_limit = FALSE;
+ protected $ar_offset = FALSE;
+ protected $ar_order = FALSE;
+ protected $ar_orderby = array();
+ protected $ar_set = array();
+ protected $ar_wherein = array();
+ protected $ar_aliased_tables = array();
+ protected $ar_store_array = array();
+ protected $ar_where_group_started = FALSE;
+ protected $ar_where_group_count = 0;
// Active Record Caching variables
- var $ar_caching = FALSE;
- var $ar_cache_exists = array();
- var $ar_cache_select = array();
- var $ar_cache_from = array();
- var $ar_cache_join = array();
- var $ar_cache_where = array();
- var $ar_cache_like = array();
- var $ar_cache_groupby = array();
- var $ar_cache_having = array();
- var $ar_cache_orderby = array();
- var $ar_cache_set = array();
-
- var $ar_no_escape = array();
- var $ar_cache_no_escape = array();
-
- // --------------------------------------------------------------------
+ protected $ar_caching = FALSE;
+ protected $ar_cache_exists = array();
+ protected $ar_cache_select = array();
+ protected $ar_cache_from = array();
+ protected $ar_cache_join = array();
+ protected $ar_cache_where = array();
+ protected $ar_cache_like = array();
+ protected $ar_cache_groupby = array();
+ protected $ar_cache_having = array();
+ protected $ar_cache_orderby = array();
+ protected $ar_cache_set = array();
+
+ protected $ar_no_escape = array();
+ protected $ar_cache_no_escape = array();
/**
* Select
@@ -96,6 +111,7 @@ class CI_DB_active_record extends CI_DB_driver {
}
}
}
+
return $this;
}
@@ -171,7 +187,7 @@ class CI_DB_active_record extends CI_DB_driver {
* select_max()
* select_min()
* select_avg()
- * select_sum()
+ * select_sum()
*
* @param string the field
* @param string an alias
@@ -196,8 +212,7 @@ class CI_DB_active_record extends CI_DB_driver {
$alias = $this->_create_alias_from_table(trim($select));
}
- $sql = $type.'('.$this->_protect_identifiers(trim($select)).') AS '.$alias;
-
+ $sql = $this->_protect_identifiers($type.'('.trim($select).')').' AS '.$this->_protect_identifiers(trim($alias));
$this->ar_select[] = $sql;
if ($this->ar_caching === TRUE)
@@ -263,30 +278,27 @@ class CI_DB_active_record extends CI_DB_driver {
{
$v = trim($v);
$this->_track_aliases($v);
-
- $this->ar_from[] = $this->_protect_identifiers($v, TRUE, NULL, FALSE);
+ $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_from[] = $v;
$this->ar_cache_exists[] = 'from';
}
}
-
}
else
{
$val = trim($val);
- // Extract any aliases that might exist. We use this information
+ // 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);
+ $this->ar_from[] = $val = $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_from[] = $val;
$this->ar_cache_exists[] = 'from';
}
}
@@ -323,23 +335,19 @@ class CI_DB_active_record extends CI_DB_driver {
}
}
- // Extract any aliases that might exist. We use this information
+ // 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];
+ $cond = $this->_protect_identifiers($match[1]).$match[2].$this->_protect_identifiers($match[3]);
}
// Assemble the JOIN statement
- $join = $type.'JOIN '.$this->_protect_identifiers($table, TRUE, NULL, FALSE).' ON '.$cond;
+ $this->ar_join[] = $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;
@@ -397,6 +405,8 @@ class CI_DB_active_record extends CI_DB_driver {
*/
protected function _where($key, $value = NULL, $type = 'AND ', $escape = NULL)
{
+ $type = $this->_group_get_type($type);
+
if ( ! is_array($key))
{
$key = array($key => $value);
@@ -410,7 +420,7 @@ class CI_DB_active_record extends CI_DB_driver {
foreach ($key as $k => $v)
{
- $prefix = (count($this->ar_where) == 0 AND count($this->ar_cache_where) == 0) ? '' : $type;
+ $prefix = (count($this->ar_where) === 0 AND count($this->ar_cache_where) === 0) ? '' : $type;
if (is_null($v) && ! $this->_has_operator($k))
{
@@ -423,10 +433,9 @@ class CI_DB_active_record extends CI_DB_driver {
if ($escape === TRUE)
{
$k = $this->_protect_identifiers($k, FALSE, $escape);
-
$v = ' '.$this->escape($v);
}
-
+
if ( ! $this->_has_operator($k))
{
$k .= ' = ';
@@ -438,7 +447,6 @@ class CI_DB_active_record extends CI_DB_driver {
}
$this->ar_where[] = $prefix.$k.$v;
-
if ($this->ar_caching === TRUE)
{
$this->ar_cache_where[] = $prefix.$k.$v;
@@ -538,6 +546,8 @@ class CI_DB_active_record extends CI_DB_driver {
return;
}
+ $type = $this->_group_get_type($type);
+
if ( ! is_array($values))
{
$values = array($values);
@@ -550,11 +560,9 @@ class CI_DB_active_record extends CI_DB_driver {
$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) . ") ";
+ $prefix = (count($this->ar_where) === 0) ? '' : $type;
+ $this->ar_where[] = $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;
@@ -648,6 +656,8 @@ class CI_DB_active_record extends CI_DB_driver {
*/
protected function _like($field, $match = '', $type = 'AND ', $side = 'both', $not = '')
{
+ $type = $this->_group_get_type($type);
+
if ( ! is_array($field))
{
$field = array($field => $match);
@@ -656,16 +666,18 @@ class CI_DB_active_record extends CI_DB_driver {
foreach ($field as $k => $v)
{
$k = $this->_protect_identifiers($k);
-
- $prefix = (count($this->ar_like) == 0) ? '' : $type;
-
+ $prefix = (count($this->ar_like) === 0) ? '' : $type;
$v = $this->escape_like_str($v);
- if ($side == 'before')
+ if ($side === 'none')
+ {
+ $like_statement = $prefix." $k $not LIKE '{$v}'";
+ }
+ elseif ($side === 'before')
{
$like_statement = $prefix." $k $not LIKE '%{$v}'";
}
- elseif ($side == 'after')
+ elseif ($side === 'after')
{
$like_statement = $prefix." $k $not LIKE '{$v}%'";
}
@@ -688,12 +700,114 @@ class CI_DB_active_record extends CI_DB_driver {
}
}
+
return $this;
}
// --------------------------------------------------------------------
/**
+ * Starts a query group.
+ *
+ * @param string (Internal use only)
+ * @param string (Internal use only)
+ * @return object
+ */
+ public function group_start($not = '', $type = 'AND ')
+ {
+ $type = $this->_group_get_type($type);
+ $this->ar_where_group_started = TRUE;
+ $prefix = (count($this->ar_where) === 0 AND count($this->ar_cache_where) === 0) ? '' : $type;
+ $this->ar_where[] = $value = $prefix.$not.str_repeat(' ', ++$this->ar_where_group_count).' (';
+
+ if ($this->ar_caching)
+ {
+ $this->ar_cache_where[] = $value;
+ }
+
+ return $this;
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Starts a query group, but ORs the group
+ *
+ * @return object
+ */
+ public function or_group_start()
+ {
+ return $this->group_start('', 'OR ');
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Starts a query group, but NOTs the group
+ *
+ * @return object
+ */
+ public function not_group_start()
+ {
+ return $this->group_start('NOT ', 'AND ');
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Starts a query group, but OR NOTs the group
+ *
+ * @return object
+ */
+ public function or_not_group_start()
+ {
+ return $this->group_start('NOT ', 'OR ');
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Ends a query group
+ *
+ * @return object
+ */
+ public function group_end()
+ {
+ $this->ar_where_group_started = FALSE;
+ $this->ar_where[] = $value = str_repeat(' ', $this->ar_where_group_count--) . ')';
+
+ if ($this->ar_caching)
+ {
+ $this->ar_cache_where[] = $value;
+ }
+
+ return $this;
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Group_get_type
+ *
+ * Called by group_start(), _like(), _where() and _where_in()
+ *
+ * @param string
+ * @return string
+ */
+ protected function _group_get_type($type)
+ {
+ if ($this->ar_where_group_started)
+ {
+ $type = '';
+ $this->ar_where_group_started = FALSE;
+ }
+
+ return $type;
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* GROUP BY
*
* @param string
@@ -712,15 +826,16 @@ class CI_DB_active_record extends CI_DB_driver {
if ($val != '')
{
- $this->ar_groupby[] = $this->_protect_identifiers($val);
+ $this->ar_groupby[] = $val = $this->_protect_identifiers($val);
if ($this->ar_caching === TRUE)
{
- $this->ar_cache_groupby[] = $this->_protect_identifiers($val);
+ $this->ar_cache_groupby[] = $val;
$this->ar_cache_exists[] = 'groupby';
}
}
}
+
return $this;
}
@@ -776,7 +891,7 @@ class CI_DB_active_record extends CI_DB_driver {
foreach ($key as $k => $v)
{
- $prefix = (count($this->ar_having) == 0) ? '' : $type;
+ $prefix = (count($this->ar_having) === 0) ? '' : $type;
if ($escape === TRUE)
{
@@ -811,11 +926,12 @@ class CI_DB_active_record extends CI_DB_driver {
*
* @param string
* @param string direction: asc or desc
+ * @param bool enable field name escaping
* @return object
*/
- public function order_by($orderby, $direction = '')
+ public function order_by($orderby, $direction = '', $escape = TRUE)
{
- if (strtolower($direction) == 'random')
+ if (strtolower($direction) === 'random')
{
$orderby = ''; // Random results want or don't need a field name
$direction = $this->_random_keyword;
@@ -826,7 +942,7 @@ class CI_DB_active_record extends CI_DB_driver {
}
- if (strpos($orderby, ',') !== FALSE)
+ if ((strpos($orderby, ',') !== FALSE) && $escape === TRUE)
{
$temp = array();
foreach (explode(',', $orderby) as $part)
@@ -842,14 +958,16 @@ class CI_DB_active_record extends CI_DB_driver {
$orderby = implode(', ', $temp);
}
- else if ($direction != $this->_random_keyword)
+ elseif ($direction != $this->_random_keyword)
{
- $orderby = $this->_protect_identifiers($orderby);
+ if ($escape === TRUE)
+ {
+ $orderby = $this->_protect_identifiers($orderby);
+ }
}
- $orderby_statement = $orderby.$direction;
+ $this->ar_orderby[] = $orderby_statement = $orderby.$direction;
- $this->ar_orderby[] = $orderby_statement;
if ($this->ar_caching === TRUE)
{
$this->ar_cache_orderby[] = $orderby_statement;
@@ -868,11 +986,11 @@ class CI_DB_active_record extends CI_DB_driver {
* @param integer the offset value
* @return object
*/
- public function limit($value, $offset = '')
+ public function limit($value, $offset = NULL)
{
$this->ar_limit = (int) $value;
- if ($offset != '')
+ if ( ! is_null($offset))
{
$this->ar_offset = (int) $offset;
}
@@ -890,7 +1008,7 @@ class CI_DB_active_record extends CI_DB_driver {
*/
public function offset($offset)
{
- $this->ar_offset = $offset;
+ $this->ar_offset = (int) $offset;
return $this;
}
@@ -931,6 +1049,36 @@ class CI_DB_active_record extends CI_DB_driver {
// --------------------------------------------------------------------
/**
+ * Get SELECT query string
+ *
+ * Compiles a SELECT query string and returns the sql.
+ *
+ * @access public
+ * @param string the table name to select from (optional)
+ * @param boolean TRUE: resets AR values; FALSE: leave AR vaules alone
+ * @return string
+ */
+ public function get_compiled_select($table = '', $reset = TRUE)
+ {
+ if ($table != '')
+ {
+ $this->_track_aliases($table);
+ $this->from($table);
+ }
+
+ $select = $this->_compile_select();
+
+ if ($reset === TRUE)
+ {
+ $this->_reset_select();
+ }
+
+ return $select;
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Get
*
* Compiles the select statement based on the other functions called
@@ -954,9 +1102,7 @@ class CI_DB_active_record extends CI_DB_driver {
$this->limit($limit, $offset);
}
- $sql = $this->_compile_select();
-
- $result = $this->query($sql);
+ $result = $this->query($this->_compile_select());
$this->_reset_select();
return $result;
}
@@ -978,20 +1124,17 @@ class CI_DB_active_record extends CI_DB_driver {
$this->from($table);
}
- $sql = $this->_compile_select($this->_count_string . $this->_protect_identifiers('numrows'));
-
- $query = $this->query($sql);
+ $result = $this->query($this->_compile_select($this->_count_string.$this->_protect_identifiers('numrows')));
$this->_reset_select();
- if ($query->num_rows() == 0)
+ if ($result->num_rows() === 0)
{
return 0;
}
- $row = $query->row();
+ $row = $result->row();
return (int) $row->numrows;
}
-
// --------------------------------------------------------------------
/**
@@ -1021,9 +1164,7 @@ class CI_DB_active_record extends CI_DB_driver {
$this->limit($limit, $offset);
}
- $sql = $this->_compile_select();
-
- $result = $this->query($sql);
+ $result = $this->query($this->_compile_select());
$this->_reset_select();
return $result;
}
@@ -1046,11 +1187,11 @@ class CI_DB_active_record extends CI_DB_driver {
$this->set_insert_batch($set);
}
- if (count($this->ar_set) == 0)
+ 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
+ // 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;
@@ -1060,30 +1201,19 @@ class CI_DB_active_record extends CI_DB_driver {
{
if ( ! isset($this->ar_from[0]))
{
- if ($this->db_debug)
- {
- return $this->display_error('db_must_set_table');
- }
- return FALSE;
+ return ($this->db_debug) ? $this->display_error('db_must_set_table') : FALSE;
}
$table = $this->ar_from[0];
}
// Batch this baby
- for ($i = 0, $total = count($this->ar_set); $i < $total; $i = $i + 100)
+ for ($i = 0, $total = count($this->ar_set); $i < $total; $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->query($this->_insert_batch($this->_protect_identifiers($table, TRUE, NULL, FALSE), $this->ar_keys, array_slice($this->ar_set, $i, 100)));
}
$this->_reset_write();
-
-
return TRUE;
}
@@ -1127,7 +1257,6 @@ class CI_DB_active_record extends CI_DB_driver {
else
{
$clean = array();
-
foreach ($row as $value)
{
$clean[] = $this->escape($value);
@@ -1148,48 +1277,107 @@ class CI_DB_active_record extends CI_DB_driver {
// --------------------------------------------------------------------
/**
+ * Get INSERT query string
+ *
+ * Compiles an insert query and returns the sql
+ *
+ * @access public
+ * @param string the table to insert into
+ * @param boolean TRUE: reset AR values; FALSE: leave AR values alone
+ * @return string
+ */
+ public function get_compiled_insert($table = '', $reset = TRUE)
+ {
+ if ($this->_validate_insert($table) === FALSE)
+ {
+ return FALSE;
+ }
+
+ $sql = $this->_insert(
+ $this->_protect_identifiers(
+ $this->ar_from[0], TRUE, NULL, FALSE
+ ),
+ array_keys($this->ar_set),
+ array_values($this->ar_set)
+ );
+
+ if ($reset === TRUE)
+ {
+ $this->_reset_write();
+ }
+
+ return $sql;
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Insert
*
* Compiles an insert string and runs the query
*
+ * @access public
* @param string the table to insert data into
* @param array an associative array of insert values
* @return object
*/
- function insert($table = '', $set = NULL)
+ public function insert($table = '', $set = NULL)
{
if ( ! is_null($set))
{
$this->set($set);
}
- if (count($this->ar_set) == 0)
+ if ($this->_validate_insert($table) === FALSE)
{
- if ($this->db_debug)
- {
- return $this->display_error('db_must_use_set');
- }
return FALSE;
}
+ $sql = $this->_insert(
+ $this->_protect_identifiers(
+ $this->ar_from[0], TRUE, NULL, FALSE
+ ),
+ array_keys($this->ar_set),
+ array_values($this->ar_set)
+ );
+
+ $this->_reset_write();
+ return $this->query($sql);
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Validate Insert
+ *
+ * This method is used by both insert() and get_compiled_insert() to
+ * validate that the there data is actually being set and that table
+ * has been chosen to be inserted into.
+ *
+ * @access public
+ * @param string the table to insert data into
+ * @return string
+ */
+ protected function _validate_insert($table = '')
+ {
+ if (count($this->ar_set) === 0)
+ {
+ return ($this->db_debug) ? $this->display_error('db_must_use_set') : FALSE;
+ }
+
if ($table == '')
{
if ( ! isset($this->ar_from[0]))
{
- if ($this->db_debug)
- {
- return $this->display_error('db_must_set_table');
- }
- return FALSE;
+ return ($this->db_debug) ? $this->display_error('db_must_set_table') : FALSE;
}
-
- $table = $this->ar_from[0];
+ }
+ else
+ {
+ $this->ar_from[0] = $table;
}
- $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);
+ return TRUE;
}
// --------------------------------------------------------------------
@@ -1210,31 +1398,22 @@ class CI_DB_active_record extends CI_DB_driver {
$this->set($set);
}
- if (count($this->ar_set) == 0)
+ if (count($this->ar_set) === 0)
{
- if ($this->db_debug)
- {
- return $this->display_error('db_must_use_set');
- }
- return FALSE;
+ return ($this->db_debug) ? $this->display_error('db_must_use_set') : FALSE;
}
if ($table == '')
{
if ( ! isset($this->ar_from[0]))
{
- if ($this->db_debug)
- {
- return $this->display_error('db_must_set_table');
- }
- return FALSE;
+ return ($this->db_debug) ? $this->display_error('db_must_set_table') : 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);
}
@@ -1242,6 +1421,38 @@ class CI_DB_active_record extends CI_DB_driver {
// --------------------------------------------------------------------
/**
+ * Get UPDATE query string
+ *
+ * Compiles an update query and returns the sql
+ *
+ * @access public
+ * @param string the table to update
+ * @param boolean TRUE: reset AR values; FALSE: leave AR values alone
+ * @return string
+ */
+ public function get_compiled_update($table = '', $reset = TRUE)
+ {
+ // Combine any cached components with the current statements
+ $this->_merge_cache();
+
+ if ($this->_validate_update($table) === FALSE)
+ {
+ return FALSE;
+ }
+
+ $sql = $this->_update($this->_protect_identifiers($this->ar_from[0], TRUE, NULL, FALSE), $this->ar_set, $this->ar_where, $this->ar_orderby, $this->ar_limit);
+
+ if ($reset === TRUE)
+ {
+ $this->_reset_write();
+ }
+
+ return $sql;
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Update
*
* Compiles an update string and runs the query
@@ -1261,29 +1472,11 @@ class CI_DB_active_record extends CI_DB_driver {
$this->set($set);
}
- if (count($this->ar_set) == 0)
+ if ($this->_validate_update($table) === FALSE)
{
- 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);
@@ -1294,12 +1487,45 @@ class CI_DB_active_record extends CI_DB_driver {
$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);
-
+ $sql = $this->_update($this->_protect_identifiers($this->ar_from[0], TRUE, NULL, FALSE), $this->ar_set, $this->ar_where, $this->ar_orderby, $this->ar_limit, $this->ar_like);
$this->_reset_write();
return $this->query($sql);
}
+ // --------------------------------------------------------------------
+
+ /**
+ * Validate Update
+ *
+ * This method is used by both update() and get_compiled_update() to
+ * validate that data is actually being set and that a table has been
+ * chosen to be update.
+ *
+ * @access public
+ * @param string the table to update data on
+ * @return bool
+ */
+ protected function _validate_update($table = '')
+ {
+ if (count($this->ar_set) == 0)
+ {
+ return ($this->db_debug) ? $this->display_error('db_must_use_set') : FALSE;
+ }
+
+ if ($table == '')
+ {
+ if ( ! isset($this->ar_from[0]))
+ {
+ return ($this->db_debug) ? $this->display_error('db_must_set_table') : FALSE;
+ }
+ }
+ else
+ {
+ $this->ar_from[0] = $table;
+ }
+
+ return TRUE;
+ }
// --------------------------------------------------------------------
@@ -1311,7 +1537,7 @@ class CI_DB_active_record extends CI_DB_driver {
* @param string the table to retrieve the results from
* @param array an associative array of update values
* @param string the where key
- * @return object
+ * @return bool
*/
public function update_batch($table = '', $set = NULL, $index = NULL)
{
@@ -1320,12 +1546,7 @@ class CI_DB_active_record extends CI_DB_driver {
if (is_null($index))
{
- if ($this->db_debug)
- {
- return $this->display_error('db_must_use_index');
- }
-
- return FALSE;
+ return ($this->db_debug) ? $this->display_error('db_must_use_index') : FALSE;
}
if ( ! is_null($set))
@@ -1333,39 +1554,29 @@ class CI_DB_active_record extends CI_DB_driver {
$this->set_update_batch($set, $index);
}
- if (count($this->ar_set) == 0)
+ if (count($this->ar_set) === 0)
{
- if ($this->db_debug)
- {
- return $this->display_error('db_must_use_set');
- }
-
- return FALSE;
+ return ($this->db_debug) ? $this->display_error('db_must_use_set') : FALSE;
}
if ($table == '')
{
if ( ! isset($this->ar_from[0]))
{
- if ($this->db_debug)
- {
- return $this->display_error('db_must_set_table');
- }
- return FALSE;
+ return ($this->db_debug) ? $this->display_error('db_must_set_table') : FALSE;
}
$table = $this->ar_from[0];
}
// Batch this baby
- for ($i = 0, $total = count($this->ar_set); $i < $total; $i = $i + 100)
+ for ($i = 0, $total = count($this->ar_set); $i < $total; $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->query($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->_reset_write();
+ return TRUE;
}
// --------------------------------------------------------------------
@@ -1391,7 +1602,6 @@ class CI_DB_active_record extends CI_DB_driver {
{
$index_set = FALSE;
$clean = array();
-
foreach ($v as $k2 => $v2)
{
if ($k2 == $index)
@@ -1403,14 +1613,7 @@ class CI_DB_active_record extends CI_DB_driver {
$not[] = $k.'-'.$v;
}
- if ($escape === FALSE)
- {
- $clean[$this->_protect_identifiers($k2)] = $v2;
- }
- else
- {
- $clean[$this->_protect_identifiers($k2)] = $this->escape($v2);
- }
+ $clean[$this->_protect_identifiers($k2)] = ($escape === FALSE) ? $v2 : $this->escape($v2);
}
if ($index_set == FALSE)
@@ -1440,11 +1643,7 @@ class CI_DB_active_record extends CI_DB_driver {
{
if ( ! isset($this->ar_from[0]))
{
- if ($this->db_debug)
- {
- return $this->display_error('db_must_set_table');
- }
- return FALSE;
+ return ($this->db_debug) ? $this->display_error('db_must_set_table') : FALSE;
}
$table = $this->ar_from[0];
@@ -1455,9 +1654,7 @@ class CI_DB_active_record extends CI_DB_driver {
}
$sql = $this->_delete($table);
-
$this->_reset_write();
-
return $this->query($sql);
}
@@ -1479,11 +1676,7 @@ class CI_DB_active_record extends CI_DB_driver {
{
if ( ! isset($this->ar_from[0]))
{
- if ($this->db_debug)
- {
- return $this->display_error('db_must_set_table');
- }
- return FALSE;
+ return ($this->db_debug) ? $this->display_error('db_must_set_table') : FALSE;
}
$table = $this->ar_from[0];
@@ -1494,15 +1687,33 @@ class CI_DB_active_record extends CI_DB_driver {
}
$sql = $this->_truncate($table);
-
$this->_reset_write();
-
return $this->query($sql);
}
// --------------------------------------------------------------------
/**
+ * Get DELETE query string
+ *
+ * Compiles a delete query string and returns the sql
+ *
+ * @access public
+ * @param string the table to delete from
+ * @param boolean TRUE: reset AR values; FALSE: leave AR values alone
+ * @return string
+ */
+ public function get_compiled_delete($table = '', $reset = TRUE)
+ {
+ $this->return_delete_sql = TRUE;
+ $sql = $this->delete($table, '', NULL, $reset);
+ $this->return_delete_sql = FALSE;
+ return $sql;
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Delete
*
* Compiles a delete string and runs the query
@@ -1522,11 +1733,7 @@ class CI_DB_active_record extends CI_DB_driver {
{
if ( ! isset($this->ar_from[0]))
{
- if ($this->db_debug)
- {
- return $this->display_error('db_must_set_table');
- }
- return FALSE;
+ return ($this->db_debug) ? $this->display_error('db_must_set_table') : FALSE;
}
$table = $this->ar_from[0];
@@ -1556,24 +1763,18 @@ class CI_DB_active_record extends CI_DB_driver {
$this->limit($limit);
}
- if (count($this->ar_where) == 0 && count($this->ar_wherein) == 0 && count($this->ar_like) == 0)
+ if (count($this->ar_where) === 0 && count($this->ar_wherein) === 0 && count($this->ar_like) === 0)
{
- if ($this->db_debug)
- {
- return $this->display_error('db_del_must_use_where');
- }
-
- return FALSE;
+ return ($this->db_debug) ? $this->display_error('db_del_must_use_where') : FALSE;
}
$sql = $this->_delete($table, $this->ar_where, $this->ar_like, $this->ar_limit);
-
if ($reset_data)
{
$this->_reset_write();
}
- return $this->query($sql);
+ return ($this->return_delete_sql === TRUE) ? $sql : $this->query($sql);
}
// --------------------------------------------------------------------
@@ -1640,13 +1841,13 @@ class CI_DB_active_record extends CI_DB_driver {
}
// if a table alias is used we can recognize it by a space
- if (strpos($table, " ") !== FALSE)
+ 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, " "));
+ $table = trim(strrchr($table, ' '));
// Store the alias, if it doesn't already exist
if ( ! in_array($table, $this->ar_aliased_tables))
@@ -1671,10 +1872,7 @@ class CI_DB_active_record extends CI_DB_driver {
// 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;
@@ -1683,7 +1881,7 @@ class CI_DB_active_record extends CI_DB_driver {
{
$sql = ( ! $this->ar_distinct) ? 'SELECT ' : 'SELECT DISTINCT ';
- if (count($this->ar_select) == 0)
+ if (count($this->ar_select) === 0)
{
$sql .= '*';
}
@@ -1702,32 +1900,19 @@ class CI_DB_active_record extends CI_DB_driver {
}
}
- // ----------------------------------------------------------------
-
// Write the "FROM" portion of the query
-
if (count($this->ar_from) > 0)
{
- $sql .= "\nFROM ";
-
- $sql .= $this->_from_tables($this->ar_from);
+ $sql .= "\nFROM ".$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);
+ $sql .= "\n".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 .= "\nWHERE ";
@@ -1735,10 +1920,7 @@ class CI_DB_active_record extends CI_DB_driver {
$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)
@@ -1749,50 +1931,32 @@ class CI_DB_active_record extends CI_DB_driver {
$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);
+ $sql .= "\nGROUP BY ".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);
+ $sql .= "\nHAVING ".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);
-
+ $sql .= "\nORDER BY ".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 $this->_limit($sql."\n", $this->ar_limit, $this->ar_offset);
}
return $sql;
@@ -1852,14 +2016,12 @@ class CI_DB_active_record extends CI_DB_driver {
foreach ($fields as $val)
{
// There are some built in keys we need to ignore for this conversion
- if ($val != '_parent_name')
+ if ($val !== '_parent_name')
{
-
$i = 0;
foreach ($out[$val] as $data)
{
- $array[$i][$val] = $data;
- $i++;
+ $array[$i++][$val] = $data;
}
}
}
@@ -1934,7 +2096,7 @@ class CI_DB_active_record extends CI_DB_driver {
*/
protected function _merge_cache()
{
- if (count($this->ar_cache_exists) == 0)
+ if (count($this->ar_cache_exists) === 0)
{
return;
}
@@ -1944,7 +2106,7 @@ class CI_DB_active_record extends CI_DB_driver {
$ar_variable = 'ar_'.$val;
$ar_cache_var = 'ar_cache_'.$val;
- if (count($this->$ar_cache_var) == 0)
+ if (count($this->$ar_cache_var) === 0)
{
continue;
}
@@ -1965,6 +2127,21 @@ class CI_DB_active_record extends CI_DB_driver {
// --------------------------------------------------------------------
/**
+ * Reset Active Record values.
+ *
+ * Publicly-visible method to reset the AR values.
+ *
+ * @return void
+ */
+ public function reset_query()
+ {
+ $this->_reset_select();
+ $this->_reset_write();
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Resets the active record values. Called by the get() function
*
* @param array An array of fields to reset
@@ -1990,25 +2167,24 @@ class CI_DB_active_record extends CI_DB_driver {
*/
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,
- );
-
- $this->_reset_run($ar_reset_items);
+ $this->_reset_run(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
+ )
+ );
}
// --------------------------------------------------------------------
@@ -2022,20 +2198,20 @@ class CI_DB_active_record extends CI_DB_driver {
*/
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
- );
-
- $this->_reset_run($ar_reset_items);
+ $this->_reset_run(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
+ )
+ );
}
+
}
/* End of file DB_active_rec.php */
-/* Location: ./system/database/DB_active_rec.php */ \ No newline at end of file
+/* Location: ./system/database/DB_active_rec.php */
diff --git a/system/database/DB_cache.php b/system/database/DB_cache.php
index ad1c28d72..79651fcb0 100644
--- a/system/database/DB_cache.php
+++ b/system/database/DB_cache.php
@@ -1,42 +1,45 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* Database Cache Class
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_Cache {
- var $CI;
- var $db; // allows passing of db object so that multiple database connections and returned db objects can be supported
+ public $CI;
+ public $db; // allows passing of db object so that multiple database connections and returned db objects can be supported
- /**
- * Constructor
- *
- * Grabs the CI super object instance so we can access it.
- *
- */
- function __construct(&$db)
+ public function __construct(&$db)
{
- // Assign the main CI object to $this->CI
- // and load the file helper since we use it a lot
+ // Assign the main CI object to $this->CI and load the file helper since we use it a lot
$this->CI =& get_instance();
$this->db =& $db;
$this->CI->load->helper('file');
@@ -47,11 +50,10 @@ class CI_DB_Cache {
/**
* Set Cache Directory Path
*
- * @access public
* @param string the path to the cache directory
* @return bool
*/
- function check_path($path = '')
+ public function check_path($path = '')
{
if ($path == '')
{
@@ -64,7 +66,7 @@ class CI_DB_Cache {
}
// Add a trailing slash to the path if needed
- $path = preg_replace("/(.+?)\/*$/", "\\1/", $path);
+ $path = preg_replace('/(.+?)\/*$/', '\\1/', $path);
if ( ! is_dir($path) OR ! is_really_writable($path))
{
@@ -84,10 +86,9 @@ class CI_DB_Cache {
* 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)
+ public function read($sql)
{
if ( ! $this->check_path())
{
@@ -95,9 +96,7 @@ class CI_DB_Cache {
}
$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)))
@@ -113,10 +112,9 @@ class CI_DB_Cache {
/**
* Write a query to a cache file
*
- * @access public
* @return bool
*/
- function write($sql, $object)
+ public function write($sql, $object)
{
if ( ! $this->check_path())
{
@@ -124,11 +122,8 @@ class CI_DB_Cache {
}
$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))
@@ -155,10 +150,9 @@ class CI_DB_Cache {
/**
* Delete cache files within a particular directory
*
- * @access public
* @return bool
*/
- function delete($segment_one = '', $segment_two = '')
+ public function delete($segment_one = '', $segment_two = '')
{
if ($segment_one == '')
{
@@ -171,7 +165,6 @@ class CI_DB_Cache {
}
$dir_path = $this->db->cachedir.$segment_one.'+'.$segment_two.'/';
-
delete_files($dir_path, TRUE);
}
@@ -180,16 +173,14 @@ class CI_DB_Cache {
/**
* Delete all existing cache files
*
- * @access public
* @return bool
*/
- function delete_all()
+ public 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
+/* Location: ./system/database/DB_cache.php */
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 4dfb584f2..6352c731e 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -25,7 +37,7 @@
* @package CodeIgniter
* @subpackage Drivers
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_driver {
@@ -69,8 +81,7 @@ class CI_DB_driver {
var $stmt_id;
var $curs_id;
var $limit_used;
-
-
+
/**
* Constructor. Accepts one parameter containing the database
@@ -96,11 +107,9 @@ class CI_DB_driver {
/**
* Initialize Database Settings
*
- * @access private Called by the constructor
- * @param mixed
- * @return void
+ * @return bool
*/
- function initialize()
+ public function initialize()
{
// If an existing connection resource is available
// there is no need to connect and select the database
@@ -114,46 +123,61 @@ class CI_DB_driver {
// Connect to the database and set the connection ID
$this->conn_id = ($this->pconnect == FALSE) ? $this->db_connect() : $this->db_pconnect();
- // No connection resource? Throw an error
+ // No connection resource? Check if there is a failover else throw an error
if ( ! $this->conn_id)
{
- log_message('error', 'Unable to connect to the database');
-
- if ($this->db_debug)
+ // Check if there is a failover set
+ if ( ! empty($this->failover) && is_array($this->failover))
{
- $this->display_error('db_unable_to_connect');
- }
- return FALSE;
- }
+ // Go over all the failovers
+ foreach ($this->failover as $failover)
+ {
+ // Replace the current settings with those of the failover
+ foreach ($failover as $key => $val)
+ {
+ $this->$key = $val;
+ }
- // ----------------------------------------------------------------
+ // Try to connect
+ $this->conn_id = ($this->pconnect == FALSE) ? $this->db_connect() : $this->db_pconnect();
- // Select the DB... assuming a database name is specified in the config file
- if ($this->database != '')
- {
- if ( ! $this->db_select())
+ // If a connection is made break the foreach loop
+ if ($this->conn_id)
+ {
+ break;
+ }
+ }
+ }
+
+ // We still don't have a connection?
+ if ( ! $this->conn_id)
{
- log_message('error', 'Unable to select database: '.$this->database);
+ log_message('error', 'Unable to connect to the database');
if ($this->db_debug)
{
- $this->display_error('db_unable_to_select', $this->database);
+ $this->display_error('db_unable_to_connect');
}
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;
+ // ----------------------------------------------------------------
+
+ // Select the DB... assuming a database name is specified in the config file
+ if ($this->database !== '' && ! $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;
+ // Now we set the character set and that's all
+ return $this->db_set_charset($this->char_set, $this->dbcollat);
}
// --------------------------------------------------------------------
@@ -218,7 +242,7 @@ class CI_DB_driver {
// 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', 'cubrid');
+ $driver_version_exceptions = array('oci8', 'sqlite', 'cubrid', 'pdo', 'mysqli');
if (in_array($this->dbdriver, $driver_version_exceptions))
{
@@ -251,9 +275,10 @@ class CI_DB_driver {
{
if ($sql == '')
{
+ log_message('error', 'Invalid query: '.$sql);
+
if ($this->db_debug)
{
- log_message('error', 'Invalid query: '.$sql);
return $this->display_error('db_invalid_query');
}
return FALSE;
@@ -306,21 +331,23 @@ class CI_DB_driver {
// This will trigger a rollback if transactions are being used
$this->_trans_status = FALSE;
+ // 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();
+
+ // Log errors
+ log_message('error', 'Query error: '.$error_msg);
+
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);
+ // Display errors
return $this->display_error(
array(
'Error Number: '.$error_no,
@@ -507,6 +534,7 @@ class CI_DB_driver {
}
$this->trans_begin($test_mode);
+ $this->_trans_depth += 1;
}
// --------------------------------------------------------------------
@@ -530,6 +558,10 @@ class CI_DB_driver {
$this->_trans_depth -= 1;
return TRUE;
}
+ else
+ {
+ $this->_trans_depth = 0;
+ }
// The query() function will set this flag to FALSE in the event that a query failed
if ($this->_trans_status === FALSE)
@@ -767,20 +799,23 @@ class CI_DB_driver {
if ($query->num_rows() > 0)
{
- foreach ($query->result_array() as $row)
+ $table = FALSE;
+ $rows = $query->result_array();
+ $key = (($row = current($rows)) && in_array('table_name', array_map('strtolower', array_keys($row))));
+
+ if ($key)
{
- if (isset($row['TABLE_NAME']))
- {
- $retval[] = $row['TABLE_NAME'];
- }
- else
- {
- $retval[] = array_shift($row);
- }
+ $table = array_key_exists('TABLE_NAME', $row) ? 'TABLE_NAME' : 'table_name';
+ }
+
+ foreach ($rows as $row)
+ {
+ $retval[] = ( ! $table) ? current($row) : $row[$table];
}
}
$this->data_cache['table_names'] = $retval;
+
return $this->data_cache['table_names'];
}
@@ -947,6 +982,7 @@ class CI_DB_driver {
foreach ($where as $key => $val)
{
$prefix = (count($dest) == 0) ? '' : ' AND ';
+ $key = $this->_protect_identifiers($key);
if ($val !== '')
{
@@ -1015,6 +1051,7 @@ class CI_DB_driver {
else
{
$args = (func_num_args() > 1) ? array_splice(func_get_args(), 1) : null;
+
if (is_null($args))
{
return call_user_func($function);
@@ -1168,7 +1205,7 @@ class CI_DB_driver {
if ($native == TRUE)
{
- $message = $error;
+ $message = (array) $error;
}
else
{
@@ -1405,6 +1442,5 @@ class CI_DB_driver {
}
-
/* End of file DB_driver.php */
-/* Location: ./system/database/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 6bc40411b..336e9497d 100644
--- a/system/database/DB_forge.php
+++ b/system/database/DB_forge.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
- * Code Igniter
+ * CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -19,28 +31,22 @@
* Database Utility Class
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_forge {
- var $fields = array();
- var $keys = array();
- var $primary_keys = array();
- var $db_char_set = '';
+ public $fields = array();
+ public $keys = array();
+ public $primary_keys = array();
+ public $db_char_set = '';
- /**
- * Constructor
- *
- * Grabs the CI super object instance so we can access it.
- *
- */
- function __construct()
+ public function __construct()
{
// Assign the main database object to $this->db
$CI =& get_instance();
$this->db =& $CI->db;
- log_message('debug', "Database Forge Class Initialized");
+ log_message('debug', 'Database Forge Class Initialized');
}
// --------------------------------------------------------------------
@@ -48,20 +54,13 @@ class CI_DB_forge {
/**
* Create database
*
- * @access public
* @param string the database name
* @return bool
*/
- function create_database($db_name)
+ public function create_database($db_name)
{
$sql = $this->_create_database($db_name);
-
- if (is_bool($sql))
- {
- return $sql;
- }
-
- return $this->db->query($sql);
+ return is_bool($sql) ? $sql : $this->db->query($sql);
}
// --------------------------------------------------------------------
@@ -69,20 +68,13 @@ class CI_DB_forge {
/**
* Drop database
*
- * @access public
* @param string the database name
* @return bool
*/
- function drop_database($db_name)
+ public function drop_database($db_name)
{
$sql = $this->_drop_database($db_name);
-
- if (is_bool($sql))
- {
- return $sql;
- }
-
- return $this->db->query($sql);
+ return is_bool($sql) ? $sql : $this->db->query($sql);
}
// --------------------------------------------------------------------
@@ -90,12 +82,11 @@ class CI_DB_forge {
/**
* Add Key
*
- * @access public
* @param string key
* @param string type
- * @return void
+ * @return object
*/
- function add_key($key = '', $primary = FALSE)
+ public function add_key($key = '', $primary = FALSE)
{
if (is_array($key))
{
@@ -120,6 +111,8 @@ class CI_DB_forge {
{
$this->keys[] = $key;
}
+
+ return $this;
}
// --------------------------------------------------------------------
@@ -127,11 +120,10 @@ class CI_DB_forge {
/**
* Add Field
*
- * @access public
* @param string collation
- * @return void
+ * @return object
*/
- function add_field($field = '')
+ public function add_field($field = '')
{
if ($field == '')
{
@@ -140,15 +132,15 @@ class CI_DB_forge {
if (is_string($field))
{
- if ($field == 'id')
+ if ($field === 'id')
{
$this->add_field(array(
- 'id' => array(
- 'type' => 'INT',
- 'constraint' => 9,
- 'auto_increment' => TRUE
- )
- ));
+ 'id' => array(
+ 'type' => 'INT',
+ 'constraint' => 9,
+ 'auto_increment' => TRUE
+ )
+ ));
$this->add_key('id', TRUE);
}
else
@@ -167,6 +159,7 @@ class CI_DB_forge {
$this->fields = array_merge($this->fields, $field);
}
+ return $this;
}
// --------------------------------------------------------------------
@@ -174,26 +167,24 @@ class CI_DB_forge {
/**
* Create Table
*
- * @access public
* @param string the table name
* @return bool
*/
- function create_table($table = '', $if_not_exists = FALSE)
+ public 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)
+ 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);
+ return is_bool($sql) ? $sql : $this->db->query($sql);
}
// --------------------------------------------------------------------
@@ -201,20 +192,13 @@ class CI_DB_forge {
/**
* Drop Table
*
- * @access public
* @param string the table name
* @return bool
*/
- function drop_table($table_name)
+ public 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);
+ return is_bool($sql) ? $sql : $this->db->query($sql);
}
// --------------------------------------------------------------------
@@ -222,20 +206,18 @@ class CI_DB_forge {
/**
* 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)
+ public 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($this->db->dbprefix.$table_name, $this->db->dbprefix.$new_table_name);
- return $this->db->query($sql);
+ return $this->db->query($this->_rename_table($this->db->dbprefix.$table_name, $this->db->dbprefix.$new_table_name));
}
// --------------------------------------------------------------------
@@ -243,13 +225,12 @@ class CI_DB_forge {
/**
* 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 = '')
+ public function add_column($table = '', $field = array(), $after_field = '')
{
if ($table == '')
{
@@ -258,8 +239,7 @@ class CI_DB_forge {
// 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 (array_keys($field) as $k)
{
$this->add_field(array($k => $field[$k]));
@@ -269,7 +249,6 @@ class CI_DB_forge {
}
$sql = $this->_alter_table('ADD', $this->db->dbprefix.$table, $this->fields, $after_field);
-
$this->_reset();
if ($this->db->query($sql) === FALSE)
@@ -279,7 +258,6 @@ class CI_DB_forge {
}
return TRUE;
-
}
// --------------------------------------------------------------------
@@ -287,14 +265,12 @@ class CI_DB_forge {
/**
* Column Drop
*
- * @access public
* @param string the table name
* @param string the column name
* @return bool
*/
- function drop_column($table = '', $column_name = '')
+ public function drop_column($table = '', $column_name = '')
{
-
if ($table == '')
{
show_error('A table name is required for that operation.');
@@ -305,9 +281,7 @@ class CI_DB_forge {
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);
+ return $this->db->query($this->_alter_table('DROP', $this->db->dbprefix.$table, $column_name));
}
// --------------------------------------------------------------------
@@ -315,13 +289,12 @@ class CI_DB_forge {
/**
* 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())
+ public function modify_column($table = '', $field = array())
{
if ($table == '')
{
@@ -330,8 +303,7 @@ class CI_DB_forge {
// 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 (array_keys($field) as $k)
{
// If no name provided, use the current name
if ( ! isset($field[$k]['name']))
@@ -340,14 +312,12 @@ class CI_DB_forge {
}
$this->add_field(array($k => $field[$k]));
-
- if (count($this->fields) == 0)
+ if (count($this->fields) === 0)
{
show_error('Field information is required.');
}
$sql = $this->_alter_table('CHANGE', $this->db->dbprefix.$table, $this->fields);
-
$this->_reset();
if ($this->db->query($sql) === FALSE)
@@ -366,17 +336,14 @@ class CI_DB_forge {
*
* Resets table creation vars
*
- * @access private
* @return void
*/
- function _reset()
+ protected function _reset()
{
- $this->fields = array();
- $this->keys = array();
- $this->primary_keys = array();
+ $this->fields = $this->keys = $this->primary_keys = array();
}
}
/* End of file DB_forge.php */
-/* Location: ./system/database/DB_forge.php */ \ No newline at end of file
+/* Location: ./system/database/DB_forge.php */
diff --git a/system/database/DB_result.php b/system/database/DB_result.php
index 48d66c8e4..730443222 100644
--- a/system/database/DB_result.php
+++ b/system/database/DB_result.php
@@ -1,20 +1,30 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* Database Result Class
*
@@ -23,32 +33,30 @@
* class for the specific database will extend and instantiate it.
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_result {
- var $conn_id = NULL;
- var $result_id = NULL;
- var $result_array = array();
- var $result_object = array();
- var $custom_result_object = array();
- var $current_row = 0;
- var $num_rows = 0;
- var $row_data = NULL;
-
+ public $conn_id = NULL;
+ public $result_id = NULL;
+ public $result_array = array();
+ public $result_object = array();
+ public $custom_result_object = array();
+ public $current_row = 0;
+ public $num_rows = 0;
+ public $row_data = NULL;
/**
* 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
*/
public function result($type = 'object')
{
- if ($type == 'array') return $this->result_array();
- else if ($type == 'object') return $this->result_object();
+ if ($type === 'array') return $this->result_array();
+ elseif ($type === 'object') return $this->result_object();
else return $this->custom_result_object($type);
}
@@ -57,8 +65,8 @@ class CI_DB_result {
/**
* Custom query result.
*
- * @param class_name A string that represents the type of object you want back
- * @return array of objects
+ * @param string A string that represents the type of object you want back
+ * @return array of objects
*/
public function custom_result_object($class_name)
{
@@ -79,7 +87,6 @@ class CI_DB_result {
while ($row = $this->_fetch_object())
{
$object = new $class_name();
-
foreach ($row as $key => $value)
{
$object->$key = $value;
@@ -97,7 +104,6 @@ class CI_DB_result {
/**
* Query result. "object" version.
*
- * @access public
* @return object
*/
public function result_object()
@@ -129,7 +135,6 @@ class CI_DB_result {
/**
* Query result. "array" version.
*
- * @access public
* @return array
*/
public function result_array()
@@ -161,7 +166,6 @@ class CI_DB_result {
/**
* 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
@@ -185,8 +189,8 @@ class CI_DB_result {
$n = 0;
}
- if ($type == 'object') return $this->row_object($n);
- else if ($type == 'array') return $this->row_array($n);
+ if ($type === 'object') return $this->row_object($n);
+ elseif ($type === 'array') return $this->row_array($n);
else return $this->custom_row_object($n, $type);
}
@@ -195,8 +199,7 @@ class CI_DB_result {
/**
* Assigns an item into a particular column slot
*
- * @access public
- * @return object
+ * @return void
*/
public function set_row($key, $value = NULL)
{
@@ -212,7 +215,6 @@ class CI_DB_result {
{
$this->row_data[$k] = $v;
}
-
return;
}
@@ -227,14 +229,12 @@ class CI_DB_result {
/**
* Returns a single result row - custom object version
*
- * @access public
* @return object
*/
public function custom_row_object($n, $type)
{
$result = $this->custom_result_object($type);
-
- if (count($result) == 0)
+ if (count($result) === 0)
{
return $result;
}
@@ -250,14 +250,12 @@ class CI_DB_result {
/**
* Returns a single result row - object version
*
- * @access public
* @return object
*/
public function row_object($n = 0)
{
$result = $this->result_object();
-
- if (count($result) == 0)
+ if (count($result) === 0)
{
return $result;
}
@@ -275,14 +273,12 @@ class CI_DB_result {
/**
* Returns a single result row - array version
*
- * @access public
* @return array
*/
public function row_array($n = 0)
{
$result = $this->result_array();
-
- if (count($result) == 0)
+ if (count($result) === 0)
{
return $result;
}
@@ -301,18 +297,12 @@ class CI_DB_result {
/**
* Returns the "first" row
*
- * @access public
* @return object
*/
public function first_row($type = 'object')
{
$result = $this->result($type);
-
- if (count($result) == 0)
- {
- return $result;
- }
- return $result[0];
+ return (count($result) === 0) ? $result : $result[0];
}
// --------------------------------------------------------------------
@@ -320,18 +310,12 @@ class CI_DB_result {
/**
* Returns the "last" row
*
- * @access public
* @return object
*/
public function last_row($type = 'object')
{
$result = $this->result($type);
-
- if (count($result) == 0)
- {
- return $result;
- }
- return $result[count($result) -1];
+ return (count($result) === 0) ? $result : $result[count($result) - 1];
}
// --------------------------------------------------------------------
@@ -339,14 +323,12 @@ class CI_DB_result {
/**
* Returns the "next" row
*
- * @access public
* @return object
*/
public function next_row($type = 'object')
{
$result = $this->result($type);
-
- if (count($result) == 0)
+ if (count($result) === 0)
{
return $result;
}
@@ -364,14 +346,12 @@ class CI_DB_result {
/**
* Returns the "previous" row
*
- * @access public
* @return object
*/
public function previous_row($type = 'object')
{
$result = $this->result($type);
-
- if (count($result) == 0)
+ if (count($result) === 0)
{
return $result;
}
@@ -404,7 +384,6 @@ class CI_DB_result {
protected function _fetch_object() { return array(); }
}
-// END DB_result class
/* End of file DB_result.php */
/* Location: ./system/database/DB_result.php */
diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php
index 52196b7ce..4c881d8a1 100644
--- a/system/database/DB_utility.php
+++ b/system/database/DB_utility.php
@@ -1,45 +1,48 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
- * Code Igniter
+ * CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* Database Utility Class
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_utility extends CI_DB_forge {
- var $db;
- var $data_cache = array();
+ public $db;
+ public $data_cache = array();
- /**
- * Constructor
- *
- * Grabs the CI super object instance so we can access it.
- *
- */
- function __construct()
+ public function __construct()
{
// Assign the main database object to $this->db
$CI =& get_instance();
$this->db =& $CI->db;
-
- log_message('debug', "Database Utility Class Initialized");
+ log_message('debug', 'Database Utility Class Initialized');
}
// --------------------------------------------------------------------
@@ -47,10 +50,9 @@ class CI_DB_utility extends CI_DB_forge {
/**
* List databases
*
- * @access public
* @return bool
*/
- function list_databases()
+ public function list_databases()
{
// Is there a cached result?
if (isset($this->data_cache['db_names']))
@@ -68,8 +70,7 @@ class CI_DB_utility extends CI_DB_forge {
}
}
- $this->data_cache['db_names'] = $dbs;
- return $this->data_cache['db_names'];
+ return $this->data_cache['db_names'] = $dbs;
}
// --------------------------------------------------------------------
@@ -77,11 +78,10 @@ class CI_DB_utility extends CI_DB_forge {
/**
* Determine if a particular database exists
*
- * @access public
* @param string
* @return boolean
*/
- function database_exists($database_name)
+ public function database_exists($database_name)
{
// Some databases won't have access to the list_databases() function, so
// this is intended to allow them to override with their own functions as
@@ -102,17 +102,17 @@ class CI_DB_utility extends CI_DB_forge {
/**
* Optimize Table
*
- * @access public
* @param string the table name
* @return bool
*/
- function optimize_table($table_name)
+ public function optimize_table($table_name)
{
$sql = $this->_optimize_table($table_name);
if (is_bool($sql))
{
- show_error('db_must_use_set');
+ show_error('db_must_use_set');
+ return FALSE;
}
$query = $this->db->query($sql);
@@ -128,10 +128,9 @@ class CI_DB_utility extends CI_DB_forge {
/**
* Optimize Database
*
- * @access public
* @return array
*/
- function optimize_database()
+ public function optimize_database()
{
$result = array();
foreach ($this->db->list_tables() as $table_name)
@@ -165,11 +164,10 @@ class CI_DB_utility extends CI_DB_forge {
/**
* Repair Table
*
- * @access public
* @param string the table name
* @return bool
*/
- function repair_table($table_name)
+ public function repair_table($table_name)
{
$sql = $this->_repair_table($table_name);
@@ -191,14 +189,13 @@ class CI_DB_utility extends CI_DB_forge {
/**
* 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 = '"')
+ public function csv_from_result($query, $delim = ',', $newline = "\n", $enclosure = '"')
{
if ( ! is_object($query) OR ! method_exists($query, 'list_fields'))
{
@@ -206,15 +203,13 @@ class CI_DB_utility extends CI_DB_forge {
}
$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;
+ $out = rtrim($out).$newline;
// Next blast through the result array and build out the rows
foreach ($query->result_array() as $row)
@@ -223,8 +218,7 @@ class CI_DB_utility extends CI_DB_forge {
{
$out .= $enclosure.str_replace($enclosure, $enclosure.$enclosure, $item).$enclosure.$delim;
}
- $out = rtrim($out);
- $out .= $newline;
+ $out = rtrim($out).$newline;
}
return $out;
@@ -235,12 +229,11 @@ class CI_DB_utility extends CI_DB_forge {
/**
* 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())
+ public function xml_from_result($query, $params = array())
{
if ( ! is_object($query) OR ! method_exists($query, 'list_fields'))
{
@@ -268,16 +261,14 @@ class CI_DB_utility extends CI_DB_forge {
foreach ($query->result_array() as $row)
{
$xml .= $tab."<{$element}>".$newline;
-
foreach ($row as $key => $val)
{
$xml .= $tab.$tab."<{$key}>".xml_convert($val)."</{$key}>".$newline;
}
$xml .= $tab."</{$element}>".$newline;
}
- $xml .= "</$root>".$newline;
- return $xml;
+ return $xml .= "</$root>".$newline;
}
// --------------------------------------------------------------------
@@ -285,10 +276,9 @@ class CI_DB_utility extends CI_DB_forge {
/**
* Database Backup
*
- * @access public
* @return void
*/
- function backup($params = array())
+ public function backup($params = array())
{
// If the parameters have not been submitted as an
// array then we know that it is simply the table
@@ -302,14 +292,14 @@ class CI_DB_utility extends CI_DB_forge {
// 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"
- );
+ '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)
@@ -323,29 +313,23 @@ class CI_DB_utility extends CI_DB_forge {
}
}
- // ------------------------------------------------------
-
// 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)
+ 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
+ // 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 (($prefs['format'] === 'gzip' AND ! @function_exists('gzencode'))
+ OR ($prefs['format'] === 'zip' AND ! @function_exists('gzcompress')))
{
if ($this->db->db_debug)
{
@@ -355,60 +339,49 @@ class CI_DB_utility extends CI_DB_forge {
$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 ($prefs['format'] === 'zip')
{
- // If they included the .zip file extension we'll remove it
- if (preg_match("|.+?\.zip$|", $prefs['filename']))
+ // Set the filename if not provided (only needed with Zip files)
+ if ($prefs['filename'] == '')
{
- $prefs['filename'] = str_replace('.zip', '', $prefs['filename']);
+ $prefs['filename'] = (count($prefs['tables']) === 1 ? $prefs['tables'] : $this->db->database)
+ .date('Y-m-d_H-i', time()).'.sql';
}
-
- // Tack on the ".sql" file extension if needed
- if ( ! preg_match("|.+?\.sql$|", $prefs['filename']))
+ else
{
- $prefs['filename'] .= '.sql';
+ // 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();
}
+ elseif ($prefs['format'] == 'txt') // Was a text file requested?
+ {
+ return $this->_backup($prefs);
+ }
+ elseif ($prefs['format'] === 'gzip') // Was a Gzip file requested?
+ {
+ return gzencode($this->_backup($prefs));
+ }
+ return;
}
}
-
/* End of file DB_utility.php */
-/* Location: ./system/database/DB_utility.php */ \ No newline at end of file
+/* Location: ./system/database/DB_utility.php */
diff --git a/system/database/drivers/cubrid/cubrid_driver.php b/system/database/drivers/cubrid/cubrid_driver.php
index d01140412..cde719eae 100644
--- a/system/database/drivers/cubrid/cubrid_driver.php
+++ b/system/database/drivers/cubrid/cubrid_driver.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author Esen Sagynov
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 2.0.2
* @filesource
diff --git a/system/database/drivers/cubrid/cubrid_forge.php b/system/database/drivers/cubrid/cubrid_forge.php
index bab03f748..85e740057 100644
--- a/system/database/drivers/cubrid/cubrid_forge.php
+++ b/system/database/drivers/cubrid/cubrid_forge.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author Esen Sagynov
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
diff --git a/system/database/drivers/cubrid/cubrid_result.php b/system/database/drivers/cubrid/cubrid_result.php
index 6f0c2b5f7..4c0fede10 100644
--- a/system/database/drivers/cubrid/cubrid_result.php
+++ b/system/database/drivers/cubrid/cubrid_result.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author Esen Sagynov
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 2.0.2
* @filesource
diff --git a/system/database/drivers/cubrid/cubrid_utility.php b/system/database/drivers/cubrid/cubrid_utility.php
index cd16d1e18..750c0d8dd 100644
--- a/system/database/drivers/cubrid/cubrid_utility.php
+++ b/system/database/drivers/cubrid/cubrid_utility.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author Esen Sagynov
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php
index b39bd9360..25a32f364 100644
--- a/system/database/drivers/mssql/mssql_driver.php
+++ b/system/database/drivers/mssql/mssql_driver.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -25,7 +37,7 @@
* @package CodeIgniter
* @subpackage Drivers
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_mssql_driver extends CI_DB {
@@ -102,14 +114,25 @@ class CI_DB_mssql_driver extends CI_DB {
/**
* Select the database
*
- * @access private called by the base class
- * @return resource
+ * @param string database name
+ * @return bool
*/
- function db_select()
+ public function db_select($database = '')
{
+ if ($database === '')
+ {
+ $database = $this->database;
+ }
+
// Note: The brackets are required in the event that the DB name
// contains reserved characters
- return @mssql_select_db('['.$this->database.']', $this->conn_id);
+ if (@mssql_select_db('['.$database.']', $this->conn_id))
+ {
+ $this->database = $database;
+ return TRUE;
+ }
+
+ return FALSE;
}
// --------------------------------------------------------------------
@@ -664,4 +687,4 @@ class CI_DB_mssql_driver extends CI_DB {
/* End of file mssql_driver.php */
-/* Location: ./system/database/drivers/mssql/mssql_driver.php */ \ No newline at end of file
+/* Location: ./system/database/drivers/mssql/mssql_driver.php */
diff --git a/system/database/drivers/mssql/mssql_forge.php b/system/database/drivers/mssql/mssql_forge.php
index 70b20ecf8..dd8aa3448 100644
--- a/system/database/drivers/mssql/mssql_forge.php
+++ b/system/database/drivers/mssql/mssql_forge.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -19,7 +31,7 @@
* MS SQL Forge Class
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_mssql_forge extends CI_DB_forge {
diff --git a/system/database/drivers/mssql/mssql_result.php b/system/database/drivers/mssql/mssql_result.php
index 2897ca5a5..bba2e6243 100644
--- a/system/database/drivers/mssql/mssql_result.php
+++ b/system/database/drivers/mssql/mssql_result.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* This class extends the parent result class: CI_DB_result
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_mssql_result extends CI_DB_result {
diff --git a/system/database/drivers/mssql/mssql_utility.php b/system/database/drivers/mssql/mssql_utility.php
index 48ecbc72a..be6ed5bb0 100644
--- a/system/database/drivers/mssql/mssql_utility.php
+++ b/system/database/drivers/mssql/mssql_utility.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -19,7 +31,7 @@
* MS SQL Utility Class
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_mssql_utility extends CI_DB_utility {
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index f87cfea4b..c88a8a766 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -1,20 +1,30 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* MySQL Database Adapter Class
*
@@ -25,51 +35,52 @@
* @package CodeIgniter
* @subpackage Drivers
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_mysql_driver extends CI_DB {
- var $dbdriver = 'mysql';
+ public $dbdriver = 'mysql';
// The character used for escaping
- var $_escape_char = '`';
+ protected $_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,
- * adding a bit more processing to all queries.
- */
- var $delete_hack = TRUE;
+ protected $_like_escape_str = '';
+ protected $_like_escape_chr = '';
/**
* 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 ';
- var $_random_keyword = ' RAND()'; // database specific random keyword
+ protected $_count_string = 'SELECT COUNT(*) AS ';
+ protected $_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
- *
- * @access private called by the base class
- * @return resource
+ * 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.
*/
- function db_connect()
+ public $delete_hack = TRUE;
+
+ public function __construct($params)
{
+ parent::__construct($params);
+
if ($this->port != '')
{
$this->hostname .= ':'.$this->port;
}
+ }
+ /**
+ * Non-persistent database connection
+ *
+ * @return resource
+ */
+ public function db_connect()
+ {
return @mysql_connect($this->hostname, $this->username, $this->password, TRUE);
}
@@ -78,16 +89,10 @@ class CI_DB_mysql_driver extends CI_DB {
/**
* Persistent database connection
*
- * @access private called by the base class
* @return resource
*/
- function db_pconnect()
+ public function db_pconnect()
{
- if ($this->port != '')
- {
- $this->hostname .= ':'.$this->port;
- }
-
return @mysql_pconnect($this->hostname, $this->username, $this->password);
}
@@ -99,10 +104,9 @@ class CI_DB_mysql_driver extends CI_DB {
* 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()
+ public function reconnect()
{
if (mysql_ping($this->conn_id) === FALSE)
{
@@ -115,12 +119,23 @@ class CI_DB_mysql_driver extends CI_DB {
/**
* Select the database
*
- * @access private called by the base class
- * @return resource
+ * @param string database name
+ * @return bool
*/
- function db_select()
+ public function db_select($database = '')
{
- return @mysql_select_db($this->database, $this->conn_id);
+ if ($database === '')
+ {
+ $database = $this->database;
+ }
+
+ if (@mysql_select_db($database, $this->conn_id))
+ {
+ $this->database = $database;
+ return TRUE;
+ }
+
+ return FALSE;
}
// --------------------------------------------------------------------
@@ -128,27 +143,15 @@ class CI_DB_mysql_driver extends CI_DB {
/**
* Set client character set
*
- * @access public
* @param string
* @param string
- * @return resource
+ * @return bool
*/
- function db_set_charset($charset, $collation)
+ public function db_set_charset($charset, $collation)
{
- if ( ! isset($this->use_set_names))
- {
- // mysql_set_charset() requires PHP >= 5.2.3 and MySQL >= 5.0.7, use SET NAMES as fallback
- $this->use_set_names = (version_compare(PHP_VERSION, '5.2.3', '>=') && version_compare(mysql_get_server_info(), '5.0.7', '>=')) ? FALSE : TRUE;
- }
-
- if ($this->use_set_names === TRUE)
- {
- 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);
- }
+ return function_exists('mysql_set_charset')
+ ? @mysql_set_charset($charset, $this->conn_id)
+ : @mysql_query("SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'", $this->conn_id);
}
// --------------------------------------------------------------------
@@ -156,12 +159,11 @@ class CI_DB_mysql_driver extends CI_DB {
/**
* Version number query string
*
- * @access public
* @return string
*/
- function _version()
+ protected function _version()
{
- return "SELECT version() AS ver";
+ return 'SELECT version() AS ver';
}
// --------------------------------------------------------------------
@@ -169,14 +171,12 @@ class CI_DB_mysql_driver extends CI_DB {
/**
* Execute the query
*
- * @access private called by the base class
* @param string an SQL query
- * @return resource
+ * @return mixed
*/
- function _execute($sql)
+ protected function _execute($sql)
{
- $sql = $this->_prep_query($sql);
- return @mysql_query($sql, $this->conn_id);
+ return @mysql_query($this->_prep_query($sql), $this->conn_id);
}
// --------------------------------------------------------------------
@@ -186,20 +186,16 @@ class CI_DB_mysql_driver extends CI_DB {
*
* 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)
+ protected 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)
+ // mysql_affected_rows() returns 0 for "DELETE FROM TABLE" queries. This hack
+ // modifies the query so that it a proper number of affected rows is returned.
+ if ($this->delete_hack === TRUE && preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $sql))
{
- 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 preg_replace('/^\s*DELETE\s+FROM\s+(\S+)\s*$/', 'DELETE FROM \\1 WHERE 1=1', $sql);
}
return $sql;
@@ -210,18 +206,12 @@ class CI_DB_mysql_driver extends CI_DB {
/**
* Begin Transaction
*
- * @access public
* @return bool
*/
- function trans_begin($test_mode = FALSE)
+ public 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)
+ if ( ! $this->trans_enabled OR $this->_trans_depth > 0)
{
return TRUE;
}
@@ -229,7 +219,7 @@ class CI_DB_mysql_driver extends CI_DB {
// Reset the transaction failure flag.
// If the $test_mode flag is set to TRUE transactions will be rolled back
// even if the queries produce a successful result.
- $this->_trans_failure = ($test_mode === TRUE) ? TRUE : FALSE;
+ $this->_trans_failure = ($test_mode === TRUE);
$this->simple_query('SET AUTOCOMMIT=0');
$this->simple_query('START TRANSACTION'); // can also be BEGIN or BEGIN WORK
@@ -241,18 +231,12 @@ class CI_DB_mysql_driver extends CI_DB {
/**
* Commit Transaction
*
- * @access public
* @return bool
*/
- function trans_commit()
+ public 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)
+ if ( ! $this->trans_enabled OR $this->_trans_depth > 0)
{
return TRUE;
}
@@ -267,18 +251,12 @@ class CI_DB_mysql_driver extends CI_DB {
/**
* Rollback Transaction
*
- * @access public
* @return bool
*/
- function trans_rollback()
+ public 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)
+ if ( ! $this->trans_enabled OR $this->_trans_depth > 0)
{
return TRUE;
}
@@ -293,12 +271,11 @@ class CI_DB_mysql_driver extends CI_DB {
/**
* 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)
+ public function escape_str($str, $like = FALSE)
{
if (is_array($str))
{
@@ -310,7 +287,7 @@ class CI_DB_mysql_driver extends CI_DB {
return $str;
}
- if (function_exists('mysql_real_escape_string') AND is_resource($this->conn_id))
+ if (function_exists('mysql_real_escape_string') && is_resource($this->conn_id))
{
$str = mysql_real_escape_string($str, $this->conn_id);
}
@@ -326,7 +303,7 @@ class CI_DB_mysql_driver extends CI_DB {
// escape LIKE condition wildcards
if ($like === TRUE)
{
- $str = str_replace(array('%', '_'), array('\\%', '\\_'), $str);
+ return str_replace(array('%', '_'), array('\\%', '\\_'), $str);
}
return $str;
@@ -337,10 +314,9 @@ class CI_DB_mysql_driver extends CI_DB {
/**
* Affected Rows
*
- * @access public
- * @return integer
+ * @return int
*/
- function affected_rows()
+ public function affected_rows()
{
return @mysql_affected_rows($this->conn_id);
}
@@ -350,10 +326,9 @@ class CI_DB_mysql_driver extends CI_DB {
/**
* Insert ID
*
- * @access public
- * @return integer
+ * @return int
*/
- function insert_id()
+ public function insert_id()
{
return @mysql_insert_id($this->conn_id);
}
@@ -366,27 +341,25 @@ class CI_DB_mysql_driver extends CI_DB {
* Generates a platform-specific query string that counts all records in
* the specified database
*
- * @access public
* @param string
* @return string
*/
- function count_all($table = '')
+ public 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));
-
+ $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();
+ $query = $query->row();
$this->_reset_select();
- return (int) $row->numrows;
+ return (int) $query->numrows;
}
// --------------------------------------------------------------------
@@ -396,17 +369,16 @@ class CI_DB_mysql_driver extends CI_DB {
*
* Generates a platform-specific query string so that the table names can be fetched
*
- * @access private
- * @param boolean
+ * @param bool
* @return string
*/
- function _list_tables($prefix_limit = FALSE)
+ protected function _list_tables($prefix_limit = FALSE)
{
- $sql = "SHOW TABLES FROM ".$this->_escape_char.$this->database.$this->_escape_char;
+ $sql = 'SHOW TABLES FROM '.$this->_escape_char.$this->database.$this->_escape_char;
- if ($prefix_limit !== FALSE AND $this->dbprefix != '')
+ if ($prefix_limit !== FALSE && $this->dbprefix != '')
{
- $sql .= " LIKE '".$this->escape_like_str($this->dbprefix)."%'";
+ return $sql." LIKE '".$this->escape_like_str($this->dbprefix)."%'";
}
return $sql;
@@ -419,13 +391,12 @@ class CI_DB_mysql_driver extends CI_DB {
*
* 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 = '')
+ public function _list_columns($table = '')
{
- return "SHOW COLUMNS FROM ".$this->_protect_identifiers($table, TRUE, NULL, FALSE);
+ return 'SHOW COLUMNS FROM '.$this->protect_identifiers($table, TRUE, NULL, FALSE);
}
// --------------------------------------------------------------------
@@ -435,13 +406,12 @@ class CI_DB_mysql_driver extends CI_DB {
*
* Generates a platform-specific query so that the column data can be retrieved
*
- * @access public
* @param string the table name
- * @return object
+ * @return string
*/
- function _field_data($table)
+ public function _field_data($table)
{
- return "DESCRIBE ".$table;
+ return 'DESCRIBE '.$table;
}
// --------------------------------------------------------------------
@@ -449,10 +419,9 @@ class CI_DB_mysql_driver extends CI_DB {
/**
* The error message string
*
- * @access private
* @return string
*/
- function _error_message()
+ protected function _error_message()
{
return mysql_error($this->conn_id);
}
@@ -462,10 +431,9 @@ class CI_DB_mysql_driver extends CI_DB {
/**
* The error message number
*
- * @access private
- * @return integer
+ * @return int
*/
- function _error_number()
+ protected function _error_number()
{
return mysql_errno($this->conn_id);
}
@@ -477,11 +445,10 @@ class CI_DB_mysql_driver extends CI_DB {
*
* This function escapes column and table names
*
- * @access private
* @param string
* @return string
*/
- function _escape_identifiers($item)
+ public function _escape_identifiers($item)
{
if ($this->_escape_char == '')
{
@@ -492,24 +459,20 @@ class CI_DB_mysql_driver extends CI_DB {
{
if (strpos($item, '.'.$id) !== FALSE)
{
- $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item);
+ $item = 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);
+ return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $this->_escape_char.$item);
}
}
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;
+ $item = str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item);
}
// remove duplicates if the user already included the escape
- return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str);
+ return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $this->_escape_char.$item.$this->_escape_char);
}
// --------------------------------------------------------------------
@@ -520,11 +483,10 @@ class CI_DB_mysql_driver extends CI_DB {
* This function implicitly groups FROM tables so there is no confusion
* about operator precedence in harmony with SQL standards
*
- * @access public
- * @param type
- * @return type
+ * @param string table name
+ * @return string
*/
- function _from_tables($tables)
+ protected function _from_tables($tables)
{
if ( ! is_array($tables))
{
@@ -541,15 +503,14 @@ class CI_DB_mysql_driver extends CI_DB {
*
* Generates a platform-specific insert string from the supplied data
*
- * @access public
* @param string the table name
* @param array the insert keys
* @param array the insert values
* @return string
*/
- function _insert($table, $keys, $values)
+ protected function _insert($table, $keys, $values)
{
- return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")";
+ return 'INSERT INTO '.$table.' ('.implode(', ', $keys).') VALUES ('.implode(', ', $values).')';
}
// --------------------------------------------------------------------
@@ -560,15 +521,14 @@ class CI_DB_mysql_driver extends CI_DB {
*
* 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)
+ protected function _replace($table, $keys, $values)
{
- return "REPLACE INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")";
+ return 'REPLACE INTO '.$table.' ('.implode(', ', $keys).') VALUES ('.implode(', ', $values).')';
}
// --------------------------------------------------------------------
@@ -578,15 +538,14 @@ class CI_DB_mysql_driver extends CI_DB {
*
* Generates a platform-specific insert string from the supplied data
*
- * @access public
* @param string the table name
* @param array the insert keys
* @param array the insert values
* @return string
*/
- function _insert_batch($table, $keys, $values)
+ protected function _insert_batch($table, $keys, $values)
{
- return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES ".implode(', ', $values);
+ return 'INSERT INTO '.$table.' ('.implode(', ', $keys).') VALUES '.implode(', ', $values);
}
// --------------------------------------------------------------------
@@ -597,7 +556,6 @@ class CI_DB_mysql_driver extends CI_DB {
*
* 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
@@ -605,24 +563,22 @@ class CI_DB_mysql_driver extends CI_DB {
* @param array the limit clause
* @return string
*/
- function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
+ protected function _update($table, $values, $where, $orderby = array(), $limit = FALSE, $like = array())
{
foreach ($values as $key => $val)
{
- $valstr[] = $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;
+ $where = ($where != '' && count($where) > 0) ? ' WHERE '.implode(' ', $where) : '';
+ if (count($like) > 0)
+ {
+ $where .= ($where == '' ? ' WHERE ' : ' AND ').implode(' ', $like);
+ }
- return $sql;
+ return 'UPDATE '.$table.' SET '.implode(', ', $valstr).$where
+ .(count($orderby) > 0 ? ' ORDER BY '.implode(', ', $orderby) : '')
+ .( ! $limit ? '' : ' LIMIT '.$limit);
}
// --------------------------------------------------------------------
@@ -633,17 +589,14 @@ class CI_DB_mysql_driver extends CI_DB {
*
* 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)
+ protected 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];
@@ -657,30 +610,21 @@ class CI_DB_mysql_driver extends CI_DB {
}
}
- $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, ';
+ $cases .= $k." = CASE \n"
+ .implode("\n", $v)."\n"
+ .'ELSE '.$k.' END, ';
}
- $sql .= substr($cases, 0, -2);
-
- $sql .= ' WHERE '.$where.$index.' IN ('.implode(',', $ids).')';
-
- return $sql;
+ return 'UPDATE '.$table.' SET '.substr($cases, 0, -2)
+ .' WHERE '.(($where != '' && count($where) > 0) ? implode(' ', $where).' AND ' : '')
+ .$index.' IN('.implode(',', $ids).')';
}
// --------------------------------------------------------------------
-
/**
* Truncate statement
*
@@ -688,13 +632,12 @@ class CI_DB_mysql_driver extends CI_DB {
* 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)
+ protected function _truncate($table)
{
- return "TRUNCATE ".$table;
+ return 'TRUNCATE '.$table;
}
// --------------------------------------------------------------------
@@ -704,31 +647,27 @@ class CI_DB_mysql_driver extends CI_DB {
*
* 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)
+ protected 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);
+ $conditions = "\nWHERE ".implode("\n", $this->ar_where);
if (count($where) > 0 && count($like) > 0)
{
- $conditions .= " AND ";
+ $conditions .= ' AND ';
}
$conditions .= implode("\n", $like);
}
- $limit = ( ! $limit) ? '' : ' LIMIT '.$limit;
-
- return "DELETE FROM ".$table.$conditions.$limit;
+ return 'DELETE FROM '.$table.$conditions.( ! $limit ? '' : ' LIMIT '.$limit);
}
// --------------------------------------------------------------------
@@ -738,24 +677,14 @@ class CI_DB_mysql_driver extends CI_DB {
*
* 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
+ * @param int the number of rows to limit the query to
+ * @param int the offset value
* @return string
*/
- function _limit($sql, $limit, $offset)
+ protected function _limit($sql, $limit, $offset)
{
- if ($offset == 0)
- {
- $offset = '';
- }
- else
- {
- $offset .= ", ";
- }
-
- return $sql."LIMIT ".$offset.$limit;
+ return $sql.' LIMIT '.($offset == 0 ? '' : $offset.', ').$limit;
}
// --------------------------------------------------------------------
@@ -763,17 +692,15 @@ class CI_DB_mysql_driver extends CI_DB {
/**
* Close DB Connection
*
- * @access public
* @param resource
* @return void
*/
- function _close($conn_id)
+ protected 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
+/* Location: ./system/database/drivers/mysql/mysql_driver.php */
diff --git a/system/database/drivers/mysql/mysql_forge.php b/system/database/drivers/mysql/mysql_forge.php
index c1cae136c..0f251b086 100644
--- a/system/database/drivers/mysql/mysql_forge.php
+++ b/system/database/drivers/mysql/mysql_forge.php
@@ -1,25 +1,35 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* MySQL Forge Class
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_mysql_forge extends CI_DB_forge {
@@ -27,13 +37,12 @@ class CI_DB_mysql_forge extends CI_DB_forge {
/**
* Create database
*
- * @access private
* @param string the database name
- * @return bool
+ * @return string
*/
- function _create_database($name)
+ public function _create_database($name)
{
- return "CREATE DATABASE ".$name;
+ return 'CREATE DATABASE '.$name;
}
// --------------------------------------------------------------------
@@ -41,13 +50,12 @@ class CI_DB_mysql_forge extends CI_DB_forge {
/**
* Drop database
*
- * @access private
* @param string the database name
- * @return bool
+ * @return string
*/
- function _drop_database($name)
+ public function _drop_database($name)
{
- return "DROP DATABASE ".$name;
+ return 'DROP DATABASE '.$name;
}
// --------------------------------------------------------------------
@@ -55,83 +63,57 @@ class CI_DB_mysql_forge extends CI_DB_forge {
/**
* Process Fields
*
- * @access private
* @param mixed the fields
* @return string
*/
- function _process_fields($fields)
+ private function _process_fields($fields)
{
$current_field_count = 0;
$sql = '';
- foreach ($fields as $field=>$attributes)
+ 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";
+ $sql .= "\n\t".$attributes;
}
else
{
$attributes = array_change_key_case($attributes, CASE_UPPER);
- $sql .= "\n\t".$this->db->_protect_identifiers($field);
+ $sql .= "\n\t".$this->db->protect_identifiers($field)
+ .( ! empty($attributes['NAME']) ? ' '.$this->db->protect_identifiers($attributes['NAME']).' ' : '');
- if (array_key_exists('NAME', $attributes))
- {
- $sql .= ' '.$this->db->_protect_identifiers($attributes['NAME']).' ';
- }
-
- if (array_key_exists('TYPE', $attributes))
+ if ( ! empty($attributes['TYPE']))
{
$sql .= ' '.$attributes['TYPE'];
- if (array_key_exists('CONSTRAINT', $attributes))
+ if ( ! empty($attributes['CONSTRAINT']))
{
- switch ($attributes['TYPE'])
+ switch (strtolower($attributes['TYPE']))
{
case 'decimal':
case 'float':
case 'numeric':
$sql .= '('.implode(',', $attributes['CONSTRAINT']).')';
- break;
-
+ break;
case 'enum':
case 'set':
$sql .= '("'.implode('","', $attributes['CONSTRAINT']).'")';
- break;
-
+ break;
default:
$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';
- }
+ $sql .= (( ! empty($attributes['UNSIGNED']) && $attributes['UNSIGNED'] === TRUE) ? ' UNSIGNED' : '')
+ .(isset($attributes['DEFAULT']) ? " DEFAULT '".$attributes['DEFAULT']."'" : '')
+ .(( ! empty($attributes['NULL']) && $attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL')
+ .(( ! empty($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE) ? ' AUTO_INCREMENT' : '');
}
// don't add a comma on the end of the last field
@@ -149,15 +131,14 @@ class CI_DB_mysql_forge extends CI_DB_forge {
/**
* 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
+ * @param bool should 'IF NOT EXISTS' be added to the SQL
* @return bool
*/
- function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists)
+ public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists)
{
$sql = 'CREATE TABLE ';
@@ -166,15 +147,12 @@ class CI_DB_mysql_forge extends CI_DB_forge {
$sql .= 'IF NOT EXISTS ';
}
- $sql .= $this->db->_escape_identifiers($table)." (";
-
- $sql .= $this->_process_fields($fields);
+ $sql .= $this->db->protect_identifiers($table).' ('.$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) . ")";
+ $sql .= ",\n\tPRIMARY KEY ".$key_name.' ('.implode(', ', $this->db->protect_identifiers($primary_keys)).')';
}
if (is_array($keys) && count($keys) > 0)
@@ -192,13 +170,11 @@ class CI_DB_mysql_forge extends CI_DB_forge {
$key = array($key_name);
}
- $sql .= ",\n\tKEY {$key_name} (" . implode(', ', $key) . ")";
+ $sql .= ",\n\tKEY ".$key_name.' ('.implode(', ', $key).')';
}
}
- $sql .= "\n) DEFAULT CHARACTER SET {$this->db->char_set} COLLATE {$this->db->dbcollat};";
-
- return $sql;
+ return $sql."\n) DEFAULT CHARACTER SET ".$this->db->char_set.' COLLATE '.$this->db->dbcollat.';';
}
// --------------------------------------------------------------------
@@ -206,12 +182,12 @@ class CI_DB_mysql_forge extends CI_DB_forge {
/**
* Drop Table
*
- * @access private
+ * @param string table name
* @return string
*/
- function _drop_table($table)
+ public function _drop_table($table)
{
- return "DROP TABLE IF EXISTS ".$this->db->_escape_identifiers($table);
+ return 'DROP TABLE IF EXISTS '.$this->db->protect_identifiers($table);
}
// --------------------------------------------------------------------
@@ -220,33 +196,26 @@ class CI_DB_mysql_forge extends CI_DB_forge {
* Alter table query
*
* Generates a platform-specific query so that a table can be altered
- * Called by add_column(), drop_column(), and column_alter(),
+ * 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
+ * @return string
*/
- function _alter_table($alter_type, $table, $fields, $after_field = '')
+ public function _alter_table($alter_type, $table, $fields, $after_field = '')
{
- $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table)." $alter_type ";
+ $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' ';
// DROP has everything it needs now.
- if ($alter_type == 'DROP')
+ if ($alter_type === 'DROP')
{
- return $sql.$this->db->_protect_identifiers($fields);
+ 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;
+ return $sql.$this->_process_fields($fields)
+ .($after_field != '' ? ' AFTER '.$this->db->protect_identifiers($after_field) : '');
}
// --------------------------------------------------------------------
@@ -256,18 +225,16 @@ class CI_DB_mysql_forge extends CI_DB_forge {
*
* 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)
+ public 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;
+ return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name);
}
}
/* End of file mysql_forge.php */
-/* Location: ./system/database/drivers/mysql/mysql_forge.php */ \ No newline at end of file
+/* Location: ./system/database/drivers/mysql/mysql_forge.php */
diff --git a/system/database/drivers/mysql/mysql_result.php b/system/database/drivers/mysql/mysql_result.php
index e1a6e93ca..8f04a936d 100644
--- a/system/database/drivers/mysql/mysql_result.php
+++ b/system/database/drivers/mysql/mysql_result.php
@@ -1,27 +1,37 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
-// --------------------------------------------------------------------
-
/**
* MySQL Result Class
*
* This class extends the parent result class: CI_DB_result
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_mysql_result extends CI_DB_result {
@@ -29,10 +39,9 @@ class CI_DB_mysql_result extends CI_DB_result {
/**
* Number of rows in the result set
*
- * @access public
- * @return integer
+ * @return int
*/
- function num_rows()
+ public function num_rows()
{
return @mysql_num_rows($this->result_id);
}
@@ -42,10 +51,9 @@ class CI_DB_mysql_result extends CI_DB_result {
/**
* Number of fields in the result set
*
- * @access public
- * @return integer
+ * @return int
*/
- function num_fields()
+ public function num_fields()
{
return @mysql_num_fields($this->result_id);
}
@@ -57,10 +65,9 @@ class CI_DB_mysql_result extends CI_DB_result {
*
* Generates an array of column names
*
- * @access public
* @return array
*/
- function list_fields()
+ public function list_fields()
{
$field_names = array();
while ($field = mysql_fetch_field($this->result_id))
@@ -78,25 +85,21 @@ class CI_DB_mysql_result extends CI_DB_result {
*
* Generates an array of objects containing field meta-data
*
- * @access public
* @return array
*/
- function field_data()
+ public function field_data()
{
$retval = array();
while ($field = mysql_fetch_object($this->result_id))
{
preg_match('/([a-zA-Z]+)(\(\d+\))?/', $field->Type, $matches);
- $type = (array_key_exists(1, $matches)) ? $matches[1] : NULL;
- $length = (array_key_exists(2, $matches)) ? preg_replace('/[^\d]/', '', $matches[2]) : NULL;
-
- $F = new stdClass();
- $F->name = $field->Field;
- $F->type = $type;
- $F->default = $field->Default;
- $F->max_length = $length;
- $F->primary_key = ( $field->Key == 'PRI' ? 1 : 0 );
+ $F = new stdClass();
+ $F->name = $field->Field;
+ $F->type = ( ! empty($matches[1])) ? $matches[1] : NULL;
+ $F->default = $field->Default;
+ $F->max_length = ( ! empty($matches[2])) ? preg_replace('/[^\d]/', '', $matches[2]) : NULL;
+ $F->primary_key = (int) ($field->Key === 'PRI');
$retval[] = $F;
}
@@ -109,9 +112,9 @@ class CI_DB_mysql_result extends CI_DB_result {
/**
* Free the result
*
- * @return null
+ * @return void
*/
- function free_result()
+ public function free_result()
{
if (is_resource($this->result_id))
{
@@ -125,14 +128,13 @@ class CI_DB_mysql_result extends CI_DB_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
*
- * @access private
* @return array
*/
- function _data_seek($n = 0)
+ protected function _data_seek($n = 0)
{
return mysql_data_seek($this->result_id, $n);
}
@@ -144,10 +146,9 @@ class CI_DB_mysql_result extends CI_DB_result {
*
* Returns the result set as an array
*
- * @access private
* @return array
*/
- function _fetch_assoc()
+ protected function _fetch_assoc()
{
return mysql_fetch_assoc($this->result_id);
}
@@ -159,16 +160,14 @@ class CI_DB_mysql_result extends CI_DB_result {
*
* Returns the result set as an object
*
- * @access private
* @return object
*/
- function _fetch_object()
+ protected 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
+/* Location: ./system/database/drivers/mysql/mysql_result.php */
diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php
index 48c4d6316..952f887fe 100644
--- a/system/database/drivers/mysql/mysql_utility.php
+++ b/system/database/drivers/mysql/mysql_utility.php
@@ -1,25 +1,35 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* MySQL Utility Class
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_mysql_utility extends CI_DB_utility {
@@ -27,12 +37,11 @@ class CI_DB_mysql_utility extends CI_DB_utility {
/**
* List databases
*
- * @access private
- * @return bool
+ * @return string
*/
- function _list_databases()
+ public function _list_databases()
{
- return "SHOW DATABASES";
+ return 'SHOW DATABASES';
}
// --------------------------------------------------------------------
@@ -42,13 +51,12 @@ class CI_DB_mysql_utility extends CI_DB_utility {
*
* Generates a platform-specific query so that a table can be optimized
*
- * @access private
* @param string the table name
- * @return object
+ * @return string
*/
- function _optimize_table($table)
+ public function _optimize_table($table)
{
- return "OPTIMIZE TABLE ".$this->db->_escape_identifiers($table);
+ return 'OPTIMIZE TABLE '.$this->db->protect_identifiers($table);
}
// --------------------------------------------------------------------
@@ -58,26 +66,24 @@ class CI_DB_mysql_utility extends CI_DB_utility {
*
* Generates a platform-specific query so that a table can be repaired
*
- * @access private
* @param string the table name
- * @return object
+ * @return string
*/
- function _repair_table($table)
+ public function _repair_table($table)
{
- return "REPAIR TABLE ".$this->db->_escape_identifiers($table);
+ return 'REPAIR TABLE '.$this->db->protect_identifiers($table);
}
// --------------------------------------------------------------------
/**
* MySQL Export
*
- * @access private
* @param array Preferences
* @return mixed
*/
- function _backup($params = array())
+ public function _backup($params = array())
{
- if (count($params) == 0)
+ if (count($params) === 0)
{
return FALSE;
}
@@ -87,16 +93,16 @@ class CI_DB_mysql_utility extends CI_DB_utility {
// Build the output
$output = '';
- foreach ((array)$tables as $table)
+ foreach ( (array) $tables as $table)
{
// Is the table in the "ignore" list?
- if (in_array($table, (array)$ignore, TRUE))
+ if (in_array($table, (array) $ignore, TRUE))
{
continue;
}
// Get the table schema
- $query = $this->db->query("SHOW CREATE TABLE `".$this->db->database.'`.`'.$table.'`');
+ $query = $this->db->query('SHOW CREATE TABLE '.$this->db->protect_identifiers($this->db->database).'.'.$this->db->protect_identifiers($table));
// No result means the table name was invalid
if ($query === FALSE)
@@ -109,7 +115,7 @@ class CI_DB_mysql_utility extends CI_DB_utility {
if ($add_drop == TRUE)
{
- $output .= 'DROP TABLE IF EXISTS '.$table.';'.$newline.$newline;
+ $output .= 'DROP TABLE IF EXISTS '.$this->db->protect_identifiers($table).';'.$newline.$newline;
}
$i = 0;
@@ -129,7 +135,7 @@ class CI_DB_mysql_utility extends CI_DB_utility {
}
// Grab all the data from the current table
- $query = $this->db->query("SELECT * FROM $table");
+ $query = $this->db->query('SELECT * FROM '.$this->db->protect_identifiers($table));
if ($query->num_rows() == 0)
{
@@ -137,7 +143,7 @@ class CI_DB_mysql_utility extends CI_DB_utility {
}
// Fetch the field names and determine if the field is an
- // integer type. We use this info to decide whether to
+ // integer type. We use this info to decide whether to
// surround the data with quotes or not
$i = 0;
@@ -146,20 +152,17 @@ class CI_DB_mysql_utility extends CI_DB_utility {
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;
+ $is_int[$i] = in_array(strtolower(mysql_field_type($query->result_id, $i)),
+ array('tinyint', 'smallint', 'mediumint', 'int', 'bigint'), //, 'timestamp'),
+ TRUE);
// Create a string of field names
- $field_str .= '`'.$field->name.'`, ';
+ $field_str .= $this->db->protect_identifiers($field->name).', ';
$i++;
}
// Trim off the end comma
- $field_str = preg_replace( "/, $/" , "" , $field_str);
-
+ $field_str = preg_replace('/, $/' , '', $field_str);
// Build the insert string
foreach ($query->result_array() as $row)
@@ -177,14 +180,7 @@ class CI_DB_mysql_utility extends CI_DB_utility {
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;
- }
+ $val_str .= ($is_int[$i] == FALSE) ? $this->db->escape($v) : $v;
}
// Append a comma
@@ -193,10 +189,10 @@ class CI_DB_mysql_utility extends CI_DB_utility {
}
// Remove the comma at the end of the string
- $val_str = preg_replace( "/, $/" , "" , $val_str);
+ $val_str = preg_replace('/, $/' , '', $val_str);
// Build the INSERT string
- $output .= 'INSERT INTO '.$table.' ('.$field_str.') VALUES ('.$val_str.');'.$newline;
+ $output .= 'INSERT INTO '.$this->db->protect_identifiers($table).' ('.$field_str.') VALUES ('.$val_str.');'.$newline;
}
$output .= $newline.$newline;
@@ -204,7 +200,8 @@ class CI_DB_mysql_utility extends CI_DB_utility {
return $output;
}
+
}
/* End of file mysql_utility.php */
-/* Location: ./system/database/drivers/mysql/mysql_utility.php */ \ No newline at end of file
+/* Location: ./system/database/drivers/mysql/mysql_utility.php */
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php
index d3200f328..dbba12e15 100644
--- a/system/database/drivers/mysqli/mysqli_driver.php
+++ b/system/database/drivers/mysqli/mysqli_driver.php
@@ -1,22 +1,32 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
- * MySQLi Database Adapter Class - MySQLi only works with PHP 5
+ * MySQLi Database Adapter Class
*
* Note: _DB is an extender class that the app controller
* creates dynamically based on whether the active record
@@ -25,57 +35,45 @@
* @package CodeIgniter
* @subpackage Drivers
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_mysqli_driver extends CI_DB {
- var $dbdriver = 'mysqli';
+ public $dbdriver = 'mysqli';
// The character used for escaping
- var $_escape_char = '`';
+ protected $_escape_char = '`';
// clause and character used for LIKE escape sequences - not used in MySQL
- var $_like_escape_str = '';
- var $_like_escape_chr = '';
+ protected $_like_escape_str = '';
+ protected $_like_escape_chr = '';
/**
* 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 ";
- var $_random_keyword = ' RAND()'; // database specific random keyword
+ protected $_count_string = 'SELECT COUNT(*) AS ';
+ protected $_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,
* adding a bit more processing to all queries.
*/
- var $delete_hack = TRUE;
-
- // whether SET NAMES must be used to set the character set
- var $use_set_names;
-
- // --------------------------------------------------------------------
+ public $delete_hack = TRUE;
/**
* Non-persistent database connection
*
- * @access private called by the base class
- * @return resource
+ * @return object
*/
- function db_connect()
+ public function db_connect()
{
- if ($this->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);
- }
-
+ return ($this->port != '')
+ ? @mysqli_connect($this->hostname, $this->username, $this->password, $this->database, $this->port)
+ : @mysqli_connect($this->hostname, $this->username, $this->password, $this->database);
}
// --------------------------------------------------------------------
@@ -83,12 +81,19 @@ class CI_DB_mysqli_driver extends CI_DB {
/**
* Persistent database connection
*
- * @access private called by the base class
- * @return resource
+ * @return object
*/
- function db_pconnect()
+ public function db_pconnect()
{
- return $this->db_connect();
+ // Persistent connection support was added in PHP 5.3.0
+ if ( ! is_php('5.3'))
+ {
+ return $this->db_connect();
+ }
+
+ return ($this->port != '')
+ ? @mysqli_connect('p:'.$this->hostname, $this->username, $this->password, $this->database, $this->port)
+ : @mysqli_connect('p:'.$this->hostname, $this->username, $this->password, $this->database);
}
// --------------------------------------------------------------------
@@ -99,10 +104,9 @@ class CI_DB_mysqli_driver extends CI_DB {
* 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()
+ public function reconnect()
{
if (mysqli_ping($this->conn_id) === FALSE)
{
@@ -115,12 +119,23 @@ class CI_DB_mysqli_driver extends CI_DB {
/**
* Select the database
*
- * @access private called by the base class
- * @return resource
+ * @param string database name
+ * @return bool
*/
- function db_select()
+ public function db_select($database = '')
{
- return @mysqli_select_db($this->conn_id, $this->database);
+ if ($database === '')
+ {
+ $database = $this->database;
+ }
+
+ if (@mysqli_select_db($this->conn_id, $database))
+ {
+ $this->database = $database;
+ return TRUE;
+ }
+
+ return FALSE;
}
// --------------------------------------------------------------------
@@ -128,27 +143,15 @@ class CI_DB_mysqli_driver extends CI_DB {
/**
* Set client character set
*
- * @access private
* @param string
* @param string
- * @return resource
+ * @return bool
*/
- function _db_set_charset($charset, $collation)
+ protected function _db_set_charset($charset, $collation)
{
- if ( ! isset($this->use_set_names))
- {
- // mysqli_set_charset() requires MySQL >= 5.0.7, use SET NAMES as fallback
- $this->use_set_names = (version_compare(mysqli_get_server_info($this->conn_id), '5.0.7', '>=')) ? FALSE : TRUE;
- }
-
- if ($this->use_set_names === TRUE)
- {
- 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);
- }
+ return function_exists('mysqli_set_charset')
+ ? @mysqli_set_charset($this->conn_id, $charset)
+ : @mysqli_query($this->conn_id, "SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'");
}
// --------------------------------------------------------------------
@@ -156,12 +159,11 @@ class CI_DB_mysqli_driver extends CI_DB {
/**
* Version number query string
*
- * @access public
* @return string
*/
- function _version()
+ protected function _version()
{
- return "SELECT version() AS ver";
+ return @mysqli_get_server_info($this->conn_id);
}
// --------------------------------------------------------------------
@@ -169,15 +171,12 @@ class CI_DB_mysqli_driver extends CI_DB {
/**
* Execute the query
*
- * @access private called by the base class
* @param string an SQL query
- * @return resource
+ * @return mixed
*/
- function _execute($sql)
+ protected function _execute($sql)
{
- $sql = $this->_prep_query($sql);
- $result = @mysqli_query($this->conn_id, $sql);
- return $result;
+ return @mysqli_query($this->conn_id, $this->_prep_query($sql));
}
// --------------------------------------------------------------------
@@ -187,20 +186,16 @@ class CI_DB_mysqli_driver extends CI_DB {
*
* 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)
+ protected 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)
+ // mysqli_affected_rows() returns 0 for "DELETE FROM TABLE" queries. This hack
+ // modifies the query so that it a proper number of affected rows is returned.
+ if ($this->delete_hack === TRUE && preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $sql))
{
- 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 preg_replace('/^\s*DELETE\s+FROM\s+(\S+)\s*$/', 'DELETE FROM \\1 WHERE 1=1', $sql);
}
return $sql;
@@ -211,18 +206,12 @@ class CI_DB_mysqli_driver extends CI_DB {
/**
* Begin Transaction
*
- * @access public
* @return bool
*/
- function trans_begin($test_mode = FALSE)
+ public 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)
+ if ( ! $this->trans_enabled OR $this->_trans_depth > 0)
{
return TRUE;
}
@@ -230,7 +219,7 @@ class CI_DB_mysqli_driver extends CI_DB {
// Reset the transaction failure flag.
// If the $test_mode flag is set to TRUE transactions will be rolled back
// even if the queries produce a successful result.
- $this->_trans_failure = ($test_mode === TRUE) ? TRUE : FALSE;
+ $this->_trans_failure = ($test_mode === TRUE);
$this->simple_query('SET AUTOCOMMIT=0');
$this->simple_query('START TRANSACTION'); // can also be BEGIN or BEGIN WORK
@@ -242,18 +231,12 @@ class CI_DB_mysqli_driver extends CI_DB {
/**
* Commit Transaction
*
- * @access public
* @return bool
*/
- function trans_commit()
+ public 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)
+ if ( ! $this->trans_enabled OR $this->_trans_depth > 0)
{
return TRUE;
}
@@ -268,18 +251,12 @@ class CI_DB_mysqli_driver extends CI_DB {
/**
* Rollback Transaction
*
- * @access public
* @return bool
*/
- function trans_rollback()
+ public 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)
+ if ( ! $this->trans_enabled OR $this->_trans_depth > 0)
{
return TRUE;
}
@@ -294,12 +271,11 @@ class CI_DB_mysqli_driver extends CI_DB {
/**
* 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)
+ public function escape_str($str, $like = FALSE)
{
if (is_array($str))
{
@@ -311,7 +287,7 @@ class CI_DB_mysqli_driver extends CI_DB {
return $str;
}
- if (function_exists('mysqli_real_escape_string') AND is_object($this->conn_id))
+ if (function_exists('mysqli_real_escape_string') && is_object($this->conn_id))
{
$str = mysqli_real_escape_string($this->conn_id, $str);
}
@@ -327,7 +303,7 @@ class CI_DB_mysqli_driver extends CI_DB {
// escape LIKE condition wildcards
if ($like === TRUE)
{
- $str = str_replace(array('%', '_'), array('\\%', '\\_'), $str);
+ return str_replace(array('%', '_'), array('\\%', '\\_'), $str);
}
return $str;
@@ -338,10 +314,9 @@ class CI_DB_mysqli_driver extends CI_DB {
/**
* Affected Rows
*
- * @access public
- * @return integer
+ * @return int
*/
- function affected_rows()
+ public function affected_rows()
{
return @mysqli_affected_rows($this->conn_id);
}
@@ -351,10 +326,9 @@ class CI_DB_mysqli_driver extends CI_DB {
/**
* Insert ID
*
- * @access public
- * @return integer
+ * @return int
*/
- function insert_id()
+ public function insert_id()
{
return @mysqli_insert_id($this->conn_id);
}
@@ -367,27 +341,25 @@ class CI_DB_mysqli_driver extends CI_DB {
* Generates a platform-specific query string that counts all records in
* the specified database
*
- * @access public
* @param string
* @return string
*/
- function count_all($table = '')
+ public 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));
-
+ $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();
+ $query = $query->row();
$this->_reset_select();
- return (int) $row->numrows;
+ return (int) $query->numrows;
}
// --------------------------------------------------------------------
@@ -398,16 +370,16 @@ class CI_DB_mysqli_driver extends CI_DB {
* Generates a platform-specific query string so that the table names can be fetched
*
* @access private
- * @param boolean
+ * @param bool
* @return string
*/
- function _list_tables($prefix_limit = FALSE)
+ protected function _list_tables($prefix_limit = FALSE)
{
- $sql = "SHOW TABLES FROM ".$this->_escape_char.$this->database.$this->_escape_char;
+ $sql = 'SHOW TABLES FROM '.$this->_escape_char.$this->database.$this->_escape_char;
- if ($prefix_limit !== FALSE AND $this->dbprefix != '')
+ if ($prefix_limit !== FALSE && $this->dbprefix != '')
{
- $sql .= " LIKE '".$this->escape_like_str($this->dbprefix)."%'";
+ return $sql." LIKE '".$this->escape_like_str($this->dbprefix)."%'";
}
return $sql;
@@ -420,13 +392,12 @@ class CI_DB_mysqli_driver extends CI_DB {
*
* 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 = '')
+ protected function _list_columns($table = '')
{
- return "SHOW COLUMNS FROM ".$this->_protect_identifiers($table, TRUE, NULL, FALSE);
+ return 'SHOW COLUMNS FROM '.$this->_protect_identifiers($table, TRUE, NULL, FALSE);
}
// --------------------------------------------------------------------
@@ -436,13 +407,12 @@ class CI_DB_mysqli_driver extends CI_DB {
*
* Generates a platform-specific query so that the column data can be retrieved
*
- * @access public
* @param string the table name
- * @return object
+ * @return string
*/
- function _field_data($table)
+ protected function _field_data($table)
{
- return "DESCRIBE ".$table;
+ return 'DESCRIBE '.$table;
}
// --------------------------------------------------------------------
@@ -450,10 +420,9 @@ class CI_DB_mysqli_driver extends CI_DB {
/**
* The error message string
*
- * @access private
* @return string
*/
- function _error_message()
+ protected function _error_message()
{
return mysqli_error($this->conn_id);
}
@@ -463,10 +432,9 @@ class CI_DB_mysqli_driver extends CI_DB {
/**
* The error message number
*
- * @access private
- * @return integer
+ * @return int
*/
- function _error_number()
+ protected function _error_number()
{
return mysqli_errno($this->conn_id);
}
@@ -478,11 +446,10 @@ class CI_DB_mysqli_driver extends CI_DB {
*
* This function escapes column and table names
*
- * @access private
* @param string
* @return string
*/
- function _escape_identifiers($item)
+ public function _escape_identifiers($item)
{
if ($this->_escape_char == '')
{
@@ -493,24 +460,20 @@ class CI_DB_mysqli_driver extends CI_DB {
{
if (strpos($item, '.'.$id) !== FALSE)
{
- $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item);
+ $item = 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);
+ return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $this->_escape_char.$item);
}
}
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;
+ $item = str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item);
}
// remove duplicates if the user already included the escape
- return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str);
+ return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $this->_escape_char.$item.$this->_escape_char);
}
// --------------------------------------------------------------------
@@ -521,11 +484,10 @@ class CI_DB_mysqli_driver extends CI_DB {
* This function implicitly groups FROM tables so there is no confusion
* about operator precedence in harmony with SQL standards
*
- * @access public
- * @param type
- * @return type
+ * @param string
+ * @return string
*/
- function _from_tables($tables)
+ protected function _from_tables($tables)
{
if ( ! is_array($tables))
{
@@ -542,15 +504,14 @@ class CI_DB_mysqli_driver extends CI_DB {
*
* Generates a platform-specific insert string from the supplied data
*
- * @access public
* @param string the table name
* @param array the insert keys
* @param array the insert values
* @return string
*/
- function _insert($table, $keys, $values)
+ protected function _insert($table, $keys, $values)
{
- return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")";
+ return 'INSERT INTO '.$table.' ('.implode(', ', $keys).') VALUES ('.implode(', ', $values).')';
}
// --------------------------------------------------------------------
@@ -560,15 +521,14 @@ class CI_DB_mysqli_driver extends CI_DB {
*
* Generates a platform-specific insert string from the supplied data
*
- * @access public
* @param string the table name
* @param array the insert keys
* @param array the insert values
* @return string
*/
- function _insert_batch($table, $keys, $values)
+ protected function _insert_batch($table, $keys, $values)
{
- return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES ".implode(', ', $values);
+ return 'INSERT INTO '.$table.' ('.implode(', ', $keys).') VALUES '.implode(', ', $values);
}
// --------------------------------------------------------------------
@@ -579,17 +539,16 @@ class CI_DB_mysqli_driver extends CI_DB {
*
* 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)
+ protected function _replace($table, $keys, $values)
{
- return "REPLACE INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")";
+ return 'REPLACE INTO '.$table.' ('.implode(', ', $keys).') VALUES ('.implode(', ', $values).')';
}
-
+
// --------------------------------------------------------------------
/**
@@ -597,7 +556,6 @@ class CI_DB_mysqli_driver extends CI_DB {
*
* 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
@@ -605,24 +563,17 @@ class CI_DB_mysqli_driver extends CI_DB {
* @param array the limit clause
* @return string
*/
- function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
+ protected function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
{
foreach ($values as $key => $val)
{
- $valstr[] = $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;
+ return 'UPDATE '.$table.' SET '.implode(', ', $valstr)
+ .(($where != '' && count($where) > 0) ? ' WHERE '.implode(' ', $where) : '')
+ .(count($orderby) > 0 ? ' ORDER BY '.implode(', ', $orderby) : '')
+ .( ! $limit ? '' : ' LIMIT '.$limit);
}
// --------------------------------------------------------------------
@@ -632,17 +583,14 @@ class CI_DB_mysqli_driver extends CI_DB {
*
* 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)
+ protected 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];
@@ -656,25 +604,19 @@ class CI_DB_mysqli_driver extends CI_DB {
}
}
- $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, ';
+ $cases .= $k.' = CASE '."\n"
+ .implode("\n", $v)."\n"
+ .'ELSE '.$k.' END, ';
}
- $sql .= substr($cases, 0, -2);
-
- $sql .= ' WHERE '.$where.$index.' IN ('.implode(',', $ids).')';
+ $where = ($where != '' && count($where) > 0) ? implode(' ', $where).' AND ' : '';
- return $sql;
+ return 'UPDATE '.$table.' SET '.substr($cases, 0, -2)
+ .' WHERE '.(($where != '' && count($where) > 0) ? implode(' ', $where).' AND ' : '')
+ .$index.' IN('.implode(',', $ids).')';
}
// --------------------------------------------------------------------
@@ -686,13 +628,12 @@ class CI_DB_mysqli_driver extends CI_DB {
* 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)
+ protected function _truncate($table)
{
- return "TRUNCATE ".$table;
+ return 'TRUNCATE '.$table;
}
// --------------------------------------------------------------------
@@ -702,31 +643,26 @@ class CI_DB_mysqli_driver extends CI_DB {
*
* 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)
+ protected 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);
+ $conditions = "\nWHERE ".implode("\n", $this->ar_where);
if (count($where) > 0 && count($like) > 0)
{
- $conditions .= " AND ";
+ $conditions .= ' AND ';
}
$conditions .= implode("\n", $like);
}
- $limit = ( ! $limit) ? '' : ' LIMIT '.$limit;
-
- return "DELETE FROM ".$table.$conditions.$limit;
+ return 'DELETE FROM '.$table.$conditions.( ! $limit ? '' : ' LIMIT '.$limit);
}
// --------------------------------------------------------------------
@@ -736,22 +672,15 @@ class CI_DB_mysqli_driver extends CI_DB {
*
* 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
+ * @param int the number of rows to limit the query to
+ * @param int the offset value
* @return string
*/
- function _limit($sql, $limit, $offset)
+ protected function _limit($sql, $limit, $offset)
{
- $sql .= "LIMIT ".$limit;
-
- if ($offset > 0)
- {
- $sql .= " OFFSET ".$offset;
- }
-
- return $sql;
+ return $sql.' LIMIT '.$limit
+ .($offset > 0 ? ' OFFSET '.$offset : '');
}
// --------------------------------------------------------------------
@@ -759,18 +688,15 @@ class CI_DB_mysqli_driver extends CI_DB {
/**
* Close DB Connection
*
- * @access public
- * @param resource
+ * @param object
* @return void
*/
- function _close($conn_id)
+ protected 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
+/* Location: ./system/database/drivers/mysqli/mysqli_driver.php */
diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php
index 260549457..7de036127 100644
--- a/system/database/drivers/mysqli/mysqli_forge.php
+++ b/system/database/drivers/mysqli/mysqli_forge.php
@@ -1,25 +1,35 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* MySQLi Forge Class
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_mysqli_forge extends CI_DB_forge {
@@ -27,13 +37,12 @@ class CI_DB_mysqli_forge extends CI_DB_forge {
/**
* Create database
*
- * @access private
* @param string the database name
- * @return bool
+ * @return string
*/
- function _create_database($name)
+ public function _create_database($name)
{
- return "CREATE DATABASE ".$name;
+ return 'CREATE DATABASE '.$name;
}
// --------------------------------------------------------------------
@@ -41,13 +50,12 @@ class CI_DB_mysqli_forge extends CI_DB_forge {
/**
* Drop database
*
- * @access private
* @param string the database name
- * @return bool
+ * @return string
*/
- function _drop_database($name)
+ public function _drop_database($name)
{
- return "DROP DATABASE ".$name;
+ return 'DROP DATABASE '.$name;
}
// --------------------------------------------------------------------
@@ -55,68 +63,35 @@ class CI_DB_mysqli_forge extends CI_DB_forge {
/**
* Process Fields
*
- * @access private
* @param mixed the fields
* @return string
*/
- function _process_fields($fields)
+ public function _process_fields($fields)
{
$current_field_count = 0;
$sql = '';
- foreach ($fields as $field=>$attributes)
+ 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";
+ $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) && $attributes['NULL'] === TRUE)
- {
- $sql .= ' NULL';
- }
- else
- {
- $sql .= ' NOT NULL';
- }
-
- if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE)
- {
- $sql .= ' AUTO_INCREMENT';
- }
+ $sql .= "\n\t".$this->db->protect_identifiers($field)
+ .( ! empty($attributes['NAME']) ? ' '.$this->db->protect_identifiers($attributes['NAME']).' ' : '')
+ .( ! empty($attributes['TYPE']) ? ' '.$attributes['TYPE'] : '')
+ .( ! empty($attributes['CONSTRAINT']) ? '('.$attributes['CONSTRAINT'].')' : '')
+ .(( ! empty($attributes['UNSIGNED']) && $attributes['UNSIGNED'] === TRUE) ? ' UNSIGNED' : '')
+ .(isset($attributes['DEFAULT']) ? " DEFAULT '".$attributes['DEFAULT']."'" : '')
+ .(( ! empty($attributes['NULL']) && $attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL')
+ .(( ! empty($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE) ? ' AUTO_INCREMENT' : '');
}
// don't add a comma on the end of the last field
@@ -134,15 +109,14 @@ class CI_DB_mysqli_forge extends CI_DB_forge {
/**
* 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
+ * @param bool should 'IF NOT EXISTS' be added to the SQL
* @return bool
*/
- function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists)
+ public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists)
{
$sql = 'CREATE TABLE ';
@@ -151,15 +125,12 @@ class CI_DB_mysqli_forge extends CI_DB_forge {
$sql .= 'IF NOT EXISTS ';
}
- $sql .= $this->db->_escape_identifiers($table)." (";
-
- $sql .= $this->_process_fields($fields);
+ $sql .= $this->db->_escape_identifiers($table).' ('.$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) . ")";
+ $key_name = $this->db->protect_identifiers(implode('_', $primary_keys));
+ $sql .= ",\n\tPRIMARY KEY ".$key_name.' ('.implode(', ', $this->db->protect_identifiers($primary_keys)).')';
}
if (is_array($keys) && count($keys) > 0)
@@ -168,22 +139,20 @@ class CI_DB_mysqli_forge extends CI_DB_forge {
{
if (is_array($key))
{
- $key_name = $this->db->_protect_identifiers(implode('_', $key));
- $key = $this->db->_protect_identifiers($key);
+ $key_name = $this->db->protect_identifiers(implode('_', $key));
+ $key = $this->db->protect_identifiers($key);
}
else
{
- $key_name = $this->db->_protect_identifiers($key);
+ $key_name = $this->db->protect_identifiers($key);
$key = array($key_name);
}
- $sql .= ",\n\tKEY {$key_name} (" . implode(', ', $key) . ")";
+ $sql .= ",\n\tKEY ".$key_name.' ('.implode(', ', $key).')';
}
}
- $sql .= "\n) DEFAULT CHARACTER SET {$this->db->char_set} COLLATE {$this->db->dbcollat};";
-
- return $sql;
+ return $sql."\n) DEFAULT CHARACTER SET ".$this->db->char_set.' COLLATE '.$this->db->dbcollat.';';
}
// --------------------------------------------------------------------
@@ -191,12 +160,11 @@ class CI_DB_mysqli_forge extends CI_DB_forge {
/**
* Drop Table
*
- * @access private
* @return string
*/
- function _drop_table($table)
+ public function _drop_table($table)
{
- return "DROP TABLE IF EXISTS ".$this->db->_escape_identifiers($table);
+ return 'DROP TABLE IF EXISTS '.$this->db->_escape_identifiers($table);
}
// --------------------------------------------------------------------
@@ -207,31 +175,24 @@ class CI_DB_mysqli_forge extends CI_DB_forge {
* 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
+ * @return string
*/
- function _alter_table($alter_type, $table, $fields, $after_field = '')
+ public function _alter_table($alter_type, $table, $fields, $after_field = '')
{
- $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table)." $alter_type ";
+ $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 != '')
+ if ($alter_type === 'DROP')
{
- $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field);
+ return $sql.$this->db->protect_identifiers($fields);
}
- return $sql;
+ return $sql.$this->_process_fields($fields)
+ .($after_field != '' ? ' AFTER '.$this->db->protect_identifiers($after_field) : '');
}
// --------------------------------------------------------------------
@@ -241,18 +202,16 @@ class CI_DB_mysqli_forge extends CI_DB_forge {
*
* 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)
+ public 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;
+ return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name);
}
}
/* End of file mysqli_forge.php */
-/* Location: ./system/database/drivers/mysqli/mysqli_forge.php */ \ No newline at end of file
+/* Location: ./system/database/drivers/mysqli/mysqli_forge.php */
diff --git a/system/database/drivers/mysqli/mysqli_result.php b/system/database/drivers/mysqli/mysqli_result.php
index 124d4e599..0a50cccac 100644
--- a/system/database/drivers/mysqli/mysqli_result.php
+++ b/system/database/drivers/mysqli/mysqli_result.php
@@ -1,27 +1,37 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* MySQLi Result Class
*
* This class extends the parent result class: CI_DB_result
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_mysqli_result extends CI_DB_result {
@@ -29,10 +39,9 @@ class CI_DB_mysqli_result extends CI_DB_result {
/**
* Number of rows in the result set
*
- * @access public
- * @return integer
+ * @return int
*/
- function num_rows()
+ public function num_rows()
{
return @mysqli_num_rows($this->result_id);
}
@@ -42,10 +51,9 @@ class CI_DB_mysqli_result extends CI_DB_result {
/**
* Number of fields in the result set
*
- * @access public
- * @return integer
+ * @return int
*/
- function num_fields()
+ public function num_fields()
{
return @mysqli_num_fields($this->result_id);
}
@@ -57,10 +65,9 @@ class CI_DB_mysqli_result extends CI_DB_result {
*
* Generates an array of column names
*
- * @access public
* @return array
*/
- function list_fields()
+ public function list_fields()
{
$field_names = array();
while ($field = mysqli_fetch_field($this->result_id))
@@ -78,40 +85,36 @@ class CI_DB_mysqli_result extends CI_DB_result {
*
* Generates an array of objects containing field meta-data
*
- * @access public
* @return array
*/
- function field_data()
+ public function field_data()
{
$retval = array();
while ($field = mysqli_fetch_object($this->result_id))
{
preg_match('/([a-zA-Z]+)(\(\d+\))?/', $field->Type, $matches);
- $type = (array_key_exists(1, $matches)) ? $matches[1] : NULL;
- $length = (array_key_exists(2, $matches)) ? preg_replace('/[^\d]/', '', $matches[2]) : NULL;
-
- $F = new stdClass();
- $F->name = $field->Field;
- $F->type = $type;
- $F->default = $field->Default;
- $F->max_length = $length;
- $F->primary_key = ( $field->Key == 'PRI' ? 1 : 0 );
+ $F = new stdClass();
+ $F->name = $field->Field;
+ $F->type = ( ! empty($matches[1])) ? $matches[1] : NULL;
+ $F->default = $field->Default;
+ $F->max_length = ( ! empty($matches[2])) ? preg_replace('/[^\d]/', '', $matches[2]) : NULL;
+ $F->primary_key = (int) ($field->Key === 'PRI');
$retval[] = $F;
}
return $retval;
}
-
+
// --------------------------------------------------------------------
/**
* Free the result
*
- * @return null
+ * @return void
*/
- function free_result()
+ public function free_result()
{
if (is_object($this->result_id))
{
@@ -129,10 +132,9 @@ class CI_DB_mysqli_result extends CI_DB_result {
* this internally before fetching results to make sure the
* result set starts at zero
*
- * @access private
* @return array
*/
- function _data_seek($n = 0)
+ protected function _data_seek($n = 0)
{
return mysqli_data_seek($this->result_id, $n);
}
@@ -144,10 +146,9 @@ class CI_DB_mysqli_result extends CI_DB_result {
*
* Returns the result set as an array
*
- * @access private
* @return array
*/
- function _fetch_assoc()
+ protected function _fetch_assoc()
{
return mysqli_fetch_assoc($this->result_id);
}
@@ -159,16 +160,14 @@ class CI_DB_mysqli_result extends CI_DB_result {
*
* Returns the result set as an object
*
- * @access private
* @return object
*/
- function _fetch_object()
+ protected 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
+/* Location: ./system/database/drivers/mysqli/mysqli_result.php */
diff --git a/system/database/drivers/mysqli/mysqli_utility.php b/system/database/drivers/mysqli/mysqli_utility.php
index e17889b8c..3fdc5c723 100644
--- a/system/database/drivers/mysqli/mysqli_utility.php
+++ b/system/database/drivers/mysqli/mysqli_utility.php
@@ -1,25 +1,35 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* MySQLi Utility Class
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_mysqli_utility extends CI_DB_utility {
@@ -27,12 +37,11 @@ class CI_DB_mysqli_utility extends CI_DB_utility {
/**
* List databases
*
- * @access private
- * @return bool
+ * @return string
*/
- function _list_databases()
+ public function _list_databases()
{
- return "SHOW DATABASES";
+ return 'SHOW DATABASES';
}
// --------------------------------------------------------------------
@@ -42,13 +51,12 @@ class CI_DB_mysqli_utility extends CI_DB_utility {
*
* Generates a platform-specific query so that a table can be optimized
*
- * @access private
* @param string the table name
- * @return object
+ * @return string
*/
- function _optimize_table($table)
+ public function _optimize_table($table)
{
- return "OPTIMIZE TABLE ".$this->db->_escape_identifiers($table);
+ return 'OPTIMIZE TABLE '.$this->db->_escape_identifiers($table);
}
// --------------------------------------------------------------------
@@ -58,13 +66,12 @@ class CI_DB_mysqli_utility extends CI_DB_utility {
*
* Generates a platform-specific query so that a table can be repaired
*
- * @access private
* @param string the table name
- * @return object
+ * @return string
*/
- function _repair_table($table)
+ public function _repair_table($table)
{
- return "REPAIR TABLE ".$this->db->_escape_identifiers($table);
+ return 'REPAIR TABLE '.$this->db->_escape_identifiers($table);
}
// --------------------------------------------------------------------
@@ -72,11 +79,10 @@ class CI_DB_mysqli_utility extends CI_DB_utility {
/**
* MySQLi Export
*
- * @access private
* @param array Preferences
* @return mixed
*/
- function _backup($params = array())
+ public function _backup($params = array())
{
// Currently unsupported
return $this->db->display_error('db_unsuported_feature');
@@ -84,4 +90,4 @@ class CI_DB_mysqli_utility extends CI_DB_utility {
}
/* End of file mysqli_utility.php */
-/* Location: ./system/database/drivers/mysqli/mysqli_utility.php */ \ No newline at end of file
+/* Location: ./system/database/drivers/mysqli/mysqli_utility.php */
diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php
index 930177e62..c6621901b 100644
--- a/system/database/drivers/oci8/oci8_driver.php
+++ b/system/database/drivers/oci8/oci8_driver.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -25,7 +37,7 @@
* @package CodeIgniter
* @subpackage Drivers
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
@@ -136,7 +148,7 @@ class CI_DB_oci8_driver extends CI_DB {
*/
public function db_set_charset($charset, $collation)
{
- // @todo - add support if needed
+ // this is done upon connect
return TRUE;
}
@@ -404,6 +416,7 @@ class CI_DB_oci8_driver extends CI_DB {
}
$str = remove_invisible_characters($str);
+ $str = str_replace("'", "''", $str);
// escape LIKE condition wildcards
if ($like === TRUE)
@@ -648,11 +661,10 @@ class CI_DB_oci8_driver extends CI_DB {
*
* Generates a platform-specific insert string from the supplied data
*
- * @access protected
- * @param string the table name
- * @param array the insert keys
- * @param array the insert values
- * @return string
+ * @param string the table name
+ * @param array the insert keys
+ * @param array the insert values
+ * @return string
*/
protected function _insert_batch($table, $keys, $values)
{
diff --git a/system/database/drivers/oci8/oci8_forge.php b/system/database/drivers/oci8/oci8_forge.php
index 3cd17585a..b4a24cdca 100644
--- a/system/database/drivers/oci8/oci8_forge.php
+++ b/system/database/drivers/oci8/oci8_forge.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -19,7 +31,7 @@
* Oracle Forge Class
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_oci8_forge extends CI_DB_forge {
diff --git a/system/database/drivers/oci8/oci8_result.php b/system/database/drivers/oci8/oci8_result.php
index ae133d7b5..0f69fa9ef 100644
--- a/system/database/drivers/oci8/oci8_result.php
+++ b/system/database/drivers/oci8/oci8_result.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* This class extends the parent result class: CI_DB_result
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_oci8_result extends CI_DB_result {
@@ -45,15 +57,15 @@ class CI_DB_oci8_result extends CI_DB_result {
if ($this->num_rows === 0 && count($this->result_array()) > 0)
{
$this->num_rows = count($this->result_array());
- @oci_execute($this->stmt_id);
+ @oci_execute($this->stmt_id, OCI_DEFAULT);
if ($this->curs_id)
{
- @oci_execute($this->curs_id);
+ @oci_execute($this->curs_id, OCI_DEFAULT);
}
}
- return $rowcount;
+ return $this->num_rows;
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/oci8/oci8_utility.php b/system/database/drivers/oci8/oci8_utility.php
index 854b467e1..d60f98bc4 100644
--- a/system/database/drivers/oci8/oci8_utility.php
+++ b/system/database/drivers/oci8/oci8_utility.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -19,7 +31,7 @@
* Oracle Utility Class
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_oci8_utility extends CI_DB_utility {
diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php
index bcd7937d9..6ba39f0cd 100644
--- a/system/database/drivers/odbc/odbc_driver.php
+++ b/system/database/drivers/odbc/odbc_driver.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -25,7 +37,7 @@
* @package CodeIgniter
* @subpackage Drivers
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_odbc_driver extends CI_DB {
diff --git a/system/database/drivers/odbc/odbc_forge.php b/system/database/drivers/odbc/odbc_forge.php
index 3ec86b4e9..e0ec687c8 100644
--- a/system/database/drivers/odbc/odbc_forge.php
+++ b/system/database/drivers/odbc/odbc_forge.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -19,7 +31,7 @@
* ODBC Forge Class
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/database/
*/
class CI_DB_odbc_forge extends CI_DB_forge {
diff --git a/system/database/drivers/odbc/odbc_result.php b/system/database/drivers/odbc/odbc_result.php
index 5d64a464f..ba660856e 100644
--- a/system/database/drivers/odbc/odbc_result.php
+++ b/system/database/drivers/odbc/odbc_result.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* This class extends the parent result class: CI_DB_result
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_odbc_result extends CI_DB_result {
diff --git a/system/database/drivers/odbc/odbc_utility.php b/system/database/drivers/odbc/odbc_utility.php
index d335bed99..bae3fe853 100644
--- a/system/database/drivers/odbc/odbc_utility.php
+++ b/system/database/drivers/odbc/odbc_utility.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -19,7 +31,7 @@
* ODBC Utility Class
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/database/
*/
class CI_DB_odbc_utility extends CI_DB_utility {
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php
index 5de2079bb..de2b0abeb 100644
--- a/system/database/drivers/pdo/pdo_driver.php
+++ b/system/database/drivers/pdo/pdo_driver.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
* @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 2.1.0
* @filesource
@@ -34,9 +46,10 @@ class CI_DB_pdo_driver extends CI_DB {
// the character used to excape - not necessary for PDO
var $_escape_char = '';
+
+ // clause and character used for LIKE escape sequences
var $_like_escape_str;
var $_like_escape_chr;
-
/**
* The syntax to count rows is slightly different across different
@@ -45,29 +58,36 @@ class CI_DB_pdo_driver extends CI_DB {
*/
var $_count_string = "SELECT COUNT(*) AS ";
var $_random_keyword;
-
+
+ // need to track the pdo DSN, driver and options
+ var $dsn;
+ var $pdodriver;
var $options = array();
function __construct($params)
{
parent::__construct($params);
-
+
+ if (preg_match('/([^;]+):/', $this->dsn, $match) && count($match) == 2)
+ {
+ // If there is a minimum valid dsn string pattern found, we're done
+ // This is for general PDO users, who tend to have a full DSN string.
+ $this->pdodriver = end($match);
+ }
+ else
+ {
+ // Try to build a complete DSN string from params
+ $this->_connect_string($params);
+ }
+
// clause and character used for LIKE escape sequences
- if (strpos($this->hostname, 'mysql') !== FALSE)
+ // this one depends on the driver being used
+ if ($this->pdodriver == 'mysql')
{
$this->_like_escape_str = '';
$this->_like_escape_chr = '';
-
- //Prior to this version, the charset can't be set in the dsn
- if(is_php('5.3.6'))
- {
- $this->hostname .= ";charset={$this->char_set}";
- }
-
- //Set the charset with the connection options
- $this->options['PDO::MYSQL_ATTR_INIT_COMMAND'] = "SET NAMES {$this->char_set}";
}
- else if (strpos($this->hostname, 'odbc') !== FALSE)
+ elseif ($this->pdodriver == 'odbc')
{
$this->_like_escape_str = " {escape '%s'} ";
$this->_like_escape_chr = '!';
@@ -78,14 +98,97 @@ class CI_DB_pdo_driver extends CI_DB {
$this->_like_escape_chr = '!';
}
- $this->hostname .= ";dbname=".$this->database;
-
- $this->trans_enabled = FALSE;
-
+ $this->trans_enabled = FALSE;
$this->_random_keyword = ' RND('.time().')'; // database specific random keyword
}
/**
+ * Connection String
+ *
+ * @access private
+ * @param array
+ * @return void
+ */
+ function _connect_string($params)
+ {
+ if (strpos($this->hostname, ':'))
+ {
+ // hostname generally would have this prototype
+ // $db['hostname'] = 'pdodriver:host(/Server(/DSN))=hostname(/DSN);';
+ // We need to get the prefix (pdodriver used by PDO).
+ $dsnarray = explode(':', $this->hostname);
+ $this->pdodriver = $dsnarray[0];
+
+ // End dsn with a semicolon for extra backward compability
+ // if database property was not empty.
+ if ( ! empty($this->database))
+ {
+ $this->dsn .= rtrim($this->hostname, ';').';';
+ }
+ }
+ else
+ {
+ // Invalid DSN, display an error
+ if ( ! array_key_exists('pdodriver', $params))
+ {
+ show_error('Invalid DB Connection String for PDO');
+ }
+
+ // Assuming that the following DSN string format is used:
+ // $dsn = 'pdo://username:password@hostname:port/database?pdodriver=pgsql';
+ $this->dsn = $this->pdodriver.':';
+
+ // Add hostname to the DSN for databases that need it
+ if ( ! empty($this->hostname)
+ && strpos($this->hostname, ':') === FALSE
+ && in_array($this->pdodriver, array('informix', 'mysql', 'pgsql', 'sybase', 'mssql', 'dblib', 'cubrid')))
+ {
+ $this->dsn .= 'host='.$this->hostname.';';
+ }
+
+ // Add a port to the DSN for databases that can use it
+ if ( ! empty($this->port) && in_array($this->pdodriver, array('informix', 'mysql', 'pgsql', 'ibm', 'cubrid')))
+ {
+ $this->dsn .= 'port='.$this->port.';';
+ }
+ }
+
+ // Add the database name to the DSN, if needed
+ if (stripos($this->dsn, 'dbname') === FALSE
+ && in_array($this->pdodriver, array('4D', 'pgsql', 'mysql', 'firebird', 'sybase', 'mssql', 'dblib', 'cubrid')))
+ {
+ $this->dsn .= 'dbname='.$this->database.';';
+ }
+ elseif (stripos($this->dsn, 'database') === FALSE && in_array($this->pdodriver, array('ibm', 'sqlsrv')))
+ {
+ if (stripos($this->dsn, 'dsn') === FALSE)
+ {
+ $this->dsn .= 'database='.$this->database.';';
+ }
+ }
+ elseif ($this->pdodriver === 'sqlite' && $this->dsn === 'sqlite:')
+ {
+ if ($this->database !== ':memory')
+ {
+ if ( ! file_exists($this->database))
+ {
+ show_error('Invalid DB Connection string for PDO SQLite');
+ }
+
+ $this->dsn .= (strpos($this->database, DIRECTORY_SEPARATOR) !== 0) ? DIRECTORY_SEPARATOR : '';
+ }
+
+ $this->dsn .= $this->database;
+ }
+
+ // Add charset to the DSN, if needed
+ if ( ! empty($this->char_set) && in_array($this->pdodriver, array('4D', 'mysql', 'sybase', 'mssql', 'dblib', 'oci')))
+ {
+ $this->dsn .= 'charset='.$this->char_set.';';
+ }
+ }
+
+ /**
* Non-persistent database connection
*
* @access private called by the base class
@@ -93,9 +196,9 @@ class CI_DB_pdo_driver extends CI_DB {
*/
function db_connect()
{
- $this->options['PDO::ATTR_ERRMODE'] = PDO::ERRMODE_SILENT;
-
- return new PDO($this->hostname, $this->username, $this->password, $this->options);
+ $this->options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_SILENT;
+
+ return $this->pdo_connect();
}
// --------------------------------------------------------------------
@@ -108,10 +211,44 @@ class CI_DB_pdo_driver extends CI_DB {
*/
function db_pconnect()
{
- $this->options['PDO::ATTR_ERRMODE'] = PDO::ERRMODE_SILENT;
- $this->options['PDO::ATTR_PERSISTENT'] = TRUE;
+ $this->options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_SILENT;
+ $this->options[PDO::ATTR_PERSISTENT] = TRUE;
- return new PDO($this->hostname, $this->username, $this->password, $this->options);
+ return $this->pdo_connect();
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * PDO connection
+ *
+ * @access private called by the PDO driver class
+ * @return resource
+ */
+ function pdo_connect()
+ {
+ // Refer : http://php.net/manual/en/ref.pdo-mysql.connection.php
+ if ($this->pdodriver == 'mysql' && is_php('5.3.6'))
+ {
+ $this->options[PDO::MYSQL_ATTR_INIT_COMMAND] = "SET NAMES $this->char_set COLLATE '$this->dbcollat'";
+ }
+
+ // Connecting...
+ try
+ {
+ $db = new PDO($this->dsn, $this->username, $this->password, $this->options);
+ }
+ catch (PDOException $e)
+ {
+ if ($this->db_debug && empty($this->failover))
+ {
+ $this->display_error($e->getMessage(), '', TRUE);
+ }
+
+ return FALSE;
+ }
+
+ return $db;
}
// --------------------------------------------------------------------
@@ -131,6 +268,7 @@ class CI_DB_pdo_driver extends CI_DB {
{
return $this->db->display_error('db_unsuported_feature');
}
+
return FALSE;
}
@@ -160,7 +298,6 @@ class CI_DB_pdo_driver extends CI_DB {
*/
function db_set_charset($charset, $collation)
{
- // @todo - add support if needed
return TRUE;
}
@@ -189,6 +326,7 @@ class CI_DB_pdo_driver extends CI_DB {
function _execute($sql)
{
$sql = $this->_prep_query($sql);
+
$result_id = $this->conn_id->query($sql);
if (is_object($result_id))
@@ -216,6 +354,17 @@ class CI_DB_pdo_driver extends CI_DB {
*/
function _prep_query($sql)
{
+ if ($this->pdodriver === 'pgsql')
+ {
+ // Change the backtick(s) for Postgre
+ $sql = str_replace('`', '"', $sql);
+ }
+ elseif ($this->pdodriver === 'sqlite')
+ {
+ // Change the backtick(s) for SQLite
+ $sql = str_replace('`', '', $sql);
+ }
+
return $sql;
}
@@ -270,6 +419,7 @@ class CI_DB_pdo_driver extends CI_DB {
}
$ret = $this->conn->commit();
+
return $ret;
}
@@ -295,6 +445,7 @@ class CI_DB_pdo_driver extends CI_DB {
}
$ret = $this->conn_id->rollBack();
+
return $ret;
}
@@ -333,7 +484,9 @@ class CI_DB_pdo_driver extends CI_DB {
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),
+ array($this->_like_escape_chr.'%',
+ $this->_like_escape_chr.'_',
+ $this->_like_escape_chr.$this->_like_escape_chr),
$str);
}
@@ -363,9 +516,9 @@ class CI_DB_pdo_driver extends CI_DB {
*/
function insert_id($name=NULL)
{
- //Convenience method for postgres insertid
- if (strpos($this->hostname, 'pgsql') !== FALSE)
+ if ($this->pdodriver == 'pgsql')
{
+ //Convenience method for postgres insertid
$v = $this->_version();
$table = func_num_args() > 0 ? func_get_arg(0) : NULL;
@@ -374,8 +527,10 @@ class CI_DB_pdo_driver extends CI_DB {
{
$sql='SELECT LASTVAL() as ins_id';
}
+
$query = $this->query($sql);
- $row = $query->row();
+ $row = $query->row();
+
return $row->ins_id;
}
else
@@ -403,7 +558,9 @@ class CI_DB_pdo_driver extends CI_DB {
return 0;
}
- $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows') . " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE));
+ $sql = $this->_count_string.$this->_protect_identifiers('numrows').' FROM ';
+ $sql .= $this->_protect_identifiers($table, TRUE, NULL, FALSE);
+ $query = $this->query($sql);
if ($query->num_rows() == 0)
{
@@ -412,6 +569,7 @@ class CI_DB_pdo_driver extends CI_DB {
$row = $query->row();
$this->_reset_select();
+
return (int) $row->numrows;
}
@@ -428,12 +586,19 @@ class CI_DB_pdo_driver extends CI_DB {
*/
function _list_tables($prefix_limit = FALSE)
{
- $sql = "SHOW TABLES FROM `".$this->database."`";
+ if ($this->pdodriver == 'pgsql')
+ {
+ // Analog function to show all tables in postgre
+ $sql = "SELECT * FROM information_schema.tables WHERE table_schema = 'public'";
+ }
+ else
+ {
+ $sql = "SHOW TABLES FROM `".$this->database."`";
+ }
if ($prefix_limit !== FALSE AND $this->dbprefix != '')
{
- //$sql .= " LIKE '".$this->escape_like_str($this->dbprefix)."%' ".sprintf($this->_like_escape_str, $this->_like_escape_chr);
- return FALSE; // not currently supported
+ return FALSE;
}
return $sql;
@@ -452,7 +617,7 @@ class CI_DB_pdo_driver extends CI_DB {
*/
function _list_columns($table = '')
{
- return "SHOW COLUMNS FROM ".$table;
+ return 'SHOW COLUMNS FROM '.$this->_from_tables($table);
}
// --------------------------------------------------------------------
@@ -468,7 +633,7 @@ class CI_DB_pdo_driver extends CI_DB {
*/
function _field_data($table)
{
- return "SELECT TOP 1 FROM ".$table;
+ return 'SELECT TOP 1 FROM '.$this->_from_tables($table);
}
// --------------------------------------------------------------------
@@ -482,6 +647,7 @@ class CI_DB_pdo_driver extends CI_DB {
function _error_message()
{
$error_array = $this->conn_id->errorInfo();
+
return $error_array[2];
}
@@ -529,8 +695,8 @@ class CI_DB_pdo_driver extends CI_DB {
if (strpos($item, '.') !== FALSE)
{
- $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item).$this->_escape_char;
-
+ $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item);
+ $str .= $this->_escape_char;
}
else
{
@@ -560,7 +726,7 @@ class CI_DB_pdo_driver extends CI_DB {
$tables = array($tables);
}
- return (count($tables) == 1) ? $tables[0] : '('.implode(', ', $tables).')';
+ return (count($tables) == 1) ? '`'.$tables[0].'`' : '('.implode(', ', $tables).')';
}
// --------------------------------------------------------------------
@@ -578,7 +744,7 @@ class CI_DB_pdo_driver extends CI_DB {
*/
function _insert($table, $keys, $values)
{
- return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")";
+ return 'INSERT INTO '.$this->_from_tables($table).' ('.implode(', ', $keys).') VALUES ('.implode(', ', $values).')';
}
// --------------------------------------------------------------------
@@ -596,7 +762,7 @@ class CI_DB_pdo_driver extends CI_DB {
*/
function _insert_batch($table, $keys, $values)
{
- return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES ".implode(', ', $values);
+ return 'INSERT INTO '.$this->_from_tables($table).' ('.implode(', ', $keys).') VALUES '.implode(', ', $values);
}
// --------------------------------------------------------------------
@@ -621,14 +787,11 @@ class CI_DB_pdo_driver extends CI_DB {
$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) : '';
+ $limit = ( ! $limit) ? '' : ' LIMIT '.$limit;
+ $orderby = (count($orderby) >= 1) ? ' ORDER BY '.implode(', ', $orderby) : '';
+ $sql = 'UPDATE '.$this->_from_tables($table).' SET '.implode(', ', $valstr);
+ $sql .= ($where != '' && count($where) >= 1) ? ' WHERE '.implode(' ', $where) : '';
$sql .= $orderby.$limit;
return $sql;
@@ -649,8 +812,8 @@ class CI_DB_pdo_driver extends CI_DB {
*/
function _update_batch($table, $values, $index, $where = NULL)
{
- $ids = array();
- $where = ($where != '' AND count($where) >=1) ? implode(" ", $where).' AND ' : '';
+ $ids = array();
+ $where = ($where != '' && count($where) >=1) ? implode(" ", $where).' AND ' : '';
foreach ($values as $key => $val)
{
@@ -665,12 +828,13 @@ class CI_DB_pdo_driver extends CI_DB {
}
}
- $sql = "UPDATE ".$table." SET ";
+ $sql = 'UPDATE '.$this->_from_tables($table).' SET ';
$cases = '';
foreach ($final as $k => $v)
{
$cases .= $k.' = CASE '."\n";
+
foreach ($v as $row)
{
$cases .= $row."\n";
@@ -680,7 +844,6 @@ class CI_DB_pdo_driver extends CI_DB {
}
$sql .= substr($cases, 0, -2);
-
$sql .= ' WHERE '.$where.$index.' IN ('.implode(',', $ids).')';
return $sql;
@@ -724,19 +887,20 @@ class CI_DB_pdo_driver extends CI_DB {
if (count($where) > 0 OR count($like) > 0)
{
- $conditions = "\nWHERE ";
+ $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;
+ return 'DELETE FROM '.$this->_from_tables($table).$conditions.$limit;
}
// --------------------------------------------------------------------
@@ -754,27 +918,16 @@ class CI_DB_pdo_driver extends CI_DB {
*/
function _limit($sql, $limit, $offset)
{
- if (strpos($this->hostname, 'cubrid') !== FALSE || strpos($this->hostname, 'sqlite') !== FALSE)
+ if ($this->pdodriver == 'cubrid' OR $this->pdodriver == 'sqlite')
{
- if ($offset == 0)
- {
- $offset = '';
- }
- else
- {
- $offset .= ", ";
- }
+ $offset = ($offset == 0) ? '' : $offset.', ';
- return $sql."LIMIT ".$offset.$limit;
+ return $sql.'LIMIT '.$offset.$limit;
}
else
{
- $sql .= "LIMIT ".$limit;
-
- if ($offset > 0)
- {
- $sql .= " OFFSET ".$offset;
- }
+ $sql .= 'LIMIT '.$limit;
+ $sql .= ($offset > 0) ? ' OFFSET '.$offset : '';
return $sql;
}
@@ -794,10 +947,7 @@ class CI_DB_pdo_driver extends CI_DB {
$this->conn_id = null;
}
-
}
-
-
/* End of file pdo_driver.php */
/* Location: ./system/database/drivers/pdo/pdo_driver.php */ \ No newline at end of file
diff --git a/system/database/drivers/pdo/pdo_forge.php b/system/database/drivers/pdo/pdo_forge.php
index 1462e8c21..478b2dbfb 100644
--- a/system/database/drivers/pdo/pdo_forge.php
+++ b/system/database/drivers/pdo/pdo_forge.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
* @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 2.1.0
* @filesource
@@ -84,7 +96,7 @@ class CI_DB_pdo_forge extends CI_DB_forge {
$sql .= 'IF NOT EXISTS ';
}
- $sql .= $this->db->_escape_identifiers($table)." (";
+ $sql .= '`'.$this->db->_escape_identifiers($table).'` (';
$current_field_count = 0;
foreach ($fields as $field=>$attributes)
@@ -99,6 +111,7 @@ class CI_DB_pdo_forge extends CI_DB_forge {
else
{
$attributes = array_change_key_case($attributes, CASE_UPPER);
+ $numeric = array('SERIAL', 'INTEGER');
$sql .= "\n\t".$this->db->_protect_identifiers($field);
@@ -106,7 +119,11 @@ class CI_DB_pdo_forge extends CI_DB_forge {
if (array_key_exists('CONSTRAINT', $attributes))
{
- $sql .= '('.$attributes['CONSTRAINT'].')';
+ // Exception for Postgre numeric which not too happy with constraint within those type
+ if ( ! ($this->db->pdodriver == 'pgsql' && in_array($attributes['TYPE'], $numeric)))
+ {
+ $sql .= '('.$attributes['CONSTRAINT'].')';
+ }
}
if (array_key_exists('UNSIGNED', $attributes) && $attributes['UNSIGNED'] === TRUE)
@@ -207,7 +224,7 @@ class CI_DB_pdo_forge extends CI_DB_forge {
*/
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);
+ $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')
@@ -259,7 +276,6 @@ class CI_DB_pdo_forge extends CI_DB_forge {
return $sql;
}
-
}
/* End of file pdo_forge.php */
diff --git a/system/database/drivers/pdo/pdo_result.php b/system/database/drivers/pdo/pdo_result.php
index 7f3058ff0..c333abc40 100644
--- a/system/database/drivers/pdo/pdo_result.php
+++ b/system/database/drivers/pdo/pdo_result.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
* @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 2.1.0
* @filesource
@@ -27,6 +39,16 @@
class CI_DB_pdo_result extends CI_DB_result {
/**
+ * @var bool Hold the flag whether a result handler already fetched before
+ */
+ protected $is_fetched = FALSE;
+
+ /**
+ * @var mixed Hold the fetched assoc array of a result handler
+ */
+ protected $result_assoc;
+
+ /**
* Number of rows in the result set
*
* @access public
@@ -34,7 +56,59 @@ class CI_DB_pdo_result extends CI_DB_result {
*/
function num_rows()
{
- return $this->result_id->rowCount();
+ if (empty($this->result_id) OR ! is_object($this->result_id))
+ {
+ // invalid result handler
+ return 0;
+ }
+ elseif (($num_rows = $this->result_id->rowCount()) && $num_rows > 0)
+ {
+ // If rowCount return something, we're done.
+ return $num_rows;
+ }
+
+ // Fetch the result, instead perform another extra query
+ return ($this->is_fetched && is_array($this->result_assoc)) ? count($this->result_assoc) : count($this->result_assoc());
+ }
+
+ /**
+ * Fetch the result handler
+ *
+ * @access public
+ * @return mixed
+ */
+ function result_assoc()
+ {
+ // If the result already fetched before, use that one
+ if (count($this->result_array) > 0 OR $this->is_fetched)
+ {
+ return $this->result_array();
+ }
+
+ // Define the output
+ $output = array('assoc', 'object');
+
+ // Fetch the result
+ foreach ($output as $type)
+ {
+ // Define the method and handler
+ $res_method = '_fetch_'.$type;
+ $res_handler = 'result_'.$type;
+
+ $this->$res_handler = array();
+ $this->_data_seek(0);
+
+ while ($row = $this->$res_method())
+ {
+ $this->{$res_handler}[] = $row;
+ }
+ }
+
+ // Save this as buffer and marked the fetch flag
+ $this->result_array = $this->result_assoc;
+ $this->is_fetched = TRUE;
+
+ return $this->result_assoc;
}
// --------------------------------------------------------------------
@@ -66,6 +140,7 @@ class CI_DB_pdo_result extends CI_DB_result {
{
return $this->db->display_error('db_unsuported_feature');
}
+
return FALSE;
}
@@ -98,6 +173,7 @@ class CI_DB_pdo_result extends CI_DB_result {
{
return $this->db->display_error('db_unsuported_feature');
}
+
return FALSE;
}
}
@@ -166,6 +242,5 @@ class CI_DB_pdo_result extends CI_DB_result {
}
-
/* End of file pdo_result.php */
/* Location: ./system/database/drivers/pdo/pdo_result.php */ \ No newline at end of file
diff --git a/system/database/drivers/pdo/pdo_utility.php b/system/database/drivers/pdo/pdo_utility.php
index 29aefca80..971ec8803 100644
--- a/system/database/drivers/pdo/pdo_utility.php
+++ b/system/database/drivers/pdo/pdo_utility.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
* @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 2.1.0
* @filesource
diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php
index 5367f9759..42329bded 100644
--- a/system/database/drivers/postgre/postgre_driver.php
+++ b/system/database/drivers/postgre/postgre_driver.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -25,7 +37,7 @@
* @package CodeIgniter
* @subpackage Drivers
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_postgre_driver extends CI_DB {
diff --git a/system/database/drivers/postgre/postgre_forge.php b/system/database/drivers/postgre/postgre_forge.php
index 91a1c6861..756fd347a 100644
--- a/system/database/drivers/postgre/postgre_forge.php
+++ b/system/database/drivers/postgre/postgre_forge.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -19,7 +31,7 @@
* Postgre Forge Class
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_postgre_forge extends CI_DB_forge {
@@ -51,31 +63,16 @@ class CI_DB_postgre_forge extends CI_DB_forge {
}
// --------------------------------------------------------------------
-
+
/**
- * Create Table
+ * Process Fields
*
- * @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
+ * @param mixed the fields
+ * @return string
*/
- function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists)
+ function _process_fields($fields, $primary_keys=array())
{
- $sql = 'CREATE TABLE ';
-
- if ($if_not_exists === TRUE)
- {
- if ($this->db->table_exists($table))
- {
- return "SELECT * FROM $table"; // Needs to return innocous but valid SQL statement
- }
- }
-
- $sql .= $this->db->_escape_identifiers($table)." (";
+ $sql = '';
$current_field_count = 0;
foreach ($fields as $field=>$attributes)
@@ -171,6 +168,38 @@ class CI_DB_postgre_forge extends CI_DB_forge {
$sql .= ',';
}
}
+
+ return $sql;
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * 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)
+ {
+ // PostgreSQL doesn't support IF NOT EXISTS syntax so we check if table exists manually
+ if ($this->db->table_exists($table))
+ {
+ return TRUE;
+ }
+ }
+
+ $sql .= $this->db->_escape_identifiers($table)." (";
+ $sql .= $this->_process_fields($fields, $primary_keys);
if (count($primary_keys) > 0)
{
@@ -212,9 +241,6 @@ class CI_DB_postgre_forge extends CI_DB_forge {
/**
* Drop Table
- *
- * @access private
- * @return bool
*/
function _drop_table($table)
{
@@ -239,40 +265,25 @@ class CI_DB_postgre_forge extends CI_DB_forge {
* @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);
+ 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;
- }
+ // DROP has everything it needs now.
+ if ($alter_type == 'DROP')
+ {
+ return $sql.$this->db->_protect_identifiers($fields);
+ }
- $sql .= " $column_definition";
+ $sql .= $this->_process_fields($fields);
- if ($default_value != '')
- {
- $sql .= " DEFAULT \"$default_value\"";
- }
+ if ($after_field != '')
+ {
+ $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field);
+ }
- if ($null === NULL)
- {
- $sql .= ' NULL';
- }
- else
- {
- $sql .= ' NOT NULL';
- }
-
- if ($after_field != '')
- {
- $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field);
- }
-
- return $sql;
-
- }
+ return $sql;
+ }
// --------------------------------------------------------------------
@@ -291,8 +302,6 @@ class CI_DB_postgre_forge extends CI_DB_forge {
$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 */
diff --git a/system/database/drivers/postgre/postgre_result.php b/system/database/drivers/postgre/postgre_result.php
index e9a1d1607..9161bf955 100644
--- a/system/database/drivers/postgre/postgre_result.php
+++ b/system/database/drivers/postgre/postgre_result.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* This class extends the parent result class: CI_DB_result
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_postgre_result extends CI_DB_result {
diff --git a/system/database/drivers/postgre/postgre_utility.php b/system/database/drivers/postgre/postgre_utility.php
index 741c52ea8..dffd8c549 100644
--- a/system/database/drivers/postgre/postgre_utility.php
+++ b/system/database/drivers/postgre/postgre_utility.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -19,7 +31,7 @@
* Postgre Utility Class
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_postgre_utility extends CI_DB_utility {
diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php
index 0cc898b38..28c3caecd 100644
--- a/system/database/drivers/sqlite/sqlite_driver.php
+++ b/system/database/drivers/sqlite/sqlite_driver.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -27,7 +39,7 @@
* @package CodeIgniter
* @subpackage Drivers
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_sqlite_driver extends CI_DB {
diff --git a/system/database/drivers/sqlite/sqlite_forge.php b/system/database/drivers/sqlite/sqlite_forge.php
index 56904082e..2b723be0b 100644
--- a/system/database/drivers/sqlite/sqlite_forge.php
+++ b/system/database/drivers/sqlite/sqlite_forge.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -19,7 +31,7 @@
* SQLite Forge Class
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_sqlite_forge extends CI_DB_forge {
diff --git a/system/database/drivers/sqlite/sqlite_result.php b/system/database/drivers/sqlite/sqlite_result.php
index 7bd30db7c..74c0dc549 100644
--- a/system/database/drivers/sqlite/sqlite_result.php
+++ b/system/database/drivers/sqlite/sqlite_result.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* This class extends the parent result class: CI_DB_result
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_sqlite_result extends CI_DB_result {
diff --git a/system/database/drivers/sqlite/sqlite_utility.php b/system/database/drivers/sqlite/sqlite_utility.php
index 508023e2f..f00687e38 100644
--- a/system/database/drivers/sqlite/sqlite_utility.php
+++ b/system/database/drivers/sqlite/sqlite_utility.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -19,7 +31,7 @@
* SQLite Utility Class
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_sqlite_utility extends CI_DB_utility {
diff --git a/system/database/drivers/sqlsrv/sqlsrv_driver.php b/system/database/drivers/sqlsrv/sqlsrv_driver.php
index 400fd31c6..9c50209ec 100644
--- a/system/database/drivers/sqlsrv/sqlsrv_driver.php
+++ b/system/database/drivers/sqlsrv/sqlsrv_driver.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -25,7 +37,7 @@
* @package CodeIgniter
* @subpackage Drivers
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_sqlsrv_driver extends CI_DB {
@@ -86,7 +98,7 @@ class CI_DB_sqlsrv_driver extends CI_DB {
*/
function db_pconnect()
{
- $this->db_connect(TRUE);
+ return $this->db_connect(TRUE);
}
// --------------------------------------------------------------------
@@ -110,12 +122,23 @@ class CI_DB_sqlsrv_driver extends CI_DB {
/**
* Select the database
*
- * @access private called by the base class
- * @return resource
+ * @param string database name
+ * @return bool
*/
- function db_select()
+ public function db_select($database = '')
{
- return $this->_execute('USE ' . $this->database);
+ if ($database === '')
+ {
+ $database = $this->database;
+ }
+
+ if ($this->_execute('USE '.$database))
+ {
+ $this->database = $database;
+ return TRUE;
+ }
+
+ return FALSE;
}
// --------------------------------------------------------------------
@@ -596,4 +619,4 @@ class CI_DB_sqlsrv_driver extends CI_DB {
/* End of file mssql_driver.php */
-/* Location: ./system/database/drivers/mssql/mssql_driver.php */ \ No newline at end of file
+/* Location: ./system/database/drivers/mssql/mssql_driver.php */
diff --git a/system/database/drivers/sqlsrv/sqlsrv_forge.php b/system/database/drivers/sqlsrv/sqlsrv_forge.php
index cc88ec5ca..2a7766927 100644
--- a/system/database/drivers/sqlsrv/sqlsrv_forge.php
+++ b/system/database/drivers/sqlsrv/sqlsrv_forge.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -19,7 +31,7 @@
* SQLSRV Forge Class
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_sqlsrv_forge extends CI_DB_forge {
diff --git a/system/database/drivers/sqlsrv/sqlsrv_result.php b/system/database/drivers/sqlsrv/sqlsrv_result.php
index bf0abd1c6..1ee19c2d1 100644
--- a/system/database/drivers/sqlsrv/sqlsrv_result.php
+++ b/system/database/drivers/sqlsrv/sqlsrv_result.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* This class extends the parent result class: CI_DB_result
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_sqlsrv_result extends CI_DB_result {
diff --git a/system/database/drivers/sqlsrv/sqlsrv_utility.php b/system/database/drivers/sqlsrv/sqlsrv_utility.php
index 13a1850c4..e96df96f9 100644
--- a/system/database/drivers/sqlsrv/sqlsrv_utility.php
+++ b/system/database/drivers/sqlsrv/sqlsrv_utility.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -19,7 +31,7 @@
* SQLSRV Utility Class
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_sqlsrv_utility extends CI_DB_utility {
diff --git a/system/helpers/array_helper.php b/system/helpers/array_helper.php
index 075a31fdf..c46c4d103 100644
--- a/system/helpers/array_helper.php
+++ b/system/helpers/array_helper.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/helpers/array_helper.html
*/
diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php
index 19ec0c778..668b034d4 100644
--- a/system/helpers/captcha_helper.php
+++ b/system/helpers/captcha_helper.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/helpers/xml_helper.html
*/
@@ -243,4 +255,4 @@ if ( ! function_exists('create_captcha'))
// ------------------------------------------------------------------------
/* End of file captcha_helper.php */
-/* Location: ./system/heleprs/captcha_helper.php */ \ No newline at end of file
+/* Location: ./system/helpers/captcha_helper.php */ \ No newline at end of file
diff --git a/system/helpers/cookie_helper.php b/system/helpers/cookie_helper.php
index 7cee02827..7b439c47f 100644
--- a/system/helpers/cookie_helper.php
+++ b/system/helpers/cookie_helper.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/helpers/cookie_helper.html
*/
diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php
index 0aeb7fafb..9e58d8630 100644
--- a/system/helpers/date_helper.php
+++ b/system/helpers/date_helper.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/helpers/date_helper.html
*/
@@ -54,10 +66,8 @@ if ( ! function_exists('now'))
return $system_time;
}
- else
- {
- return time();
- }
+
+ return time();
}
}
@@ -85,12 +95,18 @@ if ( ! function_exists('mdate'))
function mdate($datestr = '', $time = '')
{
if ($datestr == '')
+ {
return '';
+ }
- if ($time == '')
- $time = now();
+ $time = ($time == '') ? now() : $time;
+
+ $datestr = str_replace(
+ '%\\',
+ '',
+ preg_replace("/([a-z]+?){1}/i", "\\\\\\1", $datestr)
+ );
- $datestr = str_replace('%\\', '', preg_replace("/([a-z]+?){1}/i", "\\\\\\1", $datestr));
return date($datestr, $time);
}
}
@@ -162,25 +178,18 @@ if ( ! function_exists('timespan'))
$time = time();
}
- if ($time <= $seconds)
- {
- $seconds = 1;
- }
- else
- {
- $seconds = $time - $seconds;
- }
+ $seconds = ($time <= $seconds) ? 1 : $time - $seconds;
$str = '';
- $years = floor($seconds / 31536000);
+ $years = floor($seconds / 31557600);
if ($years > 0)
{
$str .= $years.' '.$CI->lang->line((($years > 1) ? 'date_years' : 'date_year')).', ';
}
- $seconds -= $years * 31536000;
- $months = floor($seconds / 2628000);
+ $seconds -= $years * 31557600;
+ $months = floor($seconds / 2629743);
if ($years > 0 OR $months > 0)
{
@@ -189,7 +198,7 @@ if ( ! function_exists('timespan'))
$str .= $months.' '.$CI->lang->line((($months > 1) ? 'date_months' : 'date_month')).', ';
}
- $seconds -= $months * 2628000;
+ $seconds -= $months * 2629743;
}
$weeks = floor($seconds / 604800);
@@ -303,9 +312,18 @@ 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));
+ return mktime(
+ gmdate("H", $time),
+ gmdate("i", $time),
+ gmdate("s", $time),
+ gmdate("m", $time),
+ gmdate("d", $time),
+ gmdate("Y", $time)
+ );
}
}
@@ -366,14 +384,14 @@ if ( ! function_exists('mysql_to_unix'))
$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)
- );
+ 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)
+ );
}
}
@@ -475,13 +493,19 @@ if ( ! function_exists('human_to_unix'))
$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);
@@ -491,6 +515,73 @@ if ( ! function_exists('human_to_unix'))
// ------------------------------------------------------------------------
/**
+ * Turns many "reasonably-date-like" strings into something
+ * that is actually useful. This only works for dates after unix epoch.
+ *
+ * @access public
+ * @param string The terribly formatted date-like string
+ * @param string Date format to return (same as php date function)
+ * @return string
+ */
+if ( ! function_exists('nice_date'))
+{
+ function nice_date($bad_date = '', $format = FALSE)
+ {
+ if (empty($bad_date))
+ {
+ return 'Unknown';
+ }
+
+ // Date like: YYYYMM
+ if (preg_match('/^\d{6}$/', $bad_date))
+ {
+ if (in_array(substr($bad_date, 0, 2),array('19', '20')))
+ {
+ $year = substr($bad_date, 0, 4);
+ $month = substr($bad_date, 4, 2);
+ }
+ else
+ {
+ $month = substr($bad_date, 0, 2);
+ $year = substr($bad_date, 2, 4);
+ }
+
+ return date($format, strtotime($year . '-' . $month . '-01'));
+ }
+
+ // Date Like: YYYYMMDD
+ if (preg_match('/^\d{8}$/',$bad_date))
+ {
+ $month = substr($bad_date, 0, 2);
+ $day = substr($bad_date, 2, 2);
+ $year = substr($bad_date, 4, 4);
+
+ return date($format, strtotime($month . '/01/' . $year));
+ }
+
+ // Date Like: MM-DD-YYYY __or__ M-D-YYYY (or anything in between)
+ if (preg_match('/^\d{1,2}-\d{1,2}-\d{4}$/',$bad_date))
+ {
+ list($m, $d, $y) = explode('-', $bad_date);
+ return date($format, strtotime("{$y}-{$m}-{$d}"));
+ }
+
+ // Any other kind of string, when converted into UNIX time,
+ // produces "0 seconds after epoc..." is probably bad...
+ // return "Invalid Date".
+ if (date('U', strtotime($bad_date)) == '0')
+ {
+ return "Invalid Date";
+ }
+
+ // It's probably a valid-ish date format already
+ return date($format, strtotime($bad_date));
+ }
+}
+
+// ------------------------------------------------------------------------
+
+/**
* Timezone Menu
*
* Generates a drop-down menu of timezones.
@@ -508,8 +599,7 @@ if ( ! function_exists('timezone_menu'))
$CI =& get_instance();
$CI->lang->load('date');
- if ($default == 'GMT')
- $default = 'UTC';
+ $default = ($default == 'GMT') ? 'UTC' : $default;
$menu = '<select name="'.$name.'"';
@@ -552,60 +642,58 @@ if ( ! function_exists('timezones'))
// 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
- );
+ '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';
+ $tz = ($tz == 'GMT') ? 'UTC' : $tz;
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 38347fa62..be65b388d 100644
--- a/system/helpers/directory_helper.php
+++ b/system/helpers/directory_helper.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/helpers/directory_helper.html
*/
diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php
index 1145688ae..aea948d81 100644
--- a/system/helpers/download_helper.php
+++ b/system/helpers/download_helper.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/helpers/download_helper.html
*/
@@ -76,26 +88,20 @@ if ( ! function_exists('force_download'))
{
$mime = (is_array($mimes[$extension])) ? $mimes[$extension][0] : $mimes[$extension];
}
-
+
// Generate the server headers
- if (strpos($_SERVER['HTTP_USER_AGENT'], "MSIE") !== FALSE)
+ header('Content-Type: "'.$mime.'"');
+ header('Content-Disposition: attachment; filename="'.$filename.'"');
+ header('Expires: 0');
+ header("Content-Transfer-Encoding: binary");
+ header("Content-Length: ".strlen($data));
+ header('Pragma: no-cache');
+
+ // Internet Explorer-specific headers.
+ if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], "MSIE") !== FALSE)
{
- header('Content-Type: "'.$mime.'"');
- header('Content-Disposition: attachment; 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($data));
- }
- else
- {
- header('Content-Type: "'.$mime.'"');
- header('Content-Disposition: attachment; filename="'.$filename.'"');
- header("Content-Transfer-Encoding: binary");
- header('Expires: 0');
- header('Pragma: no-cache');
- header("Content-Length: ".strlen($data));
}
exit($data);
diff --git a/system/helpers/email_helper.php b/system/helpers/email_helper.php
index 651aef439..f184031a9 100644
--- a/system/helpers/email_helper.php
+++ b/system/helpers/email_helper.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/helpers/email_helper.html
*/
@@ -37,7 +49,7 @@ if ( ! function_exists('valid_email'))
{
function valid_email($address)
{
- return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address)) ? FALSE : TRUE;
+ return (bool) preg_match('/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix', $address);
}
}
@@ -57,6 +69,5 @@ if ( ! function_exists('send_email'))
}
}
-
/* End of file email_helper.php */
-/* Location: ./system/helpers/email_helper.php */ \ No newline at end of file
+/* Location: ./system/helpers/email_helper.php */
diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php
index 3931667fd..2d4b10e37 100644
--- a/system/helpers/file_helper.php
+++ b/system/helpers/file_helper.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/helpers/file_helpers.html
*/
@@ -130,15 +142,11 @@ if ( ! function_exists('delete_files'))
while (FALSE !== ($filename = @readdir($current_dir)))
{
- if ($filename != "." and $filename != "..")
+ if ($filename !== '.' and $filename !== '..')
{
- if (is_dir($path.DIRECTORY_SEPARATOR.$filename))
+ if (is_dir($path.DIRECTORY_SEPARATOR.$filename) && $filename[0] !== '.')
{
- // Ignore empty folders
- if (substr($filename, 0, 1) != '.')
- {
- delete_files($path.DIRECTORY_SEPARATOR.$filename, $del_dir, $level + 1);
- }
+ delete_files($path.DIRECTORY_SEPARATOR.$filename, $del_dir, $level + 1);
}
else
{
@@ -188,21 +196,21 @@ if ( ! function_exists('get_filenames'))
while (FALSE !== ($file = readdir($fp)))
{
- if (@is_dir($source_dir.$file) && strncmp($file, '.', 1) !== 0)
+ if (@is_dir($source_dir.$file) && $file[0] !== '.')
{
get_filenames($source_dir.$file.DIRECTORY_SEPARATOR, $include_path, TRUE);
}
- elseif (strncmp($file, '.', 1) !== 0)
+ elseif ($file[0] !== '.')
{
$_filedata[] = ($include_path == TRUE) ? $source_dir.$file : $file;
}
}
+ closedir($fp);
+
return $_filedata;
}
- else
- {
- return FALSE;
- }
+
+ return FALSE;
}
}
@@ -241,23 +249,22 @@ if ( ! function_exists('get_dir_file_info'))
// foreach (scandir($source_dir, 1) as $file) // In addition to being PHP5+, scandir() is simply not as fast
while (FALSE !== ($file = readdir($fp)))
{
- if (@is_dir($source_dir.$file) AND strncmp($file, '.', 1) !== 0 AND $top_level_only === FALSE)
+ if (@is_dir($source_dir.$file) && $file[0] !== '.' && $top_level_only === FALSE)
{
get_dir_file_info($source_dir.$file.DIRECTORY_SEPARATOR, $top_level_only, TRUE);
}
- elseif (strncmp($file, '.', 1) !== 0)
+ elseif ($file[0] !== '.')
{
$_filedata[$file] = get_file_info($source_dir.$file);
$_filedata[$file]['relative_path'] = $relative_path;
}
}
+ closedir($fp);
return $_filedata;
}
- else
- {
- return FALSE;
- }
+
+ return FALSE;
}
}
@@ -352,7 +359,7 @@ if ( ! function_exists('get_mime_by_extension'))
if ( ! is_array($mimes))
{
- if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
+ if (defined('ENVIRONMENT') && is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
{
include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php');
}
@@ -379,10 +386,8 @@ if ( ! function_exists('get_mime_by_extension'))
return $mimes[$extension];
}
}
- else
- {
- return FALSE;
- }
+
+ return FALSE;
}
}
@@ -402,31 +407,31 @@ if ( ! function_exists('symbolic_permissions'))
{
function symbolic_permissions($perms)
{
- if (($perms & 0xC000) == 0xC000)
+ if (($perms & 0xC000) === 0xC000)
{
$symbolic = 's'; // Socket
}
- elseif (($perms & 0xA000) == 0xA000)
+ elseif (($perms & 0xA000) === 0xA000)
{
$symbolic = 'l'; // Symbolic Link
}
- elseif (($perms & 0x8000) == 0x8000)
+ elseif (($perms & 0x8000) === 0x8000)
{
$symbolic = '-'; // Regular
}
- elseif (($perms & 0x6000) == 0x6000)
+ elseif (($perms & 0x6000) === 0x6000)
{
$symbolic = 'b'; // Block special
}
- elseif (($perms & 0x4000) == 0x4000)
+ elseif (($perms & 0x4000) === 0x4000)
{
$symbolic = 'd'; // Directory
}
- elseif (($perms & 0x2000) == 0x2000)
+ elseif (($perms & 0x2000) === 0x2000)
{
$symbolic = 'c'; // Character special
}
- elseif (($perms & 0x1000) == 0x1000)
+ elseif (($perms & 0x1000) === 0x1000)
{
$symbolic = 'p'; // FIFO pipe
}
@@ -436,19 +441,19 @@ if ( ! function_exists('symbolic_permissions'))
}
// Owner
- $symbolic .= (($perms & 0x0100) ? 'r' : '-');
- $symbolic .= (($perms & 0x0080) ? 'w' : '-');
- $symbolic .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-'));
+ $symbolic .= (($perms & 0x0100) ? 'r' : '-')
+ . (($perms & 0x0080) ? 'w' : '-')
+ . (($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' : '-'));
+ $symbolic .= (($perms & 0x0020) ? 'r' : '-')
+ . (($perms & 0x0010) ? 'w' : '-')
+ . (($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' : '-'));
+ $symbolic .= (($perms & 0x0004) ? 'r' : '-')
+ . (($perms & 0x0002) ? 'w' : '-')
+ . (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-'));
return $symbolic;
}
@@ -474,6 +479,5 @@ if ( ! function_exists('octal_permissions'))
}
}
-
/* End of file file_helper.php */
-/* Location: ./system/helpers/file_helper.php */ \ No newline at end of file
+/* Location: ./system/helpers/file_helper.php */
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index 8733ae053..bed2cb297 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/helpers/form_helper.html
*/
@@ -58,14 +70,10 @@ if ( ! function_exists('form_open'))
// If no action is provided then set to the current url
$action OR $action = $CI->config->site_url($CI->uri->uri_string());
- $form = '<form action="'.$action.'"';
+ $form = '<form action="'.$action.'"'._attributes_to_string($attributes, TRUE).">\n";
- $form .= _attributes_to_string($attributes, TRUE);
-
- $form .= '>';
-
- // 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->base_url()) === FALSE OR strpos($form, 'method="get"')))
+ // 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();
}
@@ -144,7 +152,7 @@ if ( ! function_exists('form_hidden'))
if ( ! is_array($value))
{
- $form .= '<input type="hidden" name="'.$name.'" value="'.form_prep($value, $name).'" />'."\n";
+ $form .= '<input type="hidden" name="'.$name.'" value="'.form_prep($value, $name)."\" />\n";
}
else
{
@@ -176,7 +184,7 @@ if ( ! function_exists('form_input'))
{
$defaults = array('type' => 'text', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value);
- return "<input "._parse_form_attributes($data, $defaults).$extra." />";
+ return '<input '._parse_form_attributes($data, $defaults).$extra." />\n";
}
}
@@ -262,7 +270,7 @@ if ( ! function_exists('form_textarea'))
}
$name = (is_array($data)) ? $data['name'] : $data;
- return "<textarea "._parse_form_attributes($data, $defaults).$extra.">".form_prep($val, $name)."</textarea>";
+ return '<textarea '._parse_form_attributes($data, $defaults).$extra.'>'.form_prep($val, $name)."</textarea>\n";
}
}
@@ -313,13 +321,9 @@ if ( ! function_exists('form_dropdown'))
}
// If no selected state was submitted we will attempt to set it automatically
- if (count($selected) === 0)
+ if (count($selected) === 0 && isset($_POST[$name]))
{
- // If the form name appears in the $_POST array we have a winner!
- if (isset($_POST[$name]))
- {
- $selected = array($_POST[$name]);
- }
+ $selected = array($_POST[$name]);
}
if ($extra != '') $extra = ' '.$extra;
@@ -334,12 +338,11 @@ if ( ! function_exists('form_dropdown'))
if (is_array($val) && ! empty($val))
{
- $form .= '<optgroup label="'.$key.'">'."\n";
+ $form .= '<optgroup label="'.$key."\">\n";
foreach ($val as $optgroup_key => $optgroup_val)
{
$sel = (in_array($optgroup_key, $selected)) ? ' selected="selected"' : '';
-
$form .= '<option value="'.$optgroup_key.'"'.$sel.'>'.(string) $optgroup_val."</option>\n";
}
@@ -347,13 +350,11 @@ if ( ! function_exists('form_dropdown'))
}
else
{
- $sel = (in_array($key, $selected)) ? ' selected="selected"' : '';
-
- $form .= '<option value="'.$key.'"'.$sel.'>'.(string) $val."</option>\n";
+ $form .= '<option value="'.$key.'"'.(in_array($key, $selected) ? ' selected="selected"' : '').'>'.(string) $val."</option>\n";
}
}
- $form .= '</select>';
+ $form .= "</select>\n";
return $form;
}
@@ -400,7 +401,7 @@ if ( ! function_exists('form_checkbox'))
unset($defaults['checked']);
}
- return "<input "._parse_form_attributes($data, $defaults).$extra." />";
+ return '<input '._parse_form_attributes($data, $defaults).$extra." />\n";
}
}
@@ -446,8 +447,7 @@ if ( ! function_exists('form_submit'))
function form_submit($data = '', $value = '', $extra = '')
{
$defaults = array('type' => 'submit', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value);
-
- return "<input "._parse_form_attributes($data, $defaults).$extra." />";
+ return '<input '._parse_form_attributes($data, $defaults).$extra." />\n";
}
}
@@ -467,8 +467,7 @@ if ( ! function_exists('form_reset'))
function form_reset($data = '', $value = '', $extra = '')
{
$defaults = array('type' => 'reset', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value);
-
- return "<input "._parse_form_attributes($data, $defaults).$extra." />";
+ return '<input '._parse_form_attributes($data, $defaults).$extra." />\n";
}
}
@@ -488,14 +487,13 @@ if ( ! function_exists('form_button'))
function form_button($data = '', $content = '', $extra = '')
{
$defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'type' => 'button');
-
if ( is_array($data) AND isset($data['content']))
{
$content = $data['content'];
unset($data['content']); // content is not an attribute
}
- return "<button "._parse_form_attributes($data, $defaults).$extra.">".$content."</button>";
+ return '<button '._parse_form_attributes($data, $defaults).$extra.'>'.$content."</button>\n";
}
}
@@ -530,9 +528,7 @@ if ( ! function_exists('form_label'))
}
}
- $label .= ">$label_text</label>";
-
- return $label;
+ return $label .= ">$label_text</label>";
}
}
@@ -552,12 +548,7 @@ if ( ! function_exists('form_fieldset'))
{
function form_fieldset($legend_text = '', $attributes = array())
{
- $fieldset = "<fieldset";
-
- $fieldset .= _attributes_to_string($attributes, FALSE);
-
- $fieldset .= ">\n";
-
+ $fieldset = '<fieldset'._attributes_to_string($attributes, FALSE).">\n";
if ($legend_text != '')
{
$fieldset .= "<legend>$legend_text</legend>\n";
@@ -643,17 +634,12 @@ if ( ! function_exists('form_prep'))
return $str;
}
- $str = htmlspecialchars($str);
-
- // In case htmlspecialchars misses these.
- $str = str_replace(array("'", '"'), array("&#39;", "&quot;"), $str);
-
if ($field_name != '')
{
$prepped_fields[$field_name] = $field_name;
}
- return $str;
+ return html_escape($str);
}
}
@@ -983,7 +969,7 @@ if ( ! function_exists('_attributes_to_string'))
$attributes .= ' accept-charset="'.strtolower(config_item('charset')).'"';
}
- return ' '.$attributes;
+ return ' '.$attributes;
}
if (is_object($attributes) AND count($attributes) > 0)
@@ -991,7 +977,7 @@ if ( ! function_exists('_attributes_to_string'))
$attributes = (array)$attributes;
}
- if (is_array($attributes) AND count($attributes) > 0)
+ if (is_array($attributes) AND ($formtag === TRUE OR count($attributes) > 0))
{
$atts = '';
@@ -1034,21 +1020,20 @@ if ( ! function_exists('_get_validation_object'))
// We set this as a variable since we're returning by reference.
$return = FALSE;
-
+
if (FALSE !== ($object = $CI->load->is_loaded('form_validation')))
{
if ( ! isset($CI->$object) OR ! is_object($CI->$object))
{
return $return;
}
-
+
return $CI->$object;
}
-
+
return $return;
}
}
-
/* End of file form_helper.php */
/* Location: ./system/helpers/form_helper.php */
diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php
index b64b60650..72970d9ca 100644
--- a/system/helpers/html_helper.php
+++ b/system/helpers/html_helper.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/helpers/html_helper.html
*/
@@ -42,8 +54,7 @@ if ( ! function_exists('heading'))
{
function heading($data = '', $h = '1', $attributes = '')
{
- $attributes = ($attributes != '') ? ' '.$attributes : $attributes;
- return "<h".$h.$attributes.">".$data."</h".$h.">";
+ return '<h'.$h.($attributes != '' ? ' ' : '').$attributes.'>'.$data.'</h'.$h.'>';
}
}
@@ -112,7 +123,7 @@ if ( ! function_exists('_list'))
}
// Set the indentation based on the depth
- $out = str_repeat(" ", $depth);
+ $out = str_repeat(' ', $depth);
// Were any attributes submitted? If so generate a string
if (is_array($attributes))
@@ -130,7 +141,7 @@ if ( ! function_exists('_list'))
}
// Write the opening list tag
- $out .= "<".$type.$attributes.">\n";
+ $out .= '<'.$type.$attributes.">\n";
// Cycle through the list elements. If an array is
// encountered we will recursively call _list()
@@ -140,8 +151,7 @@ if ( ! function_exists('_list'))
{
$_last_list_item = $key;
- $out .= str_repeat(" ", $depth + 2);
- $out .= "<li>";
+ $out .= str_repeat(' ', $depth + 2).'<li>';
if ( ! is_array($val))
{
@@ -149,21 +159,14 @@ if ( ! function_exists('_list'))
}
else
{
- $out .= $_last_list_item."\n";
- $out .= _list($type, $val, '', $depth + 4);
- $out .= str_repeat(" ", $depth + 2);
+ $out .= $_last_list_item."\n"._list($type, $val, '', $depth + 4).str_repeat(' ', $depth + 2);
}
$out .= "</li>\n";
}
- // Set the indentation for the closing tag
- $out .= str_repeat(" ", $depth);
-
- // Write the closing list tag
- $out .= "</".$type.">\n";
-
- return $out;
+ // Set the indentation for the closing tag and apply it
+ return $out.str_repeat(' ', $depth).'</'.$type.">\n";
}
}
@@ -180,7 +183,7 @@ if ( ! function_exists('br'))
{
function br($num = 1)
{
- return str_repeat("<br />", $num);
+ return str_repeat('<br />', $num);
}
}
@@ -212,10 +215,9 @@ if ( ! function_exists('img'))
$img = '<img';
- foreach ($src as $k=>$v)
+ foreach ($src as $k => $v)
{
-
- if ($k == 'src' AND strpos($v, '://') === FALSE)
+ if ($k === 'src' AND strpos($v, '://') === FALSE)
{
$CI =& get_instance();
@@ -234,9 +236,7 @@ if ( ! function_exists('img'))
}
}
- $img .= '/>';
-
- return $img;
+ return $img.'/>';
}
}
@@ -278,14 +278,7 @@ if ( ! function_exists('doctype'))
}
}
- if (isset($_doctypes[$type]))
- {
- return $_doctypes[$type];
- }
- else
- {
- return FALSE;
- }
+ return (isset($_doctypes[$type])) ? $_doctypes[$type] : FALSE;
}
}
@@ -310,14 +303,13 @@ if ( ! function_exists('link_tag'))
function link_tag($href = '', $rel = 'stylesheet', $type = 'text/css', $title = '', $media = '', $index_page = FALSE)
{
$CI =& get_instance();
-
$link = '<link ';
if (is_array($href))
{
- foreach ($href as $k=>$v)
+ foreach ($href as $k => $v)
{
- if ($k == 'href' AND strpos($v, '://') === FALSE)
+ if ($k === 'href' AND strpos($v, '://') === FALSE)
{
if ($index_page === TRUE)
{
@@ -334,11 +326,11 @@ if ( ! function_exists('link_tag'))
}
}
- $link .= "/>";
+ $link .= '/>';
}
else
{
- if ( strpos($href, '://') !== FALSE)
+ if (strpos($href, '://') !== FALSE)
{
$link .= 'href="'.$href.'" ';
}
@@ -353,12 +345,12 @@ if ( ! function_exists('link_tag'))
$link .= 'rel="'.$rel.'" type="'.$type.'" ';
- if ($media != '')
+ if ($media != '')
{
$link .= 'media="'.$media.'" ';
}
- if ($title != '')
+ if ($title != '')
{
$link .= 'title="'.$title.'" ';
}
@@ -366,8 +358,7 @@ if ( ! function_exists('link_tag'))
$link .= '/>';
}
-
- return $link;
+ return $link."\n";
}
}
@@ -427,10 +418,9 @@ if ( ! function_exists('nbs'))
{
function nbs($num = 1)
{
- return str_repeat("&nbsp;", $num);
+ return str_repeat('&nbsp;', $num);
}
}
-
/* End of file html_helper.php */
-/* Location: ./system/helpers/html_helper.php */ \ No newline at end of file
+/* Location: ./system/helpers/html_helper.php */
diff --git a/system/helpers/inflector_helper.php b/system/helpers/inflector_helper.php
index 7b99bc5b4..2069a1927 100644
--- a/system/helpers/inflector_helper.php
+++ b/system/helpers/inflector_helper.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/helpers/directory_helper.html
*/
@@ -44,45 +56,36 @@ if ( ! function_exists('singular'))
$result = strval($str);
$singular_rules = array(
- '/(matr)ices$/' => '\1ix',
- '/(vert|ind)ices$/' => '\1ex',
- '/^(ox)en/' => '\1',
- '/(alias)es$/' => '\1',
- '/([octop|vir])i$/' => '\1us',
- '/(cris|ax|test)es$/' => '\1is',
- '/(shoe)s$/' => '\1',
- '/(o)es$/' => '\1',
- '/(bus|campus)es$/' => '\1',
- '/([m|l])ice$/' => '\1ouse',
- '/(x|ch|ss|sh)es$/' => '\1',
- '/(m)ovies$/' => '\1\2ovie',
- '/(s)eries$/' => '\1\2eries',
- '/([^aeiouy]|qu)ies$/' => '\1y',
- '/([lr])ves$/' => '\1f',
- '/(tive)s$/' => '\1',
- '/(hive)s$/' => '\1',
- '/([^f])ves$/' => '\1fe',
- '/(^analy)ses$/' => '\1sis',
+ '/(matr)ices$/' => '\1ix',
+ '/(vert|ind)ices$/' => '\1ex',
+ '/^(ox)en/' => '\1',
+ '/(alias)es$/' => '\1',
+ '/([octop|vir])i$/' => '\1us',
+ '/(cris|ax|test)es$/' => '\1is',
+ '/(shoe)s$/' => '\1',
+ '/(o)es$/' => '\1',
+ '/(bus|campus)es$/' => '\1',
+ '/([m|l])ice$/' => '\1ouse',
+ '/(x|ch|ss|sh)es$/' => '\1',
+ '/(m)ovies$/' => '\1\2ovie',
+ '/(s)eries$/' => '\1\2eries',
+ '/([^aeiouy]|qu)ies$/' => '\1y',
+ '/([lr])ves$/' => '\1f',
+ '/(tive)s$/' => '\1',
+ '/(hive)s$/' => '\1',
+ '/([^f])ves$/' => '\1fe',
+ '/(^analy)ses$/' => '\1sis',
'/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/' => '\1\2sis',
- '/([ti])a$/' => '\1um',
- '/(p)eople$/' => '\1\2erson',
- '/(m)en$/' => '\1an',
- '/(s)tatuses$/' => '\1\2tatus',
- '/(c)hildren$/' => '\1\2hild',
- '/(n)ews$/' => '\1\2ews',
- '/([^u])s$/' => '\1',
+ '/([ti])a$/' => '\1um',
+ '/(p)eople$/' => '\1\2erson',
+ '/(m)en$/' => '\1an',
+ '/(s)tatuses$/' => '\1\2tatus',
+ '/(c)hildren$/' => '\1\2hild',
+ '/(n)ews$/' => '\1\2ews',
+ '/([^u])s$/' => '\1',
);
-
- foreach ($singular_rules as $rule => $replacement)
- {
- if (preg_match($rule, $result))
- {
- $result = preg_replace($rule, $replacement, $result);
- break;
- }
- }
-
- return $result;
+
+ return preg_replace(array_keys($singular_rules), $singular_rules, $result);
}
}
@@ -103,39 +106,30 @@ if ( ! function_exists('plural'))
function plural($str, $force = FALSE)
{
$result = strval($str);
-
+
$plural_rules = array(
- '/^(ox)$/' => '\1\2en', // ox
- '/([m|l])ouse$/' => '\1ice', // mouse, louse
- '/(matr|vert|ind)ix|ex$/' => '\1ices', // matrix, vertex, index
- '/(x|ch|ss|sh)$/' => '\1es', // search, switch, fix, box, process, address
- '/([^aeiouy]|qu)y$/' => '\1ies', // query, ability, agency
- '/(hive)$/' => '\1s', // archive, hive
- '/(?:([^f])fe|([lr])f)$/' => '\1\2ves', // half, safe, wife
- '/sis$/' => 'ses', // basis, diagnosis
- '/([ti])um$/' => '\1a', // datum, medium
- '/(p)erson$/' => '\1eople', // person, salesperson
- '/(m)an$/' => '\1en', // man, woman, spokesman
- '/(c)hild$/' => '\1hildren', // child
- '/(buffal|tomat)o$/' => '\1\2oes', // buffalo, tomato
- '/(bu|campu)s$/' => '\1\2ses', // bus, campus
- '/(alias|status|virus)/' => '\1es', // alias
- '/(octop)us$/' => '\1i', // octopus
- '/(ax|cris|test)is$/' => '\1es', // axis, crisis
- '/s$/' => 's', // no change (compatibility)
- '/$/' => 's',
+ '/^(ox)$/' => '\1\2en', // ox
+ '/([m|l])ouse$/' => '\1ice', // mouse, louse
+ '/(matr|vert|ind)ix|ex$/' => '\1ices', // matrix, vertex, index
+ '/(x|ch|ss|sh)$/' => '\1es', // search, switch, fix, box, process, address
+ '/([^aeiouy]|qu)y$/' => '\1ies', // query, ability, agency
+ '/(hive)$/' => '\1s', // archive, hive
+ '/(?:([^f])fe|([lr])f)$/' => '\1\2ves', // half, safe, wife
+ '/sis$/' => 'ses', // basis, diagnosis
+ '/([ti])um$/' => '\1a', // datum, medium
+ '/(p)erson$/' => '\1eople', // person, salesperson
+ '/(m)an$/' => '\1en', // man, woman, spokesman
+ '/(c)hild$/' => '\1hildren', // child
+ '/(buffal|tomat)o$/' => '\1\2oes', // buffalo, tomato
+ '/(bu|campu)s$/' => '\1\2ses', // bus, campus
+ '/(alias|status|virus)/' => '\1es', // alias
+ '/(octop)us$/' => '\1i', // octopus
+ '/(ax|cris|test)is$/' => '\1es', // axis, crisis
+ '/s$/' => 's', // no change (compatibility)
+ '/$/' => 's',
);
- foreach ($plural_rules as $rule => $replacement)
- {
- if (preg_match($rule, $result))
- {
- $result = preg_replace($rule, $replacement, $result);
- break;
- }
- }
-
- return $result;
+ return preg_replace(array_keys($plural_rules), $plural_rules, $result);
}
}
@@ -154,9 +148,7 @@ if ( ! function_exists('camelize'))
{
function camelize($str)
{
- $str = 'x'.strtolower(trim($str));
- $str = ucwords(preg_replace('/[\s_]+/', ' ', $str));
- return substr(str_replace(' ', '', $str), 1);
+ return substr(str_replace(' ', '', ucwords(preg_replace('/[\s_]+/', ' ', $str))), 1);
}
}
@@ -184,20 +176,20 @@ if ( ! function_exists('underscore'))
/**
* Humanize
*
- * Takes multiple words separated by underscores and changes them to spaces
+ * Takes multiple words separated by the separator and changes them to spaces
*
* @access public
- * @param string
+ * @param string $str
+ * @param string $separator
* @return str
*/
if ( ! function_exists('humanize'))
{
- function humanize($str)
+ function humanize($str, $separator = '_')
{
- return ucwords(preg_replace('/[_]+/', ' ', strtolower(trim($str))));
+ return ucwords(preg_replace('/['.$separator.']+/', ' ', strtolower(trim($str))));
}
}
-
/* End of file inflector_helper.php */
-/* Location: ./system/helpers/inflector_helper.php */ \ No newline at end of file
+/* Location: ./system/helpers/inflector_helper.php */
diff --git a/system/helpers/language_helper.php b/system/helpers/language_helper.php
index ac0d69da1..a83580a97 100644
--- a/system/helpers/language_helper.php
+++ b/system/helpers/language_helper.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/helpers/language_helper.html
*/
@@ -53,6 +65,5 @@ if ( ! function_exists('lang'))
}
}
-// ------------------------------------------------------------------------
/* End of file language_helper.php */
-/* Location: ./system/helpers/language_helper.php */ \ No newline at end of file
+/* Location: ./system/helpers/language_helper.php */
diff --git a/system/helpers/number_helper.php b/system/helpers/number_helper.php
index 611777559..331b468c6 100644
--- a/system/helpers/number_helper.php
+++ b/system/helpers/number_helper.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/helpers/number_helper.html
*/
@@ -71,6 +83,5 @@ if ( ! function_exists('byte_format'))
}
}
-
/* End of file number_helper.php */
-/* Location: ./system/helpers/number_helper.php */ \ No newline at end of file
+/* Location: ./system/helpers/number_helper.php */
diff --git a/system/helpers/path_helper.php b/system/helpers/path_helper.php
index ffcf46842..cd87a73eb 100644
--- a/system/helpers/path_helper.php
+++ b/system/helpers/path_helper.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/helpers/xml_helper.html
*/
@@ -48,25 +60,21 @@ if ( ! function_exists('set_realpath'))
// Resolve the path
if (function_exists('realpath') AND @realpath($path) !== FALSE)
{
- $path = realpath($path).'/';
+ $path = realpath($path);
}
// Add a trailing slash
- $path = preg_replace("#([^/])/*$#", "\\1/", $path);
+ $path = rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
// Make sure the path exists
- if ($check_existance == TRUE)
+ if ($check_existance == TRUE && ! is_dir($path))
{
- if ( ! is_dir($path))
- {
- show_error('Not a valid path: '.$path);
- }
+ show_error('Not a valid path: '.$path);
}
return $path;
}
}
-
/* End of file path_helper.php */
-/* Location: ./system/helpers/path_helper.php */ \ No newline at end of file
+/* Location: ./system/helpers/path_helper.php */
diff --git a/system/helpers/security_helper.php b/system/helpers/security_helper.php
index 678dac821..99fda561a 100644
--- a/system/helpers/security_helper.php
+++ b/system/helpers/security_helper.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/helpers/security_helper.html
*/
@@ -75,14 +87,7 @@ if ( ! function_exists('do_hash'))
{
function do_hash($str, $type = 'sha1')
{
- if ($type == 'sha1')
- {
- return sha1($str);
- }
- else
- {
- return md5($str);
- }
+ return ($type === 'sha1') ? sha1($str) : md5($str);
}
}
@@ -99,10 +104,7 @@ if ( ! function_exists('strip_image_tags'))
{
function strip_image_tags($str)
{
- $str = preg_replace("#<img\s+.*?src\s*=\s*[\"'](.+?)[\"'].*?\>#", "\\1", $str);
- $str = preg_replace("#<img\s+.*?src\s*=\s*(.+?).*?\>#", "\\1", $str);
-
- return $str;
+ return preg_replace(array("#<img\s+.*?src\s*=\s*[\"'](.+?)[\"'].*?\>#", "#<img\s+.*?src\s*=\s*(.+?).*?\>#"), "\\1", $str);
}
}
@@ -123,6 +125,5 @@ if ( ! function_exists('encode_php_tags'))
}
}
-
/* End of file security_helper.php */
-/* Location: ./system/helpers/security_helper.php */ \ No newline at end of file
+/* Location: ./system/helpers/security_helper.php */
diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php
index 6d8889354..700f4486c 100644
--- a/system/helpers/smiley_helper.php
+++ b/system/helpers/smiley_helper.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/helpers/smiley_helper.html
*/
@@ -231,7 +243,7 @@ if ( ! function_exists('_get_smiley_array'))
{
if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/smileys.php'))
{
- include(APPPATH.'config/'.ENVIRONMENT.'/smileys.php');
+ include(APPPATH.'config/'.ENVIRONMENT.'/smileys.php');
}
elseif (file_exists(APPPATH.'config/smileys.php'))
{
diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php
index 9fa69f46c..04d51c2f9 100644
--- a/system/helpers/string_helper.php
+++ b/system/helpers/string_helper.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/helpers/string_helper.html
*/
@@ -215,12 +227,9 @@ if ( ! function_exists('random_string'))
case 'nozero' : $pool = '123456789';
break;
}
-
- $str = '';
- for ($i=0; $i < $len; $i++)
- {
- $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1);
- }
+
+ $str = substr(str_shuffle(str_repeat($pool, ceil($len/strlen($pool)))),0,$len);
+
return $str;
break;
case 'unique' :
diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php
index 33d7fa2fd..842a31d75 100644
--- a/system/helpers/text_helper.php
+++ b/system/helpers/text_helper.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/helpers/text_helper.html
*/
diff --git a/system/helpers/typography_helper.php b/system/helpers/typography_helper.php
index 19b4eec03..c49348e6a 100644
--- a/system/helpers/typography_helper.php
+++ b/system/helpers/typography_helper.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/helpers/typography_helper.html
*/
@@ -39,9 +51,7 @@ if ( ! function_exists('nl2br_except_pre'))
function nl2br_except_pre($str)
{
$CI =& get_instance();
-
$CI->load->library('typography');
-
return $CI->typography->nl2br_except_pre($str);
}
}
@@ -78,11 +88,12 @@ if ( ! function_exists('auto_typography'))
*
* @access public
* @param string
+ * @param string
* @return string
*/
if ( ! function_exists('entity_decode'))
{
- function entity_decode($str, $charset='UTF-8')
+ function entity_decode($str, $charset = NULL)
{
global $SEC;
return $SEC->entity_decode($str, $charset);
@@ -90,4 +101,4 @@ if ( ! function_exists('entity_decode'))
}
/* End of file typography_helper.php */
-/* Location: ./system/helpers/typography_helper.php */ \ No newline at end of file
+/* Location: ./system/helpers/typography_helper.php */
diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php
index 9f4b85248..2cbcd9dbf 100644
--- a/system/helpers/url_helper.php
+++ b/system/helpers/url_helper.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/helpers/url_helper.html
*/
@@ -50,7 +62,7 @@ if ( ! function_exists('site_url'))
/**
* Base URL
- *
+ *
* Create a local URL based on your basepath.
* Segments can be passed in as a string or an array, same as site_url
* or a URL to a file can be passed in, e.g. to an image file.
@@ -186,7 +198,6 @@ 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 == '')
@@ -236,14 +247,12 @@ if ( ! function_exists('mailto'))
{
$title = (string) $title;
- if ($title == "")
+ if ($title == '')
{
$title = $email;
}
- $attributes = _parse_attributes($attributes);
-
- return '<a href="mailto:'.$email.'"'.$attributes.'>'.$title.'</a>';
+ return '<a href="mailto:'.$email.'"'._parse_attributes($attributes).'>'.$title.'</a>';
}
}
@@ -266,19 +275,16 @@ if ( ! function_exists('safe_mailto'))
{
$title = (string) $title;
- if ($title == "")
+ if ($title == '')
{
$title = $email;
}
- for ($i = 0; $i < 16; $i++)
- {
- $x[] = substr('<a href="mailto:', $i, 1);
- }
+ $x = str_split('<a href="mailto:', 1);
- for ($i = 0; $i < strlen($email); $i++)
+ for ($i = 0, $l = strlen($email); $i < $l; $i++)
{
- $x[] = "|".ord(substr($email, $i, 1));
+ $x[] = '|'.ord($email[$i]);
}
$x[] = '"';
@@ -290,18 +296,18 @@ if ( ! function_exists('safe_mailto'))
foreach ($attributes as $key => $val)
{
$x[] = ' '.$key.'="';
- for ($i = 0; $i < strlen($val); $i++)
+ for ($i = 0, $l = strlen($val); $i < $l; $i++)
{
- $x[] = "|".ord(substr($val, $i, 1));
+ $x[] = '|'.ord($val[$i]);
}
$x[] = '"';
}
}
else
{
- for ($i = 0; $i < strlen($attributes); $i++)
+ for ($i = 0, $l = strlen($attributes); $i < $l; $i++)
{
- $x[] = substr($attributes, $i, 1);
+ $x[] = $attributes[$i];
}
}
}
@@ -309,26 +315,28 @@ if ( ! function_exists('safe_mailto'))
$x[] = '>';
$temp = array();
- for ($i = 0; $i < strlen($title); $i++)
+ for ($i = 0, $l = strlen($title); $i < $l; $i++)
{
$ordinal = ord($title[$i]);
if ($ordinal < 128)
{
- $x[] = "|".$ordinal;
+ $x[] = '|'.$ordinal;
}
else
{
- if (count($temp) == 0)
+ if (count($temp) === 0)
{
$count = ($ordinal < 224) ? 2 : 3;
}
$temp[] = $ordinal;
- if (count($temp) == $count)
+ 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;
+ $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();
}
@@ -344,8 +352,7 @@ if ( ! function_exists('safe_mailto'))
//<![CDATA[
var l=new Array();
<?php
- $i = 0;
- foreach ($x as $val){ ?>l[<?php echo $i++; ?>]='<?php echo $val; ?>';<?php } ?>
+ for ($i = 0, $c = count($x); $i < $c; $i++) { ?>l[<?php echo $i; ?>]='<?php echo $x[$i]; ?>';<?php } ?>
for (var i = l.length-1; i >= 0; i=i-1){
if (l[i].substring(0, 1) == '|') document.write("&#"+unescape(l[i].substring(1))+";");
@@ -379,49 +386,46 @@ if ( ! function_exists('auto_link'))
{
function auto_link($str, $type = 'both', $popup = FALSE)
{
- if ($type != 'email')
+ if ($type !== 'email' && preg_match_all('#(^|\s|\(|\b)((http(s?)://)|(www\.))(\w+[^\s\)\<]+)#i', $str, $matches))
{
- if (preg_match_all("#(^|\s|\()((http(s?)://)|(www\.))(\w+[^\s\)\<]+)#i", $str, $matches))
- {
- $pop = ($popup == TRUE) ? " target=\"_blank\" " : "";
+ $pop = ($popup) ? ' target="_blank" ' : '';
- for ($i = 0; $i < count($matches['0']); $i++)
+ for ($i = 0, $c = count($matches[0]); $i < $c; $i++)
+ {
+ if (preg_match('|\.$|', $matches[6][$i]))
+ {
+ $period = '.';
+ $matches[6][$i] = substr($matches[6][$i], 0, -1);
+ }
+ else
{
$period = '';
- if (preg_match("|\.$|", $matches['6'][$i]))
- {
- $period = '.';
- $matches['6'][$i] = substr($matches['6'][$i], 0, -1);
- }
-
- $str = str_replace($matches['0'][$i],
- $matches['1'][$i].'<a href="http'.
- $matches['4'][$i].'://'.
- $matches['5'][$i].
- $matches['6'][$i].'"'.$pop.'>http'.
- $matches['4'][$i].'://'.
- $matches['5'][$i].
- $matches['6'][$i].'</a>'.
- $period, $str);
}
+
+ $str = str_replace($matches[0][$i],
+ $matches[1][$i].'<a href="http'.$matches[4][$i].'://'
+ .$matches[5][$i].$matches[6][$i].'"'.$pop.'>http'
+ .$matches[4][$i].'://'.$matches[5][$i]
+ .$matches[6][$i].'</a>'.$period,
+ $str);
}
}
- if ($type != 'url')
+ if ($type !== 'url' && 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, $c = count($matches); $i < $c; $i++)
{
- for ($i = 0; $i < count($matches['0']); $i++)
+ if (preg_match('|\.$|', $matches[3][$i]))
+ {
+ $period = '.';
+ $matches[3][$i] = substr($matches[3][$i], 0, -1);
+ }
+ else
{
$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);
}
+
+ $str = str_replace($matches[0][$i], safe_mailto($matches[1][$i].'@'.$matches[2][$i].'.'.$matches[3][$i]).$period, $str);
}
}
@@ -444,7 +448,7 @@ if ( ! function_exists('prep_url'))
{
function prep_url($str = '')
{
- if ($str == 'http://' OR $str == '')
+ if ($str === 'http://' OR $str == '')
{
return '';
}
@@ -453,7 +457,7 @@ if ( ! function_exists('prep_url'))
if ( ! $url OR ! isset($url['scheme']))
{
- $str = 'http://'.$str;
+ return 'http://'.$str;
}
return $str;
@@ -478,7 +482,7 @@ if ( ! function_exists('url_title'))
{
function url_title($str, $separator = 'dash', $lowercase = FALSE)
{
- if ($separator == 'dash')
+ if ($separator === 'dash')
{
$search = '_';
$replace = '-';
@@ -501,10 +505,9 @@ if ( ! function_exists('url_title'))
);
$str = strip_tags($str);
-
foreach ($trans as $key => $val)
{
- $str = preg_replace("#".$key."#i", $val, $str);
+ $str = preg_replace('#'.$key.'#i', $val, $str);
}
if ($lowercase === TRUE)
@@ -512,7 +515,7 @@ if ( ! function_exists('url_title'))
$str = strtolower($str);
}
- return trim(stripslashes($str));
+ return trim(trim(stripslashes($str)), $replace);
}
}
@@ -527,23 +530,31 @@ if ( ! function_exists('url_title'))
*
* @access public
* @param string the URL
- * @param string the method: location or redirect
+ * @param string the method: location or refresh
* @return string
*/
if ( ! function_exists('redirect'))
{
- function redirect($uri = '', $method = 'location', $http_response_code = 302)
+ function redirect($uri = '', $method = 'auto', $http_response_code = 302)
{
if ( ! preg_match('#^https?://#i', $uri))
{
$uri = site_url($uri);
}
+ // IIS environment likely? Use 'refresh' for better compatibility
+ if (DIRECTORY_SEPARATOR !== '/' && $method === 'auto')
+ {
+ $method = 'refresh';
+ }
+
switch($method)
{
- case 'refresh' : header("Refresh:0;url=".$uri);
+ case 'refresh':
+ header('Refresh:0;url='.$uri);
break;
- default : header("Location: ".$uri, TRUE, $http_response_code);
+ default:
+ header('Location: '.$uri, TRUE, $http_response_code);
break;
}
exit;
@@ -586,13 +597,12 @@ if ( ! function_exists('_parse_attributes'))
if ($javascript == TRUE AND $att != '')
{
- $att = substr($att, 0, -1);
+ return substr($att, 0, -1);
}
return $att;
}
}
-
/* End of file url_helper.php */
-/* Location: ./system/helpers/url_helper.php */ \ No newline at end of file
+/* Location: ./system/helpers/url_helper.php */
diff --git a/system/helpers/xml_helper.php b/system/helpers/xml_helper.php
index cdd81ad70..5242193ac 100644
--- a/system/helpers/xml_helper.php
+++ b/system/helpers/xml_helper.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/helpers/xml_helper.html
*/
@@ -44,28 +56,26 @@ if ( ! function_exists('xml_convert'))
// ampersands won't get messed up
$str = preg_replace("/&#(\d+);/", "$temp\\1;", $str);
- if ($protect_all === TRUE)
+ if ($protect_all == TRUE)
{
- $str = preg_replace("/&(\w+);/", "$temp\\1;", $str);
+ $str = preg_replace('/&(\w+);/', "$temp\\1;", $str);
}
- $str = str_replace(array("&","<",">","\"", "'", "-"),
- array("&amp;", "&lt;", "&gt;", "&quot;", "&apos;", "&#45;"),
- $str);
+ $str = str_replace(array('&', '<', '>', '"', "'", '-'),
+ array('&amp;', '&lt;', '&gt;', '&quot;', '&apos;', '&#45;'),
+ $str);
// Decode the temp markers back to entities
- $str = preg_replace("/$temp(\d+);/","&#\\1;",$str);
+ $str = preg_replace('/$temp(\d+);/', '&#\\1;', $str);
- if ($protect_all === TRUE)
+ if ($protect_all == TRUE)
{
- $str = preg_replace("/$temp(\w+);/","&\\1;", $str);
+ return preg_replace("/$temp(\w+);/", '&\\1;', $str);
}
return $str;
}
}
-// ------------------------------------------------------------------------
-
/* End of file xml_helper.php */
-/* Location: ./system/helpers/xml_helper.php */ \ No newline at end of file
+/* Location: ./system/helpers/xml_helper.php */
diff --git a/system/language/english/calendar_lang.php b/system/language/english/calendar_lang.php
index 3e6312361..bf61db039 100644
--- a/system/language/english/calendar_lang.php
+++ b/system/language/english/calendar_lang.php
@@ -1,4 +1,29 @@
<?php
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
$lang['cal_su'] = "Su";
$lang['cal_mo'] = "Mo";
diff --git a/system/language/english/date_lang.php b/system/language/english/date_lang.php
index c0ace16ef..cd6cf39c4 100644
--- a/system/language/english/date_lang.php
+++ b/system/language/english/date_lang.php
@@ -1,4 +1,29 @@
<?php
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
$lang['date_year'] = "Year";
$lang['date_years'] = "Years";
@@ -16,7 +41,7 @@ $lang['date_second'] = "Second";
$lang['date_seconds'] = "Seconds";
$lang['UM12'] = '(UTC -12:00) Baker/Howland Island';
-$lang['UM11'] = '(UTC -11:00) Samoa Time Zone, Niue';
+$lang['UM11'] = '(UTC -11:00) Niue';
$lang['UM10'] = '(UTC -10:00) Hawaii-Aleutian Standard Time, Cook Islands, Tahiti';
$lang['UM95'] = '(UTC -9:30) Marquesas Islands';
$lang['UM9'] = '(UTC -9:00) Alaska Standard Time, Gambier Islands';
@@ -33,9 +58,9 @@ $lang['UM1'] = '(UTC -1:00) Azores, Cape Verde Islands';
$lang['UTC'] = '(UTC) Greenwich Mean Time, Western European Time';
$lang['UP1'] = '(UTC +1:00) Central European Time, West Africa Time';
$lang['UP2'] = '(UTC +2:00) Central Africa Time, Eastern European Time, Kaliningrad Time';
-$lang['UP3'] = '(UTC +3:00) Moscow Time, East Africa Time';
+$lang['UP3'] = '(UTC +3:00) East Africa Time, Arabia Standard Time';
$lang['UP35'] = '(UTC +3:30) Iran Standard Time';
-$lang['UP4'] = '(UTC +4:00) Azerbaijan Standard Time, Samara Time';
+$lang['UP4'] = '(UTC +4:00) Moscow Time, Azerbaijan Standard Time';
$lang['UP45'] = '(UTC +4:30) Afghanistan';
$lang['UP5'] = '(UTC +5:00) Pakistan Standard Time, Yekaterinburg Time';
$lang['UP55'] = '(UTC +5:30) Indian Standard Time, Sri Lanka Time';
@@ -53,7 +78,7 @@ $lang['UP11'] = '(UTC +11:00) Magadan Time, Solomon Islands, Vanuatu';
$lang['UP115'] = '(UTC +11:30) Norfolk Island';
$lang['UP12'] = '(UTC +12:00) Fiji, Gilbert Islands, Kamchatka Time, New Zealand Standard Time';
$lang['UP1275'] = '(UTC +12:45) Chatham Islands Standard Time';
-$lang['UP13'] = '(UTC +13:00) Phoenix Islands Time, Tonga';
+$lang['UP13'] = '(UTC +13:00) Samoa Time Zone, Phoenix Islands Time, Tonga';
$lang['UP14'] = '(UTC +14:00) Line Islands';
diff --git a/system/language/english/db_lang.php b/system/language/english/db_lang.php
index 79b82c73a..2a91597df 100644
--- a/system/language/english/db_lang.php
+++ b/system/language/english/db_lang.php
@@ -1,4 +1,29 @@
<?php
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
$lang['db_invalid_connection_str'] = 'Unable to determine the database settings based on the connection string you submitted.';
$lang['db_unable_to_connect'] = 'Unable to connect to your database server using the provided settings.';
diff --git a/system/language/english/email_lang.php b/system/language/english/email_lang.php
index e3bd113cb..e0ef427a6 100644
--- a/system/language/english/email_lang.php
+++ b/system/language/english/email_lang.php
@@ -1,4 +1,29 @@
<?php
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
$lang['email_must_be_array'] = "The email validation method must be passed an array.";
$lang['email_invalid_address'] = "Invalid email address: %s";
diff --git a/system/language/english/form_validation_lang.php b/system/language/english/form_validation_lang.php
index 3418f29ab..6afa37a29 100644
--- a/system/language/english/form_validation_lang.php
+++ b/system/language/english/form_validation_lang.php
@@ -1,4 +1,29 @@
<?php
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
$lang['required'] = "The %s field is required.";
$lang['isset'] = "The %s field must have a value.";
@@ -7,7 +32,7 @@ $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.";
-$lang['max_length'] = "The %s field can not exceed %s characters in length.";
+$lang['max_length'] = "The %s field cannot 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 alphabetical characters.";
$lang['alpha_numeric'] = "The %s field may only contain alpha-numeric characters.";
diff --git a/system/language/english/ftp_lang.php b/system/language/english/ftp_lang.php
index 1e5168cf8..18ca92713 100644
--- a/system/language/english/ftp_lang.php
+++ b/system/language/english/ftp_lang.php
@@ -1,4 +1,29 @@
<?php
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
$lang['ftp_no_connection'] = "Unable to locate a valid connection ID. Please make sure you are connected before peforming any file routines.";
$lang['ftp_unable_to_connect'] = "Unable to connect to your FTP server using the supplied hostname.";
diff --git a/system/language/english/imglib_lang.php b/system/language/english/imglib_lang.php
index 66505da07..fbb92abfb 100644
--- a/system/language/english/imglib_lang.php
+++ b/system/language/english/imglib_lang.php
@@ -1,4 +1,29 @@
<?php
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
$lang['imglib_source_image_required'] = "You must specify a source image in your preferences.";
$lang['imglib_gd_required'] = "The GD image library is required for this feature.";
diff --git a/system/language/english/migration_lang.php b/system/language/english/migration_lang.php
index 4763ca243..9765562b5 100644
--- a/system/language/english/migration_lang.php
+++ b/system/language/english/migration_lang.php
@@ -1,11 +1,36 @@
<?php
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 3.0
+ * @filesource
+ */
$lang['migration_none_found'] = "No migrations were found.";
$lang['migration_not_found'] = "This migration could not be found.";
$lang['migration_multiple_version'] = "This are multiple migrations with the same version number: %d.";
$lang['migration_class_doesnt_exist'] = "The migration class \"%s\" could not be found.";
$lang['migration_missing_up_method'] = "The migration class \"%s\" is missing an 'up' method.";
-$lang['migration_missing_down_method'] = "The migration class \"%s\" is missing an 'up' method.";
+$lang['migration_missing_down_method'] = "The migration class \"%s\" is missing a 'down' method.";
$lang['migration_invalid_filename'] = "Migration \"%s\" has an invalid filename.";
diff --git a/system/language/english/number_lang.php b/system/language/english/number_lang.php
index 908580914..5dfd882ed 100644
--- a/system/language/english/number_lang.php
+++ b/system/language/english/number_lang.php
@@ -1,4 +1,29 @@
<?php
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
$lang['terabyte_abbr'] = "TB";
$lang['gigabyte_abbr'] = "GB";
diff --git a/system/language/english/profiler_lang.php b/system/language/english/profiler_lang.php
index 1111158c8..1d10efa76 100644
--- a/system/language/english/profiler_lang.php
+++ b/system/language/english/profiler_lang.php
@@ -1,4 +1,29 @@
<?php
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
$lang['profiler_database'] = 'DATABASE';
$lang['profiler_controller_info'] = 'CLASS/METHOD';
diff --git a/system/language/english/unit_test_lang.php b/system/language/english/unit_test_lang.php
index 070bcd1f2..ed98439f4 100644
--- a/system/language/english/unit_test_lang.php
+++ b/system/language/english/unit_test_lang.php
@@ -1,4 +1,29 @@
<?php
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
$lang['ut_test_name'] = 'Test Name';
$lang['ut_test_datatype'] = 'Test Datatype';
diff --git a/system/language/english/upload_lang.php b/system/language/english/upload_lang.php
index 4de9e9e74..a9a2fe74b 100644
--- a/system/language/english/upload_lang.php
+++ b/system/language/english/upload_lang.php
@@ -1,4 +1,29 @@
<?php
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
$lang['upload_userfile_not_set'] = "Unable to find a post variable called userfile.";
$lang['upload_file_exceeds_limit'] = "The uploaded file exceeds the maximum allowed size in your PHP configuration file.";
diff --git a/system/libraries/Cache/Cache.php b/system/libraries/Cache/Cache.php
index 61e7aa761..2e78a6660 100644
--- a/system/libraries/Cache/Cache.php
+++ b/system/libraries/Cache/Cache.php
@@ -2,30 +2,42 @@
/**
* CodeIgniter
*
- * An open source application development framework for PHP 4.3.2 or newer
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
*
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2006 - 2011 EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2006 - 2012 EllisLab, Inc.
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 2.0
- * @filesource
+ * @filesource
*/
// ------------------------------------------------------------------------
/**
- * CodeIgniter Caching Class
+ * CodeIgniter Caching Class
*
* @package CodeIgniter
* @subpackage Libraries
* @category Core
- * @author ExpressionEngine Dev Team
- * @link
+ * @author EllisLab Dev Team
+ * @link
*/
class CI_Cache extends CI_Driver_Library {
-
+
protected $valid_drivers = array(
'cache_apc', 'cache_file', 'cache_memcached', 'cache_dummy'
);
@@ -33,7 +45,7 @@ class CI_Cache extends CI_Driver_Library {
protected $_cache_path = NULL; // Path of cache files (if file-based cache)
protected $_adapter = 'dummy';
protected $_backup_driver;
-
+
// ------------------------------------------------------------------------
/**
@@ -52,16 +64,16 @@ class CI_Cache extends CI_Driver_Library {
// ------------------------------------------------------------------------
/**
- * Get
+ * Get
*
- * Look for a value in the cache. If it exists, return the data
+ * Look for a value in the cache. If it exists, return the data
* if not, return FALSE
*
- * @param string
+ * @param string
* @return mixed value that is stored/FALSE on failure
*/
public function get($id)
- {
+ {
return $this->{$this->_adapter}->get($id);
}
@@ -112,7 +124,7 @@ class CI_Cache extends CI_Driver_Library {
* Cache Info
*
* @param string user/filehits
- * @return mixed array on success, false on failure
+ * @return mixed array on success, false on failure
*/
public function cache_info($type = 'user')
{
@@ -120,7 +132,7 @@ class CI_Cache extends CI_Driver_Library {
}
// ------------------------------------------------------------------------
-
+
/**
* Get Cache Metadata
*
@@ -131,7 +143,7 @@ class CI_Cache extends CI_Driver_Library {
{
return $this->{$this->_adapter}->get_metadata($id);
}
-
+
// ------------------------------------------------------------------------
/**
@@ -139,11 +151,11 @@ class CI_Cache extends CI_Driver_Library {
*
* Initialize class properties based on the configuration array.
*
- * @param array
+ * @param array
* @return void
*/
private function _initialize($config)
- {
+ {
$default_config = array(
'adapter',
'memcached'
@@ -207,10 +219,10 @@ class CI_Cache extends CI_Driver_Library {
return $obj;
}
-
+
// ------------------------------------------------------------------------
}
// End Class
/* End of file Cache.php */
-/* Location: ./system/libraries/Cache/Cache.php */ \ No newline at end of file
+/* Location: ./system/libraries/Cache/Cache.php */
diff --git a/system/libraries/Cache/drivers/Cache_apc.php b/system/libraries/Cache/drivers/Cache_apc.php
index 79d91b320..a3dd46978 100644
--- a/system/libraries/Cache/drivers/Cache_apc.php
+++ b/system/libraries/Cache/drivers/Cache_apc.php
@@ -4,36 +4,48 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2006 - 2011 EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2006 - 2012 EllisLab, Inc.
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 2.0
- * @filesource
+ * @filesource
*/
// ------------------------------------------------------------------------
/**
- * CodeIgniter APC Caching Class
+ * CodeIgniter APC Caching Class
*
* @package CodeIgniter
* @subpackage Libraries
* @category Core
- * @author ExpressionEngine Dev Team
- * @link
+ * @author EllisLab Dev Team
+ * @link
*/
class CI_Cache_apc extends CI_Driver {
/**
- * Get
+ * Get
*
- * Look for a value in the cache. If it exists, return the data
+ * Look for a value in the cache. If it exists, return the data
* if not, return FALSE
*
- * @param string
+ * @param string
* @return mixed value that is stored/FALSE on failure
*/
public function get($id)
@@ -43,8 +55,8 @@ class CI_Cache_apc extends CI_Driver {
return (is_array($data)) ? $data[0] : FALSE;
}
- // ------------------------------------------------------------------------
-
+ // ------------------------------------------------------------------------
+
/**
* Cache Save
*
@@ -56,9 +68,10 @@ class CI_Cache_apc extends CI_Driver {
*/
public function save($id, $data, $ttl = 60)
{
+ $ttl = (int) $ttl;
return apc_store($id, array($data, time(), $ttl), $ttl);
}
-
+
// ------------------------------------------------------------------------
/**
@@ -90,7 +103,7 @@ class CI_Cache_apc extends CI_Driver {
* Cache Info
*
* @param string user/filehits
- * @return mixed array on success, false on failure
+ * @return mixed array on success, false on failure
*/
public function cache_info($type = NULL)
{
@@ -137,13 +150,13 @@ class CI_Cache_apc extends CI_Driver {
log_message('error', 'The APC PHP extension must be loaded to use APC Cache.');
return FALSE;
}
-
+
return TRUE;
}
// ------------------------------------------------------------------------
-
+
}
// End Class
diff --git a/system/libraries/Cache/drivers/Cache_dummy.php b/system/libraries/Cache/drivers/Cache_dummy.php
index f96a68e27..fcd55da39 100644
--- a/system/libraries/Cache/drivers/Cache_dummy.php
+++ b/system/libraries/Cache/drivers/Cache_dummy.php
@@ -2,12 +2,24 @@
/**
* CodeIgniter
*
- * An open source application development framework for PHP 4.3.2 or newer
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
*
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2006 - 2011 EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2006 - 2012 EllisLab, Inc.
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 2.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Core
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link
*/
@@ -126,4 +138,4 @@ class CI_Cache_dummy extends CI_Driver {
// End Class
/* End of file Cache_dummy.php */
-/* Location: ./system/libraries/Cache/drivers/Cache_dummy.php */ \ No newline at end of file
+/* Location: ./system/libraries/Cache/drivers/Cache_dummy.php */
diff --git a/system/libraries/Cache/drivers/Cache_file.php b/system/libraries/Cache/drivers/Cache_file.php
index 13e2d1af6..a960730d7 100644
--- a/system/libraries/Cache/drivers/Cache_file.php
+++ b/system/libraries/Cache/drivers/Cache_file.php
@@ -2,27 +2,39 @@
/**
* CodeIgniter
*
- * An open source application development framework for PHP 4.3.2 or newer
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
*
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2006 - 2011 EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2006 - 2012 EllisLab, Inc.
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 2.0
- * @filesource
+ * @filesource
*/
// ------------------------------------------------------------------------
/**
- * CodeIgniter Memcached Caching Class
+ * CodeIgniter Memcached Caching Class
*
* @package CodeIgniter
* @subpackage Libraries
* @category Core
- * @author ExpressionEngine Dev Team
- * @link
+ * @author EllisLab Dev Team
+ * @link
*/
class CI_Cache_file extends CI_Driver {
@@ -36,9 +48,7 @@ class CI_Cache_file extends CI_Driver {
{
$CI =& get_instance();
$CI->load->helper('file');
-
$path = $CI->config->item('cache_path');
-
$this->_cache_path = ($path == '') ? APPPATH.'cache/' : $path;
}
@@ -56,16 +66,15 @@ class CI_Cache_file extends CI_Driver {
{
return FALSE;
}
-
- $data = read_file($this->_cache_path.$id);
- $data = unserialize($data);
-
+
+ $data = unserialize(read_file($this->_cache_path.$id));
+
if (time() > $data['time'] + $data['ttl'])
{
unlink($this->_cache_path.$id);
return FALSE;
}
-
+
return $data['data'];
}
@@ -76,22 +85,22 @@ class CI_Cache_file extends CI_Driver {
*
* @param string unique key
* @param mixed data to store
- * @param int length of time (in seconds) the cache is valid
+ * @param int length of time (in seconds) the cache is valid
* - Default is 60 seconds
* @return boolean true on success/false on failure
*/
public function save($id, $data, $ttl = 60)
- {
+ {
$contents = array(
'time' => time(),
- 'ttl' => $ttl,
+ 'ttl' => $ttl,
'data' => $data
);
-
+
if (write_file($this->_cache_path.$id, serialize($contents)))
{
- @chmod($this->_cache_path.$id, 0777);
- return TRUE;
+ @chmod($this->_cache_path.$id, 0660);
+ return TRUE;
}
return FALSE;
@@ -107,7 +116,7 @@ class CI_Cache_file extends CI_Driver {
*/
public function delete($id)
{
- return unlink($this->_cache_path.$id);
+ return (file_exists($this->_cache_path.$id)) ? unlink($this->_cache_path.$id) : FALSE;
}
// ------------------------------------------------------------------------
@@ -116,7 +125,7 @@ class CI_Cache_file extends CI_Driver {
* Clean the Cache
*
* @return boolean false on failure/true on success
- */
+ */
public function clean()
{
return delete_files($this->_cache_path);
@@ -151,26 +160,24 @@ class CI_Cache_file extends CI_Driver {
{
return FALSE;
}
-
- $data = read_file($this->_cache_path.$id);
- $data = unserialize($data);
-
+
+ $data = unserialize(read_file($this->_cache_path.$id));
+
if (is_array($data))
{
- $data = $data['data'];
$mtime = filemtime($this->_cache_path.$id);
- if ( ! isset($data['ttl']))
+ if ( ! isset($data['data']['ttl']))
{
return FALSE;
}
return array(
- 'expire' => $mtime + $data['ttl'],
- 'mtime' => $mtime
+ 'expire' => $mtime + $data['data']['ttl'],
+ 'mtime' => $mtime
);
}
-
+
return FALSE;
}
@@ -180,7 +187,7 @@ class CI_Cache_file extends CI_Driver {
* Is supported
*
* In the file driver, check to see that the cache directory is indeed writable
- *
+ *
* @return boolean
*/
public function is_supported()
@@ -193,4 +200,4 @@ class CI_Cache_file extends CI_Driver {
// End Class
/* End of file Cache_file.php */
-/* Location: ./system/libraries/Cache/drivers/Cache_file.php */ \ No newline at end of file
+/* Location: ./system/libraries/Cache/drivers/Cache_file.php */
diff --git a/system/libraries/Cache/drivers/Cache_memcached.php b/system/libraries/Cache/drivers/Cache_memcached.php
index fc586e025..ffe6f2ff7 100644
--- a/system/libraries/Cache/drivers/Cache_memcached.php
+++ b/system/libraries/Cache/drivers/Cache_memcached.php
@@ -2,27 +2,39 @@
/**
* CodeIgniter
*
- * An open source application development framework for PHP 4.3.2 or newer
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
*
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2006 - 2011 EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2006 - 2012 EllisLab, Inc.
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 2.0
- * @filesource
+ * @filesource
*/
// ------------------------------------------------------------------------
/**
- * CodeIgniter Memcached Caching Class
+ * CodeIgniter Memcached Caching Class
*
* @package CodeIgniter
* @subpackage Libraries
* @category Core
- * @author ExpressionEngine Dev Team
- * @link
+ * @author EllisLab Dev Team
+ * @link
*/
class CI_Cache_memcached extends CI_Driver {
@@ -37,18 +49,18 @@ class CI_Cache_memcached extends CI_Driver {
)
);
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
/**
* Fetch from cache
*
* @param mixed unique key id
* @return mixed data on success/false on failure
- */
+ */
public function get($id)
- {
+ {
$data = $this->_memcached->get($id);
-
+
return (is_array($data)) ? $data[0] : FALSE;
}
@@ -72,12 +84,12 @@ class CI_Cache_memcached extends CI_Driver {
{
return $this->_memcached->set($id, array($data, time(), $ttl), 0, $ttl);
}
-
+
return FALSE;
}
// ------------------------------------------------------------------------
-
+
/**
* Delete from Cache
*
@@ -90,7 +102,7 @@ class CI_Cache_memcached extends CI_Driver {
}
// ------------------------------------------------------------------------
-
+
/**
* Clean the Cache
*
@@ -115,7 +127,7 @@ class CI_Cache_memcached extends CI_Driver {
}
// ------------------------------------------------------------------------
-
+
/**
* Get Cache Metadata
*
@@ -149,6 +161,7 @@ class CI_Cache_memcached extends CI_Driver {
{
// Try to load memcached server info from the config file.
$CI =& get_instance();
+
if ($CI->config->load('memcached', TRUE, TRUE))
{
if (is_array($CI->config->config['memcached']))
@@ -158,11 +171,24 @@ class CI_Cache_memcached extends CI_Driver {
foreach ($CI->config->config['memcached'] as $name => $conf)
{
$this->_memcache_conf[$name] = $conf;
- }
- }
+ }
+ }
+ }
+
+ if (class_exists('Memcached'))
+ {
+ $this->_memcached = new Memcached();
+ }
+ else if (class_exists('Memcache'))
+ {
+ $this->_memcached = new Memcache();
+ }
+ else
+ {
+ log_message('error', 'Failed to create object for Memcached Cache; extension not loaded?');
+
+ return FALSE;
}
-
- $this->_memcached = new Memcached();
foreach ($this->_memcache_conf as $name => $cache_server)
{
@@ -170,26 +196,42 @@ class CI_Cache_memcached extends CI_Driver {
{
$cache_server['hostname'] = $this->_default_options['default_host'];
}
-
+
if ( ! array_key_exists('port', $cache_server))
{
$cache_server['port'] = $this->_default_options['default_port'];
}
-
+
if ( ! array_key_exists('weight', $cache_server))
{
$cache_server['weight'] = $this->_default_options['default_weight'];
}
-
- $this->_memcached->addServer(
- $cache_server['hostname'], $cache_server['port'], $cache_server['weight']
- );
+
+ if (get_class($this->_memcached) == 'Memcache')
+ {
+ // Third parameter is persistance and defaults to TRUE.
+ $this->_memcached->addServer(
+ $cache_server['hostname'],
+ $cache_server['port'],
+ TRUE,
+ $cache_server['weight']
+ );
+ }
+ else
+ {
+ $this->_memcached->addServer(
+ $cache_server['hostname'],
+ $cache_server['port'],
+ $cache_server['weight']
+ );
+ }
}
+
+ return TRUE;
}
// ------------------------------------------------------------------------
-
/**
* Is supported
*
@@ -198,15 +240,14 @@ class CI_Cache_memcached extends CI_Driver {
*/
public function is_supported()
{
- if ( ! extension_loaded('memcached'))
+ if ( ! extension_loaded('memcached') && ! extension_loaded('memcache'))
{
log_message('error', 'The Memcached Extension must be loaded to use Memcached Cache.');
-
+
return FALSE;
}
-
- $this->_setup_memcached();
- return TRUE;
+
+ return $this->_setup_memcached();
}
// ------------------------------------------------------------------------
@@ -215,4 +256,4 @@ class CI_Cache_memcached extends CI_Driver {
// End Class
/* End of file Cache_memcached.php */
-/* Location: ./system/libraries/Cache/drivers/Cache_memcached.php */ \ No newline at end of file
+/* Location: ./system/libraries/Cache/drivers/Cache_memcached.php */
diff --git a/system/libraries/Calendar.php b/system/libraries/Calendar.php
index df0fd6eeb..a05a7babf 100644
--- a/system/libraries/Calendar.php
+++ b/system/libraries/Calendar.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -23,20 +35,20 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Libraries
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/calendar.html
*/
class CI_Calendar {
- var $CI;
- var $lang;
- var $local_time;
- var $template = '';
- var $start_day = 'sunday';
- var $month_type = 'long';
- var $day_type = 'abr';
- var $show_next_prev = FALSE;
- var $next_prev_url = '';
+ private $CI;
+ public $lang;
+ public $local_time;
+ public $template = '';
+ public $start_day = 'sunday';
+ public $month_type = 'long';
+ public $day_type = 'abr';
+ public $show_next_prev = FALSE;
+ public $next_prev_url = '';
/**
* Constructor
@@ -73,7 +85,7 @@ class CI_Calendar {
* @param array config preferences
* @return void
*/
- function initialize($config = array())
+ public function initialize($config = array())
{
foreach ($config as $key => $val)
{
@@ -95,23 +107,30 @@ class CI_Calendar {
* @param array the data to be shown in the calendar cells
* @return string
*/
- function generate($year = '', $month = '', $data = array())
+ public function generate($year = '', $month = '', $data = array())
{
// Set and validate the supplied month/year
if ($year == '')
- $year = date("Y", $this->local_time);
-
- if ($month == '')
- $month = date("m", $this->local_time);
-
- if (strlen($year) == 1)
+ {
+ $year = date('Y', $this->local_time);
+ }
+ elseif (strlen($year) === 1)
+ {
$year = '200'.$year;
-
- if (strlen($year) == 2)
+ }
+ elseif (strlen($year) === 2)
+ {
$year = '20'.$year;
+ }
- if (strlen($month) == 1)
+ if ($month == '')
+ {
+ $month = date('m', $this->local_time);
+ }
+ elseif (strlen($month) === 1)
+ {
$month = '0'.$month;
+ }
$adjusted_date = $this->adjust_date($month, $year);
@@ -137,9 +156,9 @@ class CI_Calendar {
// Set the current month/year/day
// We use this to determine the "today" date
- $cur_year = date("Y", $this->local_time);
- $cur_month = date("m", $this->local_time);
- $cur_day = date("j", $this->local_time);
+ $cur_year = date('Y', $this->local_time);
+ $cur_month = date('m', $this->local_time);
+ $cur_day = date('j', $this->local_time);
$is_current_month = ($cur_year == $year AND $cur_month == $month) ? TRUE : FALSE;
@@ -147,12 +166,7 @@ class CI_Calendar {
$this->parse_template();
// Begin building the calendar output
- $out = $this->temp['table_open'];
- $out .= "\n";
-
- $out .= "\n";
- $out .= $this->temp['heading_row_start'];
- $out .= "\n";
+ $out = $this->temp['table_open']."\n\n".$this->temp['heading_row_start']."\n";
// "previous" month link
if ($this->show_next_prev == TRUE)
@@ -161,18 +175,16 @@ class CI_Calendar {
$this->next_prev_url = preg_replace("/(.+?)\/*$/", "\\1/", $this->next_prev_url);
$adjusted_date = $this->adjust_date($month - 1, $year);
- $out .= str_replace('{previous_url}', $this->next_prev_url.$adjusted_date['year'].'/'.$adjusted_date['month'], $this->temp['heading_previous_cell']);
- $out .= "\n";
+ $out .= str_replace('{previous_url}', $this->next_prev_url.$adjusted_date['year'].'/'.$adjusted_date['month'], $this->temp['heading_previous_cell'])."\n";
}
// Heading containing the month/year
$colspan = ($this->show_next_prev == TRUE) ? 5 : 7;
- $this->temp['heading_title_cell'] = str_replace('{colspan}', $colspan, $this->temp['heading_title_cell']);
- $this->temp['heading_title_cell'] = str_replace('{heading}', $this->get_month_name($month)."&nbsp;".$year, $this->temp['heading_title_cell']);
+ $this->temp['heading_title_cell'] = str_replace('{colspan}', $colspan,
+ str_replace('{heading}', $this->get_month_name($month).'&nbsp;'.$year, $this->temp['heading_title_cell']));
- $out .= $this->temp['heading_title_cell'];
- $out .= "\n";
+ $out .= $this->temp['heading_title_cell']."\n";
// "next" month link
if ($this->show_next_prev == TRUE)
@@ -181,14 +193,9 @@ class CI_Calendar {
$out .= str_replace('{next_url}', $this->next_prev_url.$adjusted_date['year'].'/'.$adjusted_date['month'], $this->temp['heading_next_cell']);
}
- $out .= "\n";
- $out .= $this->temp['heading_row_end'];
- $out .= "\n";
-
- // Write the cells containing the days of the week
- $out .= "\n";
- $out .= $this->temp['week_row_start'];
- $out .= "\n";
+ $out .= "\n".$this->temp['heading_row_end']."\n\n"
+ // Write the cells containing the days of the week
+ .$this->temp['week_row_start']."\n";
$day_names = $this->get_day_names();
@@ -197,33 +204,31 @@ class CI_Calendar {
$out .= str_replace('{week_day}', $day_names[($start_day + $i) %7], $this->temp['week_day_cell']);
}
- $out .= "\n";
- $out .= $this->temp['week_row_end'];
- $out .= "\n";
+ $out .= "\n".$this->temp['week_row_end']."\n";
// Build the main body of the calendar
while ($day <= $total_days)
{
- $out .= "\n";
- $out .= $this->temp['cal_row_start'];
- $out .= "\n";
+ $out .= "\n".$this->temp['cal_row_start']."\n";
for ($i = 0; $i < 7; $i++)
{
- $out .= ($is_current_month == TRUE AND $day == $cur_day) ? $this->temp['cal_cell_start_today'] : $this->temp['cal_cell_start'];
+ $out .= ($is_current_month === TRUE AND $day == $cur_day) ? $this->temp['cal_cell_start_today'] : $this->temp['cal_cell_start'];
if ($day > 0 AND $day <= $total_days)
{
if (isset($data[$day]))
{
// Cells with content
- $temp = ($is_current_month == TRUE AND $day == $cur_day) ? $this->temp['cal_cell_content_today'] : $this->temp['cal_cell_content'];
- $out .= str_replace('{day}', $day, str_replace('{content}', $data[$day], $temp));
+ $temp = ($is_current_month === TRUE AND $day == $cur_day) ?
+ $this->temp['cal_cell_content_today'] : $this->temp['cal_cell_content'];
+ $out .= str_replace(array('{content}', '{day}'), array($data[$day], $day), $temp);
}
else
{
// Cells with no content
- $temp = ($is_current_month == TRUE AND $day == $cur_day) ? $this->temp['cal_cell_no_content_today'] : $this->temp['cal_cell_no_content'];
+ $temp = ($is_current_month === TRUE AND $day == $cur_day) ?
+ $this->temp['cal_cell_no_content_today'] : $this->temp['cal_cell_no_content'];
$out .= str_replace('{day}', $day, $temp);
}
}
@@ -233,17 +238,14 @@ class CI_Calendar {
$out .= $this->temp['cal_cell_blank'];
}
- $out .= ($is_current_month == TRUE AND $day == $cur_day) ? $this->temp['cal_cell_end_today'] : $this->temp['cal_cell_end'];
+ $out .= ($is_current_month === TRUE AND $day == $cur_day) ? $this->temp['cal_cell_end_today'] : $this->temp['cal_cell_end'];
$day++;
}
- $out .= "\n";
- $out .= $this->temp['cal_row_end'];
- $out .= "\n";
+ $out .= "\n".$this->temp['cal_row_end']."\n";
}
- $out .= "\n";
- $out .= $this->temp['table_close'];
+ $out .= "\n".$this->temp['table_close'];
return $out;
}
@@ -260,7 +262,7 @@ class CI_Calendar {
* @param integer the month
* @return string
*/
- function get_month_name($month)
+ public function get_month_name($month)
{
if ($this->month_type == 'short')
{
@@ -275,7 +277,7 @@ class CI_Calendar {
if ($this->CI->lang->line($month) === FALSE)
{
- return ucfirst(str_replace('cal_', '', $month));
+ return ucfirst(substr($month, 4));
}
return $this->CI->lang->line($month);
@@ -293,10 +295,12 @@ class CI_Calendar {
* @param string
* @return array
*/
- function get_day_names($day_type = '')
+ public function get_day_names($day_type = '')
{
if ($day_type != '')
+ {
$this->day_type = $day_type;
+ }
if ($this->day_type == 'long')
{
@@ -312,9 +316,9 @@ class CI_Calendar {
}
$days = array();
- foreach ($day_names as $val)
+ for ($i = 0, $c = count($day_names); $i < $c; $i++)
{
- $days[] = ($this->CI->lang->line('cal_'.$val) === FALSE) ? ucfirst($val) : $this->CI->lang->line('cal_'.$val);
+ $days[] = ($this->CI->lang->line('cal_'.$day_names[$i]) === FALSE) ? ucfirst($day_names[$i]) : $this->CI->lang->line('cal_'.$day_names[$i]);
}
return $days;
@@ -334,7 +338,7 @@ class CI_Calendar {
* @param integer the year
* @return array
*/
- function adjust_date($month, $year)
+ public function adjust_date($month, $year)
{
$date = array();
@@ -353,7 +357,7 @@ class CI_Calendar {
$date['year']--;
}
- if (strlen($date['month']) == 1)
+ if (strlen($date['month']) === 1)
{
$date['month'] = '0'.$date['month'];
}
@@ -371,7 +375,7 @@ class CI_Calendar {
* @param integer the year
* @return integer
*/
- function get_total_days($month, $year)
+ public function get_total_days($month, $year)
{
$days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
@@ -402,7 +406,7 @@ class CI_Calendar {
* @access public
* @return array
*/
- function default_template()
+ public function default_template()
{
return array (
'table_open' => '<table border="0" cellpadding="4" cellspacing="0">',
@@ -440,7 +444,7 @@ class CI_Calendar {
* @access public
* @return void
*/
- function parse_template()
+ public function parse_template()
{
$this->temp = $this->default_template();
@@ -455,14 +459,11 @@ class CI_Calendar {
{
if (preg_match("/\{".$val."\}(.*?)\{\/".$val."\}/si", $this->template, $match))
{
- $this->temp[$val] = $match['1'];
+ $this->temp[$val] = $match[1];
}
- else
+ elseif (in_array($val, $today, TRUE))
{
- if (in_array($val, $today, TRUE))
- {
- $this->temp[$val] = $this->temp[str_replace('_today', '', $val)];
- }
+ $this->temp[$val] = $this->temp[substr($val, 0, -6)];
}
}
}
@@ -472,4 +473,4 @@ class CI_Calendar {
// END CI_Calendar class
/* End of file Calendar.php */
-/* Location: ./system/libraries/Calendar.php */ \ No newline at end of file
+/* Location: ./system/libraries/Calendar.php */
diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php
index ab5a70c98..10b5362a5 100644
--- a/system/libraries/Cart.php
+++ b/system/libraries/Cart.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2006 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2006 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,18 +33,19 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Shopping Cart
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/cart.html
*/
class CI_Cart {
// These are the regular expression rules that we use to validate the product ID and product name
- var $product_id_rules = '\.a-z0-9_-'; // alpha-numeric, dashes, underscores, or periods
- var $product_name_rules = '\.\:\-_ a-z0-9'; // alpha-numeric, dashes, underscores, colons or periods
+ public $product_id_rules = '\.a-z0-9_-'; // alpha-numeric, dashes, underscores, or periods
+ public $product_name_rules = '\.\:\-_ a-z0-9'; // alpha-numeric, dashes, underscores, colons or periods
+ public $product_name_safe = true; // only allow safe product names
// Private variables. Do not change!
- var $CI;
- var $_cart_contents = array();
+ private $CI;
+ private $_cart_contents = array();
/**
@@ -46,28 +59,17 @@ class CI_Cart {
$this->CI =& get_instance();
// Are any config settings being passed manually? If so, set them
- $config = array();
- if (count($params) > 0)
- {
- foreach ($params as $key => $val)
- {
- $config[$key] = $val;
- }
- }
+ $config = is_array($params) ? $params : array();
// Load the Sessions class
$this->CI->load->library('session', $config);
- // Grab the shopping cart array from the session table, if it exists
- if ($this->CI->session->userdata('cart_contents') !== FALSE)
- {
- $this->_cart_contents = $this->CI->session->userdata('cart_contents');
- }
- else
+ // Grab the shopping cart array from the session table
+ $this->_cart_contents = $this->CI->session->userdata('cart_contents');
+ if ($this->_cart_contents === FALSE)
{
// No cart exists so we'll set some base values
- $this->_cart_contents['cart_total'] = 0;
- $this->_cart_contents['total_items'] = 0;
+ $this->_cart_contents = array('cart_total' => 0, 'total_items' => 0);
}
log_message('debug', "Cart Class Initialized");
@@ -82,10 +84,10 @@ class CI_Cart {
* @param array
* @return bool
*/
- function insert($items = array())
+ public function insert($items = array())
{
// Was any cart data passed? No? Bah...
- if ( ! is_array($items) OR count($items) == 0)
+ if ( ! is_array($items) OR count($items) === 0)
{
log_message('error', 'The insert method must be passed an array containing data.');
return FALSE;
@@ -119,7 +121,7 @@ class CI_Cart {
}
// Save the cart data if the insert was successful
- if ($save_cart == TRUE)
+ if ($save_cart === TRUE)
{
$this->_save_cart();
return isset($rowid) ? $rowid : TRUE;
@@ -137,10 +139,10 @@ class CI_Cart {
* @param array
* @return bool
*/
- function _insert($items = array())
+ private function _insert($items = array())
{
// Was any cart data passed? No? Bah...
- if ( ! is_array($items) OR count($items) == 0)
+ if ( ! is_array($items) OR count($items) === 0)
{
log_message('error', 'The insert method must be passed an array containing data.');
return FALSE;
@@ -157,10 +159,8 @@ class CI_Cart {
// --------------------------------------------------------------------
- // Prep the quantity. It can only be a number. Duh...
- $items['qty'] = trim(preg_replace('/([^0-9])/i', '', $items['qty']));
- // Trim any leading zeros
- $items['qty'] = trim(preg_replace('/(^[0]+)/i', '', $items['qty']));
+ // Prep the quantity. It can only be a number. Duh... also trim any leading zeros
+ $items['qty'] = (float) $items['qty'];
// If the quantity is zero or blank there's nothing for us to do
if ( ! is_numeric($items['qty']) OR $items['qty'] == 0)
@@ -173,7 +173,7 @@ class CI_Cart {
// Validate the product ID. It can only be alpha-numeric, dashes, underscores or periods
// Not totally sure we should impose this rule, but it seems prudent to standardize IDs.
// Note: These can be user-specified by setting the $this->product_id_rules variable.
- if ( ! preg_match("/^[".$this->product_id_rules."]+$/i", $items['id']))
+ if ( ! preg_match('/^['.$this->product_id_rules.']+$/i', $items['id']))
{
log_message('error', 'Invalid product ID. The product ID can only contain alpha-numeric characters, dashes, and underscores');
return FALSE;
@@ -183,7 +183,7 @@ class CI_Cart {
// Validate the product name. It can only be alpha-numeric, dashes, underscores, colons or periods.
// Note: These can be user-specified by setting the $this->product_name_rules variable.
- if ( ! preg_match("/^[".$this->product_name_rules."]+$/i", $items['name']))
+ if ($this->product_name_safe && ! preg_match('/^['.$this->product_name_rules.']+$/i', $items['name']))
{
log_message('error', 'An invalid name was submitted as the product name: '.$items['name'].' The name can only contain alpha-numeric characters, dashes, underscores, colons, and spaces');
return FALSE;
@@ -191,10 +191,8 @@ class CI_Cart {
// --------------------------------------------------------------------
- // Prep the price. Remove anything that isn't a number or decimal point.
- $items['price'] = trim(preg_replace('/([^0-9\.])/i', '', $items['price']));
- // Trim any leading zeros
- $items['price'] = trim(preg_replace('/(^[0]+)/i', '', $items['price']));
+ // Prep the price. Remove leading zeros and anything that isn't a number or decimal point.
+ $items['price'] = (float) $items['price'];
// Is the price a valid number?
if ( ! is_numeric($items['price']))
@@ -230,20 +228,14 @@ class CI_Cart {
// --------------------------------------------------------------------
// Now that we have our unique "row ID", we'll add our cart items to the master array
+ // grab quantity if it's already there and add it on
+ $old_quantity = isset($this->_cart_contents[$rowid]['qty']) ? (int) $this->_cart_contents[$rowid]['qty'] : 0;
- // let's unset this first, just to make sure our index contains only the data from this submission
- unset($this->_cart_contents[$rowid]);
-
- // Create a new index with our new row ID
- $this->_cart_contents[$rowid]['rowid'] = $rowid;
+ // Re-create the entry, just to make sure our index contains only the data from this submission
+ $items['rowid'] = $rowid;
+ $items['qty'] += $old_quantity;
+ $this->_cart_contents[$rowid] = $items;
- // And add the new items to the cart array
- foreach ($items as $key => $val)
- {
- $this->_cart_contents[$rowid][$key] = $val;
- }
-
- // Woot!
return $rowid;
}
@@ -262,10 +254,10 @@ class CI_Cart {
* @param string
* @return bool
*/
- function update($items = array())
+ public function update($items = array())
{
// Was any cart data passed?
- if ( ! is_array($items) OR count($items) == 0)
+ if ( ! is_array($items) OR count($items) === 0)
{
return FALSE;
}
@@ -275,9 +267,9 @@ class CI_Cart {
// determine the array type is by looking for a required array key named "id".
// If it's not found we assume it's a multi-dimensional array
$save_cart = FALSE;
- if (isset($items['rowid']) AND isset($items['qty']))
+ if (isset($items['rowid'], $items['qty']))
{
- if ($this->_update($items) == TRUE)
+ if ($this->_update($items) === TRUE)
{
$save_cart = TRUE;
}
@@ -286,9 +278,9 @@ class CI_Cart {
{
foreach ($items as $val)
{
- if (is_array($val) AND isset($val['rowid']) AND isset($val['qty']))
+ if (is_array($val) && isset($val['rowid'], $val['qty']))
{
- if ($this->_update($val) == TRUE)
+ if ($this->_update($val) === TRUE)
{
$save_cart = TRUE;
}
@@ -297,7 +289,7 @@ class CI_Cart {
}
// Save the cart data if the insert was successful
- if ($save_cart == TRUE)
+ if ($save_cart === TRUE)
{
$this->_save_cart();
return TRUE;
@@ -320,7 +312,7 @@ class CI_Cart {
* @param array
* @return bool
*/
- function _update($items = array())
+ private function _update($items = array())
{
// Without these array indexes there is nothing we can do
if ( ! isset($items['qty']) OR ! isset($items['rowid']) OR ! isset($this->_cart_contents[$items['rowid']]))
@@ -329,7 +321,7 @@ class CI_Cart {
}
// Prep the quantity
- $items['qty'] = preg_replace('/([^0-9])/i', '', $items['qty']);
+ $items['qty'] = (float) $items['qty'];
// Is the quantity a number?
if ( ! is_numeric($items['qty']))
@@ -337,13 +329,6 @@ class CI_Cart {
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'])
- {
- return FALSE;
- }
-
// Is the quantity zero? If so we will remove the item from the cart.
// If the quantity is greater than zero we are updating
if ($items['qty'] == 0)
@@ -366,15 +351,10 @@ class CI_Cart {
* @access private
* @return bool
*/
- function _save_cart()
+ private function _save_cart()
{
- // Unset these so our total can be calculated correctly below
- unset($this->_cart_contents['total_items']);
- unset($this->_cart_contents['cart_total']);
-
// Lets add up the individual prices and set the cart sub-total
- $total = 0;
- $items = 0;
+ $this->_cart_contents['total_items'] = $this->_cart_contents['cart_total'] = 0;
foreach ($this->_cart_contents as $key => $val)
{
// We make sure the array contains the proper indexes
@@ -383,17 +363,11 @@ class CI_Cart {
continue;
}
- $total += ($val['price'] * $val['qty']);
- $items += $val['qty'];
-
- // Set the subtotal
+ $this->_cart_contents['cart_total'] += ($val['price'] * $val['qty']);
+ $this->_cart_contents['total_items'] += $val['qty'];
$this->_cart_contents[$key]['subtotal'] = ($this->_cart_contents[$key]['price'] * $this->_cart_contents[$key]['qty']);
}
- // Set the cart total and total items.
- $this->_cart_contents['total_items'] = $items;
- $this->_cart_contents['cart_total'] = $total;
-
// Is our cart empty? If so we delete it from the session
if (count($this->_cart_contents) <= 2)
{
@@ -419,7 +393,7 @@ class CI_Cart {
* @access public
* @return integer
*/
- function total()
+ public function total()
{
return $this->_cart_contents['cart_total'];
}
@@ -427,6 +401,24 @@ class CI_Cart {
// --------------------------------------------------------------------
/**
+ * Remove Item
+ *
+ * Removes an item from the cart
+ *
+ * @access public
+ * @return boolean
+ */
+ public function remove($rowid)
+ {
+ // unset & save
+ unset($this->_cart_contents[$rowid]);
+ $this->_save_cart();
+ return TRUE;
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Total Items
*
* Returns the total item count
@@ -434,7 +426,7 @@ class CI_Cart {
* @access public
* @return integer
*/
- function total_items()
+ public function total_items()
{
return $this->_cart_contents['total_items'];
}
@@ -449,9 +441,10 @@ class CI_Cart {
* @access public
* @return array
*/
- function contents()
+ public function contents($newest_first = FALSE)
{
- $cart = $this->_cart_contents;
+ // do we want the newest first?
+ $cart = ($newest_first) ? array_reverse($this->_cart_contents) : $this->_cart_contents;
// Remove these so they don't create a problem when showing the cart table
unset($cart['total_items']);
@@ -469,16 +462,11 @@ class CI_Cart {
* that has options associated with it.
*
* @access public
- * @return array
+ * @return bool
*/
- function has_options($rowid = '')
+ public function has_options($rowid = '')
{
- if ( ! isset($this->_cart_contents[$rowid]['options']) OR count($this->_cart_contents[$rowid]['options']) === 0)
- {
- return FALSE;
- }
-
- return TRUE;
+ return (isset($this->_cart_contents[$rowid]['options']) && count($this->_cart_contents[$rowid]['options']) !== 0) ? TRUE : FALSE;
}
// --------------------------------------------------------------------
@@ -491,14 +479,9 @@ class CI_Cart {
* @access public
* @return array
*/
- function product_options($rowid = '')
+ public function product_options($rowid = '')
{
- if ( ! isset($this->_cart_contents[$rowid]['options']))
- {
- return array();
- }
-
- return $this->_cart_contents[$rowid]['options'];
+ return isset($this->_cart_contents[$rowid]['options']) ? $this->_cart_contents[$rowid]['options'] : array();
}
// --------------------------------------------------------------------
@@ -509,9 +492,9 @@ class CI_Cart {
* Returns the supplied number with commas and a decimal point.
*
* @access public
- * @return integer
+ * @return string
*/
- function format_number($n = '')
+ public function format_number($n = '')
{
if ($n == '')
{
@@ -519,7 +502,7 @@ class CI_Cart {
}
// Remove anything that isn't a number or decimal point.
- $n = trim(preg_replace('/([^0-9\.])/i', '', $n));
+ $n = (float) $n;
return number_format($n, 2, '.', ',');
}
@@ -532,15 +515,11 @@ class CI_Cart {
* Empties the cart and kills the session
*
* @access public
- * @return null
+ * @return void
*/
- function destroy()
+ public function destroy()
{
- unset($this->_cart_contents);
-
- $this->_cart_contents['cart_total'] = 0;
- $this->_cart_contents['total_items'] = 0;
-
+ $this->_cart_contents = array('cart_total' => 0, 'total_items' => 0);
$this->CI->session->unset_userdata('cart_contents');
}
@@ -549,4 +528,4 @@ class CI_Cart {
// END Cart Class
/* End of file Cart.php */
-/* Location: ./system/libraries/Cart.php */ \ No newline at end of file
+/* Location: ./system/libraries/Cart.php */
diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php
index 9881c1eec..4e8944311 100644
--- a/system/libraries/Driver.php
+++ b/system/libraries/Driver.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
* @author EllisLab Dev Team
- * @copyright Copyright (c) 2006 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @copyright Copyright (c) 2006 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -34,7 +46,7 @@ class CI_Driver_Library {
// The first time a child is used it won't exist, so we instantiate it
// subsequents calls will go straight to the proper child.
- function __get($child)
+ public function __get($child)
{
if ( ! isset($this->lib_name))
{
@@ -43,11 +55,11 @@ class CI_Driver_Library {
// The class will be prefixed with the parent lib
$child_class = $this->lib_name.'_'.$child;
-
+
// Remove the CI_ prefix and lowercase
$lib_name = ucfirst(strtolower(str_replace('CI_', '', $this->lib_name)));
$driver_name = strtolower(str_replace('CI_', '', $child_class));
-
+
if (in_array($driver_name, array_map('strtolower', $this->valid_drivers)))
{
// check and see if the driver is in a separate file
@@ -64,7 +76,7 @@ class CI_Driver_Library {
if (file_exists($filepath))
{
include_once $filepath;
- break;
+ break 2;
}
}
}
@@ -107,6 +119,7 @@ class CI_Driver_Library {
* @link
*/
class CI_Driver {
+
protected $parent;
private $methods = array();
@@ -226,4 +239,4 @@ class CI_Driver {
// END CI_Driver CLASS
/* End of file Driver.php */
-/* Location: ./system/libraries/Driver.php */ \ No newline at end of file
+/* Location: ./system/libraries/Driver.php */
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index 9ec40af9d..922107e9f 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -23,59 +35,59 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Libraries
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/email.html
*/
class CI_Email {
- var $useragent = "CodeIgniter";
- var $mailpath = "/usr/sbin/sendmail"; // Sendmail path
- var $protocol = "mail"; // mail/sendmail/smtp
- var $smtp_host = ""; // SMTP Server. Example: mail.earthlink.net
- var $smtp_user = ""; // SMTP Username
- var $smtp_pass = ""; // SMTP Password
- var $smtp_port = "25"; // SMTP Port
- var $smtp_timeout = 5; // SMTP Timeout in seconds
- var $smtp_crypto = ""; // SMTP Encryption. Can be null, tls or ssl.
- var $wordwrap = TRUE; // TRUE/FALSE Turns word-wrap on/off
- var $wrapchars = "76"; // Number of characters to wrap at.
- var $mailtype = "text"; // text/html Defines email formatting
- var $charset = "utf-8"; // Default char set: iso-8859-1 or us-ascii
- var $multipart = "mixed"; // "mixed" (in the body) or "related" (separate)
- var $alt_message = ''; // Alternative message for HTML emails
- var $validate = FALSE; // TRUE/FALSE. Enables email validation
- var $priority = "3"; // Default priority (1 - 5)
- var $newline = "\n"; // Default newline. "\r\n" or "\n" (Use "\r\n" to comply with RFC 822)
- var $crlf = "\n"; // The RFC 2045 compliant CRLF for quoted-printable is "\r\n". Apparently some servers,
+ public $useragent = "CodeIgniter";
+ public $mailpath = "/usr/sbin/sendmail"; // Sendmail path
+ public $protocol = "mail"; // mail/sendmail/smtp
+ public $smtp_host = ""; // SMTP Server. Example: mail.earthlink.net
+ public $smtp_user = ""; // SMTP Username
+ public $smtp_pass = ""; // SMTP Password
+ public $smtp_port = "25"; // SMTP Port
+ public $smtp_timeout = 5; // SMTP Timeout in seconds
+ public $smtp_crypto = ""; // SMTP Encryption. Can be null, tls or ssl.
+ public $wordwrap = TRUE; // TRUE/FALSE Turns word-wrap on/off
+ public $wrapchars = "76"; // Number of characters to wrap at.
+ public $mailtype = "text"; // text/html Defines email formatting
+ public $charset = "utf-8"; // Default char set: iso-8859-1 or us-ascii
+ public $multipart = "mixed"; // "mixed" (in the body) or "related" (separate)
+ public $alt_message = ''; // Alternative message for HTML emails
+ public $validate = FALSE; // TRUE/FALSE. Enables email validation
+ public $priority = "3"; // Default priority (1 - 5)
+ public $newline = "\n"; // Default newline. "\r\n" or "\n" (Use "\r\n" to comply with RFC 822)
+ public $crlf = "\n"; // The RFC 2045 compliant CRLF for quoted-printable is "\r\n". Apparently some servers,
// even on the receiving end think they need to muck with CRLFs, so using "\n", while
// distasteful, is the only thing that seems to work for all environments.
- var $send_multipart = TRUE; // TRUE/FALSE - Yahoo does not like multipart alternative, so this is an override. Set to FALSE for Yahoo.
- var $bcc_batch_mode = FALSE; // TRUE/FALSE Turns on/off Bcc batch feature
- var $bcc_batch_size = 200; // If bcc_batch_mode = TRUE, sets max number of Bccs in each batch
- var $_safe_mode = FALSE;
- var $_subject = "";
- var $_body = "";
- var $_finalbody = "";
- var $_alt_boundary = "";
- var $_atc_boundary = "";
- var $_header_str = "";
- var $_smtp_connect = "";
- var $_encoding = "8bit";
- var $_IP = FALSE;
- var $_smtp_auth = FALSE;
- var $_replyto_flag = FALSE;
- var $_debug_msg = array();
- var $_recipients = array();
- var $_cc_array = array();
- var $_bcc_array = array();
- var $_headers = array();
- var $_attach_name = array();
- var $_attach_type = array();
- var $_attach_disp = array();
- var $_protocols = array('mail', 'sendmail', 'smtp');
- var $_base_charsets = array('us-ascii', 'iso-2022-'); // 7-bit charsets (excluding language suffix)
- var $_bit_depths = array('7bit', '8bit');
- var $_priorities = array('1 (Highest)', '2 (High)', '3 (Normal)', '4 (Low)', '5 (Lowest)');
+ public $send_multipart = TRUE; // TRUE/FALSE - Yahoo does not like multipart alternative, so this is an override. Set to FALSE for Yahoo.
+ public $bcc_batch_mode = FALSE; // TRUE/FALSE Turns on/off Bcc batch feature
+ public $bcc_batch_size = 200; // If bcc_batch_mode = TRUE, sets max number of Bccs in each batch
+ private $_safe_mode = FALSE;
+ private $_subject = "";
+ private $_body = "";
+ private $_finalbody = "";
+ private $_alt_boundary = "";
+ private $_atc_boundary = "";
+ private $_header_str = "";
+ private $_smtp_connect = "";
+ private $_encoding = "8bit";
+ private $_IP = FALSE;
+ private $_smtp_auth = FALSE;
+ private $_replyto_flag = FALSE;
+ private $_debug_msg = array();
+ private $_recipients = array();
+ private $_cc_array = array();
+ private $_bcc_array = array();
+ private $_headers = array();
+ private $_attach_name = array();
+ private $_attach_type = array();
+ private $_attach_disp = array();
+ private $_protocols = array('mail', 'sendmail', 'smtp');
+ private $_base_charsets = array('us-ascii', 'iso-2022-'); // 7-bit charsets (excluding language suffix)
+ private $_bit_depths = array('7bit', '8bit');
+ private $_priorities = array('1 (Highest)', '2 (High)', '3 (Normal)', '4 (Low)', '5 (Lowest)');
/**
@@ -92,7 +104,7 @@ class CI_Email {
else
{
$this->_smtp_auth = ($this->smtp_user == '' AND $this->smtp_pass == '') ? FALSE : TRUE;
- $this->_safe_mode = ((boolean)@ini_get("safe_mode") === FALSE) ? FALSE : TRUE;
+ $this->_safe_mode = (bool) @ini_get("safe_mode");
}
log_message('debug', "Email Class Initialized");
@@ -128,7 +140,7 @@ class CI_Email {
$this->clear();
$this->_smtp_auth = ($this->smtp_user == '' AND $this->smtp_pass == '') ? FALSE : TRUE;
- $this->_safe_mode = ((boolean)@ini_get("safe_mode") === FALSE) ? FALSE : TRUE;
+ $this->_safe_mode = (bool) @ini_get("safe_mode");
return $this;
}
@@ -139,6 +151,7 @@ class CI_Email {
* Initialize the Email Data
*
* @access public
+ * @param bool
* @return void
*/
public function clear($clear_attachments = FALSE)
@@ -181,7 +194,7 @@ class CI_Email {
{
if (preg_match( '/\<(.*)\>/', $from, $match))
{
- $from = $match['1'];
+ $from = $match[1];
}
if ($this->validate)
@@ -224,7 +237,7 @@ class CI_Email {
{
if (preg_match( '/\<(.*)\>/', $replyto, $match))
{
- $replyto = $match['1'];
+ $replyto = $match[1];
}
if ($this->validate)
@@ -237,7 +250,7 @@ class CI_Email {
$name = $replyto;
}
- if (strncmp($name, '"', 1) != 0)
+ if (strncmp($name, '"', 1) !== 0)
{
$name = '"'.$name.'"';
}
@@ -267,7 +280,7 @@ class CI_Email {
$this->validate_email($to);
}
- if ($this->_get_protocol() != 'mail')
+ if ($this->_get_protocol() !== 'mail')
{
$this->_set_header('To', implode(", ", $to));
}
@@ -307,7 +320,7 @@ class CI_Email {
$this->_set_header('Cc', implode(", ", $cc));
- if ($this->_get_protocol() == "smtp")
+ if ($this->_get_protocol() === 'smtp')
{
$this->_cc_array = $cc;
}
@@ -341,7 +354,7 @@ class CI_Email {
$this->validate_email($bcc);
}
- if (($this->_get_protocol() == "smtp") OR ($this->bcc_batch_mode && count($bcc) > $this->bcc_batch_size))
+ if ($this->_get_protocol() === 'smtp' OR ($this->bcc_batch_mode && count($bcc) > $this->bcc_batch_size))
{
$this->_bcc_array = $bcc;
}
@@ -405,11 +418,11 @@ class CI_Email {
* @param string
* @return void
*/
- public function attach($filename, $disposition = 'attachment')
+ public function attach($filename, $disposition = '', $newname = NULL)
{
- $this->_attach_name[] = $filename;
+ $this->_attach_name[] = array($filename, $newname);
$this->_attach_type[] = $this->_mime_types(pathinfo($filename, PATHINFO_EXTENSION));
- $this->_attach_disp[] = $disposition; // Can also be 'inline' Not sure if it matters
+ $this->_attach_disp[] = empty($disposition) ? 'attachment' : $disposition; // Can also be 'inline' Not sure if it matters
return $this;
}
@@ -465,7 +478,7 @@ class CI_Email {
*/
public function set_alt_message($str = '')
{
- $this->alt_message = $str;
+ $this->alt_message = (string) $str;
return $this;
}
@@ -490,12 +503,12 @@ class CI_Email {
* Set Wordwrap
*
* @access public
- * @param string
+ * @param bool
* @return void
*/
public function set_wordwrap($wordwrap = TRUE)
{
- $this->wordwrap = ($wordwrap === FALSE) ? FALSE : TRUE;
+ $this->wordwrap = (bool) $wordwrap;
return $this;
}
@@ -525,19 +538,13 @@ class CI_Email {
*/
public function set_priority($n = 3)
{
- if ( ! is_numeric($n))
+ if ( ! is_numeric($n) OR $n < 1 OR $n > 5)
{
$this->priority = 3;
return;
}
- if ($n < 1 OR $n > 5)
- {
- $this->priority = 3;
- return;
- }
-
- $this->priority = $n;
+ $this->priority = (int) $n;
return $this;
}
@@ -552,14 +559,7 @@ class CI_Email {
*/
public function set_newline($newline = "\n")
{
- if ($newline != "\n" AND $newline != "\r\n" AND $newline != "\r")
- {
- $this->newline = "\n";
- return;
- }
-
- $this->newline = $newline;
-
+ $this->newline = in_array($newline, array("\n", "\r\n", "\r")) ? $newline : "\n";
return $this;
}
@@ -574,14 +574,7 @@ class CI_Email {
*/
public function set_crlf($crlf = "\n")
{
- if ($crlf != "\n" AND $crlf != "\r\n" AND $crlf != "\r")
- {
- $this->crlf = "\n";
- return;
- }
-
- $this->crlf = $crlf;
-
+ $this->crlf = ($crlf !== "\n" AND $crlf !== "\r\n" AND $crlf !== "\r") ? "\n" : $crlf;
return $this;
}
@@ -609,9 +602,7 @@ class CI_Email {
*/
protected function _get_message_id()
{
- $from = $this->_headers['Return-Path'];
- $from = str_replace(">", "", $from);
- $from = str_replace("<", "", $from);
+ $from = str_replace(array('>', '<'), '', $this->_headers['Return-Path']);
return "<".uniqid('').strstr($from, '@').">";
}
@@ -651,7 +642,7 @@ class CI_Email {
foreach ($this->_base_charsets as $charset)
{
- if (strncmp($charset, $this->charset, strlen($charset)) == 0)
+ if (strncmp($charset, $this->charset, strlen($charset)) === 0)
{
$this->_encoding = '7bit';
}
@@ -673,15 +664,15 @@ class CI_Email {
*/
protected function _get_content_type()
{
- if ($this->mailtype == 'html' && count($this->_attach_name) == 0)
+ if ($this->mailtype === 'html' && count($this->_attach_name) === 0)
{
return 'html';
}
- elseif ($this->mailtype == 'html' && count($this->_attach_name) > 0)
+ elseif ($this->mailtype === 'html' && count($this->_attach_name) > 0)
{
return 'html-attach';
}
- elseif ($this->mailtype == 'text' && count($this->_attach_name) > 0)
+ elseif ($this->mailtype === 'text' && count($this->_attach_name) > 0)
{
return 'plain-attach';
}
@@ -702,9 +693,9 @@ class CI_Email {
protected function _set_date()
{
$timezone = date("Z");
- $operator = (strncmp($timezone, '-', 1) == 0) ? '-' : '+';
+ $operator = (strncmp($timezone, '-', 1) === 0) ? '-' : '+';
$timezone = abs($timezone);
- $timezone = floor($timezone/3600) * 100 + ($timezone % 3600 ) / 60;
+ $timezone = floor($timezone/3600) * 100 + ($timezone % 3600) / 60;
return sprintf("%s %s%04d", date("D, j M Y H:i:s"), $operator, $timezone);
}
@@ -762,7 +753,7 @@ class CI_Email {
*/
public function valid_email($address)
{
- return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address)) ? FALSE : TRUE;
+ return (bool) preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address);
}
// --------------------------------------------------------------------
@@ -778,28 +769,14 @@ class CI_Email {
{
if ( ! is_array($email))
{
- if (preg_match('/\<(.*)\>/', $email, $match))
- {
- return $match['1'];
- }
- else
- {
- return $email;
- }
+ return (preg_match('/\<(.*)\>/', $email, $match)) ? $match[1] : $email;
}
$clean_email = array();
foreach ($email as $addy)
{
- if (preg_match( '/\<(.*)\>/', $addy, $match))
- {
- $clean_email[] = $match['1'];
- }
- else
- {
- $clean_email[] = $addy;
- }
+ $clean_email[] = (preg_match( '/\<(.*)\>/', $addy, $match)) ? $match[1] : $addy;
}
return $clean_email;
@@ -825,32 +802,15 @@ class CI_Email {
return $this->word_wrap($this->alt_message, '76');
}
- if (preg_match('/\<body.*?\>(.*)\<\/body\>/si', $this->_body, $match))
- {
- $body = $match['1'];
- }
- else
- {
- $body = $this->_body;
- }
-
- $body = trim(strip_tags($body));
- $body = preg_replace( '#<!--(.*)--\>#', "", $body);
- $body = str_replace("\t", "", $body);
+ $body = (preg_match('/\<body.*?\>(.*)\<\/body\>/si', $this->_body, $match)) ? $match[1] : $this->_body;
+ $body = str_replace("\t", '', preg_replace('#<!--(.*)--\>#', '', trim(strip_tags($body))));
for ($i = 20; $i >= 3; $i--)
{
- $n = "";
-
- for ($x = 1; $x <= $i; $x ++)
- {
- $n .= "\n";
- }
-
- $body = str_replace($n, "\n\n", $body);
+ $body = str_replace(str_repeat("\n", $i), "\n\n", $body);
}
- return $this->word_wrap($body, '76');
+ return $this->word_wrap($body, 76);
}
// --------------------------------------------------------------------
@@ -868,7 +828,7 @@ class CI_Email {
// Se the character limit
if ($charlim == '')
{
- $charlim = ($this->wrapchars == "") ? "76" : $this->wrapchars;
+ $charlim = ($this->wrapchars == "") ? 76 : $this->wrapchars;
}
// Reduce multiple spaces
@@ -885,10 +845,10 @@ class CI_Email {
$unwrap = array();
if (preg_match_all("|(\{unwrap\}.+?\{/unwrap\})|s", $str, $matches))
{
- for ($i = 0; $i < count($matches['0']); $i++)
+ for ($i = 0, $c = count($matches[0]); $i < $c; $i++)
{
- $unwrap[] = $matches['1'][$i];
- $str = str_replace($matches['1'][$i], "{{unwrapped".$i."}}", $str);
+ $unwrap[] = $matches[1][$i];
+ $str = str_replace($matches[1][$i], "{{unwrapped".$i."}}", $str);
}
}
@@ -910,7 +870,7 @@ class CI_Email {
}
$temp = '';
- while ((strlen($line)) > $charlim)
+ do
{
// If the over-length word is a URL we won't wrap it
if (preg_match("!\[url.+\]|://|wwww.!", $line))
@@ -922,19 +882,16 @@ class CI_Email {
$temp .= substr($line, 0, $charlim-1);
$line = substr($line, $charlim-1);
}
+ while (strlen($line) > $charlim);
// If $temp contains data it means we had to split up an over-length
// word into smaller chunks so we'll add it back to our current line
if ($temp != '')
{
- $output .= $temp.$this->newline.$line;
- }
- else
- {
- $output .= $line;
+ $output .= $temp.$this->newline;
}
- $output .= $this->newline;
+ $output .= $line.$this->newline;
}
// Put our markers back
@@ -977,7 +934,7 @@ class CI_Email {
*/
protected function _write_headers()
{
- if ($this->protocol == 'mail')
+ if ($this->protocol === 'mail')
{
$this->_subject = $this->_headers['Subject'];
unset($this->_headers['Subject']);
@@ -996,7 +953,7 @@ class CI_Email {
}
}
- if ($this->_get_protocol() == 'mail')
+ if ($this->_get_protocol() === 'mail')
{
$this->_header_str = rtrim($this->_header_str);
}
@@ -1012,7 +969,7 @@ class CI_Email {
*/
protected function _build_message()
{
- if ($this->wordwrap === TRUE AND $this->mailtype != 'html')
+ if ($this->wordwrap === TRUE AND $this->mailtype !== 'html')
{
$this->_body = $this->word_wrap($this->_body);
}
@@ -1020,17 +977,17 @@ class CI_Email {
$this->_set_boundaries();
$this->_write_headers();
- $hdr = ($this->_get_protocol() == 'mail') ? $this->newline : '';
+ $hdr = ($this->_get_protocol() === 'mail') ? $this->newline : '';
$body = '';
switch ($this->_get_content_type())
{
case 'plain' :
- $hdr .= "Content-Type: text/plain; charset=" . $this->charset . $this->newline;
- $hdr .= "Content-Transfer-Encoding: " . $this->_get_encoding();
+ $hdr .= "Content-Type: text/plain; charset=" . $this->charset . $this->newline
+ . "Content-Transfer-Encoding: " . $this->_get_encoding();
- if ($this->_get_protocol() == 'mail')
+ if ($this->_get_protocol() === 'mail')
{
$this->_header_str .= $hdr;
$this->_finalbody = $this->_body;
@@ -1042,33 +999,32 @@ class CI_Email {
return;
- break;
case 'html' :
if ($this->send_multipart === FALSE)
{
- $hdr .= "Content-Type: text/html; charset=" . $this->charset . $this->newline;
- $hdr .= "Content-Transfer-Encoding: quoted-printable";
+ $hdr .= "Content-Type: text/html; charset=" . $this->charset . $this->newline
+ . "Content-Transfer-Encoding: quoted-printable";
}
else
{
$hdr .= "Content-Type: multipart/alternative; boundary=\"" . $this->_alt_boundary . "\"" . $this->newline . $this->newline;
- $body .= $this->_get_mime_message() . $this->newline . $this->newline;
- $body .= "--" . $this->_alt_boundary . $this->newline;
+ $body .= $this->_get_mime_message() . $this->newline . $this->newline
+ . "--" . $this->_alt_boundary . $this->newline
- $body .= "Content-Type: text/plain; charset=" . $this->charset . $this->newline;
- $body .= "Content-Transfer-Encoding: " . $this->_get_encoding() . $this->newline . $this->newline;
- $body .= $this->_get_alt_message() . $this->newline . $this->newline . "--" . $this->_alt_boundary . $this->newline;
+ . "Content-Type: text/plain; charset=" . $this->charset . $this->newline
+ . "Content-Transfer-Encoding: " . $this->_get_encoding() . $this->newline . $this->newline
+ . $this->_get_alt_message() . $this->newline . $this->newline . "--" . $this->_alt_boundary . $this->newline
- $body .= "Content-Type: text/html; charset=" . $this->charset . $this->newline;
- $body .= "Content-Transfer-Encoding: quoted-printable" . $this->newline . $this->newline;
+ . "Content-Type: text/html; charset=" . $this->charset . $this->newline
+ . "Content-Transfer-Encoding: quoted-printable" . $this->newline . $this->newline;
}
$this->_finalbody = $body . $this->_prep_quoted_printable($this->_body) . $this->newline . $this->newline;
- if ($this->_get_protocol() == 'mail')
+ if ($this->_get_protocol() === 'mail')
{
$this->_header_str .= $hdr;
}
@@ -1085,61 +1041,57 @@ class CI_Email {
return;
- break;
case 'plain-attach' :
$hdr .= "Content-Type: multipart/".$this->multipart."; boundary=\"" . $this->_atc_boundary."\"" . $this->newline . $this->newline;
- if ($this->_get_protocol() == 'mail')
+ if ($this->_get_protocol() === 'mail')
{
$this->_header_str .= $hdr;
}
- $body .= $this->_get_mime_message() . $this->newline . $this->newline;
- $body .= "--" . $this->_atc_boundary . $this->newline;
+ $body .= $this->_get_mime_message() . $this->newline . $this->newline
+ . "--" . $this->_atc_boundary . $this->newline
- $body .= "Content-Type: text/plain; charset=" . $this->charset . $this->newline;
- $body .= "Content-Transfer-Encoding: " . $this->_get_encoding() . $this->newline . $this->newline;
+ . "Content-Type: text/plain; charset=" . $this->charset . $this->newline
+ . "Content-Transfer-Encoding: " . $this->_get_encoding() . $this->newline . $this->newline
- $body .= $this->_body . $this->newline . $this->newline;
+ . $this->_body . $this->newline . $this->newline;
break;
case 'html-attach' :
$hdr .= "Content-Type: multipart/".$this->multipart."; boundary=\"" . $this->_atc_boundary."\"" . $this->newline . $this->newline;
- if ($this->_get_protocol() == 'mail')
+ if ($this->_get_protocol() === 'mail')
{
$this->_header_str .= $hdr;
}
- $body .= $this->_get_mime_message() . $this->newline . $this->newline;
- $body .= "--" . $this->_atc_boundary . $this->newline;
+ $body .= $this->_get_mime_message() . $this->newline . $this->newline
+ . "--" . $this->_atc_boundary . $this->newline
- $body .= "Content-Type: multipart/alternative; boundary=\"" . $this->_alt_boundary . "\"" . $this->newline .$this->newline;
- $body .= "--" . $this->_alt_boundary . $this->newline;
+ . "Content-Type: multipart/alternative; boundary=\"" . $this->_alt_boundary . "\"" . $this->newline .$this->newline
+ . "--" . $this->_alt_boundary . $this->newline
- $body .= "Content-Type: text/plain; charset=" . $this->charset . $this->newline;
- $body .= "Content-Transfer-Encoding: " . $this->_get_encoding() . $this->newline . $this->newline;
- $body .= $this->_get_alt_message() . $this->newline . $this->newline . "--" . $this->_alt_boundary . $this->newline;
+ . "Content-Type: text/plain; charset=" . $this->charset . $this->newline
+ . "Content-Transfer-Encoding: " . $this->_get_encoding() . $this->newline . $this->newline
+ . $this->_get_alt_message() . $this->newline . $this->newline . "--" . $this->_alt_boundary . $this->newline
- $body .= "Content-Type: text/html; charset=" . $this->charset . $this->newline;
- $body .= "Content-Transfer-Encoding: quoted-printable" . $this->newline . $this->newline;
+ . "Content-Type: text/html; charset=" . $this->charset . $this->newline
+ . "Content-Transfer-Encoding: quoted-printable" . $this->newline . $this->newline
- $body .= $this->_prep_quoted_printable($this->_body) . $this->newline . $this->newline;
- $body .= "--" . $this->_alt_boundary . "--" . $this->newline . $this->newline;
+ . $this->_prep_quoted_printable($this->_body) . $this->newline . $this->newline
+ . "--" . $this->_alt_boundary . "--" . $this->newline . $this->newline;
break;
}
$attachment = array();
-
- $z = 0;
-
- for ($i=0; $i < count($this->_attach_name); $i++)
+ for ($i = 0, $c = count($this->_attach_name), $z = 0; $i < $c; $i++)
{
- $filename = $this->_attach_name[$i];
- $basename = basename($filename);
+ $filename = $this->_attach_name[$i][0];
+ $basename = (is_null($this->_attach_name[$i][1])) ? basename($filename) : $this->_attach_name[$i][1];
$ctype = $this->_attach_type[$i];
if ( ! file_exists($filename))
@@ -1148,13 +1100,12 @@ class CI_Email {
return FALSE;
}
- $h = "--".$this->_atc_boundary.$this->newline;
- $h .= "Content-type: ".$ctype."; ";
- $h .= "name=\"".$basename."\"".$this->newline;
- $h .= "Content-Disposition: ".$this->_attach_disp[$i].";".$this->newline;
- $h .= "Content-Transfer-Encoding: base64".$this->newline;
+ $attachment[$z++] = "--".$this->_atc_boundary.$this->newline
+ . "Content-type: ".$ctype."; "
+ . "name=\"".$basename."\"".$this->newline
+ . "Content-Disposition: ".$this->_attach_disp[$i].";".$this->newline
+ . "Content-Transfer-Encoding: base64".$this->newline;
- $attachment[$z++] = $h;
$file = filesize($filename) +1;
if ( ! $fp = fopen($filename, FOPEN_READ))
@@ -1168,17 +1119,7 @@ class CI_Email {
}
$body .= implode($this->newline, $attachment).$this->newline."--".$this->_atc_boundary."--";
-
-
- if ($this->_get_protocol() == 'mail')
- {
- $this->_finalbody = $body;
- }
- else
- {
- $this->_finalbody = $hdr . $body;
- }
-
+ $this->_finalbody = ($this->_get_protocol() === 'mail') ? $body : $hdr . $body;
return;
}
@@ -1200,16 +1141,13 @@ class CI_Email {
// Set the character limit
// Don't allow over 76, as that will make servers and MUAs barf
// all over quoted-printable data
- if ($charlim == '' OR $charlim > '76')
+ if ($charlim == '' OR $charlim > 76)
{
- $charlim = '76';
+ $charlim = 76;
}
- // Reduce multiple spaces
- $str = preg_replace("| +|", " ", $str);
-
- // kill nulls
- $str = preg_replace('/\x00+/', '', $str);
+ // Reduce multiple spaces & remove nulls
+ $str = preg_replace(array("| +|", '/\x00+/'), array(' ', ''), $str);
// Standardize newlines
if (strpos($str, "\r") !== FALSE)
@@ -1221,13 +1159,10 @@ class CI_Email {
// properly and MUAs will behave, so {unwrap} must go!
$str = str_replace(array('{unwrap}', '{/unwrap}'), '', $str);
- // Break into an array of lines
- $lines = explode("\n", $str);
-
$escape = '=';
$output = '';
- foreach ($lines as $line)
+ foreach (explode("\n", $str) as $line)
{
$length = strlen($line);
$temp = '';
@@ -1238,17 +1173,15 @@ class CI_Email {
for ($i = 0; $i < $length; $i++)
{
// Grab the next character
- $char = substr($line, $i, 1);
+ $char = $line[$i];
$ascii = ord($char);
// Convert spaces and tabs but only if it's the end of the line
- if ($i == ($length - 1))
+ if ($i === ($length - 1) && ($ascii === 32 OR $ascii === 9))
{
- $char = ($ascii == '32' OR $ascii == '9') ? $escape.sprintf('%02s', dechex($ascii)) : $char;
+ $char = $escape.sprintf('%02s', dechex($ascii));
}
-
- // encode = signs
- if ($ascii == '61')
+ elseif ($ascii === 61) // encode = signs
{
$char = $escape.strtoupper(sprintf('%02s', dechex($ascii))); // =3D
}
@@ -1311,7 +1244,7 @@ class CI_Email {
for ($i = 0, $length = strlen($str); $i < $length; $i++)
{
// Grab the next character
- $char = substr($str, $i, 1);
+ $char = $str[$i];
$ascii = ord($char);
// convert ALL non-printable ASCII characters and our specials
@@ -1321,7 +1254,7 @@ class CI_Email {
}
// handle regular spaces a bit more compactly than =20
- if ($ascii == 32)
+ if ($ascii === 32)
{
$char = '_';
}
@@ -1372,22 +1305,14 @@ class CI_Email {
$this->_build_headers();
- if ($this->bcc_batch_mode AND count($this->_bcc_array) > 0)
+ if ($this->bcc_batch_mode AND count($this->_bcc_array) > $this->bcc_batch_size)
{
- if (count($this->_bcc_array) > $this->bcc_batch_size)
- return $this->batch_bcc_send();
+ return $this->batch_bcc_send();
}
$this->_build_message();
- if ( ! $this->_spool_email())
- {
- return FALSE;
- }
- else
- {
- return TRUE;
- }
+ return $this->_spool_email();
}
// --------------------------------------------------------------------
@@ -1406,7 +1331,7 @@ class CI_Email {
$chunk = array();
- for ($i = 0; $i < count($this->_bcc_array); $i++)
+ for ($i = 0, $c = count($this->_bcc_array); $i < $c; $i++)
{
if (isset($this->_bcc_array[$i]))
{
@@ -1416,25 +1341,23 @@ class CI_Email {
if ($i == $float)
{
$chunk[] = substr($set, 1);
- $float = $float + $this->bcc_batch_size;
+ $float += $this->bcc_batch_size;
$set = "";
}
- if ($i == count($this->_bcc_array)-1)
+ if ($i === $c-1)
{
$chunk[] = substr($set, 1);
}
}
- for ($i = 0; $i < count($chunk); $i++)
+ for ($i = 0, $c = count($chunk); $i < $c; $i++)
{
unset($this->_headers['Bcc']);
- unset($bcc);
- $bcc = $this->_str_to_array($chunk[$i]);
- $bcc = $this->clean_email($bcc);
+ $bcc = $this->clean_email($this->_str_to_array($chunk[$i]));
- if ($this->protocol != 'smtp')
+ if ($this->protocol !== 'smtp')
{
$this->_set_header('Bcc', implode(", ", $bcc));
}
@@ -1491,33 +1414,10 @@ class CI_Email {
{
$this->_unwrap_specials();
- switch ($this->_get_protocol())
+ $method = '_send_with_' . $this->_get_protocol();
+ if ( ! $this->$method())
{
- case 'mail' :
-
- if ( ! $this->_send_with_mail())
- {
- $this->_set_error_message('lang:email_send_failure_phpmail');
- return FALSE;
- }
- break;
- case 'sendmail' :
-
- if ( ! $this->_send_with_sendmail())
- {
- $this->_set_error_message('lang:email_send_failure_sendmail');
- return FALSE;
- }
- break;
- case 'smtp' :
-
- if ( ! $this->_send_with_smtp())
- {
- $this->_set_error_message('lang:email_send_failure_smtp');
- return FALSE;
- }
- break;
-
+ $this->_set_error_message('lang:email_send_failure_' . ($this->_get_protocol() === 'mail' ? 'phpmail' : $this->_get_protocol()));
}
$this->_set_error_message('lang:email_sent', $this->_get_protocol());
@@ -1536,28 +1436,13 @@ class CI_Email {
{
if ($this->_safe_mode == TRUE)
{
- if ( ! mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str))
- {
- return FALSE;
- }
- else
- {
- return TRUE;
- }
+ return mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str);
}
else
{
// most documentation of sendmail using the "-f" flag lacks a space after it, however
// we've encountered servers that seem to require it to be in place.
-
- if ( ! mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str, "-f ".$this->clean_email($this->_headers['From'])))
- {
- return FALSE;
- }
- else
- {
- return TRUE;
- }
+ return mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str, "-f ".$this->clean_email($this->_headers['From']));
}
}
@@ -1584,12 +1469,7 @@ class CI_Email {
$status = pclose($fp);
- if (version_compare(PHP_VERSION, '4.2.3') == -1)
- {
- $status = $status >> 8 & 0xFF;
- }
-
- if ($status != 0)
+ if ($status !== 0)
{
$this->_set_error_message('lang:email_exit_status', $status);
$this->_set_error_message('lang:email_no_socket');
@@ -1658,7 +1538,7 @@ class CI_Email {
$this->_set_error_message($reply);
- if (strncmp($reply, '250', 3) != 0)
+ if (strncmp($reply, '250', 3) !== 0)
{
$this->_set_error_message('lang:email_smtp_error', $reply);
return FALSE;
@@ -1679,9 +1559,8 @@ class CI_Email {
*/
protected function _smtp_connect()
{
- $ssl = NULL;
- if ($this->smtp_crypto == 'ssl')
- $ssl = 'ssl://';
+ $ssl = ($this->smtp_crypto == 'ssl') ? 'ssl://' : NULL;
+
$this->_smtp_connect = fsockopen($ssl.$this->smtp_host,
$this->smtp_port,
$errno,
@@ -1700,7 +1579,14 @@ class CI_Email {
{
$this->_send_command('hello');
$this->_send_command('starttls');
- stream_socket_enable_crypto($this->_smtp_connect, TRUE, STREAM_CRYPTO_METHOD_TLS_CLIENT);
+
+ $crypto = stream_socket_enable_crypto($this->_smtp_connect, TRUE, STREAM_CRYPTO_METHOD_TLS_CLIENT);
+
+ if ($crypto !== TRUE)
+ {
+ $this->_set_error_message('lang:email_smtp_error', $this->_get_smtp_data());
+ return FALSE;
+ }
}
return $this->_send_command('hello');
@@ -1804,7 +1690,7 @@ class CI_Email {
$reply = $this->_get_smtp_data();
- if (strncmp($reply, '334', 3) != 0)
+ if (strncmp($reply, '334', 3) !== 0)
{
$this->_set_error_message('lang:email_failed_smtp_login', $reply);
return FALSE;
@@ -1814,7 +1700,7 @@ class CI_Email {
$reply = $this->_get_smtp_data();
- if (strncmp($reply, '334', 3) != 0)
+ if (strncmp($reply, '334', 3) !== 0)
{
$this->_set_error_message('lang:email_smtp_auth_un', $reply);
return FALSE;
@@ -1824,7 +1710,7 @@ class CI_Email {
$reply = $this->_get_smtp_data();
- if (strncmp($reply, '235', 3) != 0)
+ if (strncmp($reply, '235', 3) !== 0)
{
$this->_set_error_message('lang:email_smtp_auth_pw', $reply);
return FALSE;
@@ -1848,10 +1734,8 @@ class CI_Email {
$this->_set_error_message('lang:email_smtp_data_failure', $data);
return FALSE;
}
- else
- {
- return TRUE;
- }
+
+ return TRUE;
}
// --------------------------------------------------------------------
@@ -1870,7 +1754,7 @@ class CI_Email {
{
$data .= $str;
- if (substr($str, 3, 1) == " ")
+ if ($str[3] == " ")
{
break;
}
@@ -1909,12 +1793,16 @@ class CI_Email {
$cip = (isset($_SERVER['HTTP_CLIENT_IP']) AND $_SERVER['HTTP_CLIENT_IP'] != "") ? $_SERVER['HTTP_CLIENT_IP'] : FALSE;
$rip = (isset($_SERVER['REMOTE_ADDR']) AND $_SERVER['REMOTE_ADDR'] != "") ? $_SERVER['REMOTE_ADDR'] : FALSE;
- $fip = (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND $_SERVER['HTTP_X_FORWARDED_FOR'] != "") ? $_SERVER['HTTP_X_FORWARDED_FOR'] : FALSE;
-
- if ($cip && $rip) $this->_IP = $cip;
- elseif ($rip) $this->_IP = $rip;
- elseif ($cip) $this->_IP = $cip;
- elseif ($fip) $this->_IP = $fip;
+ if ($cip) $this->_IP = $cip;
+ elseif ($rip) $this->_IP = $rip;
+ else
+ {
+ $fip = (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND $_SERVER['HTTP_X_FORWARDED_FOR'] != "") ? $_SERVER['HTTP_X_FORWARDED_FOR'] : FALSE;
+ if ($fip)
+ {
+ $this->_IP = $fip;
+ }
+ }
if (strpos($this->_IP, ',') !== FALSE)
{
@@ -1927,10 +1815,6 @@ class CI_Email {
$this->_IP = '0.0.0.0';
}
- unset($cip);
- unset($rip);
- unset($fip);
-
return $this->_IP;
}
@@ -1972,7 +1856,7 @@ class CI_Email {
$CI =& get_instance();
$CI->lang->load('email');
- if (substr($msg, 0, 5) != 'lang:' || FALSE === ($line = $CI->lang->line(substr($msg, 5))))
+ if (substr($msg, 0, 5) !== 'lang:' || FALSE === ($line = $CI->lang->line(substr($msg, 5))))
{
$this->_debug_msg[] = str_replace('%s', $val, $msg)."<br />";
}
diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php
index b30a8cf0b..0b0618991 100644
--- a/system/libraries/Encrypt.php
+++ b/system/libraries/Encrypt.php
@@ -1,20 +1,30 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* CodeIgniter Encryption Class
*
@@ -23,29 +33,21 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Libraries
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/encryption.html
*/
class CI_Encrypt {
- var $CI;
- var $encryption_key = '';
- var $_hash_type = 'sha1';
- var $_mcrypt_exists = FALSE;
- var $_mcrypt_cipher;
- var $_mcrypt_mode;
+ public $encryption_key = '';
+ protected $_hash_type = 'sha1';
+ protected $_mcrypt_exists = FALSE;
+ protected $_mcrypt_cipher;
+ protected $_mcrypt_mode;
- /**
- * Constructor
- *
- * Simply determines whether the mcrypt library exists.
- *
- */
public function __construct()
{
- $this->CI =& get_instance();
$this->_mcrypt_exists = ( ! function_exists('mcrypt_encrypt')) ? FALSE : TRUE;
- log_message('debug', "Encrypt Class Initialized");
+ log_message('debug', 'Encrypt Class Initialized');
}
// --------------------------------------------------------------------
@@ -56,11 +58,10 @@ class CI_Encrypt {
* Returns it as MD5 in order to have an exact-length 128 bit key.
* Mcrypt is sensitive to keys that are not the correct length
*
- * @access public
* @param string
* @return string
*/
- function get_key($key = '')
+ public function get_key($key = '')
{
if ($key == '')
{
@@ -72,7 +73,7 @@ class CI_Encrypt {
$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.');
}
@@ -86,13 +87,13 @@ class CI_Encrypt {
/**
* Set the encryption key
*
- * @access public
* @param string
- * @return void
+ * @return object
*/
- function set_key($key = '')
+ public function set_key($key = '')
{
$this->encryption_key = $key;
+ return $this;
}
// --------------------------------------------------------------------
@@ -108,25 +109,14 @@ class CI_Encrypt {
* that is randomized with each call to this function,
* even if the supplied message and key are the same.
*
- * @access public
* @param string the string to encode
* @param string the key
* @return string
*/
- function encode($string, $key = '')
+ public function encode($string, $key = '')
{
- $key = $this->get_key($key);
-
- if ($this->_mcrypt_exists === TRUE)
- {
- $enc = $this->mcrypt_encode($string, $key);
- }
- else
- {
- $enc = $this->_xor_encode($string, $key);
- }
-
- return base64_encode($enc);
+ $method = ($this->_mcrypt_exists === TRUE) ? 'mcrypt_encode' : '_xor_encode';
+ return base64_encode($this->$method($string, $this->get_key($key)));
}
// --------------------------------------------------------------------
@@ -136,35 +126,19 @@ class CI_Encrypt {
*
* Reverses the above process
*
- * @access public
* @param string
* @param string
* @return string
*/
- function decode($string, $key = '')
+ public function decode($string, $key = '')
{
- $key = $this->get_key($key);
-
if (preg_match('/[^a-zA-Z0-9\/\+=]/', $string))
{
return FALSE;
}
- $dec = base64_decode($string);
-
- if ($this->_mcrypt_exists === TRUE)
- {
- if (($dec = $this->mcrypt_decode($dec, $key)) === FALSE)
- {
- return FALSE;
- }
- }
- else
- {
- $dec = $this->_xor_decode($dec, $key);
- }
-
- return $dec;
+ $method = ($this->_mcrypt_exists === TRUE) ? 'mcrypt_decode' : '_xor_decode';
+ return $this->$method(base64_decode($string), $this->get_key($key));
}
// --------------------------------------------------------------------
@@ -179,19 +153,22 @@ class CI_Encrypt {
*
* 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 = '')
+ public 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;
}
+ elseif (preg_match('/[^a-zA-Z0-9\/\+=]/', $string))
+ {
+ return FALSE;
+ }
// decode it first
// set mode temporarily to what it was when string was encoded with the legacy
@@ -200,14 +177,7 @@ class CI_Encrypt {
$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;
@@ -230,25 +200,25 @@ class CI_Encrypt {
* Takes a plain-text string and key as input and generates an
* encoded bit-string using XOR
*
- * @access private
* @param string
* @param string
* @return string
*/
- function _xor_encode($string, $key)
+ protected function _xor_encode($string, $key)
{
$rand = '';
- while (strlen($rand) < 32)
+ do
{
$rand .= mt_rand(0, mt_getrandmax());
}
+ while (strlen($rand) < 32);
$rand = $this->hash($rand);
$enc = '';
- for ($i = 0; $i < strlen($string); $i++)
+ for ($i = 0, $ls = strlen($string), $lr = strlen($rand); $i < $ls; $i++)
{
- $enc .= substr($rand, ($i % strlen($rand)), 1).(substr($rand, ($i % strlen($rand)), 1) ^ substr($string, $i, 1));
+ $enc .= $rand[($i % $lr)].($rand[($i % $lr)] ^ $string[$i]);
}
return $this->_xor_merge($enc, $key);
@@ -262,19 +232,18 @@ class CI_Encrypt {
* Takes an encoded string and key as input and generates the
* plain-text original message
*
- * @access private
* @param string
* @param string
* @return string
*/
- function _xor_decode($string, $key)
+ protected function _xor_decode($string, $key)
{
$string = $this->_xor_merge($string, $key);
$dec = '';
- for ($i = 0; $i < strlen($string); $i++)
+ for ($i = 0, $l = strlen($string); $i < $l; $i++)
{
- $dec .= (substr($string, $i++, 1) ^ substr($string, $i, 1));
+ $dec .= ($string[$i++] ^ $string[$i]);
}
return $dec;
@@ -287,18 +256,17 @@ class CI_Encrypt {
*
* Takes a string and key as input and computes the difference using XOR
*
- * @access private
* @param string
* @param string
* @return string
*/
- function _xor_merge($string, $key)
+ protected function _xor_merge($string, $key)
{
$hash = $this->hash($key);
$str = '';
- for ($i = 0; $i < strlen($string); $i++)
+ for ($i = 0, $ls = strlen($string), $lh = strlen($hash); $i < $ls; $i++)
{
- $str .= substr($string, $i, 1) ^ substr($hash, ($i % strlen($hash)), 1);
+ $str .= $string[$i] ^ $hash[($i % $lh)];
}
return $str;
@@ -309,12 +277,11 @@ class CI_Encrypt {
/**
* Encrypt using Mcrypt
*
- * @access public
* @param string
* @param string
* @return string
*/
- function mcrypt_encode($data, $key)
+ public 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);
@@ -326,12 +293,11 @@ class CI_Encrypt {
/**
* Decrypt using Mcrypt
*
- * @access public
* @param string
* @param string
* @return string
*/
- function mcrypt_decode($data, $key)
+ public function mcrypt_decode($data, $key)
{
$data = $this->_remove_cipher_noise($data, $key);
$init_size = mcrypt_get_iv_size($this->_get_cipher(), $this->_get_mode());
@@ -353,27 +319,23 @@ class CI_Encrypt {
* 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)
+ protected function _add_cipher_noise($data, $key)
{
- $keyhash = $this->hash($key);
- $keylen = strlen($keyhash);
+ $key = $this->hash($key);
$str = '';
- for ($i = 0, $j = 0, $len = strlen($data); $i < $len; ++$i, ++$j)
+ for ($i = 0, $j = 0, $ld = strlen($data), $lk = strlen($key); $i < $ld; ++$i, ++$j)
{
- if ($j >= $keylen)
+ if ($j >= $lk)
{
$j = 0;
}
- $str .= chr((ord($data[$i]) + ord($keyhash[$j])) % 256);
+ $str .= chr((ord($data[$i]) + ord($key[$j])) % 256);
}
return $str;
@@ -387,28 +349,26 @@ class CI_Encrypt {
*
* Function description
*
- * @access public
* @param type
* @return type
*/
- function _remove_cipher_noise($data, $key)
+ protected function _remove_cipher_noise($data, $key)
{
- $keyhash = $this->hash($key);
- $keylen = strlen($keyhash);
+ $key = $this->hash($key);
$str = '';
- for ($i = 0, $j = 0, $len = strlen($data); $i < $len; ++$i, ++$j)
+ for ($i = 0, $j = 0, $ld = strlen($data), $lk = strlen($key); $i < $ld; ++$i, ++$j)
{
- if ($j >= $keylen)
+ if ($j >= $lk)
{
$j = 0;
}
- $temp = ord($data[$i]) - ord($keyhash[$j]);
+ $temp = ord($data[$i]) - ord($key[$j]);
if ($temp < 0)
{
- $temp = $temp + 256;
+ $temp += 256;
}
$str .= chr($temp);
@@ -422,13 +382,13 @@ class CI_Encrypt {
/**
* Set the Mcrypt Cipher
*
- * @access public
* @param constant
* @return string
*/
- function set_cipher($cipher)
+ public function set_cipher($cipher)
{
$this->_mcrypt_cipher = $cipher;
+ return $this;
}
// --------------------------------------------------------------------
@@ -436,13 +396,13 @@ class CI_Encrypt {
/**
* Set the Mcrypt Mode
*
- * @access public
* @param constant
* @return string
*/
- function set_mode($mode)
+ public function set_mode($mode)
{
$this->_mcrypt_mode = $mode;
+ return $this;
}
// --------------------------------------------------------------------
@@ -450,14 +410,13 @@ class CI_Encrypt {
/**
* Get Mcrypt cipher Value
*
- * @access private
* @return string
*/
- function _get_cipher()
+ protected function _get_cipher()
{
if ($this->_mcrypt_cipher == '')
{
- $this->_mcrypt_cipher = MCRYPT_RIJNDAEL_256;
+ return $this->_mcrypt_cipher = MCRYPT_RIJNDAEL_256;
}
return $this->_mcrypt_cipher;
@@ -468,14 +427,13 @@ class CI_Encrypt {
/**
* Get Mcrypt Mode Value
*
- * @access private
* @return string
*/
- function _get_mode()
+ protected function _get_mode()
{
if ($this->_mcrypt_mode == '')
{
- $this->_mcrypt_mode = MCRYPT_MODE_CBC;
+ return $this->_mcrypt_mode = MCRYPT_MODE_CBC;
}
return $this->_mcrypt_mode;
@@ -486,13 +444,12 @@ class CI_Encrypt {
/**
* Set the Hash type
*
- * @access public
* @param string
- * @return string
+ * @return void
*/
- function set_hash($type = 'sha1')
+ public function set_hash($type = 'sha1')
{
- $this->_hash_type = ($type != 'sha1' AND $type != 'md5') ? 'sha1' : $type;
+ $this->_hash_type = ($type !== 'sha1' && $type !== 'md5') ? 'sha1' : $type;
}
// --------------------------------------------------------------------
@@ -500,48 +457,14 @@ class CI_Encrypt {
/**
* Hash encode a string
*
- * @access public
* @param string
* @return string
*/
- function hash($str)
+ public function hash($str)
{
- return ($this->_hash_type == 'sha1') ? $this->sha1($str) : md5($str);
+ return ($this->_hash_type === 'sha1') ? sha1($str) : md5($str);
}
-
- // --------------------------------------------------------------------
-
- /**
- * Generate an SHA1 Hash
- *
- * @access public
- * @param string
- * @return string
- */
- function sha1($str)
- {
- if ( ! function_exists('sha1'))
- {
- if ( ! function_exists('mhash'))
- {
- require_once(BASEPATH.'libraries/Sha1.php');
- $SH = new CI_SHA;
- return $SH->generate($str);
- }
- else
- {
- return bin2hex(mhash(MHASH_SHA1, $str));
- }
- }
- else
- {
- return sha1($str);
- }
- }
-
}
-// END CI_Encrypt class
-
/* End of file Encrypt.php */
-/* Location: ./system/libraries/Encrypt.php */ \ No newline at end of file
+/* Location: ./system/libraries/Encrypt.php */
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index a34809e05..2ee734ae6 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Validation
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/form_validation.html
*/
class CI_Form_validation {
@@ -66,7 +78,6 @@ class CI_Form_validation {
* 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
@@ -74,7 +85,7 @@ class CI_Form_validation {
public function set_rules($field, $label = '', $rules = '')
{
// No reason to set rules if we have no POST data
- if (count($_POST) == 0)
+ if (count($_POST) === 0)
{
return $this;
}
@@ -101,7 +112,7 @@ class CI_Form_validation {
}
// No fields? Nothing to do...
- if ( ! is_string($field) OR ! is_string($rules) OR $field == '')
+ if ( ! is_string($field) OR ! is_string($rules) OR $field == '')
{
return $this;
}
@@ -109,21 +120,20 @@ class CI_Form_validation {
// 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
+ // Is the field name an array? 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))
+ if (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++)
+ for ($i = 0, $c = count($matches[0]); $i < $c; $i++)
{
- if ($matches['1'][$i] != '')
+ if ($matches[1][$i] != '')
{
- $indexes[] = $matches['1'][$i];
+ $indexes[] = $matches[1][$i];
}
}
@@ -157,7 +167,6 @@ class CI_Form_validation {
* 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
@@ -181,7 +190,6 @@ class CI_Form_validation {
*
* Permits a prefix/suffix to be added to each error message
*
- * @access public
* @param string
* @param string
* @return void
@@ -201,7 +209,6 @@ class CI_Form_validation {
*
* Gets the error message associated with a particular field
*
- * @access public
* @param string the field name
* @return void
*/
@@ -232,7 +239,6 @@ class CI_Form_validation {
*
* Returns the error messages as a string, wrapped in the error delimiters
*
- * @access public
* @param string
* @param string
* @return str
@@ -275,23 +281,22 @@ class CI_Form_validation {
*
* This function does all the work.
*
- * @access public
* @return bool
*/
public function run($group = '')
{
// Do we even have any data to process? Mm?
- if (count($_POST) == 0)
+ 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)
+ if (count($this->_field_data) === 0)
{
// No validation rules? We're done...
- if (count($this->_config_rules) == 0)
+ if (count($this->_config_rules) === 0)
{
return FALSE;
}
@@ -309,7 +314,7 @@ class CI_Form_validation {
}
// We're we able to set the rules correctly?
- if (count($this->_field_data) == 0)
+ if (count($this->_field_data) === 0)
{
log_message('debug', "Unable to find validation rules");
return FALSE;
@@ -326,7 +331,7 @@ class CI_Form_validation {
// 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)
+ if ($row['is_array'] === TRUE)
{
$this->_field_data[$field]['postdata'] = $this->_reduce_array($_POST, $row['keys']);
}
@@ -352,14 +357,7 @@ class CI_Form_validation {
// 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;
+ return ($total_errors === 0);
}
// --------------------------------------------------------------------
@@ -367,7 +365,6 @@ class CI_Form_validation {
/**
* Traverse a multidimensional $_POST array index until the data is found
*
- * @access private
* @param array
* @param array
* @param integer
@@ -375,23 +372,9 @@ class CI_Form_validation {
*/
protected function _reduce_array($array, $keys, $i = 0)
{
- if (is_array($array))
+ if (is_array($array) && isset($keys[$i]))
{
- 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 isset($array[$keys[$i]]) ? $this->_reduce_array($array[$keys[$i]], $keys, ($i+1)) : NULL;
}
return $array;
@@ -402,7 +385,6 @@ class CI_Form_validation {
/**
* Re-populate the _POST array with our finalized and processed data
*
- * @access private
* @return null
*/
protected function _reset_post_array()
@@ -411,7 +393,7 @@ class CI_Form_validation {
{
if ( ! is_null($row['postdata']))
{
- if ($row['is_array'] == FALSE)
+ if ($row['is_array'] === FALSE)
{
if (isset($_POST[$row['field']]))
{
@@ -424,7 +406,7 @@ class CI_Form_validation {
$post_ref =& $_POST;
// before we assign values, make a reference to the right POST key
- if (count($row['keys']) == 1)
+ if (count($row['keys']) === 1)
{
$post_ref =& $post_ref[current($row['keys'])];
}
@@ -460,7 +442,6 @@ class CI_Form_validation {
/**
* Executes the Validation routines
*
- * @access private
* @param array
* @param array
* @param mixed
@@ -502,7 +483,7 @@ class CI_Form_validation {
// --------------------------------------------------------------------
// Isset Test. Typically this rule will only apply to checkboxes.
- if (is_null($postdata) AND $callback == FALSE)
+ if (is_null($postdata) AND $callback === FALSE)
{
if (in_array('isset', $rules, TRUE) OR in_array('required', $rules))
{
@@ -593,7 +574,7 @@ class CI_Form_validation {
$result = $this->CI->$rule($postdata, $param);
// Re-assign the result to the master data array
- if ($_in_array == TRUE)
+ if ($_in_array === TRUE)
{
$this->_field_data[$row['field']]['postdata'][$cycles] = (is_bool($result)) ? $postdata : $result;
}
@@ -618,7 +599,7 @@ class CI_Form_validation {
{
$result = $rule($postdata);
- if ($_in_array == TRUE)
+ if ($_in_array === TRUE)
{
$this->_field_data[$row['field']]['postdata'][$cycles] = (is_bool($result)) ? $postdata : $result;
}
@@ -637,7 +618,7 @@ class CI_Form_validation {
$result = $this->$rule($postdata, $param);
- if ($_in_array == TRUE)
+ if ($_in_array === TRUE)
{
$this->_field_data[$row['field']]['postdata'][$cycles] = (is_bool($result)) ? $postdata : $result;
}
@@ -664,7 +645,7 @@ class CI_Form_validation {
// 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']))
+ if (isset($this->_field_data[$param], $this->_field_data[$param]['label']))
{
$param = $this->_translate_fieldname($this->_field_data[$param]['label']);
}
@@ -690,7 +671,6 @@ class CI_Form_validation {
/**
* Translate a field name
*
- * @access private
* @param string the field name
* @return string
*/
@@ -698,7 +678,7 @@ class CI_Form_validation {
{
// Do we need to translate the field name?
// We look for the prefix lang: to determine this
- if (substr($fieldname, 0, 5) == 'lang:')
+ if (substr($fieldname, 0, 5) === 'lang:')
{
// Grab the variable
$line = substr($fieldname, 5);
@@ -721,20 +701,19 @@ class CI_Form_validation {
* 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
+ * @return string
*/
public function set_value($field = '', $default = '')
{
- if ( ! isset($this->_field_data[$field]))
+ if ( ! isset($this->_field_data[$field], $this->_field_data[$field]['postdata']))
{
return $default;
}
// If the data is an array output them one at a time.
- // E.g: form_input('name[]', set_value('name[]');
+ // E.g: form_input('name[]', set_value('name[]');
if (is_array($this->_field_data[$field]['postdata']))
{
return array_shift($this->_field_data[$field]['postdata']);
@@ -751,20 +730,15 @@ class CI_Form_validation {
* 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
*/
public function set_select($field = '', $value = '', $default = FALSE)
{
- if ( ! isset($this->_field_data[$field]) OR ! isset($this->_field_data[$field]['postdata']))
+ if ( ! isset($this->_field_data[$field], $this->_field_data[$field]['postdata']))
{
- if ($default === TRUE AND count($this->_field_data) === 0)
- {
- return ' selected="selected"';
- }
- return '';
+ return ($default === TRUE && count($this->_field_data) === 0) ? ' selected="selected"' : '';
}
$field = $this->_field_data[$field]['postdata'];
@@ -776,12 +750,9 @@ class CI_Form_validation {
return '';
}
}
- else
+ elseif (($field == '' OR $value == '') OR ($field != $value))
{
- if (($field == '' OR $value == '') OR ($field != $value))
- {
- return '';
- }
+ return '';
}
return ' selected="selected"';
@@ -795,20 +766,15 @@ class CI_Form_validation {
* 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
*/
public function set_radio($field = '', $value = '', $default = FALSE)
{
- if ( ! isset($this->_field_data[$field]) OR ! isset($this->_field_data[$field]['postdata']))
+ if ( ! isset($this->_field_data[$field], $this->_field_data[$field]['postdata']))
{
- if ($default === TRUE AND count($this->_field_data) === 0)
- {
- return ' checked="checked"';
- }
- return '';
+ return ($default === TRUE && count($this->_field_data) === 0) ? ' checked="checked"' : '';
}
$field = $this->_field_data[$field]['postdata'];
@@ -839,40 +805,14 @@ class CI_Form_validation {
* 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
*/
public 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))
- {
- return '';
- }
- }
- else
- {
- if (($field == '' OR $value == '') OR ($field != $value))
- {
- return '';
- }
- }
-
- return ' checked="checked"';
+ // Logic is exactly the same as for radio fields
+ return $this->set_radio($field, $value, $default);
}
// --------------------------------------------------------------------
@@ -880,20 +820,12 @@ class CI_Form_validation {
/**
* Required
*
- * @access public
* @param string
* @return bool
*/
public function required($str)
{
- if ( ! is_array($str))
- {
- return (trim($str) == '') ? FALSE : TRUE;
- }
- else
- {
- return ( ! empty($str));
- }
+ return ( ! is_array($str)) ? (trim($str) !== '') : ( ! empty($str));
}
// --------------------------------------------------------------------
@@ -901,19 +833,13 @@ class CI_Form_validation {
/**
* Performs a Regular Expression match test.
*
- * @access public
* @param string
* @param regex
* @return bool
*/
public function regex_match($str, $regex)
{
- if ( ! preg_match($regex, $str))
- {
- return FALSE;
- }
-
- return TRUE;
+ return (bool) preg_match($regex, $str);
}
// --------------------------------------------------------------------
@@ -921,7 +847,6 @@ class CI_Form_validation {
/**
* Match one field to another
*
- * @access public
* @param string
* @param field
* @return bool
@@ -933,52 +858,54 @@ class CI_Form_validation {
return FALSE;
}
- $field = $_POST[$field];
-
- return ($str !== $field) ? FALSE : TRUE;
+ return ($str === $_POST[$field]);
}
-
+
// --------------------------------------------------------------------
/**
- * Match one field to another
+ * Is Unique
+ *
+ * Check if the input value doesn't already exist
+ * in the specified database field.
*
- * @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;
- }
+ list($table, $field) = explode('.', $field);
+ if (isset($this->CI->db))
+ {
+ $query = $this->CI->db->limit(1)->get_where($table, array($field => $str));
+ return $query->num_rows() === 0;
+ }
+ return FALSE;
+ }
// --------------------------------------------------------------------
/**
* Minimum Length
*
- * @access public
* @param string
* @param value
* @return bool
*/
public function min_length($str, $val)
{
- if (preg_match("/[^0-9]/", $val))
+ if (preg_match('/[^0-9]/', $val))
{
return FALSE;
}
if (function_exists('mb_strlen'))
{
- return (mb_strlen($str) < $val) ? FALSE : TRUE;
+ return ! (mb_strlen($str) < $val);
}
- return (strlen($str) < $val) ? FALSE : TRUE;
+ return ! (strlen($str) < $val);
}
// --------------------------------------------------------------------
@@ -986,24 +913,23 @@ class CI_Form_validation {
/**
* Max Length
*
- * @access public
* @param string
* @param value
* @return bool
*/
public function max_length($str, $val)
{
- if (preg_match("/[^0-9]/", $val))
+ if (preg_match('/[^0-9]/', $val))
{
return FALSE;
}
if (function_exists('mb_strlen'))
{
- return (mb_strlen($str) > $val) ? FALSE : TRUE;
+ return ! (mb_strlen($str) > $val);
}
- return (strlen($str) > $val) ? FALSE : TRUE;
+ return ! (strlen($str) > $val);
}
// --------------------------------------------------------------------
@@ -1011,24 +937,23 @@ class CI_Form_validation {
/**
* Exact Length
*
- * @access public
* @param string
* @param value
* @return bool
*/
public function exact_length($str, $val)
{
- if (preg_match("/[^0-9]/", $val))
+ if (preg_match('/[^0-9]/', $val))
{
return FALSE;
}
if (function_exists('mb_strlen'))
{
- return (mb_strlen($str) != $val) ? FALSE : TRUE;
+ return (mb_strlen($str) == $val);
}
- return (strlen($str) != $val) ? FALSE : TRUE;
+ return (strlen($str) == $val);
}
// --------------------------------------------------------------------
@@ -1036,13 +961,12 @@ class CI_Form_validation {
/**
* Valid Email
*
- * @access public
* @param string
* @return bool
*/
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;
+ return (bool) preg_match('/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix', $str);
}
// --------------------------------------------------------------------
@@ -1050,7 +974,6 @@ class CI_Form_validation {
/**
* Valid Emails
*
- * @access public
* @param string
* @return bool
*/
@@ -1063,7 +986,7 @@ class CI_Form_validation {
foreach (explode(',', $str) as $email)
{
- if (trim($email) != '' && $this->valid_email(trim($email)) === FALSE)
+ if (trim($email) !== '' && $this->valid_email(trim($email)) === FALSE)
{
return FALSE;
}
@@ -1077,9 +1000,8 @@ class CI_Form_validation {
/**
* Validate IP Address
*
- * @access public
* @param string
- * @return string
+ * @return bool
*/
public function valid_ip($ip)
{
@@ -1091,13 +1013,12 @@ class CI_Form_validation {
/**
* Alpha
*
- * @access public
* @param string
* @return bool
*/
public function alpha($str)
{
- return ( ! preg_match("/^([a-z])+$/i", $str)) ? FALSE : TRUE;
+ return (bool) preg_match('/^[a-z]+$/i', $str);
}
// --------------------------------------------------------------------
@@ -1105,13 +1026,12 @@ class CI_Form_validation {
/**
* Alpha-numeric
*
- * @access public
* @param string
* @return bool
*/
public function alpha_numeric($str)
{
- return ( ! preg_match("/^([a-z0-9])+$/i", $str)) ? FALSE : TRUE;
+ return (bool) preg_match('/^[a-z0-9]+$/i', $str);
}
// --------------------------------------------------------------------
@@ -1119,13 +1039,12 @@ class CI_Form_validation {
/**
* Alpha-numeric with underscores and dashes
*
- * @access public
* @param string
* @return bool
*/
public function alpha_dash($str)
{
- return ( ! preg_match("/^([-a-z0-9_-])+$/i", $str)) ? FALSE : TRUE;
+ return (bool) preg_match('/^[a-z0-9_-]+$/i', $str);
}
// --------------------------------------------------------------------
@@ -1133,13 +1052,12 @@ class CI_Form_validation {
/**
* Numeric
*
- * @access public
* @param string
* @return bool
*/
public function numeric($str)
{
- return (bool)preg_match( '/^[\-+]?[0-9]*\.?[0-9]+$/', $str);
+ return (bool) preg_match('/^[\-+]?[0-9]*\.?[0-9]+$/', $str);
}
@@ -1148,13 +1066,12 @@ class CI_Form_validation {
/**
* Is Numeric
*
- * @access public
* @param string
* @return bool
*/
public function is_numeric($str)
{
- return ( ! is_numeric($str)) ? FALSE : TRUE;
+ return is_numeric($str);
}
// --------------------------------------------------------------------
@@ -1162,7 +1079,6 @@ class CI_Form_validation {
/**
* Integer
*
- * @access public
* @param string
* @return bool
*/
@@ -1176,7 +1092,6 @@ class CI_Form_validation {
/**
* Decimal number
*
- * @access public
* @param string
* @return bool
*/
@@ -1190,7 +1105,6 @@ class CI_Form_validation {
/**
* Greather than
*
- * @access public
* @param string
* @return bool
*/
@@ -1208,7 +1122,6 @@ class CI_Form_validation {
/**
* Less than
*
- * @access public
* @param string
* @return bool
*/
@@ -1226,13 +1139,12 @@ class CI_Form_validation {
/**
* Is a Natural number (0,1,2,3, etc.)
*
- * @access public
* @param string
* @return bool
*/
public function is_natural($str)
{
- return (bool) preg_match( '/^[0-9]+$/', $str);
+ return (bool) preg_match('/^[0-9]+$/', $str);
}
// --------------------------------------------------------------------
@@ -1240,23 +1152,12 @@ class CI_Form_validation {
/**
* Is a Natural number, but not a zero (1,2,3, etc.)
*
- * @access public
* @param string
* @return bool
*/
public function is_natural_no_zero($str)
{
- if ( ! preg_match( '/^[0-9]+$/', $str))
- {
- return FALSE;
- }
-
- if ($str == 0)
- {
- return FALSE;
- }
-
- return TRUE;
+ return ($str != 0 && preg_match('/^[0-9]+$/', $str));
}
// --------------------------------------------------------------------
@@ -1267,7 +1168,6 @@ class CI_Form_validation {
* 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
*/
@@ -1284,7 +1184,6 @@ class CI_Form_validation {
* This function allows HTML to be safely shown in a form.
* Special characters are converted.
*
- * @access public
* @param string
* @return string
*/
@@ -1305,7 +1204,7 @@ class CI_Form_validation {
return $data;
}
- return str_replace(array("'", '"', '<', '>'), array("&#39;", "&quot;", '&lt;', '&gt;'), stripslashes($data));
+ return str_replace(array("'", '"', '<', '>'), array('&#39;', '&quot;', '&lt;', '&gt;'), stripslashes($data));
}
// --------------------------------------------------------------------
@@ -1313,7 +1212,6 @@ class CI_Form_validation {
/**
* Prep URL
*
- * @access public
* @param string
* @return string
*/
@@ -1324,7 +1222,7 @@ class CI_Form_validation {
return '';
}
- if (substr($str, 0, 7) != 'http://' && substr($str, 0, 8) != 'https://')
+ if (substr($str, 0, 7) !== 'http://' && substr($str, 0, 8) !== 'https://')
{
$str = 'http://'.$str;
}
@@ -1337,7 +1235,6 @@ class CI_Form_validation {
/**
* Strip Image Tags
*
- * @access public
* @param string
* @return string
*/
@@ -1351,7 +1248,6 @@ class CI_Form_validation {
/**
* XSS Clean
*
- * @access public
* @param string
* @return string
*/
@@ -1365,7 +1261,6 @@ class CI_Form_validation {
/**
* Convert PHP tags to entities
*
- * @access public
* @param string
* @return string
*/
@@ -1375,7 +1270,6 @@ class CI_Form_validation {
}
}
-// END Form Validation Class
/* End of file Form_validation.php */
/* Location: ./system/libraries/Form_validation.php */
diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php
index d7a8b3b02..ab395b0a0 100644
--- a/system/libraries/Ftp.php
+++ b/system/libraries/Ftp.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,18 +33,18 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Libraries
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/ftp.html
*/
class CI_FTP {
- var $hostname = '';
- var $username = '';
- var $password = '';
- var $port = 21;
- var $passive = TRUE;
- var $debug = FALSE;
- var $conn_id = FALSE;
+ public $hostname = '';
+ public $username = '';
+ public $password = '';
+ public $port = 21;
+ public $passive = TRUE;
+ public $debug = FALSE;
+ public $conn_id = FALSE;
/**
@@ -59,7 +71,7 @@ class CI_FTP {
* @param array
* @return void
*/
- function initialize($config = array())
+ public function initialize($config = array())
{
foreach ($config as $key => $val)
{
@@ -82,7 +94,7 @@ class CI_FTP {
* @param array the connection values
* @return bool
*/
- function connect($config = array())
+ public function connect($config = array())
{
if (count($config) > 0)
{
@@ -124,7 +136,7 @@ class CI_FTP {
* @access private
* @return bool
*/
- function _login()
+ private function _login()
{
return @ftp_login($this->conn_id, $this->username, $this->password);
}
@@ -137,7 +149,7 @@ class CI_FTP {
* @access private
* @return bool
*/
- function _is_conn()
+ private function _is_conn()
{
if ( ! is_resource($this->conn_id))
{
@@ -167,7 +179,7 @@ class CI_FTP {
* @param bool
* @return bool
*/
- function changedir($path = '', $supress_debug = FALSE)
+ public function changedir($path = '', $supress_debug = FALSE)
{
if ($path == '' OR ! $this->_is_conn())
{
@@ -197,7 +209,7 @@ class CI_FTP {
* @param string
* @return bool
*/
- function mkdir($path = '', $permissions = NULL)
+ public function mkdir($path = '', $permissions = NULL)
{
if ($path == '' OR ! $this->_is_conn())
{
@@ -235,7 +247,7 @@ class CI_FTP {
* @param string
* @return bool
*/
- function upload($locpath, $rempath, $mode = 'auto', $permissions = NULL)
+ public function upload($locpath, $rempath, $mode = 'auto', $permissions = NULL)
{
if ( ! $this->_is_conn())
{
@@ -249,14 +261,14 @@ class CI_FTP {
}
// Set the mode if not specified
- if ($mode == 'auto')
+ if ($mode === 'auto')
{
// Get the file extension so we can set the upload type
$ext = $this->_getext($locpath);
$mode = $this->_settype($ext);
}
- $mode = ($mode == 'ascii') ? FTP_ASCII : FTP_BINARY;
+ $mode = ($mode === 'ascii') ? FTP_ASCII : FTP_BINARY;
$result = @ftp_put($this->conn_id, $rempath, $locpath, $mode);
@@ -289,7 +301,7 @@ class CI_FTP {
* @param string
* @return bool
*/
- function download($rempath, $locpath, $mode = 'auto')
+ public function download($rempath, $locpath, $mode = 'auto')
{
if ( ! $this->_is_conn())
{
@@ -297,14 +309,14 @@ class CI_FTP {
}
// Set the mode if not specified
- if ($mode == 'auto')
+ if ($mode === 'auto')
{
// Get the file extension so we can set the upload type
$ext = $this->_getext($rempath);
$mode = $this->_settype($ext);
}
- $mode = ($mode == 'ascii') ? FTP_ASCII : FTP_BINARY;
+ $mode = ($mode === 'ascii') ? FTP_ASCII : FTP_BINARY;
$result = @ftp_get($this->conn_id, $locpath, $rempath, $mode);
@@ -331,7 +343,7 @@ class CI_FTP {
* @param bool
* @return bool
*/
- function rename($old_file, $new_file, $move = FALSE)
+ public function rename($old_file, $new_file, $move = FALSE)
{
if ( ! $this->_is_conn())
{
@@ -344,9 +356,7 @@ class CI_FTP {
{
if ($this->debug == TRUE)
{
- $msg = ($move == FALSE) ? 'ftp_unable_to_rename' : 'ftp_unable_to_move';
-
- $this->_error($msg);
+ $this->_error('ftp_unable_to_' . ($move == FALSE ? 'rename' : 'move'));
}
return FALSE;
}
@@ -364,7 +374,7 @@ class CI_FTP {
* @param string
* @return bool
*/
- function move($old_file, $new_file)
+ public function move($old_file, $new_file)
{
return $this->rename($old_file, $new_file, TRUE);
}
@@ -378,7 +388,7 @@ class CI_FTP {
* @param string
* @return bool
*/
- function delete_file($filepath)
+ public function delete_file($filepath)
{
if ( ! $this->_is_conn())
{
@@ -409,7 +419,7 @@ class CI_FTP {
* @param string
* @return bool
*/
- function delete_dir($filepath)
+ public function delete_dir($filepath)
{
if ( ! $this->_is_conn())
{
@@ -458,23 +468,13 @@ class CI_FTP {
* @param string the permissions
* @return bool
*/
- function chmod($path, $perm)
+ public function chmod($path, $perm)
{
if ( ! $this->_is_conn())
{
return FALSE;
}
- // Permissions can only be set when running PHP 5
- if ( ! function_exists('ftp_chmod'))
- {
- if ($this->debug == TRUE)
- {
- $this->_error('ftp_unable_to_chmod');
- }
- return FALSE;
- }
-
$result = @ftp_chmod($this->conn_id, $perm, $path);
if ($result === FALSE)
@@ -497,7 +497,7 @@ class CI_FTP {
* @access public
* @return array
*/
- function list_files($path = '.')
+ public function list_files($path = '.')
{
if ( ! $this->_is_conn())
{
@@ -521,7 +521,7 @@ class CI_FTP {
* @param string path to destination - include the base folder with trailing slash
* @return bool
*/
- function mirror($locpath, $rempath)
+ public function mirror($locpath, $rempath)
{
if ( ! $this->_is_conn())
{
@@ -531,24 +531,20 @@ class CI_FTP {
// Open the local file path
if ($fp = @opendir($locpath))
{
- // Attempt to open the remote file path.
- if ( ! $this->changedir($rempath, TRUE))
+ // Attempt to open the remote file path and try to create it, if it doesn't exist
+ if ( ! $this->changedir($rempath, TRUE) AND ( ! $this->mkdir($rempath) OR ! $this->changedir($rempath)))
{
- // If it doesn't exist we'll attempt to create the direcotory
- if ( ! $this->mkdir($rempath) OR ! $this->changedir($rempath))
- {
- return FALSE;
- }
+ return FALSE;
}
// Recursively read the local directory
while (FALSE !== ($file = readdir($fp)))
{
- if (@is_dir($locpath.$file) && substr($file, 0, 1) != '.')
+ if (@is_dir($locpath.$file) && $file[0] !== '.')
{
$this->mirror($locpath.$file."/", $rempath.$file."/");
}
- elseif (substr($file, 0, 1) != ".")
+ elseif ($file[0] !== ".")
{
// Get the file extension so we can se the upload type
$ext = $this->_getext($file);
@@ -573,7 +569,7 @@ class CI_FTP {
* @param string
* @return string
*/
- function _getext($filename)
+ private function _getext($filename)
{
if (FALSE === strpos($filename, '.'))
{
@@ -594,7 +590,7 @@ class CI_FTP {
* @param string
* @return string
*/
- function _settype($ext)
+ private function _settype($ext)
{
$text_types = array(
'txt',
@@ -622,18 +618,16 @@ class CI_FTP {
* Close the connection
*
* @access public
- * @param string path to source
- * @param string path to destination
* @return bool
*/
- function close()
+ public function close()
{
if ( ! $this->_is_conn())
{
return FALSE;
}
- @ftp_close($this->conn_id);
+ return @ftp_close($this->conn_id);
}
// ------------------------------------------------------------------------
@@ -643,9 +637,9 @@ class CI_FTP {
*
* @access private
* @param string
- * @return bool
+ * @return void
*/
- function _error($line)
+ private function _error($line)
{
$CI =& get_instance();
$CI->lang->load('ftp');
@@ -657,4 +651,4 @@ class CI_FTP {
// END FTP Class
/* End of file Ftp.php */
-/* Location: ./system/libraries/Ftp.php */ \ No newline at end of file
+/* Location: ./system/libraries/Ftp.php */
diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php
index 7f905128b..9826eabdd 100644
--- a/system/libraries/Image_lib.php
+++ b/system/libraries/Image_lib.php
@@ -1,87 +1,91 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* Image Manipulation class
*
* @package CodeIgniter
* @subpackage Libraries
* @category Image_lib
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/image_lib.html
*/
class CI_Image_lib {
- var $image_library = 'gd2'; // Can be: imagemagick, netpbm, gd, gd2
- var $library_path = '';
- var $dynamic_output = FALSE; // Whether to send to browser or write to disk
- var $source_image = '';
- var $new_image = '';
- var $width = '';
- var $height = '';
- var $quality = '90';
- var $create_thumb = FALSE;
- var $thumb_marker = '_thumb';
- var $maintain_ratio = TRUE; // Whether to maintain aspect ratio when resizing or use hard values
- var $master_dim = 'auto'; // auto, height, or width. Determines what to use as the master dimension
- var $rotation_angle = '';
- var $x_axis = '';
- var $y_axis = '';
+ public $image_library = 'gd2'; // Can be: imagemagick, netpbm, gd, gd2
+ public $library_path = '';
+ public $dynamic_output = FALSE; // Whether to send to browser or write to disk
+ public $source_image = '';
+ public $new_image = '';
+ public $width = '';
+ public $height = '';
+ public $quality = '90';
+ public $create_thumb = FALSE;
+ public $thumb_marker = '_thumb';
+ public $maintain_ratio = TRUE; // Whether to maintain aspect ratio when resizing or use hard values
+ public $master_dim = 'auto'; // auto, height, or width. Determines what to use as the master dimension
+ public $rotation_angle = '';
+ public $x_axis = '';
+ public $y_axis = '';
// Watermark Vars
- var $wm_text = ''; // Watermark text if graphic is not used
- var $wm_type = 'text'; // Type of watermarking. Options: text/overlay
- var $wm_x_transp = 4;
- var $wm_y_transp = 4;
- var $wm_overlay_path = ''; // Watermark image path
- var $wm_font_path = ''; // TT font
- var $wm_font_size = 17; // Font size (different versions of GD will either use points or pixels)
- var $wm_vrt_alignment = 'B'; // Vertical alignment: T M B
- var $wm_hor_alignment = 'C'; // Horizontal alignment: L R C
- var $wm_padding = 0; // Padding around text
- var $wm_hor_offset = 0; // Lets you push text to the right
- var $wm_vrt_offset = 0; // Lets you push text down
- var $wm_font_color = '#ffffff'; // Text color
- var $wm_shadow_color = ''; // Dropshadow color
- var $wm_shadow_distance = 2; // Dropshadow distance
- var $wm_opacity = 50; // Image opacity: 1 - 100 Only works with image
+ public $wm_text = ''; // Watermark text if graphic is not used
+ public $wm_type = 'text'; // Type of watermarking. Options: text/overlay
+ public $wm_x_transp = 4;
+ public $wm_y_transp = 4;
+ public $wm_overlay_path = ''; // Watermark image path
+ public $wm_font_path = ''; // TT font
+ public $wm_font_size = 17; // Font size (different versions of GD will either use points or pixels)
+ public $wm_vrt_alignment = 'B'; // Vertical alignment: T M B
+ public $wm_hor_alignment = 'C'; // Horizontal alignment: L R C
+ public $wm_padding = 0; // Padding around text
+ public $wm_hor_offset = 0; // Lets you push text to the right
+ public $wm_vrt_offset = 0; // Lets you push text down
+ protected $wm_font_color = '#ffffff'; // Text color
+ protected $wm_shadow_color = ''; // Dropshadow color
+ public $wm_shadow_distance = 2; // Dropshadow distance
+ public $wm_opacity = 50; // Image opacity: 1 - 100 Only works with image
// Private Vars
- var $source_folder = '';
- var $dest_folder = '';
- var $mime_type = '';
- var $orig_width = '';
- var $orig_height = '';
- var $image_type = '';
- var $size_str = '';
- var $full_src_path = '';
- var $full_dst_path = '';
- var $create_fnc = 'imagecreatetruecolor';
- var $copy_fnc = 'imagecopyresampled';
- var $error_msg = array();
- var $wm_use_drop_shadow = FALSE;
- var $wm_use_truetype = FALSE;
+ public $source_folder = '';
+ public $dest_folder = '';
+ public $mime_type = '';
+ public $orig_width = '';
+ public $orig_height = '';
+ public $image_type = '';
+ public $size_str = '';
+ public $full_src_path = '';
+ public $full_dst_path = '';
+ public $create_fnc = 'imagecreatetruecolor';
+ public $copy_fnc = 'imagecopyresampled';
+ public $error_msg = array();
+ protected $wm_use_drop_shadow = FALSE;
+ public $wm_use_truetype = FALSE;
- /**
- * Constructor
- *
- * @param string
- * @return void
- */
public function __construct($props = array())
{
if (count($props) > 0)
@@ -89,7 +93,7 @@ class CI_Image_lib {
$this->initialize($props);
}
- log_message('debug', "Image Lib Class Initialized");
+ log_message('debug', 'Image Lib Class Initialized');
}
// --------------------------------------------------------------------
@@ -99,20 +103,41 @@ class CI_Image_lib {
*
* Resets values in case this class is used in a loop
*
- * @access public
* @return void
*/
- function clear()
+ public function clear()
{
- $props = array('source_folder', 'dest_folder', 'source_image', 'full_src_path', 'full_dst_path', 'new_image', 'image_type', 'size_str', 'quality', 'orig_width', 'orig_height', 'rotation_angle', 'x_axis', 'y_axis', 'create_fnc', 'copy_fnc', 'wm_overlay_path', 'wm_use_truetype', 'dynamic_output', 'wm_font_size', 'wm_text', 'wm_vrt_alignment', 'wm_hor_alignment', 'wm_padding', 'wm_hor_offset', 'wm_vrt_offset', 'wm_font_color', 'wm_use_drop_shadow', 'wm_shadow_color', 'wm_shadow_distance', 'wm_opacity');
+ $props = array('library_path', 'source_image', 'new_image', 'width', 'height', 'rotation_angle', 'x_axis', 'y_axis', 'wm_text', 'wm_overlay_path', 'wm_font_path', 'wm_shadow_color', 'source_folder', 'dest_folder', 'mime_type', 'orig_width', 'orig_height', 'image_type', 'size_str', 'full_src_path', 'full_dst_path');
foreach ($props as $val)
{
$this->$val = '';
}
- // special consideration for master_dim
- $this->master_dim = 'auto';
+ $this->image_library = 'gd2';
+ $this->dynamic_output = FALSE;
+ $this->quality = '90';
+ $this->create_thumb = FALSE;
+ $this->thumb_marker = '_thumb';
+ $this->maintain_ratio = TRUE;
+ $this->master_dim = 'auto';
+ $this->wm_type = 'text';
+ $this->wm_x_transp = 4;
+ $this->wm_y_transp = 4;
+ $this->wm_font_size = 17;
+ $this->wm_vrt_alignment = 'B';
+ $this->wm_hor_alignment = 'C';
+ $this->wm_padding = 0;
+ $this->wm_hor_offset = 0;
+ $this->wm_vrt_offset = 0;
+ $this->wm_font_color = '#ffffff';
+ $this->wm_shadow_distance = 2;
+ $this->wm_opacity = 50;
+ $this->create_fnc = 'imagecreatetruecolor';
+ $this->copy_fnc = 'imagecopyresampled';
+ $this->error_msg = array();
+ $this->wm_use_drop_shadow = FALSE;
+ $this->wm_use_truetype = FALSE;
}
// --------------------------------------------------------------------
@@ -120,42 +145,58 @@ class CI_Image_lib {
/**
* initialize image preferences
*
- * @access public
* @param array
* @return bool
*/
- function initialize($props = array())
+ public function initialize($props = array())
{
- /*
- * Convert array elements into class variables
- */
+ // Convert array elements into class variables
if (count($props) > 0)
{
foreach ($props as $key => $val)
{
- $this->$key = $val;
+ if (property_exists($this, $key))
+ {
+ if (in_array($key, array('wm_font_color', 'wm_shadow_color')))
+ {
+ if (preg_match('/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i', $val, $matches))
+ {
+ /* $matches[1] contains our hex color value, but it might be
+ * both in the full 6-length format or the shortened 3-length
+ * value.
+ * We'll later need the full version, so we keep it if it's
+ * already there and if not - we'll convert to it. We can
+ * access string characters by their index as in an array,
+ * so we'll do that and use concatenation to form the final
+ * value:
+ */
+ $val = (strlen($matches[1]) === 6)
+ ? '#'.$matches[1]
+ : '#'.$matches[1][0].$matches[1][0].$matches[1][1].$matches[1][1].$matches[1][2].$matches[1][2];
+ }
+ else
+ {
+ continue;
+ }
+ }
+
+ $this->$key = $val;
+ }
}
}
- /*
- * Is there a source image?
- *
- * If not, there's no reason to continue
- *
- */
+ // 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;
+ return FALSE;
}
- /*
- * Is getimagesize() Available?
+ /* Is getimagesize() available?
*
* We use it to determine the image properties (width/height).
- * Note: We need to figure out how to determine image
+ * Note: We need to figure out how to determine image
* properties using ImageMagick and NetPBM
- *
*/
if ( ! function_exists('getimagesize'))
{
@@ -165,17 +206,15 @@ class CI_Image_lib {
$this->image_library = strtolower($this->image_library);
- /*
- * Set the full server path
+ /* 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)
+ if (function_exists('realpath') && @realpath($this->source_image) !== FALSE)
{
- $full_source_path = str_replace("\\", "/", realpath($this->source_image));
+ $full_source_path = str_replace('\\', '/', realpath($this->source_image));
}
else
{
@@ -189,7 +228,7 @@ class CI_Image_lib {
// Set the Image Properties
if ( ! $this->get_image_properties($this->source_folder.$this->source_image))
{
- return FALSE;
+ return FALSE;
}
/*
@@ -197,64 +236,58 @@ class CI_Image_lib {
*
* 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
+ * 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;
}
+ elseif (strpos($this->new_image, '/') === FALSE)
+ {
+ $this->dest_folder = $this->source_folder;
+ $this->dest_image = $this->new_image;
+ }
else
{
if (strpos($this->new_image, '/') === FALSE AND strpos($this->new_image, '\\') === FALSE)
{
- $this->dest_folder = $this->source_folder;
- $this->dest_image = $this->new_image;
+ $full_dest_path = str_replace('\\', '/', realpath($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;
- }
+ $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);
- }
+ // 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
+ /* 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);
+ $xp = $this->explode_name($this->dest_image);
$filename = $xp['name'];
$file_ext = $xp['ext'];
@@ -262,69 +295,58 @@ class CI_Image_lib {
$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?
+ /* 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.
- *
+ * image's width/height. We'll recalculate it here.
*/
- if ($this->maintain_ratio === TRUE && ($this->width != '' AND $this->height != ''))
+ if ($this->maintain_ratio === TRUE && ($this->width != 0 OR $this->height != 0))
{
$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
+ /* 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));
+ $this->quality = trim(str_replace('%', '', $this->quality));
- if ($this->quality == '' OR $this->quality == 0 OR ! is_numeric($this->quality))
+ if ($this->quality == '' OR $this->quality == 0 OR ! preg_match('/^[0-9]+$/', $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;
+ $this->x_axis = ($this->x_axis == '' OR ! preg_match('/^[0-9]+$/', $this->x_axis)) ? 0 : $this->x_axis;
+ $this->y_axis = ($this->y_axis == '' OR ! preg_match('/^[0-9]+$/', $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));
+ $this->wm_overlay_path = str_replace('\\', '/', realpath($this->wm_overlay_path));
}
if ($this->wm_shadow_color != '')
{
$this->wm_use_drop_shadow = TRUE;
}
+ elseif ($this->wm_use_drop_shadow == TRUE && $this->wm_shadow_color == '')
+ {
+ $this->wm_use_drop_shadow = FALSE;
+ }
if ($this->wm_font_path != '')
{
@@ -342,18 +364,11 @@ class CI_Image_lib {
* This is a wrapper function that chooses the proper
* resize function based on the protocol specified
*
- * @access public
* @return bool
*/
- function resize()
+ public function resize()
{
- $protocol = 'image_process_'.$this->image_library;
-
- if (preg_match('/gd2$/i', $protocol))
- {
- $protocol = 'image_process_gd';
- }
-
+ $protocol = ($this->image_library === 'gd2') ? 'image_process_gd' : 'image_process_'.$this->image_library;
return $this->$protocol('resize');
}
@@ -365,18 +380,11 @@ class CI_Image_lib {
* This is a wrapper function that chooses the proper
* cropping function based on the protocol specified
*
- * @access public
* @return bool
*/
- function crop()
+ public function crop()
{
- $protocol = 'image_process_'.$this->image_library;
-
- if (preg_match('/gd2$/i', $protocol))
- {
- $protocol = 'image_process_gd';
- }
-
+ $protocol = ($this->image_library === 'gd2') ? 'image_process_gd' : 'image_process_'.$this->image_library;
return $this->$protocol('crop');
}
@@ -388,10 +396,9 @@ class CI_Image_lib {
* This is a wrapper function that chooses the proper
* rotation function based on the protocol specified
*
- * @access public
* @return bool
*/
- function rotate()
+ public function rotate()
{
// Allowed rotation values
$degs = array(90, 180, 270, 'vrt', 'hor');
@@ -399,7 +406,7 @@ class CI_Image_lib {
if ($this->rotation_angle == '' OR ! in_array($this->rotation_angle, $degs))
{
$this->set_error('imglib_rotation_angle_required');
- return FALSE;
+ return FALSE;
}
// Reassign the width and height
@@ -414,23 +421,16 @@ class CI_Image_lib {
$this->height = $this->orig_height;
}
-
// Choose resizing function
- if ($this->image_library == 'imagemagick' OR $this->image_library == 'netpbm')
+ 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();
- }
+ return ($this->rotation_angle === 'hor' OR $this->rotation_angle === 'vrt')
+ ? $this->image_mirror_gd()
+ : $this->image_rotate_gd();
}
// --------------------------------------------------------------------
@@ -440,36 +440,29 @@ class CI_Image_lib {
*
* This function will resize or crop
*
- * @access public
* @param string
* @return bool
*/
- function image_process_gd($action = 'resize')
+ public function image_process_gd($action = 'resize')
{
$v2_override = FALSE;
// 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... assuming dynamic rendering is off.
- if ($this->dynamic_output === FALSE)
+ if ($this->dynamic_output === FALSE && $this->orig_width == $this->width && $this->orig_height == $this->height)
{
- if ($this->orig_width == $this->width AND $this->orig_height == $this->height)
+ if ($this->source_image != $this->new_image && @copy($this->full_src_path, $this->full_dst_path))
{
- 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);
- }
- }
-
- return TRUE;
+ @chmod($this->full_dst_path, FILE_WRITE_MODE);
}
+
+ return TRUE;
}
// Let's set up our values based on the action
if ($action == 'crop')
{
- // Reassign the source width/height if cropping
+ // Reassign the source width/height if cropping
$this->orig_width = $this->width;
$this->orig_height = $this->height;
@@ -493,14 +486,15 @@ class CI_Image_lib {
return FALSE;
}
- // 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'))
+ /* 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' && function_exists('imagecreatetruecolor') && $v2_override == FALSE)
+ */
+ if ($this->image_library === 'gd2' && function_exists('imagecreatetruecolor'))
{
$create = 'imagecreatetruecolor';
$copy = 'imagecopyresampled';
@@ -521,21 +515,17 @@ class CI_Image_lib {
$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
+ // Show the image
if ($this->dynamic_output == TRUE)
{
$this->image_display_gd($dst_img);
}
- else
+ elseif ( ! $this->image_save_gd($dst_img)) // Or save it
{
- // Or save it
- if ( ! $this->image_save_gd($dst_img))
- {
- return FALSE;
- }
+ return FALSE;
}
- // Kill the file handles
+ // Kill the file handles
imagedestroy($dst_img);
imagedestroy($src_img);
@@ -552,11 +542,10 @@ class CI_Image_lib {
*
* This function will resize, crop or rotate
*
- * @access public
* @param string
* @return bool
*/
- function image_process_imagemagick($action = 'resize')
+ public function image_process_imagemagick($action = 'resize')
{
// Do we have a vaild library path?
if ($this->library_path == '')
@@ -565,44 +554,34 @@ class CI_Image_lib {
return FALSE;
}
- if ( ! preg_match("/convert$/i", $this->library_path))
+ if ( ! preg_match('/convert$/i', $this->library_path))
{
- $this->library_path = rtrim($this->library_path, '/').'/';
-
- $this->library_path .= 'convert';
+ $this->library_path = rtrim($this->library_path, '/').'/convert';
}
// Execute the command
- $cmd = $this->library_path." -quality ".$this->quality;
+ $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";
+ $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;
- }
+ $angle = ($this->rotation_angle === 'hor' OR $this->rotation_angle === 'vrt')
+ ? '-flop' : '-rotate '.$this->rotation_angle;
- $cmd .= " ".$angle." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1";
+ $cmd .= ' '.$angle.' "'.$this->full_src_path.'" "'.$this->full_dst_path.'" 2>&1';
}
- else // Resize
+ else // Resize
{
- $cmd .= " -resize ".$this->width."x".$this->height." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1";
+ $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?
+ // Did it work?
if ($retval > 0)
{
$this->set_error('imglib_image_process_failed');
@@ -622,11 +601,10 @@ class CI_Image_lib {
*
* This function will resize, crop or rotate
*
- * @access public
* @param string
* @return bool
*/
- function image_process_netpbm($action = 'resize')
+ public function image_process_netpbm($action = 'resize')
{
if ($this->library_path == '')
{
@@ -634,7 +612,7 @@ class CI_Image_lib {
return FALSE;
}
- // Build the resizing command
+ // Build the resizing command
switch ($this->image_type)
{
case 1 :
@@ -681,10 +659,9 @@ class CI_Image_lib {
$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?
+ // Did it work?
if ($retval > 0)
{
$this->set_error('imglib_image_process_failed');
@@ -695,7 +672,7 @@ class CI_Image_lib {
// 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');
+ unlink($this->dest_folder.'netpbm.tmp');
@chmod($this->full_dst_path, FILE_WRITE_MODE);
return TRUE;
@@ -706,12 +683,11 @@ class CI_Image_lib {
/**
* Image Rotate Using GD
*
- * @access public
* @return bool
*/
- function image_rotate_gd()
+ public function image_rotate_gd()
{
- // Create the image handle
+ // Create the image handle
if ( ! ($src_img = $this->image_create_gd()))
{
return FALSE;
@@ -724,29 +700,24 @@ class CI_Image_lib {
$white = imagecolorallocate($src_img, 255, 255, 255);
- // Rotate it!
+ // Rotate it!
$dst_img = imagerotate($src_img, $this->rotation_angle, $white);
- // Save the Image
+ // Show the image
if ($this->dynamic_output == TRUE)
{
$this->image_display_gd($dst_img);
}
- else
+ elseif ( ! $this->image_save_gd($dst_img)) // ... or save it
{
- // Or save it
- if ( ! $this->image_save_gd($dst_img))
- {
- return FALSE;
- }
+ return FALSE;
}
- // Kill the file handles
+ // Kill the file handles
imagedestroy($dst_img);
imagedestroy($src_img);
// Set the file to 777
-
@chmod($this->full_dst_path, FILE_WRITE_MODE);
return TRUE;
@@ -759,10 +730,9 @@ class CI_Image_lib {
*
* This function will flip horizontal or vertical
*
- * @access public
* @return bool
*/
- function image_mirror_gd()
+ public function image_mirror_gd()
{
if ( ! $src_img = $this->image_create_gd())
{
@@ -772,13 +742,10 @@ class CI_Image_lib {
$width = $this->orig_width;
$height = $this->orig_height;
- if ($this->rotation_angle == 'hor')
+ if ($this->rotation_angle === 'hor')
{
- for ($i = 0; $i < $height; $i++)
+ for ($i = 0; $i < $height; $i++, $left = 0, $right = $width-1)
{
- $left = 0;
- $right = $width-1;
-
while ($left < $right)
{
$cl = imagecolorat($src_img, $left, $i);
@@ -794,11 +761,8 @@ class CI_Image_lib {
}
else
{
- for ($i = 0; $i < $width; $i++)
+ for ($i = 0; $i < $width; $i++, $top = 0, $bot = $height-1)
{
- $top = 0;
- $bot = $height-1;
-
while ($top < $bot)
{
$ct = imagecolorat($src_img, $i, $top);
@@ -813,21 +777,17 @@ class CI_Image_lib {
}
}
- // Show the image
+ // Show the image
if ($this->dynamic_output == TRUE)
{
$this->image_display_gd($src_img);
}
- else
+ elseif ( ! $this->image_save_gd($src_img)) // ... or save it
{
- // Or save it
- if ( ! $this->image_save_gd($src_img))
- {
- return FALSE;
- }
+ return FALSE;
}
- // Kill the file handles
+ // Kill the file handles
imagedestroy($src_img);
// Set the file to 777
@@ -844,20 +804,12 @@ class CI_Image_lib {
* This is a wrapper function that chooses the type
* of watermarking based on the specified preference.
*
- * @access public
* @param string
* @return bool
*/
- function watermark()
+ public function watermark()
{
- if ($this->wm_type == 'overlay')
- {
- return $this->overlay_watermark();
- }
- else
- {
- return $this->text_watermark();
- }
+ return ($this->wm_type === 'overlay') ? $this->overlay_watermark() : $this->text_watermark();
}
// --------------------------------------------------------------------
@@ -865,10 +817,9 @@ class CI_Image_lib {
/**
* Watermark - Graphic Version
*
- * @access public
* @return bool
*/
- function overlay_watermark()
+ public function overlay_watermark()
{
if ( ! function_exists('imagecolortransparent'))
{
@@ -876,28 +827,28 @@ class CI_Image_lib {
return FALSE;
}
- // Fetch source image properties
+ // Fetch source image properties
$this->get_image_properties();
- // Fetch watermark image properties
- $props = $this->get_image_properties($this->wm_overlay_path, TRUE);
+ // 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'];
+ $wm_width = $props['width'];
+ $wm_height = $props['height'];
- // Create two image resources
+ // 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
+ // 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));
+ $this->wm_vrt_alignment = strtoupper($this->wm_vrt_alignment[0]);
+ $this->wm_hor_alignment = strtoupper($this->wm_hor_alignment[0]);
if ($this->wm_vrt_alignment == 'B')
$this->wm_vrt_offset = $this->wm_vrt_offset * -1;
@@ -905,34 +856,32 @@ class CI_Image_lib {
if ($this->wm_hor_alignment == 'R')
$this->wm_hor_offset = $this->wm_hor_offset * -1;
- // Set the base x and y axis values
+ // 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)
+ // Set the vertical position
+ if ($this->wm_vrt_alignment === 'M')
{
- 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;
+ $y_axis += ($this->orig_height / 2) - ($wm_height / 2);
+ }
+ elseif ($this->wm_vrt_alignment === 'B')
+ {
+ $y_axis += $this->orig_height - $wm_height;
}
- // Set the horizontal position
- switch ($this->wm_hor_alignment)
+ // Set the horizontal position
+ if ($this->wm_hor_alignment === 'C')
{
- 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;
+ $x_axis += ($this->orig_width / 2) - ($wm_width / 2);
+ }
+ elseif ($this->wm_hor_alignment === 'R')
+ {
+ $x_axis += $this->orig_width - $wm_width;
}
// Build the finalized image
- if ($wm_img_type == 3 AND function_exists('imagealphablending'))
+ if ($wm_img_type == 3 && function_exists('imagealphablending'))
{
@imagealphablending($src_img, TRUE);
}
@@ -954,17 +903,14 @@ class CI_Image_lib {
imagecopymerge($src_img, $wm_img, $x_axis, $y_axis, 0, 0, $wm_width, $wm_height, $this->wm_opacity);
}
- // Output the image
+ // Output the image
if ($this->dynamic_output == TRUE)
{
$this->image_display_gd($src_img);
}
- else
+ elseif ( ! $this->image_save_gd($src_img)) // ... or save it
{
- if ( ! $this->image_save_gd($src_img))
- {
- return FALSE;
- }
+ return FALSE;
}
imagedestroy($src_img);
@@ -978,45 +924,29 @@ class CI_Image_lib {
/**
* Watermark - Text Version
*
- * @access public
* @return bool
*/
- function text_watermark()
+ public 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))
+ if ($this->wm_use_truetype == TRUE && ! file_exists($this->wm_font_path))
{
$this->set_error('imglib_missing_font');
return FALSE;
}
- // Fetch source image properties
+ // 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
+ // 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')
@@ -1031,7 +961,9 @@ class CI_Image_lib {
if ($this->wm_use_truetype == TRUE)
{
if ($this->wm_font_size == '')
- $this->wm_font_size = '17';
+ {
+ $this->wm_font_size = 17;
+ }
$fontwidth = $this->wm_font_size-($this->wm_font_size/4);
$fontheight = $this->wm_font_size;
@@ -1047,58 +979,64 @@ class CI_Image_lib {
$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)
+ // Set verticle alignment
+ if ($this->wm_vrt_alignment === 'M')
{
- 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;
+ $y_axis += ($this->orig_height / 2) + ($fontheight / 2);
+ }
+ elseif ($this->wm_vrt_alignment === 'B')
+ {
+ $y_axis += $this->orig_height - $fontheight - $this->wm_shadow_distance - ($fontheight / 2);
}
$x_shad = $x_axis + $this->wm_shadow_distance;
$y_shad = $y_axis + $this->wm_shadow_distance;
- // Set horizontal alignment
- switch ($this->wm_hor_alignment)
+ if ($this->wm_use_drop_shadow)
{
- 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;
- }
+ // Set horizontal alignment
+ if ($this->wm_hor_alignment === 'R')
+ {
+ $x_shad += $this->orig_width - ($fontwidth * strlen($this->wm_text));
+ $x_axis += $this->orig_width - ($fontwidth * strlen($this->wm_text));
+ }
+ elseif ($this->wm_hor_alignment === 'C')
+ {
+ $x_shad += floor(($this->orig_width - ($fontwidth * strlen($this->wm_text))) / 2);
+ $x_axis += floor(($this->orig_width - ($fontwidth * strlen($this->wm_text))) / 2);
+ }
- // Add the text to the source image
- if ($this->wm_use_truetype)
- {
- if ($this->wm_use_drop_shadow)
+ /* Set RGB values for text and shadow
+ *
+ * First character is #, so we don't really need it.
+ * Get the rest of the string and split it into 2-length
+ * hex values:
+ */
+ $txt_color = str_split(substr($this->wm_font_color, 1, 6), 2);
+ $txt_color = imagecolorclosest($src_img, hexdec($txt_color[0]), hexdec($txt_color[1]), hexdec($txt_color[2]));
+ $drp_color = str_split(substr($this->wm_shadow_color, 1, 6), 2);
+ $drp_color = imagecolorclosest($src_img, hexdec($drp_color[0]), hexdec($drp_color[1]), hexdec($drp_color[2]));
+
+ // Add the text to the source image
+ if ($this->wm_use_truetype)
+ {
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)
+ }
+ else
+ {
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
+ // Output the final image
if ($this->dynamic_output == TRUE)
{
$this->image_display_gd($src_img);
@@ -1121,11 +1059,10 @@ class CI_Image_lib {
* 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 = '')
+ public function image_create_gd($path = '', $image_type = '')
{
if ($path == '')
$path = $this->full_src_path;
@@ -1178,11 +1115,10 @@ class CI_Image_lib {
* 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)
+ public function image_save_gd($resource)
{
switch ($this->image_type)
{
@@ -1239,14 +1175,13 @@ class CI_Image_lib {
/**
* Dynamically outputs an image
*
- * @access public
* @param resource
* @return void
*/
- function image_display_gd($resource)
+ public function image_display_gd($resource)
{
- header("Content-Disposition: filename={$this->source_image};");
- header("Content-Type: {$this->mime_type}");
+ 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');
@@ -1275,38 +1210,47 @@ class CI_Image_lib {
* 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()
+ public 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')
+ if (($this->width == 0 && $this->height == 0) OR $this->orig_width == 0 OR $this->orig_height == 0
+ OR ( ! preg_match('/^[0-9]+$/', $this->width) && ! preg_match('/^[0-9]+$/', $this->height))
+ OR ! preg_match('/^[0-9]+$/', $this->orig_width) OR ! preg_match('/^[0-9]+$/', $this->orig_height))
{
- $this->master_dim = ($ratio < 0) ? 'width' : 'height';
+ return;
}
- if (($this->width != $new_width) AND ($this->height != $new_height))
+ // Sanitize so we don't call preg_match() anymore
+ $this->width = (int) $this->width;
+ $this->height = (int) $this->height;
+
+ if ($this->master_dim !== 'width' && $this->master_dim !== 'height')
{
- if ($this->master_dim == 'height')
+ if ($this->width > 0 && $this->height > 0)
{
- $this->width = $new_width;
+ $this->master_dim = ((($this->orig_height/$this->orig_width) - ($this->height/$this->width)) < 0)
+ ? 'width' : 'height';
}
else
{
- $this->height = $new_height;
+ $this->master_dim = ($this->height === 0) ? 'width' : 'height';
}
}
+ elseif (($this->master_dim === 'width' && $this->width === 0)
+ OR ($this->master_dim === 'height' && $this->height === 0))
+ {
+ return;
+ }
+
+ if ($this->master_dim === 'width')
+ {
+ $this->height = (int) ceil($this->width*$this->orig_height/$this->orig_width);
+ }
+ else
+ {
+ $this->width = (int) ceil($this->orig_width*$this->height/$this->orig_height);
+ }
}
// --------------------------------------------------------------------
@@ -1316,17 +1260,18 @@ class CI_Image_lib {
*
* A helper function that gets info about the file
*
- * @access public
* @param string
* @return mixed
*/
- function get_image_properties($path = '', $return = FALSE)
+ public function get_image_properties($path = '', $return = FALSE)
{
// For now we require GD but we should
// find a way to determine this using IM or NetPBM
if ($path == '')
+ {
$path = $this->full_src_path;
+ }
if ( ! file_exists($path))
{
@@ -1334,27 +1279,25 @@ class CI_Image_lib {
return FALSE;
}
- $vals = @getimagesize($path);
-
+ $vals = getimagesize($path);
$types = array(1 => 'gif', 2 => 'jpeg', 3 => 'png');
-
- $mime = (isset($types[$vals['2']])) ? 'image/'.$types[$vals['2']] : 'image/jpg';
+ $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;
+ return array(
+ 'width' => $vals[0],
+ 'height' => $vals[1],
+ 'image_type' => $vals[2],
+ 'size_str' => $vals[3],
+ 'mime_type' => $mime
+ );
}
- $this->orig_width = $vals['0'];
- $this->orig_height = $vals['1'];
- $this->image_type = $vals['2'];
- $this->size_str = $vals['3'];
+ $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;
@@ -1366,21 +1309,20 @@ class CI_Image_lib {
* Size calculator
*
* This function takes a known width x height and
- * recalculates it to a new size. Only one
+ * 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' => ''
- * );
+ * 'width' => $width,
+ * 'height' => $height,
+ * 'new_width' => 40,
+ * 'new_height' => ''
+ * );
*
- * @access public
* @param array
* @return array
*/
- function size_calculator($vals)
+ public function size_calculator($vals)
{
if ( ! is_array($vals))
{
@@ -1419,16 +1361,15 @@ class CI_Image_lib {
*
* 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
+ * 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)
+ public function explode_name($source_image)
{
$ext = strrchr($source_image, '.');
$name = ($ext === FALSE) ? $source_image : substr($source_image, 0, -strlen($ext));
@@ -1441,17 +1382,16 @@ class CI_Image_lib {
/**
* Is GD Installed?
*
- * @access public
* @return bool
*/
- function gd_loaded()
+ public function gd_loaded()
{
if ( ! extension_loaded('gd'))
{
- if ( ! dl('gd.so'))
- {
- return FALSE;
- }
+ /* As it is stated in the PHP manual, dl() is not always available
+ * and even if so - it could generate an E_WARNING message on failure
+ */
+ return (function_exists('dl') && @dl('gd.so'));
}
return TRUE;
@@ -1462,17 +1402,14 @@ class CI_Image_lib {
/**
* Get GD version
*
- * @access public
* @return mixed
*/
- function gd_version()
+ public 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 preg_replace('/\D/', '', $gd_version['GD Version']);
}
return FALSE;
@@ -1483,11 +1420,10 @@ class CI_Image_lib {
/**
* Set error message
*
- * @access public
* @param string
* @return void
*/
- function set_error($msg)
+ public function set_error($msg)
{
$CI =& get_instance();
$CI->lang->load('imglib');
@@ -1515,23 +1451,15 @@ class CI_Image_lib {
/**
* Show error messages
*
- * @access public
* @param string
* @return string
*/
- function display_errors($open = '<p>', $close = '</p>')
+ public function display_errors($open = '<p>', $close = '</p>')
{
- $str = '';
- foreach ($this->error_msg as $val)
- {
- $str .= $open.$val.$close;
- }
-
- return $str;
+ return (count($this->error_msg) > 0) ? $open.implode($close.$open, $this->error_msg).$close : '';
}
}
-// END Image_lib Class
/* End of file Image_lib.php */
-/* Location: ./system/libraries/Image_lib.php */ \ No newline at end of file
+/* Location: ./system/libraries/Image_lib.php */
diff --git a/system/libraries/Javascript.php b/system/libraries/Javascript.php
index 34e0d7001..33df6007a 100644
--- a/system/libraries/Javascript.php
+++ b/system/libraries/Javascript.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,12 +33,12 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Javascript
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/javascript.html
*/
class CI_Javascript {
- var $_javascript_location = 'js';
+ protected $_javascript_location = 'js';
public function __construct($params = array())
{
@@ -52,7 +64,7 @@ class CI_Javascript {
log_message('debug', "Javascript Class Initialized and loaded. Driver used: $js_library_driver");
}
- // --------------------------------------------------------------------
+ // --------------------------------------------------------------------
// Event Code
// --------------------------------------------------------------------
@@ -61,12 +73,11 @@ class CI_Javascript {
*
* 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 = '')
+ public function blur($element = 'this', $js = '')
{
return $this->js->_blur($element, $js);
}
@@ -78,12 +89,11 @@ class CI_Javascript {
*
* 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 = '')
+ public function change($element = 'this', $js = '')
{
return $this->js->_change($element, $js);
}
@@ -95,13 +105,12 @@ class CI_Javascript {
*
* 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)
+ public function click($element = 'this', $js = '', $ret_false = TRUE)
{
return $this->js->_click($element, $js, $ret_false);
}
@@ -113,12 +122,11 @@ class CI_Javascript {
*
* 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 = '')
+ public function dblclick($element = 'this', $js = '')
{
return $this->js->_dblclick($element, $js);
}
@@ -130,12 +138,11 @@ class CI_Javascript {
*
* 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 = '')
+ public function error($element = 'this', $js = '')
{
return $this->js->_error($element, $js);
}
@@ -147,12 +154,11 @@ class CI_Javascript {
*
* 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 = '')
+ public function focus($element = 'this', $js = '')
{
return $this->js->__add_event($focus, $js);
}
@@ -164,13 +170,12 @@ class CI_Javascript {
*
* 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)
+ public function hover($element = 'this', $over, $out)
{
return $this->js->__hover($element, $over, $out);
}
@@ -182,12 +187,11 @@ class CI_Javascript {
*
* 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 = '')
+ public function keydown($element = 'this', $js = '')
{
return $this->js->_keydown($element, $js);
}
@@ -199,12 +203,11 @@ class CI_Javascript {
*
* 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 = '')
+ public function keyup($element = 'this', $js = '')
{
return $this->js->_keyup($element, $js);
}
@@ -216,12 +219,11 @@ class CI_Javascript {
*
* 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 = '')
+ public function load($element = 'this', $js = '')
{
return $this->js->_load($element, $js);
}
@@ -233,12 +235,11 @@ class CI_Javascript {
*
* 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 = '')
+ public function mousedown($element = 'this', $js = '')
{
return $this->js->_mousedown($element, $js);
}
@@ -250,12 +251,11 @@ class CI_Javascript {
*
* 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 = '')
+ public function mouseout($element = 'this', $js = '')
{
return $this->js->_mouseout($element, $js);
}
@@ -267,12 +267,11 @@ class CI_Javascript {
*
* 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 = '')
+ public function mouseover($element = 'this', $js = '')
{
return $this->js->_mouseover($element, $js);
}
@@ -284,12 +283,11 @@ class CI_Javascript {
*
* 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 = '')
+ public function mouseup($element = 'this', $js = '')
{
return $this->js->_mouseup($element, $js);
}
@@ -301,11 +299,10 @@ class CI_Javascript {
*
* Outputs the called javascript to the screen
*
- * @access public
* @param string The code to output
* @return string
*/
- function output($js)
+ public function output($js)
{
return $this->js->_output($js);
}
@@ -317,12 +314,11 @@ class CI_Javascript {
*
* 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)
+ public function ready($js)
{
return $this->js->_document_ready($js);
}
@@ -334,12 +330,11 @@ class CI_Javascript {
*
* 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 = '')
+ public function resize($element = 'this', $js = '')
{
return $this->js->_resize($element, $js);
}
@@ -351,12 +346,11 @@ class CI_Javascript {
*
* 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 = '')
+ public function scroll($element = 'this', $js = '')
{
return $this->js->_scroll($element, $js);
}
@@ -368,17 +362,16 @@ class CI_Javascript {
*
* 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 = '')
+ public function unload($element = 'this', $js = '')
{
return $this->js->_unload($element, $js);
}
- // --------------------------------------------------------------------
+ // --------------------------------------------------------------------
// Effects
// --------------------------------------------------------------------
@@ -388,12 +381,11 @@ class CI_Javascript {
*
* Outputs a javascript library addClass event
*
- * @access public
* @param string - element
* @param string - Class to add
* @return string
*/
- function addClass($element = 'this', $class = '')
+ public function addClass($element = 'this', $class = '')
{
return $this->js->_addClass($element, $class);
}
@@ -405,13 +397,12 @@ class CI_Javascript {
*
* 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 = '')
+ public function animate($element = 'this', $params = array(), $speed = '', $extra = '')
{
return $this->js->_animate($element, $params, $speed, $extra);
}
@@ -423,13 +414,12 @@ class CI_Javascript {
*
* 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 = '')
+ public function fadeIn($element = 'this', $speed = '', $callback = '')
{
return $this->js->_fadeIn($element, $speed, $callback);
}
@@ -441,13 +431,12 @@ class CI_Javascript {
*
* 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 = '')
+ public function fadeOut($element = 'this', $speed = '', $callback = '')
{
return $this->js->_fadeOut($element, $speed, $callback);
}
@@ -458,13 +447,12 @@ class CI_Javascript {
*
* 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 = '')
+ public function slideUp($element = 'this', $speed = '', $callback = '')
{
return $this->js->_slideUp($element, $speed, $callback);
@@ -477,12 +465,11 @@ class CI_Javascript {
*
* Outputs a javascript library removeClass event
*
- * @access public
* @param string - element
* @param string - Class to add
* @return string
*/
- function removeClass($element = 'this', $class = '')
+ public function removeClass($element = 'this', $class = '')
{
return $this->js->_removeClass($element, $class);
}
@@ -494,13 +481,12 @@ class CI_Javascript {
*
* 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 = '')
+ public function slideDown($element = 'this', $speed = '', $callback = '')
{
return $this->js->_slideDown($element, $speed, $callback);
}
@@ -512,13 +498,12 @@ class CI_Javascript {
*
* 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 = '')
+ public function slideToggle($element = 'this', $speed = '', $callback = '')
{
return $this->js->_slideToggle($element, $speed, $callback);
@@ -531,13 +516,12 @@ class CI_Javascript {
*
* 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 = '')
+ public function hide($element = 'this', $speed = '', $callback = '')
{
return $this->js->_hide($element, $speed, $callback);
}
@@ -549,11 +533,10 @@ class CI_Javascript {
*
* Outputs a javascript library toggle event
*
- * @access public
* @param string - element
* @return string
*/
- function toggle($element = 'this')
+ public function toggle($element = 'this')
{
return $this->js->_toggle($element);
@@ -566,11 +549,10 @@ class CI_Javascript {
*
* Outputs a javascript library toggle class event
*
- * @access public
* @param string - element
* @return string
*/
- function toggleClass($element = 'this', $class='')
+ public function toggleClass($element = 'this', $class='')
{
return $this->js->_toggleClass($element, $class);
}
@@ -582,13 +564,12 @@ class CI_Javascript {
*
* 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 = '')
+ public function show($element = 'this', $speed = '', $callback = '')
{
return $this->js->_show($element, $speed, $callback);
}
@@ -601,11 +582,10 @@ class CI_Javascript {
*
* 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)
+ public function compile($view_var = 'script_foot', $script_tags = TRUE)
{
$this->js->_compile($view_var, $script_tags);
}
@@ -615,10 +595,9 @@ class CI_Javascript {
*
* Clears any previous javascript collected for output
*
- * @access public
* @return void
*/
- function clear_compile()
+ public function clear_compile()
{
$this->js->_clear_compile();
}
@@ -630,11 +609,10 @@ class CI_Javascript {
*
* Outputs a <script> tag with the source as an external js file
*
- * @access public
* @param string The element to attach the event to
* @return string
*/
- function external($external_file = '', $relative = FALSE)
+ public function external($external_file = '', $relative = FALSE)
{
if ($external_file !== '')
{
@@ -648,7 +626,7 @@ class CI_Javascript {
}
}
- if ($relative === TRUE OR strncmp($external_file, 'http://', 7) == 0 OR strncmp($external_file, 'https://', 8) == 0)
+ if ($relative === TRUE OR strncmp($external_file, 'http://', 7) === 0 OR strncmp($external_file, 'https://', 8) === 0)
{
$str = $this->_open_script($external_file);
}
@@ -661,8 +639,7 @@ class CI_Javascript {
$str = $this->_open_script($this->CI->config->slash_item('base_url').$this->_javascript_location.$external_file);
}
- $str .= $this->_close_script();
- return $str;
+ return $str.$this->_close_script();
}
// --------------------------------------------------------------------
@@ -672,20 +649,17 @@ class CI_Javascript {
*
* Outputs a <script> tag
*
- * @access public
* @param string The element to attach the event to
* @param boolean If a CDATA section should be added
* @return string
*/
- function inline($script, $cdata = TRUE)
+ public function inline($script, $cdata = TRUE)
{
- $str = $this->_open_script();
- $str .= ($cdata) ? "\n// <![CDATA[\n{$script}\n// ]]>\n" : "\n{$script}\n";
- $str .= $this->_close_script();
-
- return $str;
+ return $this->_open_script()
+ . ($cdata ? "\n// <![CDATA[\n{$script}\n// ]]>\n" : "\n{$script}\n")
+ . $this->_close_script();
}
-
+
// --------------------------------------------------------------------
/**
@@ -693,15 +667,13 @@ class CI_Javascript {
*
* Outputs an opening <script>
*
- * @access private
* @param string
* @return string
*/
- function _open_script($src = '')
+ protected function _open_script($src = '')
{
- $str = '<script type="text/javascript" charset="'.strtolower($this->CI->config->item('charset')).'"';
- $str .= ($src == '') ? '>' : ' src="'.$src.'">';
- return $str;
+ return '<script type="text/javascript" charset="'.strtolower($this->CI->config->item('charset')).'"'
+ . ($src == '' ? '>' : ' src="'.$src.'">');
}
// --------------------------------------------------------------------
@@ -711,11 +683,10 @@ class CI_Javascript {
*
* Outputs an closing </script>
*
- * @access private
* @param string
* @return string
*/
- function _close_script($extra = "\n")
+ protected function _close_script($extra = "\n")
{
return "</script>$extra";
}
@@ -732,13 +703,12 @@ class CI_Javascript {
*
* 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 = '')
+ public function update($element = 'this', $speed = '', $callback = '')
{
return $this->js->_updater($element, $speed, $callback);
}
@@ -754,7 +724,7 @@ class CI_Javascript {
* @param bool match array types (defaults to objects)
* @return string a json formatted string
*/
- function generate_json($result = NULL, $match_array_type = FALSE)
+ public 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
@@ -815,11 +785,10 @@ class CI_Javascript {
*
* Checks for an associative array
*
- * @access public
* @param type
* @return type
*/
- function _is_associative_array($arr)
+ protected function _is_associative_array($arr)
{
foreach (array_keys($arr) as $key => $val)
{
@@ -839,11 +808,10 @@ class CI_Javascript {
*
* Ensures a standard json value and escapes values
*
- * @access public
* @param type
* @return type
*/
- function _prep_args($result, $is_key = FALSE)
+ protected function _prep_args($result, $is_key = FALSE)
{
if (is_null($result))
{
@@ -855,7 +823,7 @@ class CI_Javascript {
}
elseif (is_string($result) OR $is_key)
{
- return '"'.str_replace(array('\\', "\t", "\n", "\r", '"', '/'), array('\\\\', '\\t', '\\n', "\\r", '\"', '\/'), $result).'"';
+ return '"'.str_replace(array('\\', "\t", "\n", "\r", '"', '/'), array('\\\\', '\\t', '\\n', "\\r", '\"', '\/'), $result).'"';
}
elseif (is_scalar($result))
{
@@ -868,4 +836,4 @@ class CI_Javascript {
// END Javascript Class
/* End of file Javascript.php */
-/* Location: ./system/libraries/Javascript.php */ \ No newline at end of file
+/* Location: ./system/libraries/Javascript.php */
diff --git a/system/libraries/Log.php b/system/libraries/Log.php
index 9f1db76ba..944173fdd 100644
--- a/system/libraries/Log.php
+++ b/system/libraries/Log.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,16 +33,18 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Logging
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/general/errors.html
*/
class CI_Log {
protected $_log_path;
- protected $_threshold = 1;
- protected $_date_fmt = 'Y-m-d H:i:s';
- protected $_enabled = TRUE;
- protected $_levels = array('ERROR' => '1', 'DEBUG' => '2', 'INFO' => '3', 'ALL' => '4');
+ protected $_threshold = 1;
+ protected $_threshold_max = 0;
+ protected $_threshold_array = array();
+ protected $_date_fmt = 'Y-m-d H:i:s';
+ protected $_enabled = TRUE;
+ protected $_levels = array('ERROR' => 1, 'DEBUG' => 2, 'INFO' => 3, 'ALL' => 4);
/**
* Constructor
@@ -48,7 +62,12 @@ class CI_Log {
if (is_numeric($config['log_threshold']))
{
- $this->_threshold = $config['log_threshold'];
+ $this->_threshold = (int) $config['log_threshold'];
+ }
+ elseif (is_array($config['log_threshold']))
+ {
+ $this->_threshold = $this->_threshold_max;
+ $this->_threshold_array = array_flip($config['log_threshold']);
}
if ($config['log_date_format'] != '')
@@ -78,17 +97,20 @@ class CI_Log {
$level = strtoupper($level);
- if ( ! isset($this->_levels[$level]) OR ($this->_levels[$level] > $this->_threshold))
+ if (( ! isset($this->_levels[$level]) OR ($this->_levels[$level] > $this->_threshold))
+ AND ! isset($this->_threshold_array[$this->_levels[$level]]))
{
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";
+ $newfile = TRUE;
+ $message .= "<"."?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?".">\n\n";
}
if ( ! $fp = @fopen($filepath, FOPEN_WRITE_CREATE))
@@ -103,7 +125,10 @@ class CI_Log {
flock($fp, LOCK_UN);
fclose($fp);
- @chmod($filepath, FILE_WRITE_MODE);
+ if (isset($newfile) AND $newfile === TRUE)
+ {
+ @chmod($filepath, FILE_WRITE_MODE);
+ }
return TRUE;
}
@@ -111,4 +136,4 @@ class CI_Log {
// END Log Class
/* End of file Log.php */
-/* Location: ./system/libraries/Log.php */ \ No newline at end of file
+/* Location: ./system/libraries/Log.php */
diff --git a/system/libraries/Migration.php b/system/libraries/Migration.php
index 3943ec130..d07097223 100644
--- a/system/libraries/Migration.php
+++ b/system/libraries/Migration.php
@@ -1,15 +1,27 @@
-<?php defined('BASEPATH') OR exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
* @author EllisLab Dev Team
- * @copyright Copyright (c) 2006 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @copyright Copyright (c) 2006 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
- * @since Version 1.0
+ * @since Version 3.0
* @filesource
*/
@@ -32,6 +44,8 @@ class CI_Migration {
protected $_migration_enabled = FALSE;
protected $_migration_path = NULL;
protected $_migration_version = 0;
+ protected $_migration_table = 'migrations';
+ protected $_migration_auto_latest = FALSE;
protected $_error_string = '';
@@ -57,7 +71,7 @@ class CI_Migration {
}
// If not set, set it
- $this->_migration_path == '' OR $this->_migration_path = APPPATH . 'migrations/';
+ $this->_migration_path == '' AND $this->_migration_path = APPPATH.'migrations/';
// Add trailing slash if not set
$this->_migration_path = rtrim($this->_migration_path, '/').'/';
@@ -68,16 +82,28 @@ class CI_Migration {
// They'll probably be using dbforge
$this->load->dbforge();
+ // Make sure the migration table name was set.
+ if (empty($this->_migration_table))
+ {
+ show_error('Migrations configuration file (migration.php) must have "migration_table" set.');
+ }
+
// If the migrations table is missing, make it
- if ( ! $this->db->table_exists('migrations'))
+ if ( ! $this->db->table_exists($this->_migration_table))
{
$this->dbforge->add_field(array(
'version' => array('type' => 'INT', 'constraint' => 3),
));
- $this->dbforge->create_table('migrations', TRUE);
+ $this->dbforge->create_table($this->_migration_table, TRUE);
+
+ $this->db->insert($this->_migration_table, array('version' => 0));
+ }
- $this->db->insert('migrations', array('version' => 0));
+ // Do we auto migrate to the latest migration?
+ if ($this->_migration_auto_latest === TRUE AND ! $this->latest())
+ {
+ show_error($this->error_string());
}
}
@@ -105,13 +131,12 @@ class CI_Migration {
++$stop;
$step = 1;
}
-
else
{
// Moving Down
$step = -1;
}
-
+
$method = $step === 1 ? 'up' : 'down';
$migrations = array();
@@ -119,7 +144,7 @@ class CI_Migration {
// But first let's make sure that everything is the way it should be
for ($i = $start; $i != $stop; $i += $step)
{
- $f = glob(sprintf($this->_migration_path . '%03d_*.php', $i));
+ $f = glob(sprintf($this->_migration_path.'%03d_*.php', $i));
// Only one migration per step is permitted
if (count($f) > 1)
@@ -129,11 +154,11 @@ class CI_Migration {
}
// Migration step not found
- if (count($f) == 0)
+ if (count($f) === 0)
{
// If trying to migrate up to a version greater than the last
// existing one, migrate to the last one.
- if ($step == 1)
+ if ($step === 1)
{
break;
}
@@ -160,7 +185,7 @@ class CI_Migration {
}
include $f[0];
- $class = 'Migration_' . ucfirst($match[1]);
+ $class = 'Migration_'.ucfirst($match[1]);
if ( ! class_exists($class))
{
@@ -183,9 +208,9 @@ class CI_Migration {
}
}
- log_message('debug', 'Current migration: ' . $current_version);
+ log_message('debug', 'Current migration: '.$current_version);
- $version = $i + ($step == 1 ? -1 : 0);
+ $version = $i + ($step === 1 ? -1 : 0);
// If there is nothing to do so quit
if ($migrations === array())
@@ -193,13 +218,13 @@ class CI_Migration {
return TRUE;
}
- log_message('debug', 'Migrating from ' . $method . ' to version ' . $version);
+ log_message('debug', 'Migrating from '.$method.' to version '.$version);
// Loop through the migrations
foreach ($migrations AS $migration)
{
// Run the migration class
- $class = 'Migration_' . ucfirst(strtolower($migration));
+ $class = 'Migration_'.ucfirst(strtolower($migration));
call_user_func(array(new $class, $method));
$current_version += $step;
@@ -223,12 +248,12 @@ class CI_Migration {
{
if ( ! $migrations = $this->find_migrations())
{
- $this->_error_string = $this->line->lang('migration_none_found');
+ $this->_error_string = $this->lang->line('migration_none_found');
return false;
}
$last_migration = basename(end($migrations));
-
+
// Calculate the last migration step from existing migration
// filenames and procceed to the standard version migration
return $this->version((int) substr($last_migration, 0, 3));
@@ -271,19 +296,17 @@ class CI_Migration {
protected function find_migrations()
{
// Load all *_*.php files in the migrations path
- $files = glob($this->_migration_path . '*_*.php');
- $file_count = count($files);
-
- for ($i = 0; $i < $file_count; $i++)
+ $files = glob($this->_migration_path.'*_*.php');
+
+ for ($i = 0, $c = count($files); $i < $c; $i++)
{
// Mark wrongly formatted files as false for later filtering
- $name = basename($files[$i], '.php');
- if ( ! preg_match('/^\d{3}_(\w+)$/', $name))
+ if ( ! preg_match('/^\d{3}_(\w+)$/', basename($files[$i], '.php')))
{
$files[$i] = FALSE;
}
}
-
+
sort($files);
return $files;
@@ -299,7 +322,7 @@ class CI_Migration {
*/
protected function _get_version()
{
- $row = $this->db->get('migrations')->row();
+ $row = $this->db->select('version')->get($this->_migration_table)->row();
return $row ? $row->version : 0;
}
@@ -314,7 +337,7 @@ class CI_Migration {
*/
protected function _update_version($migrations)
{
- return $this->db->update('migrations', array(
+ return $this->db->update($this->_migration_table, array(
'version' => $migrations
));
}
@@ -335,4 +358,4 @@ class CI_Migration {
}
/* End of file Migration.php */
-/* Location: ./system/libraries/Migration.php */ \ No newline at end of file
+/* Location: ./system/libraries/Migration.php */
diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php
index cdaacf2d4..35ac541e8 100644
--- a/system/libraries/Pagination.php
+++ b/system/libraries/Pagination.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,44 +33,43 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Pagination
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/pagination.html
*/
class CI_Pagination {
- var $base_url = ''; // The page we are linking to
- var $prefix = ''; // A custom prefix added to the path.
- var $suffix = ''; // A custom suffix added to the path.
-
- var $total_rows = 0; // Total number of items (database results)
- var $per_page = 10; // Max number of items you want shown per page
- var $num_links = 2; // Number of "digit" links to show before/after the currently viewed page
- var $cur_page = 0; // The current page being viewed
- var $use_page_numbers = FALSE; // Use page number for segment instead of offset
- var $first_link = '&lsaquo; First';
- var $next_link = '&gt;';
- var $prev_link = '&lt;';
- var $last_link = 'Last &rsaquo;';
- var $uri_segment = 3;
- var $full_tag_open = '';
- var $full_tag_close = '';
- var $first_tag_open = '';
- var $first_tag_close = '&nbsp;';
- var $last_tag_open = '&nbsp;';
- var $last_tag_close = '';
- var $first_url = ''; // Alternative URL for the First Page.
- var $cur_tag_open = '&nbsp;<strong>';
- var $cur_tag_close = '</strong>';
- var $next_tag_open = '&nbsp;';
- var $next_tag_close = '&nbsp;';
- var $prev_tag_open = '&nbsp;';
- var $prev_tag_close = '';
- var $num_tag_open = '&nbsp;';
- var $num_tag_close = '';
- var $page_query_string = FALSE;
- var $query_string_segment = 'per_page';
- var $display_pages = TRUE;
- var $anchor_class = '';
+ protected $base_url = ''; // The page we are linking to
+ protected $prefix = ''; // A custom prefix added to the path.
+ protected $suffix = ''; // A custom suffix added to the path.
+ protected $total_rows = 0; // Total number of items (database results)
+ protected $per_page = 10; // Max number of items you want shown per page
+ protected $num_links = 2; // Number of "digit" links to show before/after the currently viewed page
+ protected $cur_page = 0; // The current page being viewed
+ protected $use_page_numbers = FALSE; // Use page number for segment instead of offset
+ protected $first_link = '&lsaquo; First';
+ protected $next_link = '&gt;';
+ protected $prev_link = '&lt;';
+ protected $last_link = 'Last &rsaquo;';
+ protected $uri_segment = 3;
+ protected $full_tag_open = '';
+ protected $full_tag_close = '';
+ protected $first_tag_open = '';
+ protected $first_tag_close = '&nbsp;';
+ protected $last_tag_open = '&nbsp;';
+ protected $last_tag_close = '';
+ protected $first_url = ''; // Alternative URL for the First Page.
+ protected $cur_tag_open = '&nbsp;<strong>';
+ protected $cur_tag_close = '</strong>';
+ protected $next_tag_open = '&nbsp;';
+ protected $next_tag_close = '&nbsp;';
+ protected $prev_tag_open = '&nbsp;';
+ protected $prev_tag_close = '';
+ protected $num_tag_open = '&nbsp;';
+ protected $num_tag_close = '';
+ protected $page_query_string = FALSE;
+ protected $query_string_segment = 'per_page';
+ protected $display_pages = TRUE;
+ protected $anchor_class = '';
/**
* Constructor
@@ -68,16 +79,7 @@ class CI_Pagination {
*/
public function __construct($params = array())
{
- if (count($params) > 0)
- {
- $this->initialize($params);
- }
-
- if ($this->anchor_class != '')
- {
- $this->anchor_class = 'class="'.$this->anchor_class.'" ';
- }
-
+ $this->initialize($params);
log_message('debug', "Pagination Class Initialized");
}
@@ -90,7 +92,7 @@ class CI_Pagination {
* @param array initialization parameters
* @return void
*/
- function initialize($params = array())
+ public function initialize($params = array())
{
if (count($params) > 0)
{
@@ -102,6 +104,11 @@ class CI_Pagination {
}
}
}
+
+ if ($this->anchor_class != '')
+ {
+ $this->anchor_class = 'class="'.$this->anchor_class.'" ';
+ }
}
// --------------------------------------------------------------------
@@ -112,7 +119,7 @@ class CI_Pagination {
* @access public
* @return string
*/
- function create_links()
+ public function create_links()
{
// If our item count or per-page total is zero there is no need to continue.
if ($this->total_rows == 0 OR $this->per_page == 0)
@@ -121,66 +128,51 @@ class CI_Pagination {
}
// Calculate the total number of pages
- $num_pages = ceil($this->total_rows / $this->per_page);
+ $num_pages = (int) ceil($this->total_rows / $this->per_page);
// Is there only one page? Hm... nothing more to do here then.
- if ($num_pages == 1)
+ if ($num_pages === 1)
{
return '';
}
// Set the base page index for starting page number
- if ($this->use_page_numbers)
- {
- $base_page = 1;
- }
- else
- {
- $base_page = 0;
- }
+ $base_page = ($this->use_page_numbers) ? 1 : 0;
// Determine the current page number.
$CI =& get_instance();
+ // See if we are using a prefix or suffix on links
+ if ($this->prefix != '' OR $this->suffix != '')
+ {
+ $this->cur_page = (int) str_replace(array($this->prefix, $this->suffix), '', $CI->uri->segment($this->uri_segment));
+ }
+
if ($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE)
{
if ($CI->input->get($this->query_string_segment) != $base_page)
{
- $this->cur_page = $CI->input->get($this->query_string_segment);
-
- // Prep the current page - no funny business!
- $this->cur_page = (int) $this->cur_page;
+ $this->cur_page = (int) $CI->input->get($this->query_string_segment);
}
}
- else
+ elseif ( ! $this->cur_page AND $CI->uri->segment($this->uri_segment) != $base_page)
{
- if ($CI->uri->segment($this->uri_segment) != $base_page)
- {
- $this->cur_page = $CI->uri->segment($this->uri_segment);
-
- // Prep the current page - no funny business!
- $this->cur_page = (int) $this->cur_page;
- }
+ $this->cur_page = (int) $CI->uri->segment($this->uri_segment);
}
-
- // Set current page to 1 if using page numbers instead of offset
- if ($this->use_page_numbers AND $this->cur_page == 0)
+
+ // Set current page to 1 if it's not valid or if using page numbers instead of offset
+ if ( ! is_numeric($this->cur_page) OR ($this->use_page_numbers AND $this->cur_page == 0))
{
$this->cur_page = $base_page;
}
- $this->num_links = (int)$this->num_links;
+ $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 = $base_page;
- }
-
// Is the page number beyond the result range?
// If so we show the last page
if ($this->use_page_numbers)
@@ -199,7 +191,7 @@ class CI_Pagination {
}
$uri_page_number = $this->cur_page;
-
+
if ( ! $this->use_page_numbers)
{
$this->cur_page = floor(($this->cur_page/$this->per_page) + 1);
@@ -234,22 +226,15 @@ class CI_Pagination {
// Render the "previous" link
if ($this->prev_link !== FALSE AND $this->cur_page != 1)
{
- if ($this->use_page_numbers)
- {
- $i = $uri_page_number - 1;
- }
- else
- {
- $i = $uri_page_number - $this->per_page;
- }
+ $i = ($this->use_page_numbers) ? $uri_page_number - 1 : $uri_page_number - $this->per_page;
- if ($i == 0 && $this->first_url != '')
+ if ($i == $base_page AND $this->first_url != '')
{
$output .= $this->prev_tag_open.'<a '.$this->anchor_class.'href="'.$this->first_url.'">'.$this->prev_link.'</a>'.$this->prev_tag_close;
}
else
{
- $i = ($i == 0) ? '' : $this->prefix.$i.$this->suffix;
+ $i = ($i == $base_page) ? '' : $this->prefix.$i.$this->suffix;
$output .= $this->prev_tag_open.'<a '.$this->anchor_class.'href="'.$this->base_url.$i.'">'.$this->prev_link.'</a>'.$this->prev_tag_close;
}
@@ -261,14 +246,7 @@ class CI_Pagination {
// Write the digit links
for ($loop = $start -1; $loop <= $end; $loop++)
{
- if ($this->use_page_numbers)
- {
- $i = $loop;
- }
- else
- {
- $i = ($loop * $this->per_page) - $this->per_page;
- }
+ $i = ($this->use_page_numbers) ? $loop : ($loop * $this->per_page) - $this->per_page;
if ($i >= $base_page)
{
@@ -298,14 +276,7 @@ class CI_Pagination {
// Render the "next" link
if ($this->next_link !== FALSE AND $this->cur_page < $num_pages)
{
- if ($this->use_page_numbers)
- {
- $i = $this->cur_page + 1;
- }
- else
- {
- $i = ($this->cur_page * $this->per_page);
- }
+ $i = ($this->use_page_numbers) ? $this->cur_page + 1 : $this->cur_page * $this->per_page;
$output .= $this->next_tag_open.'<a '.$this->anchor_class.'href="'.$this->base_url.$this->prefix.$i.$this->suffix.'">'.$this->next_link.'</a>'.$this->next_tag_close;
}
@@ -313,18 +284,12 @@ class CI_Pagination {
// Render the "Last" link
if ($this->last_link !== FALSE AND ($this->cur_page + $this->num_links) < $num_pages)
{
- if ($this->use_page_numbers)
- {
- $i = $num_pages;
- }
- else
- {
- $i = (($num_pages * $this->per_page) - $this->per_page);
- }
+ $i = ($this->use_page_numbers) ? $num_pages : ($num_pages * $this->per_page) - $this->per_page;
+
$output .= $this->last_tag_open.'<a '.$this->anchor_class.'href="'.$this->base_url.$this->prefix.$i.$this->suffix.'">'.$this->last_link.'</a>'.$this->last_tag_close;
}
- // Kill double slashes. Note: Sometimes we can end up with a double slash
+ // Kill double slashes. Note: Sometimes we can end up with a double slash
// in the penultimate link so we'll kill all double slashes.
$output = preg_replace("#([^:])//+#", "\\1/", $output);
@@ -337,4 +302,4 @@ class CI_Pagination {
// END Pagination Class
/* End of file Pagination.php */
-/* Location: ./system/libraries/Pagination.php */ \ No newline at end of file
+/* Location: ./system/libraries/Pagination.php */
diff --git a/system/libraries/Parser.php b/system/libraries/Parser.php
index d223da020..321248277 100644
--- a/system/libraries/Parser.php
+++ b/system/libraries/Parser.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,14 +33,15 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Parser
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/parser.html
*/
class CI_Parser {
- var $l_delim = '{';
- var $r_delim = '}';
- var $object;
+ public $l_delim = '{';
+ public $r_delim = '}';
+ public $object;
+ private $CI;
/**
* Parse a template
@@ -44,8 +57,8 @@ class CI_Parser {
*/
public function parse($template, $data, $return = FALSE)
{
- $CI =& get_instance();
- $template = $CI->load->view($template, $data, TRUE);
+ $this->CI =& get_instance();
+ $template = $this->CI->load->view($template, $data, TRUE);
return $this->_parse($template, $data, $return);
}
@@ -64,7 +77,7 @@ class CI_Parser {
* @param bool
* @return string
*/
- function parse_string($template, $data, $return = FALSE)
+ public function parse_string($template, $data, $return = FALSE)
{
return $this->_parse($template, $data, $return);
}
@@ -77,13 +90,13 @@ class CI_Parser {
* Parses pseudo-variables contained in the specified template,
* replacing them with the data in the second param
*
- * @access public
+ * @access private
* @param string
* @param array
* @param bool
* @return string
*/
- function _parse($template, $data, $return = FALSE)
+ private function _parse($template, $data, $return = FALSE)
{
if ($template == '')
{
@@ -104,8 +117,7 @@ class CI_Parser {
if ($return == FALSE)
{
- $CI =& get_instance();
- $CI->output->append_output($template);
+ $this->CI->output->append_output($template);
}
return $template;
@@ -121,7 +133,7 @@ class CI_Parser {
* @param string
* @return void
*/
- function set_delimiters($l = '{', $r = '}')
+ public function set_delimiters($l = '{', $r = '}')
{
$this->l_delim = $l;
$this->r_delim = $r;
@@ -138,9 +150,9 @@ class CI_Parser {
* @param string
* @return string
*/
- function _parse_single($key, $val, $string)
+ private function _parse_single($key, $val, $string)
{
- return str_replace($this->l_delim.$key.$this->r_delim, $val, $string);
+ return str_replace($this->l_delim.$key.$this->r_delim, (string) $val, $string);
}
// --------------------------------------------------------------------
@@ -156,7 +168,7 @@ class CI_Parser {
* @param string
* @return string
*/
- function _parse_pair($variable, $data, $string)
+ private function _parse_pair($variable, $data, $string)
{
if (FALSE === ($match = $this->_match_pair($string, $variable)))
{
@@ -166,7 +178,7 @@ class CI_Parser {
$str = '';
foreach ($data as $row)
{
- $temp = $match['1'];
+ $temp = $match[1];
foreach ($row as $key => $val)
{
if ( ! is_array($val))
@@ -182,7 +194,7 @@ class CI_Parser {
$str .= $temp;
}
- return str_replace($match['0'], $str, $string);
+ return str_replace($match[0], $str, $string);
}
// --------------------------------------------------------------------
@@ -195,7 +207,7 @@ class CI_Parser {
* @param string
* @return mixed
*/
- function _match_pair($string, $variable)
+ private function _match_pair($string, $variable)
{
if ( ! preg_match("|" . preg_quote($this->l_delim) . $variable . preg_quote($this->r_delim) . "(.+?)". preg_quote($this->l_delim) . '/' . $variable . preg_quote($this->r_delim) . "|s", $string, $match))
{
diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php
index 082a5ee1d..89c616543 100644
--- a/system/libraries/Profiler.php
+++ b/system/libraries/Profiler.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -27,7 +39,7 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Libraries
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/general/profiling.html
*/
class CI_Profiler {
@@ -114,12 +126,10 @@ class CI_Profiler {
{
// 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 (preg_match('/(.+?)_end/i', $key, $match)
+ AND isset($this->CI->benchmark->marker[$match[1].'_end'], $this->CI->benchmark->marker[$match[1].'_start']))
{
- 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);
- }
+ $profile[$match[1]] = $this->CI->benchmark->elapsed_time($match[1].'_start', $key);
}
}
@@ -127,12 +137,11 @@ class CI_Profiler {
// 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 .= '<fieldset id="ci_profiler_benchmarks" style="border:1px solid #900;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
- $output .= "\n";
- $output .= '<legend style="color:#900;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_benchmarks').'&nbsp;&nbsp;</legend>';
- $output .= "\n";
- $output .= "\n\n<table style='width:100%'>\n";
+ $output = "\n\n"
+ . '<fieldset id="ci_profiler_benchmarks" style="border:1px solid #900;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'
+ . "\n"
+ . '<legend style="color:#900;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_benchmarks').'&nbsp;&nbsp;</legend>'
+ . "\n\n\n<table style='width:100%'>\n";
foreach ($profile as $key => $val)
{
@@ -140,10 +149,7 @@ class CI_Profiler {
$output .= "<tr><td style='padding:5px;width:50%;color:#000;font-weight:bold;background-color:#ddd;'>".$key."&nbsp;&nbsp;</td><td style='padding:5px;width:50%;color:#900;font-weight:normal;background-color:#ddd;'>".$val."</td></tr>\n";
}
- $output .= "</table>\n";
- $output .= "</fieldset>";
-
- return $output;
+ return $output."</table>\n</fieldset>";
}
// --------------------------------------------------------------------
@@ -166,19 +172,16 @@ class CI_Profiler {
}
}
- if (count($dbs) == 0)
+ if (count($dbs) === 0)
{
- $output = "\n\n";
- $output .= '<fieldset id="ci_profiler_queries" style="border:1px solid #0000FF;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
- $output .= "\n";
- $output .= '<legend style="color:#0000FF;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_queries').'&nbsp;&nbsp;</legend>';
- $output .= "\n";
- $output .= "\n\n<table style='border:none; width:100%;'>\n";
- $output .="<tr><td style='width:100%;color:#0000FF;font-weight:normal;background-color:#eee;padding:5px'>".$this->CI->lang->line('profiler_no_db')."</td></tr>\n";
- $output .= "</table>\n";
- $output .= "</fieldset>";
-
- return $output;
+ return "\n\n"
+ . '<fieldset id="ci_profiler_queries" style="border:1px solid #0000FF;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee;">'
+ . "\n"
+ . '<legend style="color:#0000FF;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_queries').'&nbsp;&nbsp;</legend>'
+ . "\n\n\n<table style='border:none; width:100%;'>\n"
+ . '<tr><td style="width:100%;color:#0000FF;font-weight:normal;background-color:#eee;padding:5px;">'
+ . $this->CI->lang->line('profiler_no_db')
+ . "</td></tr>\n</table>\n</fieldset>";
}
// Load the text helper so we can highlight the SQL
@@ -193,8 +196,6 @@ class CI_Profiler {
foreach ($dbs as $db)
{
- $count++;
-
$hide_queries = (count($db->queries) > $this->_query_toggle_count) ? ' display:none' : '';
$show_hide_js = '(<span style="cursor: pointer;" onclick="var s=document.getElementById(\'ci_profiler_queries_db_'.$count.'\').style;s.display=s.display==\'none\'?\'\':\'none\';this.innerHTML=this.innerHTML==\''.$this->CI->lang->line('profiler_section_hide').'\'?\''.$this->CI->lang->line('profiler_section_show').'\':\''.$this->CI->lang->line('profiler_section_hide').'\';">'.$this->CI->lang->line('profiler_section_hide').'</span>)';
@@ -204,13 +205,12 @@ class CI_Profiler {
$show_hide_js = '(<span style="cursor: pointer;" onclick="var s=document.getElementById(\'ci_profiler_queries_db_'.$count.'\').style;s.display=s.display==\'none\'?\'\':\'none\';this.innerHTML=this.innerHTML==\''.$this->CI->lang->line('profiler_section_show').'\'?\''.$this->CI->lang->line('profiler_section_hide').'\':\''.$this->CI->lang->line('profiler_section_show').'\';">'.$this->CI->lang->line('profiler_section_show').'</span>)';
}
- $output .= '<fieldset style="border:1px solid #0000FF;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
- $output .= "\n";
- $output .= '<legend style="color:#0000FF;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_database').':&nbsp; '.$db->database.'&nbsp;&nbsp;&nbsp;'.$this->CI->lang->line('profiler_queries').': '.count($db->queries).'&nbsp;&nbsp;'.$show_hide_js.'</legend>';
- $output .= "\n";
- $output .= "\n\n<table style='width:100%;{$hide_queries}' id='ci_profiler_queries_db_{$count}'>\n";
+ $output .= '<fieldset style="border:1px solid #0000FF;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'
+ . "\n"
+ . '<legend style="color:#0000FF;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_database').':&nbsp; '.$db->database.'&nbsp;&nbsp;&nbsp;'.$this->CI->lang->line('profiler_queries').': '.count($db->queries).'&nbsp;&nbsp;'.$show_hide_js.'</legend>'
+ . "\n\n\n<table style='width:100%;{$hide_queries}' id='ci_profiler_queries_db_{$count}'>\n";
- if (count($db->queries) == 0)
+ if (count($db->queries) === 0)
{
$output .= "<tr><td style='width:100%;color:#0000FF;font-weight:normal;background-color:#eee;padding:5px;'>".$this->CI->lang->line('profiler_no_queries')."</td></tr>\n";
}
@@ -231,8 +231,7 @@ class CI_Profiler {
}
}
- $output .= "</table>\n";
- $output .= "</fieldset>";
+ $output .= "</table>\n</fieldset>";
}
@@ -249,13 +248,13 @@ class CI_Profiler {
*/
protected function _compile_get()
{
- $output = "\n\n";
- $output .= '<fieldset id="ci_profiler_get" style="border:1px solid #cd6e00;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
- $output .= "\n";
- $output .= '<legend style="color:#cd6e00;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_get_data').'&nbsp;&nbsp;</legend>';
- $output .= "\n";
+ $output = "\n\n"
+ . '<fieldset id="ci_profiler_get" style="border:1px solid #cd6e00;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'
+ . "\n"
+ . '<legend style="color:#cd6e00;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_get_data').'&nbsp;&nbsp;</legend>'
+ . "\n";
- if (count($_GET) == 0)
+ if (count($_GET) === 0)
{
$output .= "<div style='color:#cd6e00;font-weight:normal;padding:4px 0 4px 0'>".$this->CI->lang->line('profiler_no_get')."</div>";
}
@@ -270,23 +269,15 @@ class CI_Profiler {
$key = "'".$key."'";
}
- $output .= "<tr><td style='width:50%;color:#000;background-color:#ddd;padding:5px'>&#36;_GET[".$key."]&nbsp;&nbsp; </td><td style='width:50%;padding:5px;color:#cd6e00;font-weight:normal;background-color:#ddd;'>";
- if (is_array($val))
- {
- $output .= "<pre>" . htmlspecialchars(stripslashes(print_r($val, true))) . "</pre>";
- }
- else
- {
- $output .= htmlspecialchars(stripslashes($val));
- }
- $output .= "</td></tr>\n";
+ $output .= "<tr><td style='width:50%;color:#000;background-color:#ddd;padding:5px'>&#36;_GET[".$key."]&nbsp;&nbsp; </td><td style='width:50%;padding:5px;color:#cd6e00;font-weight:normal;background-color:#ddd;'>"
+ . (is_array($val) ? "<pre>" . htmlspecialchars(stripslashes(print_r($val, true))) . "</pre>" : htmlspecialchars(stripslashes($val)))
+ . "</td></tr>\n";
}
$output .= "</table>\n";
}
- $output .= "</fieldset>";
- return $output;
+ return $output.'</fieldset>';
}
// --------------------------------------------------------------------
@@ -298,11 +289,11 @@ class CI_Profiler {
*/
protected function _compile_post()
{
- $output = "\n\n";
- $output .= '<fieldset id="ci_profiler_post" style="border:1px solid #009900;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
- $output .= "\n";
- $output .= '<legend style="color:#009900;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_post_data').'&nbsp;&nbsp;</legend>';
- $output .= "\n";
+ $output = "\n\n"
+ . '<fieldset id="ci_profiler_post" style="border:1px solid #009900;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'
+ . "\n"
+ . '<legend style="color:#009900;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_post_data').'&nbsp;&nbsp;</legend>'
+ . "\n";
if (count($_POST) == 0)
{
@@ -333,9 +324,8 @@ class CI_Profiler {
$output .= "</table>\n";
}
- $output .= "</fieldset>";
- return $output;
+ return $output.'</fieldset>';
}
// --------------------------------------------------------------------
@@ -347,24 +337,13 @@ class CI_Profiler {
*/
protected function _compile_uri_string()
{
- $output = "\n\n";
- $output .= '<fieldset id="ci_profiler_uri_string" style="border:1px solid #000;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
- $output .= "\n";
- $output .= '<legend style="color:#000;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_uri_string').'&nbsp;&nbsp;</legend>';
- $output .= "\n";
-
- if ($this->CI->uri->uri_string == '')
- {
- $output .= "<div style='color:#000;font-weight:normal;padding:4px 0 4px 0'>".$this->CI->lang->line('profiler_no_uri')."</div>";
- }
- else
- {
- $output .= "<div style='color:#000;font-weight:normal;padding:4px 0 4px 0'>".$this->CI->uri->uri_string."</div>";
- }
-
- $output .= "</fieldset>";
-
- return $output;
+ return "\n\n"
+ . '<fieldset id="ci_profiler_uri_string" style="border:1px solid #000;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'
+ . "\n"
+ . '<legend style="color:#000;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_uri_string').'&nbsp;&nbsp;</legend>'
+ . "\n<div style='color:#000;font-weight:normal;padding:4px 0 4px 0'>"
+ . ($this->CI->uri->uri_string == '' ? $this->CI->lang->line('profiler_no_uri') : $this->CI->uri->uri_string)
+ . '</div></fieldset>';
}
// --------------------------------------------------------------------
@@ -376,17 +355,12 @@ class CI_Profiler {
*/
protected function _compile_controller_info()
{
- $output = "\n\n";
- $output .= '<fieldset id="ci_profiler_controller_info" style="border:1px solid #995300;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
- $output .= "\n";
- $output .= '<legend style="color:#995300;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_controller_info').'&nbsp;&nbsp;</legend>';
- $output .= "\n";
-
- $output .= "<div style='color:#995300;font-weight:normal;padding:4px 0 4px 0'>".$this->CI->router->fetch_class()."/".$this->CI->router->fetch_method()."</div>";
-
- $output .= "</fieldset>";
-
- return $output;
+ return "\n\n"
+ . '<fieldset id="ci_profiler_controller_info" style="border:1px solid #995300;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'
+ . "\n"
+ . '<legend style="color:#995300;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_controller_info').'&nbsp;&nbsp;</legend>'
+ . "\n<div style='color:#995300;font-weight:normal;padding:4px 0 4px 0'>".$this->CI->router->fetch_class().'/'.$this->CI->router->fetch_method()
+ . '</div></fieldset>';
}
// --------------------------------------------------------------------
@@ -400,24 +374,13 @@ class CI_Profiler {
*/
protected function _compile_memory_usage()
{
- $output = "\n\n";
- $output .= '<fieldset id="ci_profiler_memory_usage" style="border:1px solid #5a0099;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
- $output .= "\n";
- $output .= '<legend style="color:#5a0099;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_memory_usage').'&nbsp;&nbsp;</legend>';
- $output .= "\n";
-
- if (function_exists('memory_get_usage') && ($usage = memory_get_usage()) != '')
- {
- $output .= "<div style='color:#5a0099;font-weight:normal;padding:4px 0 4px 0'>".number_format($usage).' bytes</div>';
- }
- else
- {
- $output .= "<div style='color:#5a0099;font-weight:normal;padding:4px 0 4px 0'>".$this->CI->lang->line('profiler_no_memory')."</div>";
- }
-
- $output .= "</fieldset>";
-
- return $output;
+ return "\n\n"
+ . '<fieldset id="ci_profiler_memory_usage" style="border:1px solid #5a0099;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'
+ . "\n"
+ . '<legend style="color:#5a0099;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_memory_usage').'&nbsp;&nbsp;</legend>'
+ . "\n<div style='color:#5a0099;font-weight:normal;padding:4px 0 4px 0'>"
+ . ((function_exists('memory_get_usage') && ($usage = memory_get_usage()) != '') ? number_format($usage).' bytes' : $this->CI->lang->line('profiler_no_memory'))
+ . '</div></fieldset>';
}
// --------------------------------------------------------------------
@@ -431,13 +394,11 @@ class CI_Profiler {
*/
protected function _compile_http_headers()
{
- $output = "\n\n";
- $output .= '<fieldset id="ci_profiler_http_headers" style="border:1px solid #000;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
- $output .= "\n";
- $output .= '<legend style="color:#000;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_headers').'&nbsp;&nbsp;(<span style="cursor: pointer;" onclick="var s=document.getElementById(\'ci_profiler_httpheaders_table\').style;s.display=s.display==\'none\'?\'\':\'none\';this.innerHTML=this.innerHTML==\''.$this->CI->lang->line('profiler_section_show').'\'?\''.$this->CI->lang->line('profiler_section_hide').'\':\''.$this->CI->lang->line('profiler_section_show').'\';">'.$this->CI->lang->line('profiler_section_show').'</span>)</legend>';
- $output .= "\n";
-
- $output .= "\n\n<table style='width:100%;display:none' id='ci_profiler_httpheaders_table'>\n";
+ $output = "\n\n"
+ . '<fieldset id="ci_profiler_http_headers" style="border:1px solid #000;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'
+ . "\n"
+ . '<legend style="color:#000;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_headers').'&nbsp;&nbsp;(<span style="cursor: pointer;" onclick="var s=document.getElementById(\'ci_profiler_httpheaders_table\').style;s.display=s.display==\'none\'?\'\':\'none\';this.innerHTML=this.innerHTML==\''.$this->CI->lang->line('profiler_section_show').'\'?\''.$this->CI->lang->line('profiler_section_hide').'\':\''.$this->CI->lang->line('profiler_section_show').'\';">'.$this->CI->lang->line('profiler_section_show').'</span>)</legend>'
+ . "\n\n\n<table style='width:100%;display:none' id='ci_profiler_httpheaders_table'>\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)
{
@@ -445,10 +406,7 @@ class CI_Profiler {
$output .= "<tr><td style='vertical-align: top;width:50%;padding:5px;color:#900;background-color:#ddd;'>".$header."&nbsp;&nbsp;</td><td style='width:50%;padding:5px;color:#000;background-color:#ddd;'>".$val."</td></tr>\n";
}
- $output .= "</table>\n";
- $output .= "</fieldset>";
-
- return $output;
+ return $output."</table>\n</fieldset>";
}
// --------------------------------------------------------------------
@@ -462,13 +420,11 @@ class CI_Profiler {
*/
protected function _compile_config()
{
- $output = "\n\n";
- $output .= '<fieldset id="ci_profiler_config" style="border:1px solid #000;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
- $output .= "\n";
- $output .= '<legend style="color:#000;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_config').'&nbsp;&nbsp;(<span style="cursor: pointer;" onclick="var s=document.getElementById(\'ci_profiler_config_table\').style;s.display=s.display==\'none\'?\'\':\'none\';this.innerHTML=this.innerHTML==\''.$this->CI->lang->line('profiler_section_show').'\'?\''.$this->CI->lang->line('profiler_section_hide').'\':\''.$this->CI->lang->line('profiler_section_show').'\';">'.$this->CI->lang->line('profiler_section_show').'</span>)</legend>';
- $output .= "\n";
-
- $output .= "\n\n<table style='width:100%; display:none' id='ci_profiler_config_table'>\n";
+ $output = "\n\n"
+ . '<fieldset id="ci_profiler_config" style="border:1px solid #000;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'
+ . "\n"
+ . '<legend style="color:#000;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_config').'&nbsp;&nbsp;(<span style="cursor: pointer;" onclick="var s=document.getElementById(\'ci_profiler_config_table\').style;s.display=s.display==\'none\'?\'\':\'none\';this.innerHTML=this.innerHTML==\''.$this->CI->lang->line('profiler_section_show').'\'?\''.$this->CI->lang->line('profiler_section_hide').'\':\''.$this->CI->lang->line('profiler_section_show').'\';">'.$this->CI->lang->line('profiler_section_show').'</span>)</legend>'
+ . "\n\n\n<table style='width:100%; display:none' id='ci_profiler_config_table'>\n";
foreach ($this->CI->config->config as $config=>$val)
{
@@ -480,10 +436,7 @@ class CI_Profiler {
$output .= "<tr><td style='padding:5px; vertical-align: top;color:#900;background-color:#ddd;'>".$config."&nbsp;&nbsp;</td><td style='padding:5px; color:#000;background-color:#ddd;'>".htmlspecialchars($val)."</td></tr>\n";
}
- $output .= "</table>\n";
- $output .= "</fieldset>";
-
- return $output;
+ return $output."</table>\n</fieldset>";
}
// --------------------------------------------------------------------
@@ -493,20 +446,20 @@ class CI_Profiler {
*
* @return string
*/
- private function _compile_session_data()
+ protected function _compile_session_data()
{
if ( ! isset($this->CI->session))
{
return;
}
- $output = '<fieldset id="ci_profiler_csession" style="border:1px solid #000;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
- $output .= '<legend style="color:#000;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_session_data').'&nbsp;&nbsp;(<span style="cursor: pointer;" onclick="var s=document.getElementById(\'ci_profiler_session_data\').style;s.display=s.display==\'none\'?\'\':\'none\';this.innerHTML=this.innerHTML==\''.$this->CI->lang->line('profiler_section_show').'\'?\''.$this->CI->lang->line('profiler_section_hide').'\':\''.$this->CI->lang->line('profiler_section_show').'\';">'.$this->CI->lang->line('profiler_section_show').'</span>)</legend>';
- $output .= "<table style='width:100%;display:none' id='ci_profiler_session_data'>";
+ $output = '<fieldset id="ci_profiler_csession" style="border:1px solid #000;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'
+ . '<legend style="color:#000;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_session_data').'&nbsp;&nbsp;(<span style="cursor: pointer;" onclick="var s=document.getElementById(\'ci_profiler_session_data\').style;s.display=s.display==\'none\'?\'\':\'none\';this.innerHTML=this.innerHTML==\''.$this->CI->lang->line('profiler_section_show').'\'?\''.$this->CI->lang->line('profiler_section_hide').'\':\''.$this->CI->lang->line('profiler_section_show').'\';">'.$this->CI->lang->line('profiler_section_show').'</span>)</legend>'
+ . "<table style='width:100%;display:none' id='ci_profiler_session_data'>";
foreach ($this->CI->session->all_userdata() as $key => $val)
{
- if (is_array($val))
+ if (is_array($val) || is_object($val))
{
$val = print_r($val, TRUE);
}
@@ -514,9 +467,7 @@ class CI_Profiler {
$output .= "<tr><td style='padding:5px; vertical-align: top;color:#900;background-color:#ddd;'>".$key."&nbsp;&nbsp;</td><td style='padding:5px; color:#000;background-color:#ddd;'>".htmlspecialchars($val)."</td></tr>\n";
}
- $output .= '</table>';
- $output .= "</fieldset>";
- return $output;
+ return $output."</table>\n</fieldset>";
}
// --------------------------------------------------------------------
@@ -541,18 +492,16 @@ class CI_Profiler {
}
}
- if ($fields_displayed == 0)
+ if ($fields_displayed === 0)
{
$output .= '<p style="border:1px solid #5a0099;padding:10px;margin:20px 0;background-color:#eee">'.$this->CI->lang->line('profiler_no_profiles').'</p>';
}
- $output .= '</div>';
-
- return $output;
+ return $output.'</div>';
}
}
// END CI_Profiler class
/* End of file Profiler.php */
-/* Location: ./system/libraries/Profiler.php */ \ No newline at end of file
+/* Location: ./system/libraries/Profiler.php */
diff --git a/system/libraries/Session.php b/system/libraries/Session.php
index 8ee08c5b2..66b39a6a2 100644
--- a/system/libraries/Session.php
+++ b/system/libraries/Session.php
@@ -1,51 +1,61 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* Session Class
*
* @package CodeIgniter
* @subpackage Libraries
* @category Sessions
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/sessions.html
*/
class CI_Session {
- var $sess_encrypt_cookie = FALSE;
- 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';
- var $cookie_prefix = '';
- var $cookie_path = '';
- var $cookie_domain = '';
- var $cookie_secure = FALSE;
- var $sess_time_to_update = 300;
- var $encryption_key = '';
- var $flashdata_key = 'flash';
- var $time_reference = 'time';
- var $gc_probability = 5;
- var $userdata = array();
- var $CI;
- var $now;
+ public $sess_encrypt_cookie = FALSE;
+ public $sess_use_database = FALSE;
+ public $sess_table_name = '';
+ public $sess_expiration = 7200;
+ public $sess_expire_on_close = FALSE;
+ public $sess_match_ip = FALSE;
+ public $sess_match_useragent = TRUE;
+ public $sess_cookie_name = 'ci_session';
+ public $cookie_prefix = '';
+ public $cookie_path = '';
+ public $cookie_domain = '';
+ public $cookie_secure = FALSE;
+ public $sess_time_to_update = 300;
+ public $encryption_key = '';
+ public $flashdata_key = 'flash';
+ public $time_reference = 'time';
+ public $gc_probability = 5;
+ public $userdata = array();
+ public $CI;
+ public $now;
/**
* Session Constructor
@@ -55,7 +65,7 @@ class CI_Session {
*/
public function __construct($params = array())
{
- log_message('debug', "Session Class Initialized");
+ log_message('debug', 'Session Class Initialized');
// Set the super object to a local variable for use throughout the class
$this->CI =& get_instance();
@@ -81,14 +91,14 @@ class CI_Session {
$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 != '')
+ // Are we using a database? If so, load it
+ if ($this->sess_use_database === TRUE && $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
+ // 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
@@ -97,12 +107,12 @@ class CI_Session {
{
$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.
+ // create a new one. If it does, we'll update it.
if ( ! $this->sess_read())
{
$this->sess_create();
@@ -121,7 +131,7 @@ class CI_Session {
// Delete expired sessions if necessary
$this->_sess_gc();
- log_message('debug', "Session routines successfully run");
+ log_message('debug', 'Session routines successfully run');
}
// --------------------------------------------------------------------
@@ -129,10 +139,9 @@ class CI_Session {
/**
* Fetch the current session data if it exists
*
- * @access public
* @return bool
*/
- function sess_read()
+ public function sess_read()
{
// Fetch the cookie
$session = $this->CI->input->cookie($this->sess_cookie_name);
@@ -155,7 +164,7 @@ class CI_Session {
$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
+ // 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.');
@@ -168,7 +177,7 @@ class CI_Session {
$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']))
+ if ( ! is_array($session) OR ! isset($session['session_id'], $session['ip_address'], $session['user_agent'], $session['last_activity']))
{
$this->sess_destroy();
return FALSE;
@@ -181,15 +190,15 @@ class CI_Session {
return FALSE;
}
- // Does the IP Match?
- if ($this->sess_match_ip == TRUE AND $session['ip_address'] != $this->CI->input->ip_address())
+ // Does the IP match?
+ if ($this->sess_match_ip == TRUE && $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, 120)))
+ if ($this->sess_match_useragent == TRUE && trim($session['user_agent']) !== trim(substr($this->CI->input->user_agent(), 0, 120)))
{
$this->sess_destroy();
return FALSE;
@@ -212,8 +221,8 @@ class CI_Session {
$query = $this->CI->db->get($this->sess_table_name);
- // No result? Kill it!
- if ($query->num_rows() == 0)
+ // No result? Kill it!
+ if ($query->num_rows() === 0)
{
$this->sess_destroy();
return FALSE;
@@ -221,7 +230,7 @@ class CI_Session {
// 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 != '')
+ if (isset($row->user_data) && $row->user_data != '')
{
$custom_data = $this->_unserialize($row->user_data);
@@ -247,10 +256,9 @@ class CI_Session {
/**
* Write the session data
*
- * @access public
* @return void
*/
- function sess_write()
+ public 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)
@@ -272,7 +280,7 @@ class CI_Session {
$cookie_userdata[$val] = $this->userdata[$val];
}
- // Did we find any custom data? If not, we turn the empty array into a string
+ // 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)
{
@@ -288,7 +296,7 @@ class CI_Session {
$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
+ // 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);
@@ -299,28 +307,27 @@ class CI_Session {
/**
* Create a new session
*
- * @access public
* @return void
*/
- function sess_create()
+ public function sess_create()
{
$sessid = '';
- while (strlen($sessid) < 32)
+ do
{
$sessid .= mt_rand(0, mt_getrandmax());
}
+ while (strlen($sessid) < 32);
// 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, 120),
- 'last_activity' => $this->now,
- 'user_data' => ''
- );
-
+ 'session_id' => md5(uniqid($sessid, TRUE)),
+ 'ip_address' => $this->CI->input->ip_address(),
+ 'user_agent' => substr($this->CI->input->user_agent(), 0, 120),
+ 'last_activity' => $this->now,
+ 'user_data' => ''
+ );
// Save the data to the DB if needed
if ($this->sess_use_database === TRUE)
@@ -337,10 +344,9 @@ class CI_Session {
/**
* Update an existing session
*
- * @access public
* @return void
*/
- function sess_update()
+ public 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)
@@ -348,29 +354,52 @@ class CI_Session {
return;
}
+ // _set_cookie() will handle this for us if we aren't using database sessions
+ // by pushing all userdata to the cookie.
+ $cookie_data = NULL;
+
+ /* Changing the session ID during an AJAX call causes problems,
+ * so we'll only update our last_activity
+ */
+ if ($this->CI->input->is_ajax_request())
+ {
+ $this->userdata['last_activity'] = $this->now;
+
+ // 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->userdata['last_activity']),
+ array('session_id' => $this->userdata['session_id'])));
+ }
+
+ return $this->_set_cookie($cookie_data);
+ }
+
// 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)
+ do
{
$new_sessid .= mt_rand(0, mt_getrandmax());
}
+ while (strlen($new_sessid) < 32);
// 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;
+ // Turn it into a hash and update the session data array
+ $this->userdata['session_id'] = $new_sessid = md5(uniqid($new_sessid, TRUE));
$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)
{
@@ -393,13 +422,12 @@ class CI_Session {
/**
* Destroy the current session
*
- * @access public
* @return void
*/
- function sess_destroy()
+ public function sess_destroy()
{
// Kill the session DB row
- if ($this->sess_use_database === TRUE AND isset($this->userdata['session_id']))
+ if ($this->sess_use_database === TRUE && isset($this->userdata['session_id']))
{
$this->CI->db->where('session_id', $this->userdata['session_id']);
$this->CI->db->delete($this->sess_table_name);
@@ -407,13 +435,13 @@ class CI_Session {
// Kill the cookie
setcookie(
- $this->sess_cookie_name,
- addslashes(serialize(array())),
- ($this->now - 31500000),
- $this->cookie_path,
- $this->cookie_domain,
- 0
- );
+ $this->sess_cookie_name,
+ addslashes(serialize(array())),
+ ($this->now - 31500000),
+ $this->cookie_path,
+ $this->cookie_domain,
+ 0
+ );
}
// --------------------------------------------------------------------
@@ -421,11 +449,10 @@ class CI_Session {
/**
* Fetch a specific item from the session array
*
- * @access public
* @param string
* @return string
*/
- function userdata($item)
+ public function userdata($item)
{
return ( ! isset($this->userdata[$item])) ? FALSE : $this->userdata[$item];
}
@@ -435,10 +462,9 @@ class CI_Session {
/**
* Fetch all session data
*
- * @access public
* @return array
*/
- function all_userdata()
+ public function all_userdata()
{
return $this->userdata;
}
@@ -448,12 +474,11 @@ class CI_Session {
/**
* Add or change data in the "userdata" array
*
- * @access public
* @param mixed
* @param string
* @return void
*/
- function set_userdata($newdata = array(), $newval = '')
+ public function set_userdata($newdata = array(), $newval = '')
{
if (is_string($newdata))
{
@@ -476,10 +501,9 @@ class CI_Session {
/**
* Delete a session variable from the "userdata" array
*
- * @access array
* @return void
*/
- function unset_userdata($newdata = array())
+ public function unset_userdata($newdata = array())
{
if (is_string($newdata))
{
@@ -503,12 +527,11 @@ class CI_Session {
* Add or change flashdata, only available
* until the next request
*
- * @access public
* @param mixed
* @param string
* @return void
*/
- function set_flashdata($newdata = array(), $newval = '')
+ public function set_flashdata($newdata = array(), $newval = '')
{
if (is_string($newdata))
{
@@ -519,8 +542,7 @@ class CI_Session {
{
foreach ($newdata as $key => $val)
{
- $flashdata_key = $this->flashdata_key.':new:'.$key;
- $this->set_userdata($flashdata_key, $val);
+ $this->set_userdata($this->flashdata_key.':new:'.$key, $val);
}
}
}
@@ -530,21 +552,18 @@ class CI_Session {
/**
* Keeps existing flashdata available to next request.
*
- * @access public
* @param string
* @return void
*/
- function keep_flashdata($key)
+ public function keep_flashdata($key)
{
- // 'old' flashdata gets removed. Here we mark all
+ // '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);
+ $value = $this->userdata($this->flashdata_key.':old:'.$key);
- $new_flashdata_key = $this->flashdata_key.':new:'.$key;
- $this->set_userdata($new_flashdata_key, $value);
+ $this->set_userdata($this->flashdata_key.':new:'.$key, $value);
}
// ------------------------------------------------------------------------
@@ -552,14 +571,12 @@ class CI_Session {
/**
* Fetch a specific flashdata item from the session array
*
- * @access public
* @param string
* @return string
*/
- function flashdata($key)
+ public function flashdata($key)
{
- $flashdata_key = $this->flashdata_key.':old:'.$key;
- return $this->userdata($flashdata_key);
+ return $this->userdata($this->flashdata_key.':old:'.$key);
}
// ------------------------------------------------------------------------
@@ -568,10 +585,9 @@ class CI_Session {
* Identifies flashdata as 'old' for removal
* when _flashdata_sweep() runs.
*
- * @access private
* @return void
*/
- function _flashdata_mark()
+ protected function _flashdata_mark()
{
$userdata = $this->all_userdata();
foreach ($userdata as $name => $value)
@@ -579,8 +595,7 @@ class CI_Session {
$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->set_userdata($this->flashdata_key.':old:'.$parts[1], $value);
$this->unset_userdata($name);
}
}
@@ -591,11 +606,9 @@ class CI_Session {
/**
* Removes all flashdata marked as 'old'
*
- * @access private
* @return void
*/
-
- function _flashdata_sweep()
+ protected function _flashdata_sweep()
{
$userdata = $this->all_userdata();
foreach ($userdata as $key => $value)
@@ -613,22 +626,13 @@ class CI_Session {
/**
* Get the "now" time
*
- * @access private
* @return string
*/
- function _get_time()
+ protected 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;
+ return (strtolower($this->time_reference) === 'gmt')
+ ? mktime(gmdate('H'), gmdate('i'), gmdate('s'), gmdate('m'), gmdate('d'), gmdate('Y'))
+ : time();
}
// --------------------------------------------------------------------
@@ -636,10 +640,9 @@ class CI_Session {
/**
* Write the session cookie
*
- * @access public
* @return void
*/
- function _set_cookie($cookie_data = NULL)
+ protected function _set_cookie($cookie_data = NULL)
{
if (is_null($cookie_data))
{
@@ -663,13 +666,13 @@ class CI_Session {
// Set the cookie
setcookie(
- $this->sess_cookie_name,
- $cookie_data,
- $expire,
- $this->cookie_path,
- $this->cookie_domain,
- $this->cookie_secure
- );
+ $this->sess_cookie_name,
+ $cookie_data,
+ $expire,
+ $this->cookie_path,
+ $this->cookie_domain,
+ $this->cookie_secure
+ );
}
// --------------------------------------------------------------------
@@ -680,33 +683,39 @@ class CI_Session {
* 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)
+ protected function _serialize($data)
{
if (is_array($data))
{
- foreach ($data as $key => $val)
- {
- if (is_string($val))
- {
- $data[$key] = str_replace('\\', '{{slash}}', $val);
- }
- }
+ array_walk_recursive($data, array(&$this, '_escape_slashes'));
}
- else
+ elseif (is_string($data))
{
- if (is_string($data))
- {
- $data = str_replace('\\', '{{slash}}', $data);
- }
+ $data = str_replace('\\', '{{slash}}', $data);
}
-
return serialize($data);
}
+ /**
+ * Escape slashes
+ *
+ * This function converts any slashes found into a temporary marker
+ *
+ * @param string
+ * @param string
+ * @return void
+ */
+ protected function _escape_slashes(&$val, $key)
+ {
+ if (is_string($val))
+ {
+ $val = str_replace('\\', '{{slash}}', $val);
+ }
+ }
+
// --------------------------------------------------------------------
/**
@@ -715,30 +724,39 @@ class CI_Session {
* 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)
+ protected function _unserialize($data)
{
$data = @unserialize(strip_slashes($data));
if (is_array($data))
{
- foreach ($data as $key => $val)
- {
- if (is_string($val))
- {
- $data[$key] = str_replace('{{slash}}', '\\', $val);
- }
- }
-
+ array_walk_recursive($data, array(&$this, '_unescape_slashes'));
return $data;
}
return (is_string($data)) ? str_replace('{{slash}}', '\\', $data) : $data;
}
+ /**
+ * Unescape slashes
+ *
+ * This function converts any slash markers back into actual slashes
+ *
+ * @param string
+ * @param string
+ * @return void
+ */
+ protected function _unescape_slashes(&$val, $key)
+ {
+ if (is_string($val))
+ {
+ $val= str_replace('{{slash}}', '\\', $val);
+ }
+ }
+
// --------------------------------------------------------------------
/**
@@ -747,10 +765,9 @@ class CI_Session {
* This deletes expired session rows from database
* if the probability percentage is met
*
- * @access public
* @return void
*/
- function _sess_gc()
+ protected function _sess_gc()
{
if ($this->sess_use_database != TRUE)
{
@@ -769,9 +786,7 @@ class CI_Session {
}
}
-
}
-// END Session Class
/* End of file Session.php */
-/* Location: ./system/libraries/Session.php */ \ No newline at end of file
+/* Location: ./system/libraries/Session.php */
diff --git a/system/libraries/Sha1.php b/system/libraries/Sha1.php
deleted file mode 100644
index 1a657572b..000000000
--- a/system/libraries/Sha1.php
+++ /dev/null
@@ -1,251 +0,0 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
-/**
- * CodeIgniter
- *
- * An open source application development framework for PHP 5.1.6 or newer
- *
- * @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
- * @link http://codeigniter.com
- * @since Version 1.0
- * @filesource
- */
-
-// ------------------------------------------------------------------------
-
-/**
- * SHA1 Encoding Class
- *
- * Purpose: Provides 160 bit hashing using The Secure Hash Algorithm
- * developed at the National Institute of Standards and Technology. The 40
- * character SHA1 message hash is computationally infeasible to crack.
- *
- * This class is a fallback for servers that are not running PHP greater than
- * 4.3, or do not have the MHASH library.
- *
- * This class is based on two scripts:
- *
- * Marcus Campbell's PHP implementation (GNU license)
- * http://www.tecknik.net/sha-1/
- *
- * ...which is based on Paul Johnston's JavaScript version
- * (BSD license). http://pajhome.org.uk/
- *
- * I encapsulated the functions and wrote one additional method to fix
- * a hex conversion bug. - Rick Ellis
- *
- * @package CodeIgniter
- * @subpackage Libraries
- * @category Encryption
- * @author ExpressionEngine Dev Team
- * @link http://codeigniter.com/user_guide/general/encryption.html
- */
-class CI_SHA1 {
-
- public function __construct()
- {
- log_message('debug', "SHA1 Class Initialized");
- }
-
- /**
- * Generate the Hash
- *
- * @access public
- * @param string
- * @return string
- */
- function generate($str)
- {
- $n = ((strlen($str) + 8) >> 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 < count($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
-
-/* End of file Sha1.php */
-/* Location: ./system/libraries/Sha1.php */ \ No newline at end of file
diff --git a/system/libraries/Table.php b/system/libraries/Table.php
index def696776..fb154e50f 100644
--- a/system/libraries/Table.php
+++ b/system/libraries/Table.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.3.1
* @filesource
@@ -23,19 +35,19 @@
* @package CodeIgniter
* @subpackage Libraries
* @category HTML Tables
- * @author ExpressionEngine Dev Team
- * @link http://codeigniter.com/user_guide/libraries/uri.html
+ * @author EllisLab Dev Team
+ * @link http://codeigniter.com/user_guide/libraries/table.html
*/
class CI_Table {
- var $rows = array();
- var $heading = array();
- var $auto_heading = TRUE;
- var $caption = NULL;
- var $template = NULL;
- var $newline = "\n";
- var $empty_cells = "";
- var $function = FALSE;
+ public $rows = array();
+ public $heading = array();
+ public $auto_heading = TRUE;
+ public $caption = NULL;
+ public $template = NULL;
+ public $newline = "\n";
+ public $empty_cells = '';
+ public $function = FALSE;
public function __construct()
{
@@ -47,11 +59,10 @@ class CI_Table {
/**
* Set the template
*
- * @access public
* @param array
* @return void
*/
- function set_template($template)
+ public function set_template($template)
{
if ( ! is_array($template))
{
@@ -68,11 +79,10 @@ class CI_Table {
*
* Can be passed as an array or discreet params
*
- * @access public
* @param mixed
* @return void
*/
- function set_heading()
+ public function set_heading()
{
$args = func_get_args();
$this->heading = $this->_prep_args($args);
@@ -86,14 +96,13 @@ class CI_Table {
* 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)
+ public function make_columns($array = array(), $col_limit = 0)
{
- if ( ! is_array($array) OR count($array) == 0)
+ if ( ! is_array($array) OR count($array) === 0)
{
return FALSE;
}
@@ -108,7 +117,7 @@ class CI_Table {
}
$new = array();
- while (count($array) > 0)
+ do
{
$temp = array_splice($array, 0, $col_limit);
@@ -122,6 +131,7 @@ class CI_Table {
$new[] = $temp;
}
+ while (count($array) > 0);
return $new;
}
@@ -133,11 +143,10 @@ class CI_Table {
*
* Can be passed as an array or discreet params
*
- * @access public
* @param mixed
* @return void
*/
- function set_empty($value)
+ public function set_empty($value)
{
$this->empty_cells = $value;
}
@@ -149,11 +158,10 @@ class CI_Table {
*
* Can be passed as an array or discreet params
*
- * @access public
* @param mixed
* @return void
*/
- function add_row()
+ public function add_row()
{
$args = func_get_args();
$this->rows[] = $this->_prep_args($args);
@@ -166,16 +174,15 @@ class CI_Table {
*
* Ensures a standard associative array format for all cell data
*
- * @access public
* @param type
* @return type
*/
- function _prep_args($args)
+ protected 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])))
+ if (isset($args[0]) AND (count($args) === 1 && is_array($args[0])))
{
// args sent as indexed array
if ( ! isset($args[0]['data']))
@@ -212,11 +219,10 @@ class CI_Table {
/**
* Add a table caption
*
- * @access public
* @param string
* @return void
*/
- function set_caption($caption)
+ public function set_caption($caption)
{
$this->caption = $caption;
}
@@ -226,11 +232,10 @@ class CI_Table {
/**
* Generate the table
*
- * @access public
* @param mixed
* @return string
*/
- function generate($table_data = NULL)
+ public function generate($table_data = NULL)
{
// The table data can optionally be passed to this function
// either as a database result object or an array
@@ -242,13 +247,13 @@ class CI_Table {
}
elseif (is_array($table_data))
{
- $set_heading = (count($this->heading) == 0 AND $this->auto_heading == FALSE) ? FALSE : TRUE;
+ $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)
+ if (count($this->heading) === 0 AND count($this->rows) === 0)
{
return 'Undefined table data';
}
@@ -261,24 +266,18 @@ class CI_Table {
// Build the table!
- $out = $this->template['table_open'];
- $out .= $this->newline;
+ $out = $this->template['table_open'].$this->newline;
// Add any caption here
if ($this->caption)
{
- $out .= $this->newline;
- $out .= '<caption>' . $this->caption . '</caption>';
- $out .= $this->newline;
+ $out .= $this->newline.'<caption>'.$this->caption.'</caption>'.$this->newline;
}
// 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->template['thead_open'].$this->newline.$this->template['heading_row_start'].$this->newline;
foreach ($this->heading as $heading)
{
@@ -292,22 +291,16 @@ class CI_Table {
}
}
- $out .= $temp;
- $out .= isset($heading['data']) ? $heading['data'] : '';
- $out .= $this->template['heading_cell_end'];
+ $out .= $temp.(isset($heading['data']) ? $heading['data'] : '').$this->template['heading_cell_end'];
}
- $out .= $this->template['heading_row_end'];
- $out .= $this->newline;
- $out .= $this->template['thead_close'];
- $out .= $this->newline;
+ $out .= $this->template['heading_row_end'].$this->newline.$this->template['thead_close'].$this->newline;
}
// Build the table rows
if (count($this->rows) > 0)
{
- $out .= $this->template['tbody_open'];
- $out .= $this->newline;
+ $out .= $this->template['tbody_open'].$this->newline;
$i = 1;
foreach ($this->rows as $row)
@@ -320,8 +313,7 @@ class CI_Table {
// We use modulus to alternate the row colors
$name = (fmod($i++, 2)) ? '' : 'alt_';
- $out .= $this->template['row_'.$name.'start'];
- $out .= $this->newline;
+ $out .= $this->template['row_'.$name.'start'].$this->newline;
foreach ($row as $cell)
{
@@ -329,7 +321,7 @@ class CI_Table {
foreach ($cell as $key => $val)
{
- if ($key != 'data')
+ if ($key !== 'data')
{
$temp = str_replace('<td', "<td $key='$val'", $temp);
}
@@ -357,12 +349,10 @@ class CI_Table {
$out .= $this->template['cell_'.$name.'end'];
}
- $out .= $this->template['row_'.$name.'end'];
- $out .= $this->newline;
+ $out .= $this->template['row_'.$name.'end'].$this->newline;
}
- $out .= $this->template['tbody_close'];
- $out .= $this->newline;
+ $out .= $this->template['tbody_close'].$this->newline;
}
$out .= $this->template['table_close'];
@@ -378,10 +368,9 @@ class CI_Table {
/**
* Clears the table arrays. Useful if multiple tables are being generated
*
- * @access public
* @return void
*/
- function clear()
+ public function clear()
{
$this->rows = array();
$this->heading = array();
@@ -393,11 +382,10 @@ class CI_Table {
/**
* Set table data from a database result object
*
- * @access public
* @param object
* @return void
*/
- function _set_from_object($query)
+ protected function _set_from_object($query)
{
if ( ! is_object($query))
{
@@ -405,7 +393,7 @@ class CI_Table {
}
// First generate the headings from the table column names
- if (count($this->heading) == 0)
+ if (count($this->heading) === 0)
{
if ( ! method_exists($query, 'list_fields'))
{
@@ -431,13 +419,12 @@ class CI_Table {
/**
* Set table data from an array
*
- * @access public
* @param array
* @return void
*/
- function _set_from_array($data, $set_heading = TRUE)
+ protected function _set_from_array($data, $set_heading = TRUE)
{
- if ( ! is_array($data) OR count($data) == 0)
+ if ( ! is_array($data) OR count($data) === 0)
{
return FALSE;
}
@@ -446,7 +433,7 @@ class CI_Table {
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)
+ if ($i++ === 0 AND count($data) > 1 AND count($this->heading) === 0 AND $set_heading == TRUE)
{
$this->heading = $this->_prep_args($row);
}
@@ -454,8 +441,6 @@ class CI_Table {
{
$this->rows[] = $this->_prep_args($row);
}
-
- $i++;
}
}
@@ -464,10 +449,9 @@ class CI_Table {
/**
* Compile Template
*
- * @access private
* @return void
*/
- function _compile_template()
+ protected function _compile_template()
{
if ($this->template == NULL)
{
@@ -490,10 +474,9 @@ class CI_Table {
/**
* Default Template
*
- * @access private
* @return void
*/
- function _default_template()
+ protected function _default_template()
{
return array (
'table_open' => '<table border="0" cellpadding="4" cellspacing="0">',
@@ -526,6 +509,5 @@ class CI_Table {
}
-
/* End of file Table.php */
-/* Location: ./system/libraries/Table.php */ \ No newline at end of file
+/* Location: ./system/libraries/Table.php */
diff --git a/system/libraries/Trackback.php b/system/libraries/Trackback.php
index b0a767822..79a009133 100644
--- a/system/libraries/Trackback.php
+++ b/system/libraries/Trackback.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -23,23 +35,18 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Trackbacks
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/trackback.html
*/
class CI_Trackback {
- var $time_format = 'local';
- var $charset = 'UTF-8';
- var $data = array('url' => '', 'title' => '', 'excerpt' => '', 'blog_name' => '', 'charset' => '');
- var $convert_ascii = TRUE;
- var $response = '';
- var $error_msg = array();
+ public $time_format = 'local';
+ public $charset = 'UTF-8';
+ public $data = array('url' => '', 'title' => '', 'excerpt' => '', 'blog_name' => '', 'charset' => '');
+ public $convert_ascii = TRUE;
+ public $response = '';
+ public $error_msg = array();
- /**
- * Constructor
- *
- * @access public
- */
public function __construct()
{
log_message('debug', "Trackback Class Initialized");
@@ -50,11 +57,10 @@ class CI_Trackback {
/**
* Send Trackback
*
- * @access public
* @param array
* @return bool
*/
- function send($tb_data)
+ public function send($tb_data)
{
if ( ! is_array($tb_data))
{
@@ -84,20 +90,9 @@ class CI_Trackback {
}
// Convert High ASCII Characters
- if ($this->convert_ascii == TRUE)
+ if ($this->convert_ascii == TRUE && in_array($item, array('excerpt', 'title', 'blog_name')))
{
- 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);
- }
+ $$item = $this->convert_ascii($$item);
}
}
@@ -132,10 +127,9 @@ class CI_Trackback {
* 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()
+ public function receive()
{
foreach (array('url', 'title', 'blog_name', 'excerpt') as $val)
{
@@ -174,11 +168,10 @@ class CI_Trackback {
* sends the "incomplete information" error, as that's
* the most common one.
*
- * @access public
* @param string
* @return void
*/
- function send_error($message = 'Incomplete Information')
+ public function send_error($message = 'Incomplete Information')
{
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?".">\n<response>\n<error>1</error>\n<message>".$message."</message>\n</response>";
exit;
@@ -192,10 +185,9 @@ class CI_Trackback {
* This should be called when a trackback has been
* successfully received and inserted.
*
- * @access public
* @return void
*/
- function send_success()
+ public function send_success()
{
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?".">\n<response>\n<error>0</error>\n</response>";
exit;
@@ -206,11 +198,10 @@ class CI_Trackback {
/**
* Fetch a particular item
*
- * @access public
* @param string
* @return string
*/
- function data($item)
+ public function data($item)
{
return ( ! isset($this->data[$item])) ? '' : $this->data[$item];
}
@@ -223,12 +214,11 @@ class CI_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)
+ public function process($url, $data)
{
$target = parse_url($url);
@@ -268,15 +258,9 @@ class CI_Trackback {
@fclose($fp);
- if (stristr($this->response, '<error>0</error>') === FALSE)
+ if (stripos($this->response, '<error>0</error>') === FALSE)
{
- $message = 'An unknown error was encountered';
-
- if (preg_match("/<message>(.*?)<\/message>/is", $this->response, $match))
- {
- $message = trim($match['1']);
- }
-
+ $message = (preg_match('/<message>(.*?)<\/message>/is', $this->response, $match)) ? trim($match[1]) : 'An unknown error was encountered';
$this->set_error($message);
return FALSE;
}
@@ -293,11 +277,10 @@ class CI_Trackback {
* 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)
+ public function extract_urls($urls)
{
// Remove the pesky white space and replace with a comma.
$urls = preg_replace("/\s*(\S+)\s*/", "\\1,", $urls);
@@ -306,7 +289,7 @@ class CI_Trackback {
$urls = str_replace(",,", ",", $urls);
// Remove any comma that might be at the end
- if (substr($urls, -1) == ",")
+ if (substr($urls, -1) === ',')
{
$urls = substr($urls, 0, -1);
}
@@ -329,17 +312,16 @@ class CI_Trackback {
*
* Simply adds "http://" if missing
*
- * @access public
* @param string
* @return string
*/
- function validate_url($url)
+ public function validate_url($url)
{
$url = trim($url);
- if (substr($url, 0, 4) != "http")
+ if (strpos($url, 'http') !== 0)
{
- $url = "http://".$url;
+ $url = 'http://'.$url;
}
}
@@ -348,11 +330,10 @@ class CI_Trackback {
/**
* Find the Trackback URL's ID
*
- * @access public
* @param string
* @return string
*/
- function get_id($url)
+ public function get_id($url)
{
$tb_id = "";
@@ -397,23 +378,20 @@ class CI_Trackback {
/**
* Convert Reserved XML characters to Entities
*
- * @access public
* @param string
* @return string
*/
- function convert_xml($str)
+ public function convert_xml($str)
{
$temp = '__TEMP_AMPERSANDS__';
- $str = preg_replace("/&#(\d+);/", "$temp\\1;", $str);
- $str = preg_replace("/&(\w+);/", "$temp\\1;", $str);
+ $str = preg_replace(array('/&#(\d+);/', '/&(\w+);/'), "$temp\\1;", $str);
$str = str_replace(array("&","<",">","\"", "'", "-"),
array("&amp;", "&lt;", "&gt;", "&quot;", "&#39;", "&#45;"),
$str);
- $str = preg_replace("/$temp(\d+);/","&#\\1;",$str);
- $str = preg_replace("/$temp(\w+);/","&\\1;", $str);
+ $str = preg_replace(array("/$temp(\d+);/", "/$temp(\w+);/"), array('&#\\1;', '&\\1;'), $str);
return $str;
}
@@ -425,13 +403,12 @@ class CI_Trackback {
*
* 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 = '&#8230;')
+ public function limit_characters($str, $n = 500, $end_char = '&#8230;')
{
if (strlen($str) < $n)
{
@@ -445,13 +422,13 @@ class CI_Trackback {
return $str;
}
- $out = "";
+ $out = '';
foreach (explode(' ', trim($str)) as $val)
{
$out .= $val.' ';
if (strlen($out) >= $n)
{
- return trim($out).$end_char;
+ return rtrim($out).$end_char;
}
}
}
@@ -464,11 +441,10 @@ class CI_Trackback {
* Converts Hight ascii text and MS Word special chars
* to character entities
*
- * @access public
* @param string
* @return string
*/
- function convert_ascii($str)
+ public function convert_ascii($str)
{
$count = 1;
$out = '';
@@ -484,16 +460,16 @@ class CI_Trackback {
}
else
{
- if (count($temp) == 0)
+ if (count($temp) === 0)
{
$count = ($ordinal < 224) ? 2 : 3;
}
$temp[] = $ordinal;
- if (count($temp) == $count)
+ 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);
+ $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;
@@ -510,11 +486,10 @@ class CI_Trackback {
/**
* Set error message
*
- * @access public
* @param string
* @return void
*/
- function set_error($msg)
+ public function set_error($msg)
{
log_message('error', $msg);
$this->error_msg[] = $msg;
@@ -525,24 +500,17 @@ class CI_Trackback {
/**
* Show error messages
*
- * @access public
* @param string
* @param string
* @return string
*/
- function display_errors($open = '<p>', $close = '</p>')
+ public function display_errors($open = '<p>', $close = '</p>')
{
- $str = '';
- foreach ($this->error_msg as $val)
- {
- $str .= $open.$val.$close;
- }
-
- return $str;
+ return (count($this->error_msg) > 0) ? $open . implode($close . $open, $this->error_msg) . $close : '';
}
}
// END Trackback Class
/* End of file Trackback.php */
-/* Location: ./system/libraries/Trackback.php */ \ No newline at end of file
+/* Location: ./system/libraries/Trackback.php */
diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php
index 734cec104..46c73ef8b 100644
--- a/system/libraries/Typography.php
+++ b/system/libraries/Typography.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -19,30 +31,30 @@
* Typography Class
*
*
- * @access private
+ * @access protected
* @category Helpers
- * @author ExpressionEngine Dev Team
- * @link http://codeigniter.com/user_guide/helpers/
+ * @author EllisLab Dev Team
+ * @link http://codeigniter.com/user_guide/libraries/typography.html
*/
class CI_Typography {
// Block level elements that should not be wrapped inside <p> tags
- var $block_elements = 'address|blockquote|div|dl|fieldset|form|h\d|hr|noscript|object|ol|p|pre|script|table|ul';
+ public $block_elements = 'address|blockquote|div|dl|fieldset|form|h\d|hr|noscript|object|ol|p|pre|script|table|ul';
// Elements that should not have <p> and <br /> tags within them.
- var $skip_elements = 'p|pre|ol|ul|dl|object|table|h\d';
+ public $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';
+ public $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');
+ public $inner_block_required = array('blockquote');
// the last block element parsed
- var $last_block_element = '';
+ public $last_block_element = '';
// whether or not to protect quotes within { curly braces }
- var $protect_braced_quotes = FALSE;
+ public $protect_braced_quotes = FALSE;
/**
* Auto Typography
@@ -60,7 +72,7 @@ class CI_Typography {
* @param bool whether to reduce more then two consecutive newlines to two
* @return string
*/
- function auto_typography($str, $reduce_linebreaks = FALSE)
+ public function auto_typography($str, $reduce_linebreaks = FALSE)
{
if ($str == '')
{
@@ -115,35 +127,32 @@ class CI_Typography {
// 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] = <opening tag>
- // [1] = Content...
- // [2] = <closing tag>
- // Etc...
- // }
+ /* Split the string at every tag. This expression creates an array with this prototype:
+ *
+ * [array]
+ * {
+ * [0] = <opening tag>
+ * [1] = Content...
+ * [2] = <closing tag>
+ * 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;
- $current_chunk = 0;
- $total_chunks = count($chunks);
- foreach ($chunks as $chunk)
+ for ($i = 0, $c = count($chunks) - 1; $i <= $c; $i++)
{
- $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 <pre> tags and a few other things.
- if (preg_match("#<(/*)(".$this->block_elements.").*?>#", $chunk, $match))
+ if (preg_match("#<(/*)(".$this->block_elements.").*?>#", $chunks[$i], $match))
{
if (preg_match("#".$this->skip_elements."#", $match[2]))
{
- $process = ($match[1] == '/') ? TRUE : FALSE;
+ $process = ($match[1] === '/');
}
if ($match[1] == '')
@@ -151,24 +160,24 @@ class CI_Typography {
$this->last_block_element = $match[2];
}
- $str .= $chunk;
+ $str .= $chunks[$i];
continue;
}
- if ($process == FALSE)
+ if ($process === FALSE)
{
- $str .= $chunk;
+ $str .= $chunks[$i];
continue;
}
// Force a newline to make sure end tags get processed by _format_newlines()
- if ($current_chunk == $total_chunks)
+ if ($i === $c)
{
- $chunk .= "\n";
+ $chunks[$i] .= "\n";
}
// Convert Newlines into <p> and <br /> tags
- $str .= $this->_format_newlines($chunk);
+ $str .= $this->_format_newlines($chunks[$i]);
}
// No opening block level tag? Add it if needed.
@@ -253,7 +262,7 @@ class CI_Typography {
* @param string
* @return string
*/
- function format_characters($str)
+ public function format_characters($str)
{
static $table;
@@ -313,18 +322,13 @@ class CI_Typography {
*
* Converts newline characters into either <p> tags or <br />
*
- * @access public
+ * @access protected
* @param string
* @return string
*/
- function _format_newlines($str)
+ protected function _format_newlines($str)
{
- if ($str == '')
- {
- return $str;
- }
-
- if (strpos($str, "\n") === FALSE && ! in_array($this->last_block_element, $this->inner_block_required))
+ if ($str == '' OR (strpos($str, "\n") === FALSE AND ! in_array($this->last_block_element, $this->inner_block_required)))
{
return $str;
}
@@ -361,11 +365,11 @@ class CI_Typography {
* 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
+ * @access protected
* @param array
* @return string
*/
- function _protect_characters($match)
+ protected function _protect_characters($match)
{
return str_replace(array("'",'"','--',' '), array('{@SQ}', '{@DQ}', '{@DD}', '{@NBS}'), $match[0]);
}
@@ -379,25 +383,16 @@ class CI_Typography {
* @param string
* @return string
*/
- function nl2br_except_pre($str)
+ public function nl2br_except_pre($str)
{
- $ex = explode("pre>",$str);
- $ct = count($ex);
-
- $newstr = "";
- for ($i = 0; $i < $ct; $i++)
+ $newstr = '';
+ for ($ex = explode('pre>', $str), $ct = count($ex), $i = 0; $i < $ct; $i++)
{
- if (($i % 2) == 0)
+ $newstr .= (($i % 2) === 0) ? nl2br($ex[$i]) : $ex[$i];
+ if ($ct - 1 !== $i)
{
- $newstr .= nl2br($ex[$i]);
+ $newstr .= 'pre>';
}
- else
- {
- $newstr .= $ex[$i];
- }
-
- if ($ct - 1 != $i)
- $newstr .= "pre>";
}
return $newstr;
@@ -407,4 +402,4 @@ class CI_Typography {
// END Typography Class
/* End of file Typography.php */
-/* Location: ./system/libraries/Typography.php */ \ No newline at end of file
+/* Location: ./system/libraries/Typography.php */
diff --git a/system/libraries/Unit_test.php b/system/libraries/Unit_test.php
index 5bd7e801a..38d767c69 100644
--- a/system/libraries/Unit_test.php
+++ b/system/libraries/Unit_test.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.3.1
* @filesource
@@ -23,17 +35,17 @@
* @package CodeIgniter
* @subpackage Libraries
* @category UnitTesting
- * @author ExpressionEngine Dev Team
- * @link http://codeigniter.com/user_guide/libraries/uri.html
+ * @author EllisLab Dev Team
+ * @link http://codeigniter.com/user_guide/libraries/unit_testing.html
*/
class CI_Unit_test {
- var $active = TRUE;
- var $results = array();
- var $strict = FALSE;
- var $_template = NULL;
- var $_template_rows = NULL;
- var $_test_items_visible = array();
+ public $active = TRUE;
+ public $results = array();
+ public $strict = FALSE;
+ protected $_template = NULL;
+ protected $_template_rows = NULL;
+ protected $_test_items_visible = array();
public function __construct()
{
@@ -58,11 +70,10 @@ class CI_Unit_test {
*
* Runs the supplied tests
*
- * @access public
* @param array
* @return void
*/
- function set_test_items($items = array())
+ public function set_test_items($items = array())
{
if ( ! empty($items) AND is_array($items))
{
@@ -77,13 +88,12 @@ class CI_Unit_test {
*
* Runs the supplied tests
*
- * @access public
* @param mixed
* @param mixed
* @param string
* @return string
*/
- function run($test, $expected = TRUE, $test_name = 'undefined', $notes = '')
+ public function run($test, $expected = TRUE, $test_name = 'undefined', $notes = '')
{
if ($this->active == FALSE)
{
@@ -98,11 +108,7 @@ class CI_Unit_test {
}
else
{
- if ($this->strict == TRUE)
- $result = ($test === $expected) ? TRUE : FALSE;
- else
- $result = ($test == $expected) ? TRUE : FALSE;
-
+ $result = ($this->strict == TRUE) ? ($test === $expected) : ($test == $expected);
$extype = gettype($expected);
}
@@ -130,12 +136,11 @@ class CI_Unit_test {
*
* Displays a table with the test data
*
- * @access public
* @return string
*/
- function report($result = array())
+ public function report($result = array())
{
- if (count($result) == 0)
+ if (count($result) === 0)
{
$result = $this->result();
}
@@ -164,10 +169,7 @@ class CI_Unit_test {
}
}
- $temp = $this->_template_rows;
- $temp = str_replace('{item}', $key, $temp);
- $temp = str_replace('{result}', $val, $temp);
- $table .= $temp;
+ $table .= str_replace(array('{item}', '{result}'), array($key, $val), $this->_template_rows);
}
$r .= str_replace('{rows}', $table, $this->_template);
@@ -183,13 +185,12 @@ class CI_Unit_test {
*
* Causes the evaluation to use === rather than ==
*
- * @access public
* @param bool
* @return null
*/
- function use_strict($state = TRUE)
+ public function use_strict($state = TRUE)
{
- $this->strict = ($state == FALSE) ? FALSE : TRUE;
+ $this->strict = (bool) $state;
}
// --------------------------------------------------------------------
@@ -199,13 +200,12 @@ class CI_Unit_test {
*
* Enables/disables unit testing
*
- * @access public
* @param bool
* @return null
*/
- function active($state = TRUE)
+ public function active($state = TRUE)
{
- $this->active = ($state == FALSE) ? FALSE : TRUE;
+ $this->active = (bool) $state;
}
// --------------------------------------------------------------------
@@ -215,15 +215,14 @@ class CI_Unit_test {
*
* Returns the raw result data
*
- * @access public
* @return array
*/
- function result($results = array())
+ public function result($results = array())
{
$CI =& get_instance();
$CI->load->language('unit_test');
- if (count($results) == 0)
+ if (count($results) === 0)
{
$results = $this->results;
}
@@ -273,11 +272,10 @@ class CI_Unit_test {
*
* This lets us set the template to be used to display results
*
- * @access public
* @param string
* @return void
*/
- function set_template($template)
+ public function set_template($template)
{
$this->_template = $template;
}
@@ -289,19 +287,17 @@ class CI_Unit_test {
*
* This lets us show file names and line numbers
*
- * @access private
* @return array
*/
- function _backtrace()
+ protected 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' => (isset($back[1]['file']) ? $back[1]['file'] : ''),
+ 'line' => (isset($back[1]['line']) ? $back[1]['line'] : '')
+ );
}
return array('file' => 'Unknown', 'line' => 'Unknown');
}
@@ -311,19 +307,14 @@ class CI_Unit_test {
/**
* Get Default Template
*
- * @access private
* @return string
*/
- function _default_template()
+ protected function _default_template()
{
- $this->_template = "\n".'<table style="width:100%; font-size:small; margin:10px 0; border-collapse:collapse; border:1px solid #CCC;">';
- $this->_template .= '{rows}';
- $this->_template .= "\n".'</table>';
-
- $this->_template_rows = "\n\t".'<tr>';
- $this->_template_rows .= "\n\t\t".'<th style="text-align: left; border-bottom:1px solid #CCC;">{item}</th>';
- $this->_template_rows .= "\n\t\t".'<td style="border-bottom:1px solid #CCC;">{result}</td>';
- $this->_template_rows .= "\n\t".'</tr>';
+ $this->_template = "\n".'<table style="width:100%; font-size:small; margin:10px 0; border-collapse:collapse; border:1px solid #CCC;">{rows}'."\n".'</table>';
+
+ $this->_template_rows = "\n\t<tr>\n\t\t".'<th style="text-align: left; border-bottom:1px solid #CCC;">{item}</th>'
+ . "\n\t\t".'<td style="border-bottom:1px solid #CCC;">{result}</td>'."\n\t</tr>";
}
// --------------------------------------------------------------------
@@ -333,30 +324,23 @@ class CI_Unit_test {
*
* Harvests the data within the template {pseudo-variables}
*
- * @access private
* @return void
*/
- function _parse_template()
+ protected function _parse_template()
{
if ( ! is_null($this->_template_rows))
{
return;
}
- if (is_null($this->_template))
+ if (is_null($this->_template) OR ! preg_match("/\{rows\}(.*?)\{\/rows\}/si", $this->_template, $match))
{
$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);
+ $this->_template_rows = $match[1];
+ $this->_template = str_replace($match[0], '{rows}', $this->_template);
}
}
@@ -365,8 +349,6 @@ class CI_Unit_test {
/**
* Helper functions to test boolean true/false
*
- *
- * @access private
* @return bool
*/
function is_true($test)
@@ -380,4 +362,4 @@ function is_false($test)
/* End of file Unit_test.php */
-/* Location: ./system/libraries/Unit_test.php */ \ No newline at end of file
+/* Location: ./system/libraries/Unit_test.php */
diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php
index 91fbf66ca..82383f658 100644
--- a/system/libraries/Upload.php
+++ b/system/libraries/Upload.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -21,7 +33,7 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Uploads
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/file_uploading.html
*/
class CI_Upload {
@@ -30,6 +42,7 @@ class CI_Upload {
public $max_width = 0;
public $max_height = 0;
public $max_filename = 0;
+ public $max_filename_increment = 100;
public $allowed_types = "";
public $file_temp = "";
public $file_name = "";
@@ -80,31 +93,32 @@ class CI_Upload {
public function initialize($config = array())
{
$defaults = array(
- 'max_size' => 0,
- 'max_width' => 0,
- 'max_height' => 0,
- 'max_filename' => 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_",
- 'client_name' => ''
+ 'max_size' => 0,
+ 'max_width' => 0,
+ 'max_height' => 0,
+ 'max_filename' => 0,
+ 'max_filename_increment' => 100,
+ '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_",
+ 'client_name' => ''
);
@@ -403,7 +417,7 @@ class CI_Upload {
$filename = str_replace($this->file_ext, '', $filename);
$new_filename = '';
- for ($i = 1; $i < 100; $i++)
+ for ($i = 1; $i < $this->max_filename_increment; $i++)
{
if ( ! file_exists($path.$filename.$i.$this->file_ext))
{
@@ -920,13 +934,7 @@ class CI_Upload {
*/
public function display_errors($open = '<p>', $close = '</p>')
{
- $str = '';
- foreach ($this->error_msg as $val)
- {
- $str .= $open.$val.$close;
- }
-
- return $str;
+ return (count($this->error_msg) > 0) ? $open . implode($close . $open, $this->error_msg) . $close : '';
}
// --------------------------------------------------------------------
diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php
index 0b77a7d42..cd644c00d 100644
--- a/system/libraries/User_agent.php
+++ b/system/libraries/User_agent.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -18,42 +30,41 @@
/**
* User Agent Class
*
- * Identifies the platform, browser, robot, or mobile devise of the browsing agent
+ * Identifies the platform, browser, robot, or mobile device of the browsing agent
*
* @package CodeIgniter
* @subpackage Libraries
* @category User Agent
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/user_agent.html
*/
class CI_User_agent {
- var $agent = NULL;
+ public $agent = NULL;
- var $is_browser = FALSE;
- var $is_robot = FALSE;
- var $is_mobile = FALSE;
+ public $is_browser = FALSE;
+ public $is_robot = FALSE;
+ public $is_mobile = FALSE;
- var $languages = array();
- var $charsets = array();
+ public $languages = array();
+ public $charsets = array();
- var $platforms = array();
- var $browsers = array();
- var $mobiles = array();
- var $robots = array();
+ public $platforms = array();
+ public $browsers = array();
+ public $mobiles = array();
+ public $robots = array();
- var $platform = '';
- var $browser = '';
- var $version = '';
- var $mobile = '';
- var $robot = '';
+ public $platform = '';
+ public $browser = '';
+ public $version = '';
+ public $mobile = '';
+ public $robot = '';
/**
* Constructor
*
* Sets the User Agent and runs the compilation routine
*
- * @access public
* @return void
*/
public function __construct()
@@ -79,10 +90,9 @@ class CI_User_agent {
/**
* Compile the User Agent Data
*
- * @access private
* @return bool
*/
- private function _load_agent_file()
+ protected function _load_agent_file()
{
if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/user_agents.php'))
{
@@ -135,10 +145,9 @@ class CI_User_agent {
/**
* Compile the User Agent Data
*
- * @access private
* @return bool
*/
- private function _compile_data()
+ protected function _compile_data()
{
$this->_set_platform();
@@ -156,10 +165,9 @@ class CI_User_agent {
/**
* Set the Platform
*
- * @access private
* @return mixed
*/
- private function _set_platform()
+ protected function _set_platform()
{
if (is_array($this->platforms) AND count($this->platforms) > 0)
{
@@ -180,10 +188,9 @@ class CI_User_agent {
/**
* Set the Browser
*
- * @access private
* @return bool
*/
- private function _set_browser()
+ protected function _set_browser()
{
if (is_array($this->browsers) AND count($this->browsers) > 0)
{
@@ -207,10 +214,9 @@ class CI_User_agent {
/**
* Set the Robot
*
- * @access private
* @return bool
*/
- private function _set_robot()
+ protected function _set_robot()
{
if (is_array($this->robots) AND count($this->robots) > 0)
{
@@ -232,10 +238,9 @@ class CI_User_agent {
/**
* Set the Mobile Device
*
- * @access private
* @return bool
*/
- private function _set_mobile()
+ protected function _set_mobile()
{
if (is_array($this->mobiles) AND count($this->mobiles) > 0)
{
@@ -257,19 +262,16 @@ class CI_User_agent {
/**
* Set the accepted languages
*
- * @access private
* @return void
*/
- private function _set_languages()
+ protected function _set_languages()
{
- if ((count($this->languages) == 0) AND isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) AND $_SERVER['HTTP_ACCEPT_LANGUAGE'] != '')
+ 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);
+ $this->languages = explode(',', preg_replace('/(;q=[0-9\.]+)/i', '', strtolower(trim($_SERVER['HTTP_ACCEPT_LANGUAGE']))));
}
- if (count($this->languages) == 0)
+ if (count($this->languages) === 0)
{
$this->languages = array('Undefined');
}
@@ -280,19 +282,16 @@ class CI_User_agent {
/**
* Set the accepted character sets
*
- * @access private
* @return void
*/
- private function _set_charsets()
+ protected function _set_charsets()
{
- if ((count($this->charsets) == 0) AND isset($_SERVER['HTTP_ACCEPT_CHARSET']) AND $_SERVER['HTTP_ACCEPT_CHARSET'] != '')
+ 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);
+ $this->charsets = explode(',', preg_replace('/(;q=.+)/i', '', strtolower(trim($_SERVER['HTTP_ACCEPT_CHARSET']))));
}
- if (count($this->charsets) == 0)
+ if (count($this->charsets) === 0)
{
$this->charsets = array('Undefined');
}
@@ -303,7 +302,6 @@ class CI_User_agent {
/**
* Is Browser
*
- * @access public
* @return bool
*/
public function is_browser($key = NULL)
@@ -328,7 +326,6 @@ class CI_User_agent {
/**
* Is Robot
*
- * @access public
* @return bool
*/
public function is_robot($key = NULL)
@@ -353,7 +350,6 @@ class CI_User_agent {
/**
* Is Mobile
*
- * @access public
* @return bool
*/
public function is_mobile($key = NULL)
@@ -378,16 +374,11 @@ class CI_User_agent {
/**
* Is this a referral from another site?
*
- * @access public
* @return bool
*/
public function is_referral()
{
- if ( ! isset($_SERVER['HTTP_REFERER']) OR $_SERVER['HTTP_REFERER'] == '')
- {
- return FALSE;
- }
- return TRUE;
+ return ( ! isset($_SERVER['HTTP_REFERER']) OR $_SERVER['HTTP_REFERER'] == '') ? FALSE : TRUE;
}
// --------------------------------------------------------------------
@@ -395,7 +386,6 @@ class CI_User_agent {
/**
* Agent String
*
- * @access public
* @return string
*/
public function agent_string()
@@ -408,7 +398,6 @@ class CI_User_agent {
/**
* Get Platform
*
- * @access public
* @return string
*/
public function platform()
@@ -421,7 +410,6 @@ class CI_User_agent {
/**
* Get Browser Name
*
- * @access public
* @return string
*/
public function browser()
@@ -434,7 +422,6 @@ class CI_User_agent {
/**
* Get the Browser Version
*
- * @access public
* @return string
*/
public function version()
@@ -447,7 +434,6 @@ class CI_User_agent {
/**
* Get The Robot Name
*
- * @access public
* @return string
*/
public function robot()
@@ -459,7 +445,6 @@ class CI_User_agent {
/**
* Get the Mobile Device
*
- * @access public
* @return string
*/
public function mobile()
@@ -472,7 +457,6 @@ class CI_User_agent {
/**
* Get the referrer
*
- * @access public
* @return bool
*/
public function referrer()
@@ -485,12 +469,11 @@ class CI_User_agent {
/**
* Get the accepted languages
*
- * @access public
* @return array
*/
public function languages()
{
- if (count($this->languages) == 0)
+ if (count($this->languages) === 0)
{
$this->_set_languages();
}
@@ -503,12 +486,11 @@ class CI_User_agent {
/**
* Get the accepted Character Sets
*
- * @access public
* @return array
*/
public function charsets()
{
- if (count($this->charsets) == 0)
+ if (count($this->charsets) === 0)
{
$this->_set_charsets();
}
@@ -521,7 +503,6 @@ class CI_User_agent {
/**
* Test for a particular language
*
- * @access public
* @return bool
*/
public function accept_lang($lang = 'en')
@@ -534,7 +515,6 @@ class CI_User_agent {
/**
* Test for a particular character set
*
- * @access public
* @return bool
*/
public function accept_charset($charset = 'utf-8')
@@ -544,6 +524,5 @@ class CI_User_agent {
}
-
/* End of file User_agent.php */
-/* Location: ./system/libraries/User_agent.php */ \ No newline at end of file
+/* Location: ./system/libraries/User_agent.php */
diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php
index d702e902f..730a0fc49 100644
--- a/system/libraries/Xmlrpc.php
+++ b/system/libraries/Xmlrpc.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -27,43 +39,43 @@ if ( ! function_exists('xml_parser_create'))
* @package CodeIgniter
* @subpackage Libraries
* @category XML-RPC
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/xmlrpc.html
*/
class CI_Xmlrpc {
- var $debug = FALSE; // Debugging on or off
- var $xmlrpcI4 = 'i4';
- var $xmlrpcInt = 'int';
- var $xmlrpcBoolean = 'boolean';
- 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 $result;
- var $response = array(); // Response from remote server
-
- var $xss_clean = TRUE;
+ public $debug = FALSE; // Debugging on or off
+ public $xmlrpcI4 = 'i4';
+ public $xmlrpcInt = 'int';
+ public $xmlrpcBoolean = 'boolean';
+ public $xmlrpcDouble = 'double';
+ public $xmlrpcString = 'string';
+ public $xmlrpcDateTime = 'dateTime.iso8601';
+ public $xmlrpcBase64 = 'base64';
+ public $xmlrpcArray = 'array';
+ public $xmlrpcStruct = 'struct';
+
+ public $xmlrpcTypes = array();
+ public $valid_parents = array();
+ public $xmlrpcerr = array(); // Response numbers
+ public $xmlrpcstr = array(); // Response strings
+
+ public $xmlrpc_defencoding = 'UTF-8';
+ public $xmlrpcName = 'XML-RPC for CodeIgniter';
+ public $xmlrpcVersion = '1.1';
+ public $xmlrpcerruser = 800; // Start of user errors
+ public $xmlrpcerrxml = 100; // Start of XML Parse errors
+ public $xmlrpc_backslash = ''; // formulate backslashes for escaping regexp
+
+ public $client;
+ public $method;
+ public $data;
+ public $message = '';
+ public $error = ''; // Error string for request
+ public $result;
+ public $response = array(); // Response from remote server
+
+ public $xss_clean = TRUE;
//-------------------------------------
// VALUES THAT MULTIPLE CLASSES NEED
@@ -71,7 +83,7 @@ class CI_Xmlrpc {
public function __construct($config = array())
{
- $this->xmlrpcName = $this->xmlrpcName;
+ $this->xmlrpcName = $this->xmlrpcName;
$this->xmlrpc_backslash = chr(92).chr(92);
// Types for info sent back and forth
@@ -89,23 +101,23 @@ class CI_Xmlrpc {
// 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')
- );
+ '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
@@ -116,7 +128,7 @@ class CI_Xmlrpc {
$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->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';
@@ -132,7 +144,7 @@ class CI_Xmlrpc {
// Initialize Prefs
//-------------------------------------
- function initialize($config = array())
+ public function initialize($config = array())
{
if (count($config) > 0)
{
@@ -151,9 +163,9 @@ class CI_Xmlrpc {
// Take URL and parse it
//-------------------------------------
- function server($url, $port=80)
+ public function server($url, $port=80)
{
- if (substr($url, 0, 4) != "http")
+ if (strpos($url, 'http') !== 0)
{
$url = "http://".$url;
}
@@ -175,7 +187,7 @@ class CI_Xmlrpc {
// Set Timeout
//-------------------------------------
- function timeout($seconds=5)
+ public function timeout($seconds = 5)
{
if ( ! is_null($this->client) && is_int($seconds))
{
@@ -188,7 +200,7 @@ class CI_Xmlrpc {
// Set Methods
//-------------------------------------
- function method($function)
+ public function method($function)
{
$this->method = $function;
}
@@ -198,7 +210,7 @@ class CI_Xmlrpc {
// Take Array of Data and Create Objects
//-------------------------------------
- function request($incoming)
+ public function request($incoming)
{
if ( ! is_array($incoming))
{
@@ -219,42 +231,34 @@ class CI_Xmlrpc {
// Set Debug
//-------------------------------------
- function set_debug($flag = TRUE)
+ public function set_debug($flag = TRUE)
{
- $this->debug = ($flag == TRUE) ? TRUE : FALSE;
+ $this->debug = ($flag == TRUE);
}
//-------------------------------------
// Values Parsing
//-------------------------------------
- function values_parsing($value, $return = FALSE)
+ public function values_parsing($value, $return = FALSE)
{
if (is_array($value) && array_key_exists(0, $value))
{
- if ( ! isset($value['1']) OR ( ! isset($this->xmlrpcTypes[$value['1']])))
+ if ( ! isset($value[1]) OR ( ! isset($this->xmlrpcTypes[$value[1]])))
{
- if (is_array($value[0]))
- {
- $temp = new XML_RPC_Values($value['0'], 'array');
- }
- else
- {
- $temp = new XML_RPC_Values($value['0'], 'string');
- }
+ $temp = new XML_RPC_Values($value[0], (is_array($value[0]) ? 'array' : 'string'));
}
- elseif (is_array($value['0']) && ($value['1'] == 'struct' OR $value['1'] == 'array'))
+ else
{
- while (list($k) = each($value['0']))
+ if (is_array($value[0]) && ($value[1] == 'struct' OR $value[1] == 'array'))
{
- $value['0'][$k] = $this->values_parsing($value['0'][$k], TRUE);
+ 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']);
+ $temp = new XML_RPC_Values($value[0], $value[1]);
}
}
else
@@ -271,24 +275,18 @@ class CI_Xmlrpc {
// Sends XML-RPC Request
//-------------------------------------
- function send_request()
+ public 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))
+ if ( ! $this->result = $this->client->send($this->message) OR ! is_object($this->result->val))
{
$this->error = $this->result->errstr;
return FALSE;
}
$this->response = $this->result->decode();
-
return TRUE;
}
// END
@@ -297,7 +295,7 @@ class CI_Xmlrpc {
// Returns Error
//-------------------------------------
- function display_error()
+ public function display_error()
{
return $this->error;
}
@@ -307,7 +305,7 @@ class CI_Xmlrpc {
// Returns Remote Server Response
//-------------------------------------
- function display_response()
+ public function display_response()
{
return $this->response;
}
@@ -317,9 +315,9 @@ class CI_Xmlrpc {
// Sends an Error Message for Server Request
//-------------------------------------
- function send_error_message($number, $message)
+ public function send_error_message($number, $message)
{
- return new XML_RPC_Response('0',$number, $message);
+ return new XML_RPC_Response(0, $number, $message);
}
// END
@@ -328,14 +326,11 @@ class CI_Xmlrpc {
// Send Response for Server Request
//-------------------------------------
- function send_response($response)
+ public 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);
+ return new XML_RPC_Response($this->values_parsing($response));
}
// END
@@ -347,18 +342,18 @@ class CI_Xmlrpc {
* XML-RPC Client class
*
* @category XML-RPC
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/xmlrpc.html
*/
class XML_RPC_Client extends CI_Xmlrpc
{
- var $path = '';
- var $server = '';
- var $port = 80;
- var $errno = '';
- var $errstring = '';
- var $timeout = 5;
- var $no_multicall = FALSE;
+ public $path = '';
+ public $server = '';
+ public $port = 80;
+ public $errno = '';
+ public $errstring = '';
+ public $timeout = 5;
+ public $no_multicall = FALSE;
public function __construct($path, $server, $port=80)
{
@@ -369,7 +364,7 @@ class XML_RPC_Client extends CI_Xmlrpc
$this->path = $path;
}
- function send($msg)
+ public function send($msg)
{
if (is_array($msg))
{
@@ -381,7 +376,7 @@ class XML_RPC_Client extends CI_Xmlrpc
return $this->sendPayload($msg);
}
- function sendPayload($msg)
+ public function sendPayload($msg)
{
$fp = @fsockopen($this->server, $this->port,$this->errno, $this->errstr, $this->timeout);
@@ -399,12 +394,12 @@ class XML_RPC_Client extends CI_Xmlrpc
}
$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;
+ $op = "POST {$this->path} HTTP/1.0$r"
+ . "Host: {$this->server}$r"
+ . "Content-Type: text/xml$r"
+ . "User-Agent: {$this->xmlrpcName}$r"
+ . "Content-Length: ".strlen($msg->payload)."$r$r"
+ . $msg->payload;
if ( ! fputs($fp, $op, strlen($op)))
@@ -418,23 +413,23 @@ class XML_RPC_Client extends CI_Xmlrpc
return $resp;
}
-} // end class XML_RPC_Client
-
+}
+// end class XML_RPC_Client
/**
* XML-RPC Response class
*
* @category XML-RPC
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/xmlrpc.html
*/
class XML_RPC_Response
{
- var $val = 0;
- var $errno = 0;
- var $errstr = '';
- var $headers = array();
- var $xss_clean = TRUE;
+ public $val = 0;
+ public $errno = 0;
+ public $errstr = '';
+ public $headers = array();
+ public $xss_clean = TRUE;
public function __construct($val, $code = 0, $fstr = '')
{
@@ -442,7 +437,14 @@ class XML_RPC_Response
{
// error
$this->errno = $code;
- $this->errstr = htmlentities($fstr);
+ if ( ! is_php('5.4'))
+ {
+ $this->errstr = htmlspecialchars($fstr, ENT_NOQUOTES, 'UTF-8');
+ }
+ else
+ {
+ $this->errstr = htmlspecialchars($fstr, ENT_XML1 | ENT_NOQUOTES, 'UTF-8');
+ }
}
else if ( ! is_object($val))
{
@@ -456,27 +458,26 @@ class XML_RPC_Response
}
}
- function faultCode()
+ public function faultCode()
{
return $this->errno;
}
- function faultString()
+ public function faultString()
{
return $this->errstr;
}
- function value()
+ public function value()
{
return $this->val;
}
- function prepare_response()
+ public function prepare_response()
{
- $result = "<methodResponse>\n";
- if ($this->errno)
- {
- $result .= '<fault>
+ return "<methodResponse>\n"
+ . ($this->errno
+ ? '<fault>
<value>
<struct>
<member>
@@ -489,23 +490,16 @@ class XML_RPC_Response
</member>
</struct>
</value>
-</fault>';
- }
- else
- {
- $result .= "<params>\n<param>\n" .
- $this->val->serialize_class() .
- "</param>\n</params>";
- }
- $result .= "\n</methodResponse>";
- return $result;
+</fault>'
+ : "<params>\n<param>\n".$this->val->serialize_class()."</param>\n</params>")
+ . "\n</methodResponse>";
}
- function decode($array=FALSE)
+ public function decode($array = FALSE)
{
$CI =& get_instance();
-
- if ($array !== FALSE && is_array($array))
+
+ if (is_array($array))
{
while (list($key) = each($array))
{
@@ -544,7 +538,7 @@ class XML_RPC_Response
// XML-RPC Object to PHP Types
//-------------------------------------
- function xmlrpc_decoder($xmlrpc_val)
+ public function xmlrpc_decoder($xmlrpc_val)
{
$kind = $xmlrpc_val->kindOf();
@@ -555,12 +549,10 @@ class XML_RPC_Response
elseif ($kind == 'array')
{
reset($xmlrpc_val->me);
- list($a,$b) = each($xmlrpc_val->me);
- $size = count($b);
-
+ $b = current($xmlrpc_val->me);
$arr = array();
- for ($i = 0; $i < $size; $i++)
+ for ($i = 0, $size = count($b); $i < $size; $i++)
{
$arr[] = $this->xmlrpc_decoder($xmlrpc_val->me['array'][$i]);
}
@@ -584,7 +576,7 @@ class XML_RPC_Response
// ISO-8601 time to server or UTC time
//-------------------------------------
- function iso8601_decode($time, $utc=0)
+ public function iso8601_decode($time, $utc = 0)
{
// return a timet in the localtime, or UTC
$t = 0;
@@ -596,23 +588,22 @@ class XML_RPC_Response
return $t;
}
-} // End Response Class
-
-
+}
+// End Response Class
/**
* XML-RPC Message class
*
* @category XML-RPC
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/xmlrpc.html
*/
class XML_RPC_Message extends CI_Xmlrpc
{
- var $payload;
- var $method_name;
- var $params = array();
- var $xh = array();
+ public $payload;
+ public $method_name;
+ public $params = array();
+ public $xh = array();
public function __construct($method, $pars=0)
{
@@ -621,7 +612,7 @@ class XML_RPC_Message extends CI_Xmlrpc
$this->method_name = $method;
if (is_array($pars) && count($pars) > 0)
{
- for ($i=0; $i<count($pars); $i++)
+ for ($i = 0, $c = count($pars); $i < $c; $i++)
{
// $pars[$i] = XML_RPC_Values
$this->params[] = $pars[$i];
@@ -633,13 +624,13 @@ class XML_RPC_Message extends CI_Xmlrpc
// Create Payload to Send
//-------------------------------------
- function createPayload()
+ public function createPayload()
{
- $this->payload = "<?xml version=\"1.0\"?".">\r\n<methodCall>\r\n";
- $this->payload .= '<methodName>' . $this->method_name . "</methodName>\r\n";
- $this->payload .= "<params>\r\n";
+ $this->payload = "<?xml version=\"1.0\"?".">\r\n<methodCall>\r\n"
+ . '<methodName>'.$this->method_name."</methodName>\r\n"
+ . "<params>\r\n";
- for ($i=0; $i<count($this->params); $i++)
+ for ($i = 0, $c = count($this->params); $i < $c; $i++)
{
// $p = XML_RPC_Values
$p = $this->params[$i];
@@ -653,7 +644,7 @@ class XML_RPC_Message extends CI_Xmlrpc
// Parse External XML-RPC Server's Response
//-------------------------------------
- function parseResponse($fp)
+ public function parseResponse($fp)
{
$data = '';
@@ -668,16 +659,14 @@ class XML_RPC_Message extends CI_Xmlrpc
if ($this->debug === TRUE)
{
- echo "<pre>";
- echo "---DATA---\n" . htmlspecialchars($data) . "\n---END DATA---\n\n";
- echo "</pre>";
+ echo "<pre>---DATA---\n".htmlspecialchars($data)."\n---END DATA---\n\n</pre>";
}
//-------------------------------------
// Check for data
//-------------------------------------
- if ($data == "")
+ if ($data === '')
{
error_log($this->xmlrpcstr['no_data']);
$r = new XML_RPC_Response(0, $this->xmlrpcerr['no_data'], $this->xmlrpcstr['no_data']);
@@ -689,7 +678,7 @@ class XML_RPC_Message extends CI_Xmlrpc
// Check for HTTP 200 Response
//-------------------------------------
- if (strncmp($data, 'HTTP', 4) == 0 && ! preg_match('/^HTTP\/[0-9\.]+ 200 /', $data))
+ 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 . ')');
@@ -702,13 +691,14 @@ class XML_RPC_Message extends CI_Xmlrpc
$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(
+ 'isf' => 0,
+ 'ac' => '',
+ 'headers' => array(),
+ 'stack' => array(),
+ 'valuestack' => array(),
+ 'isf_reason' => 0
+ );
xml_set_object($parser, $this);
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, true);
@@ -757,9 +747,7 @@ class XML_RPC_Message extends CI_Xmlrpc
{
if ($this->debug === TRUE)
{
- echo "---Invalid Return---\n";
- echo $this->xh[$parser]['isf_reason'];
- echo "---Invalid Return---\n\n";
+ echo "---Invalid Return---\n".$this->xh[$parser]['isf_reason']."---Invalid Return---\n\n";
}
$r = new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'],$this->xmlrpcstr['invalid_return'].' '.$this->xh[$parser]['isf_reason']);
@@ -789,9 +777,7 @@ class XML_RPC_Message extends CI_Xmlrpc
echo "---END HEADERS---\n\n";
}
- echo "---DATA---\n" . htmlspecialchars($data) . "\n---END DATA---\n\n";
-
- echo "---PARSED---\n" ;
+ echo "---DATA---\n".htmlspecialchars($data)."\n---END DATA---\n\n---PARSED---\n";
var_dump($this->xh[$parser]['value']);
echo "\n---END PARSED---</pre>";
}
@@ -801,7 +787,6 @@ class XML_RPC_Message extends CI_Xmlrpc
//-------------------------------------
$v = $this->xh[$parser]['value'];
-
if ($this->xh[$parser]['isf'])
{
$errno_v = $v->me['struct']['faultCode'];
@@ -843,7 +828,7 @@ class XML_RPC_Message extends CI_Xmlrpc
// Start Element Handler
//-------------------------------------
- function open_tag($the_parser, $name, $attrs)
+ public function open_tag($the_parser, $name, $attrs)
{
// If invalid nesting, then return
if ($this->xh[$the_parser]['isf'] > 1) return;
@@ -945,7 +930,7 @@ class XML_RPC_Message extends CI_Xmlrpc
// End Element Handler
//-------------------------------------
- function closing_tag($the_parser, $name)
+ public function closing_tag($the_parser, $name)
{
if ($this->xh[$the_parser]['isf'] > 1) return;
@@ -1089,7 +1074,7 @@ class XML_RPC_Message extends CI_Xmlrpc
// Parses Character Data
//-------------------------------------
- function character_data($the_parser, $data)
+ public function character_data($the_parser, $data)
{
if ($this->xh[$the_parser]['isf'] > 1) return; // XML Fault found already
@@ -1111,13 +1096,16 @@ class XML_RPC_Message extends CI_Xmlrpc
}
- function addParam($par) { $this->params[]=$par; }
+ public function addParam($par)
+ {
+ $this->params[] = $par;
+ }
- function output_parameters($array=FALSE)
+ public function output_parameters($array = FALSE)
{
$CI =& get_instance();
-
- if ($array !== FALSE && is_array($array))
+
+ if (is_array($array))
{
while (list($key) = each($array))
{
@@ -1139,7 +1127,7 @@ class XML_RPC_Message extends CI_Xmlrpc
{
$parameters = array();
- for ($i = 0; $i < count($this->params); $i++)
+ for ($i = 0, $c = count($this->params); $i < $c; $i++)
{
$a_param = $this->decode_message($this->params[$i]);
@@ -1158,7 +1146,7 @@ class XML_RPC_Message extends CI_Xmlrpc
}
- function decode_message($param)
+ public function decode_message($param)
{
$kind = $param->kindOf();
@@ -1169,11 +1157,10 @@ class XML_RPC_Message extends CI_Xmlrpc
elseif ($kind == 'array')
{
reset($param->me);
- list($a,$b) = each($param->me);
-
+ $b = current($param->me);
$arr = array();
- for($i = 0; $i < count($b); $i++)
+ for($i = 0, $c = count($b); $i < $c; $i++)
{
$arr[] = $this->decode_message($param->me['array'][$i]);
}
@@ -1183,7 +1170,6 @@ class XML_RPC_Message extends CI_Xmlrpc
elseif ($kind == 'struct')
{
reset($param->me['struct']);
-
$arr = array();
while (list($key,$value) = each($param->me['struct']))
@@ -1195,23 +1181,22 @@ class XML_RPC_Message extends CI_Xmlrpc
}
}
-} // End XML_RPC_Messages class
-
-
+}
+// End XML_RPC_Messages class
/**
* XML-RPC Values class
*
* @category XML-RPC
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/xmlrpc.html
*/
class XML_RPC_Values extends CI_Xmlrpc
{
- var $me = array();
- var $mytype = 0;
+ public $me = array();
+ public $mytype = 0;
- public function __construct($val=-1, $type='')
+ public function __construct($val = -1, $type = '')
{
parent::__construct();
@@ -1234,7 +1219,7 @@ class XML_RPC_Values extends CI_Xmlrpc
}
}
- function addScalar($val, $type='string')
+ public function addScalar($val, $type = 'string')
{
$typeof = $this->xmlrpcTypes[$type];
@@ -1252,14 +1237,7 @@ class XML_RPC_Values extends CI_Xmlrpc
if ($type == $this->xmlrpcBoolean)
{
- if (strcasecmp($val,'true')==0 OR $val==1 OR ($val==true && strcasecmp($val,'false')))
- {
- $val = 1;
- }
- else
- {
- $val=0;
- }
+ $val = (strcasecmp($val,'true') === 0 OR $val == 1 OR ($val == true && strcasecmp($val, 'false'))) ? 1 : 0;
}
if ($this->mytype == 2)
@@ -1278,7 +1256,7 @@ class XML_RPC_Values extends CI_Xmlrpc
return 1;
}
- function addArray($vals)
+ public function addArray($vals)
{
if ($this->mytype != 0)
{
@@ -1291,7 +1269,7 @@ class XML_RPC_Values extends CI_Xmlrpc
return 1;
}
- function addStruct($vals)
+ public function addStruct($vals)
{
if ($this->mytype != 0)
{
@@ -1303,7 +1281,7 @@ class XML_RPC_Values extends CI_Xmlrpc
return 1;
}
- function kindOf()
+ public function kindOf()
{
switch($this->mytype)
{
@@ -1321,7 +1299,7 @@ class XML_RPC_Values extends CI_Xmlrpc
}
}
- function serializedata($typ, $val)
+ public function serializedata($typ, $val)
{
$rs = '';
@@ -1333,20 +1311,18 @@ class XML_RPC_Values extends CI_Xmlrpc
reset($val);
while (list($key2, $val2) = each($val))
{
- $rs .= "<member>\n<name>{$key2}</name>\n";
- $rs .= $this->serializeval($val2);
- $rs .= "</member>\n";
+ $rs .= "<member>\n<name>{$key2}</name>\n".$this->serializeval($val2)."</member>\n";
}
$rs .= '</struct>';
break;
case 2:
// array
$rs .= "<array>\n<data>\n";
- for($i=0; $i < count($val); $i++)
+ for($i = 0, $c = count($val); $i < $c; $i++)
{
$rs .= $this->serializeval($val[$i]);
}
- $rs.="</data>\n</array>\n";
+ $rs .= "</data>\n</array>\n";
break;
case 1:
// others
@@ -1371,26 +1347,24 @@ class XML_RPC_Values extends CI_Xmlrpc
return $rs;
}
- function serialize_class()
+ public function serialize_class()
{
return $this->serializeval($this);
}
- function serializeval($o)
+ public function serializeval($o)
{
$ar = $o->me;
reset($ar);
list($typ, $val) = each($ar);
- $rs = "<value>\n".$this->serializedata($typ, $val)."</value>\n";
- return $rs;
+ return "<value>\n".$this->serializedata($typ, $val)."</value>\n";
}
- function scalarval()
+ public function scalarval()
{
reset($this->me);
- list($a,$b) = each($this->me);
- return $b;
+ return current($this->me);
}
@@ -1400,24 +1374,13 @@ class XML_RPC_Values extends CI_Xmlrpc
// Useful for sending time in XML-RPC
- function iso8601_encode($time, $utc=0)
+ public function iso8601_encode($time, $utc = 0)
{
- if ($utc == 1)
- {
- $t = strftime("%Y%m%dT%H:%i:%s", $time);
- }
- else
- {
- if (function_exists('gmstrftime'))
- $t = gmstrftime("%Y%m%dT%H:%i:%s", $time);
- else
- $t = strftime("%Y%m%dT%H:%i:%s", $time - date('Z'));
- }
- return $t;
+ return ($utc) ? strftime('%Y%m%dT%H:%i:%s', $time) : gmstrftime('%Y%m%dT%H:%i:%s', $time);
}
}
// END XML_RPC_Values Class
/* End of file Xmlrpc.php */
-/* Location: ./system/libraries/Xmlrpc.php */ \ No newline at end of file
+/* Location: ./system/libraries/Xmlrpc.php */
diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php
index 9cd332147..355d43f29 100644
--- a/system/libraries/Xmlrpcs.php
+++ b/system/libraries/Xmlrpcs.php
@@ -1,13 +1,25 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -31,17 +43,16 @@ if ( ! class_exists('CI_Xmlrpc'))
* @package CodeIgniter
* @subpackage Libraries
* @category XML-RPC
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/xmlrpc.html
*/
class CI_Xmlrpcs extends CI_Xmlrpc
{
- 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 $controller_obj;
-
- var $object = FALSE;
+ public $methods = array(); //array of methods mapped to function names and signatures
+ public $debug_msg = ''; // Debug Message
+ public $system_methods = array(); // XML RPC Server methods
+ public $controller_obj;
+ public $object = FALSE;
/**
* Constructor
@@ -68,7 +79,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc
* @param mixed
* @return void
*/
- function initialize($config=array())
+ public function initialize($config = array())
{
if (isset($config['functions']) && is_array($config['functions']))
{
@@ -99,26 +110,26 @@ class CI_Xmlrpcs extends CI_Xmlrpc
* @access public
* @return void
*/
- function set_system_methods()
+ public function set_system_methods()
{
$this->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'),
+ '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')
- );
+ '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')
+ );
}
// --------------------------------------------------------------------
@@ -129,12 +140,10 @@ class CI_Xmlrpcs extends CI_Xmlrpc
* @access public
* @return void
*/
- function serve()
+ public function serve()
{
$r = $this->parseRequest();
- $payload = '<?xml version="1.0" encoding="'.$this->xmlrpc_defencoding.'"?'.'>'."\n";
- $payload .= $this->debug_msg;
- $payload .= $r->prepare_response();
+ $payload = '<?xml version="1.0" encoding="'.$this->xmlrpc_defencoding.'"?'.'>'."\n".$this->debug_msg.$r->prepare_response();
header("Content-Type: text/xml");
header("Content-Length: ".strlen($payload));
@@ -153,7 +162,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc
* @param string docstring
* @return void
*/
- function add_to_map($methodname, $function, $sig, $doc)
+ public function add_to_map($methodname, $function, $sig, $doc)
{
$this->methods[$methodname] = array(
'function' => $function,
@@ -171,7 +180,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc
* @param string data
* @return object xmlrpc response
*/
- function parseRequest($data='')
+ public function parseRequest($data = '')
{
global $HTTP_RAW_POST_DATA;
@@ -191,13 +200,14 @@ class CI_Xmlrpcs extends CI_Xmlrpc
$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'] = '';
+ $parser_object->xh[$parser] = array(
+ 'isf' => 0,
+ 'isf_reason' => '',
+ 'params' => array(),
+ 'stack' => array(),
+ 'valuestack' => array(),
+ 'method' => ''
+ );
xml_set_object($parser, $parser_object);
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, true);
@@ -231,7 +241,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc
$m = new XML_RPC_Message($parser_object->xh[$parser]['method']);
$plist='';
- for ($i=0; $i < count($parser_object->xh[$parser]['params']); $i++)
+ for ($i = 0, $c = count($parser_object->xh[$parser]['params']); $i < $c; $i++)
{
if ($this->debug === TRUE)
{
@@ -243,9 +253,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc
if ($this->debug === TRUE)
{
- echo "<pre>";
- echo "---PLIST---\n" . $plist . "\n---PLIST END---\n\n";
- echo "</pre>";
+ echo "<pre>---PLIST---\n".$plist."\n---PLIST END---\n\n</pre>";
}
$r = $this->_execute($m);
@@ -272,12 +280,12 @@ class CI_Xmlrpcs extends CI_Xmlrpc
* @param object
* @return mixed
*/
- function _execute($m)
+ protected 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;
+ $system_call = (strncmp($methName, 'system', 5) === 0);
if ($this->xss_clean == FALSE)
{
@@ -298,22 +306,20 @@ class CI_Xmlrpcs extends CI_Xmlrpc
//-------------------------------------
$method_parts = explode(".", $this->methods[$methName]['function']);
- $objectCall = (isset($method_parts['1']) && $method_parts['1'] != "") ? TRUE : FALSE;
+ $objectCall = (isset($method_parts[1]) && $method_parts[1] != '');
if ($system_call === TRUE)
{
- if ( ! is_callable(array($this,$method_parts['1'])))
+ if ( ! is_callable(array($this,$method_parts[1])))
{
return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']);
}
}
else
{
- 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($this->methods[$methName]['function']))
+ if (($objectCall AND ! is_callable(array($method_parts[0], $method_parts[1])))
+ OR ( ! $objectCall AND ! is_callable($this->methods[$methName]['function']))
+ )
{
return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']);
}
@@ -326,13 +332,13 @@ class CI_Xmlrpcs extends CI_Xmlrpc
if (isset($this->methods[$methName]['signature']))
{
$sig = $this->methods[$methName]['signature'];
- for ($i=0; $i<count($sig); $i++)
+ for ($i = 0, $c = count($sig); $i < $c; $i++)
{
$current_sig = $sig[$i];
- if (count($current_sig) == count($m->params)+1)
+ if (count($current_sig) === count($m->params)+1)
{
- for ($n=0; $n < count($m->params); $n++)
+ for ($n = 0, $mc = count($m->params); $n < $mc; $n++)
{
$p = $m->params[$n];
$pt = ($p->kindOf() == 'scalar') ? $p->scalarval() : $p->kindOf();
@@ -358,7 +364,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc
if ($objectCall === TRUE)
{
- if ($method_parts[0] == "this" && $system_call == TRUE)
+ if ($method_parts[0] === 'this' && $system_call === TRUE)
{
return call_user_func(array($this, $method_parts[1]), $m);
}
@@ -367,11 +373,11 @@ class CI_Xmlrpcs extends CI_Xmlrpc
if ($this->object === FALSE)
{
$CI =& get_instance();
- return $CI->$method_parts['1']($m);
+ return $CI->$method_parts[1]($m);
}
else
{
- return $this->object->$method_parts['1']($m);
+ return $this->object->$method_parts[1]($m);
//return call_user_func(array(&$method_parts['0'],$method_parts['1']), $m);
}
}
@@ -381,7 +387,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc
return call_user_func($this->methods[$methName]['function'], $m);
}
}
-
+
// --------------------------------------------------------------------
/**
@@ -391,7 +397,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc
* @param mixed
* @return object
*/
- function listMethods($m)
+ public function listMethods($m)
{
$v = new XML_RPC_Values();
$output = array();
@@ -409,7 +415,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc
$v->addArray($output);
return new XML_RPC_Response($v);
}
-
+
// --------------------------------------------------------------------
/**
@@ -419,7 +425,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc
* @param mixed
* @return object
*/
- function methodSignature($m)
+ public function methodSignature($m)
{
$parameters = $m->output_parameters();
$method_name = $parameters[0];
@@ -431,15 +437,15 @@ class CI_Xmlrpcs extends CI_Xmlrpc
$sigs = array();
$signature = $this->methods[$method_name]['signature'];
- for ($i=0; $i < count($signature); $i++)
+ for ($i = 0, $c = count($signature); $i < $c; $i++)
{
$cursig = array();
$inSig = $signature[$i];
- for ($j=0; $j<count($inSig); $j++)
+ for ($j = 0, $jc = count($inSig); $j < $jc; $j++)
{
$cursig[]= new XML_RPC_Values($inSig[$j], 'string');
}
- $sigs[]= new XML_RPC_Values($cursig, 'array');
+ $sigs[] = new XML_RPC_Values($cursig, 'array');
}
$r = new XML_RPC_Response(new XML_RPC_Values($sigs, 'array'));
}
@@ -464,7 +470,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc
* @param mixed
* @return object
*/
- function methodHelp($m)
+ public function methodHelp($m)
{
$parameters = $m->output_parameters();
$method_name = $parameters[0];
@@ -480,7 +486,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc
return new XML_RPC_Response(0, $this->xmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']);
}
}
-
+
// --------------------------------------------------------------------
/**
@@ -490,7 +496,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc
* @param mixed
* @return object
*/
- function multicall($m)
+ public function multicall($m)
{
// Disabled
return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']);
@@ -507,7 +513,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc
$m = new XML_RPC_Message($value[0]);
$plist='';
- for ($i=0; $i < count($value[1]); $i++)
+ for ($i = 0, $c = count($value[1]); $i < $c; $i++)
{
$m->addParam(new XML_RPC_Values($value[1][$i], 'string'));
}
@@ -534,7 +540,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc
* @param mixed
* @return object
*/
- function multicall_error($err)
+ public function multicall_error($err)
{
$str = is_string($err) ? $this->xmlrpcstr["multicall_${err}"] : $err->faultString();
$code = is_string($err) ? $this->xmlrpcerr["multicall_${err}"] : $err->faultCode();
@@ -554,7 +560,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc
* @param mixed
* @return object
*/
- function do_multicall($call)
+ public function do_multicall($call)
{
if ($call->kindOf() != 'struct')
{
@@ -585,11 +591,10 @@ class CI_Xmlrpcs extends CI_Xmlrpc
return $this->multicall_error('notarray');
}
- list($a,$b)=each($params->me);
- $numParams = count($b);
+ list($a,$b) = each($params->me);
$msg = new XML_RPC_Message($scalar_value);
- for ($i = 0; $i < $numParams; $i++)
+ for ($i = 0, $numParams = count($b); $i < $numParams; $i++)
{
$msg->params[] = $params->me['array'][$i];
}
@@ -607,6 +612,5 @@ class CI_Xmlrpcs extends CI_Xmlrpc
}
// END XML_RPC_Server class
-
/* End of file Xmlrpcs.php */
-/* Location: ./system/libraries/Xmlrpcs.php */ \ No newline at end of file
+/* Location: ./system/libraries/Xmlrpcs.php */
diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php
index 666327d5c..50e84920e 100644
--- a/system/libraries/Zip.php
+++ b/system/libraries/Zip.php
@@ -4,10 +4,22 @@
*
* An open source application development framework for PHP 5.1.6 or newer
*
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
+ *
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://codeigniter.com/user_guide/license.html
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
@@ -27,7 +39,7 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Encryption
- * @author ExpressionEngine Dev Team
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/zip.html
*/
class CI_Zip {
@@ -87,9 +99,9 @@ class CI_Zip {
*/
function _get_mod_time($dir)
{
- // filemtime() will return false, but it does raise an error.
- $date = (@filemtime($dir)) ? filemtime($dir) : getdate($this->now);
-
+ // filemtime() may return false, but raises an error for non-existing files
+ $date = (file_exists($dir)) ? filemtime($dir): getdate($this->now);
+
$time['file_mtime'] = ($date['hours'] << 11) + ($date['minutes'] << 5) + $date['seconds'] / 2;
$time['file_mdate'] = (($date['year'] - 1980) << 9) + ($date['mon'] << 5) + $date['mday'];
diff --git a/system/libraries/javascript/Jquery.php b/system/libraries/javascript/Jquery.php
index baab83d25..03574c66e 100644
--- a/system/libraries/javascript/Jquery.php
+++ b/system/libraries/javascript/Jquery.php
@@ -1,102 +1,112 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
-
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
- * An open source application development framework for PHP 4.3.2 or newer
+ * An open source application development framework for PHP 5.1.6 or newer
+ *
+ * NOTICE OF LICENSE
+ *
+ * Licensed under the Open Software License version 3.0
+ *
+ * This source file is subject to the Open Software License (OSL 3.0) that is
+ * bundled with this package in the files license.txt / license.rst. It is
+ * also available through the world wide web at this URL:
+ * http://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to obtain it
+ * through the world wide web, please send an email to
+ * licensing@ellislab.com so we can send you a copy immediately.
*
* @package CodeIgniter
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
- * @license http://www.codeigniter.com/user_guide/license.html
- * @link http://www.codeigniter.com
+ * @author EllisLab Dev Team
+ * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
+ * @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
+// ------------------------------------------------------------------------
+
/**
* Jquery Class
*
* @package CodeIgniter
* @subpackage Libraries
- * @author ExpressionEngine Dev Team
* @category Loader
- * @link http://www.codeigniter.com/user_guide/libraries/javascript.html
+ * @author EllisLab Dev Team
+ * @link http://codeigniter.com/user_guide/libraries/javascript.html
*/
-
+
class CI_Jquery extends CI_Javascript {
- var $_javascript_folder = 'js';
- var $jquery_code_for_load = array();
- var $jquery_code_for_compile = array();
- var $jquery_corner_active = FALSE;
- var $jquery_table_sorter_active = FALSE;
- var $jquery_table_sorter_pager_active = FALSE;
- var $jquery_ajax_img = '';
+ protected $_javascript_folder = 'js';
+ public $jquery_code_for_load = array();
+ public $jquery_code_for_compile = array();
+ public $jquery_corner_active = FALSE;
+ public $jquery_table_sorter_active = FALSE;
+ public $jquery_table_sorter_pager_active = FALSE;
+ public $jquery_ajax_img = '';
public function __construct($params)
{
- $this->CI =& get_instance();
+ $this->CI =& get_instance();
extract($params);
if ($autoload === TRUE)
{
- $this->script();
+ $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 = '')
+ protected 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 = '')
+ protected 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)
+ protected function _click($element = 'this', $js = '', $ret_false = TRUE)
{
if ( ! is_array($js))
{
@@ -112,70 +122,66 @@ class CI_Jquery extends CI_Javascript {
}
// --------------------------------------------------------------------
-
+
/**
* 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 = '')
+ protected 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 = '')
+ protected 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 = '')
+ protected 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)
+ protected 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";
@@ -185,103 +191,97 @@ class CI_Jquery extends CI_Javascript {
}
// --------------------------------------------------------------------
-
+
/**
* 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 = '')
+ protected 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 = '')
+ protected 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 = '')
+ protected 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 = '')
+ protected 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 = '')
+ protected 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 = '')
+ protected function _mouseover($element = 'this', $js = '')
{
return $this->_add_event($element, $js, 'mouseover');
}
@@ -293,12 +293,11 @@ class CI_Jquery extends CI_Javascript {
*
* 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 = '')
+ protected function _mouseup($element = 'this', $js = '')
{
return $this->_add_event($element, $js, 'mouseup');
}
@@ -310,18 +309,17 @@ class CI_Jquery extends CI_Javascript {
*
* 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 = '')
+ protected 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";
@@ -335,12 +333,11 @@ class CI_Jquery extends CI_Javascript {
*
* 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 = '')
+ protected function _resize($element = 'this', $js = '')
{
return $this->_add_event($element, $js, 'resize');
}
@@ -352,16 +349,15 @@ class CI_Jquery extends CI_Javascript {
*
* 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 = '')
+ protected function _scroll($element = 'this', $js = '')
{
return $this->_add_event($element, $js, 'scroll');
}
-
+
// --------------------------------------------------------------------
/**
@@ -369,34 +365,31 @@ class CI_Jquery extends CI_Javascript {
*
* 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 = '')
+ protected 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='')
+ protected function _addClass($element = 'this', $class='')
{
$element = $this->_prep_element($element);
- $str = "$({$element}).addClass(\"$class\");";
- return $str;
+ return "$({$element}).addClass(\"$class\");";
}
// --------------------------------------------------------------------
@@ -406,19 +399,18 @@ class CI_Jquery extends CI_Javascript {
*
* 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 = '')
+ protected 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.'\', ';
@@ -430,71 +422,63 @@ class CI_Jquery extends CI_Javascript {
{
$speed = ', '.$speed;
}
-
+
if ($extra != '')
{
$extra = ', '.$extra;
}
-
- $str = "$({$element}).animate({\n$animations\n\t\t}".$speed.$extra.");";
-
- return $str;
+
+ return "$({$element}).animate({\n$animations\n\t\t}".$speed.$extra.");";
}
// --------------------------------------------------------------------
-
+
/**
* 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 = '')
+ protected function _fadeIn($element = 'this', $speed = '', $callback = '')
{
- $element = $this->_prep_element($element);
+ $element = $this->_prep_element($element);
$speed = $this->_validate_speed($speed);
-
+
if ($callback != '')
{
$callback = ", function(){\n{$callback}\n}";
}
-
- $str = "$({$element}).fadeIn({$speed}{$callback});";
-
- return $str;
+
+ return "$({$element}).fadeIn({$speed}{$callback});";
}
-
+
// --------------------------------------------------------------------
-
+
/**
* 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 = '')
+ protected 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;
+
+ return "$({$element}).fadeOut({$speed}{$callback});";
}
// --------------------------------------------------------------------
@@ -504,27 +488,24 @@ class CI_Jquery extends CI_Javascript {
*
* 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 = '')
+ protected function _hide($element = 'this', $speed = '', $callback = '')
{
- $element = $this->_prep_element($element);
+ $element = $this->_prep_element($element);
$speed = $this->_validate_speed($speed);
-
+
if ($callback != '')
{
$callback = ", function(){\n{$callback}\n}";
}
-
- $str = "$({$element}).hide({$speed}{$callback});";
- return $str;
+ return "$({$element}).hide({$speed}{$callback});";
}
-
+
// --------------------------------------------------------------------
/**
@@ -532,163 +513,145 @@ class CI_Jquery extends CI_Javascript {
*
* Outputs a jQuery remove class event
*
- * @access private
* @param string - element
* @return string
*/
- function _removeClass($element = 'this', $class='')
+ protected function _removeClass($element = 'this', $class='')
{
$element = $this->_prep_element($element);
- $str = "$({$element}).removeClass(\"$class\");";
- return $str;
+ return "$({$element}).removeClass(\"$class\");";
}
// --------------------------------------------------------------------
-
+
/**
* 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 = '')
+ protected function _slideUp($element = 'this', $speed = '', $callback = '')
{
- $element = $this->_prep_element($element);
+ $element = $this->_prep_element($element);
$speed = $this->_validate_speed($speed);
-
+
if ($callback != '')
{
$callback = ", function(){\n{$callback}\n}";
}
-
- $str = "$({$element}).slideUp({$speed}{$callback});";
-
- return $str;
+
+ return "$({$element}).slideUp({$speed}{$callback});";
}
-
+
// --------------------------------------------------------------------
-
+
/**
* 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 = '')
+ protected 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;
+
+ return "$({$element}).slideDown({$speed}{$callback});";
}
// --------------------------------------------------------------------
-
+
/**
* 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 = '')
+ protected 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;
+
+ return "$({$element}).slideToggle({$speed}{$callback});";
}
-
+
// --------------------------------------------------------------------
-
+
/**
* Toggle
*
* Outputs a jQuery toggle event
*
- * @access private
* @param string - element
* @return string
*/
- function _toggle($element = 'this')
+ protected function _toggle($element = 'this')
{
$element = $this->_prep_element($element);
- $str = "$({$element}).toggle();";
- return $str;
+ return "$({$element}).toggle();";
}
-
+
// --------------------------------------------------------------------
-
+
/**
* Toggle Class
*
* Outputs a jQuery toggle class event
*
- * @access private
* @param string - element
* @return string
*/
- function _toggleClass($element = 'this', $class='')
+ protected function _toggleClass($element = 'this', $class='')
{
$element = $this->_prep_element($element);
- $str = "$({$element}).toggleClass(\"$class\");";
- return $str;
+ return "$({$element}).toggleClass(\"$class\");";
}
-
+
// --------------------------------------------------------------------
-
+
/**
* 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 = '')
+ protected function _show($element = 'this', $speed = '', $callback = '')
{
- $element = $this->_prep_element($element);
+ $element = $this->_prep_element($element);
$speed = $this->_validate_speed($speed);
-
+
if ($callback != '')
{
$callback = ", function(){\n{$callback}\n}";
}
-
- $str = "$({$element}).show({$speed}{$callback});";
-
- return $str;
+
+ return "$({$element}).show({$speed}{$callback});";
}
// --------------------------------------------------------------------
@@ -696,22 +659,20 @@ class CI_Jquery extends CI_Javascript {
/**
* Updater
*
- * An Ajax call that populates the designated DOM node with
+ * 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 = '')
- {
+
+ protected 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') == '')
{
@@ -719,41 +680,38 @@ class CI_Jquery extends CI_Javascript {
}
else
{
- $loading_notifier = '<img src=\'' . $this->CI->config->slash_item('base_url') . $this->CI->config->item('javascript_ajax_img') . '\' alt=\'Loading\' />';
+ $loading_notifier = '<img src=\''.$this->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
+
+ $updater = "$($container).empty();\n" // anything that was in... get it out
+ . "\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 .= "}";
+ $request_options .= ', {'
+ . (is_array($options) ? "'".implode("', '", $options)."'" : "'".str_replace(":", "':'", $options)."'")
+ . '}';
}
- $updater .= "\t\t$($container).load('$controller'$request_options);";
- return $updater;
+ return $updater."\t\t$($container).load('$controller'$request_options);";
}
// --------------------------------------------------------------------
// Pre-written handy stuff
// --------------------------------------------------------------------
-
+
/**
* Zebra tables
*
- * @access private
* @param string table name
* @param string plugin location
* @return string
*/
- function _zebraTables($class = '', $odd = 'odd', $hover = '')
+ protected 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;
@@ -766,22 +724,19 @@ class CI_Jquery extends CI_Javascript {
return $zebra;
}
-
-
// --------------------------------------------------------------------
// Plugins
// --------------------------------------------------------------------
-
+
/**
* Corner Plugin
*
* http://www.malsup.com/jquery/corner/
*
- * @access public
* @param string target
* @return string
*/
- function corner($element = '', $corner_style = '')
+ public function corner($element = '', $corner_style = '')
{
// may want to make this configurable down the road
$corner_location = '/plugins/jquery.corner.js';
@@ -793,7 +748,7 @@ class CI_Jquery extends CI_Javascript {
return "$(" . $this->_prep_element($element) . ").corner(".$corner_style.");";
}
-
+
// --------------------------------------------------------------------
/**
@@ -801,11 +756,10 @@ class CI_Jquery extends CI_Javascript {
*
* Load a thickbox modal window
*
- * @access public
* @return void
*/
- function modal($src, $relative = FALSE)
- {
+ public function modal($src, $relative = FALSE)
+ {
$this->jquery_code_for_load[] = $this->external($src, $relative);
}
@@ -816,10 +770,9 @@ class CI_Jquery extends CI_Javascript {
*
* Load an Effect library
*
- * @access public
* @return void
*/
- function effect($src, $relative = FALSE)
+ public function effect($src, $relative = FALSE)
{
$this->jquery_code_for_load[] = $this->external($src, $relative);
}
@@ -831,10 +784,9 @@ class CI_Jquery extends CI_Javascript {
*
* Load a plugin library
*
- * @access public
* @return void
*/
- function plugin($src, $relative = FALSE)
+ public function plugin($src, $relative = FALSE)
{
$this->jquery_code_for_load[] = $this->external($src, $relative);
}
@@ -846,10 +798,9 @@ class CI_Jquery extends CI_Javascript {
*
* Load a user interface library
*
- * @access public
* @return void
*/
- function ui($src, $relative = FALSE)
+ public function ui($src, $relative = FALSE)
{
$this->jquery_code_for_load[] = $this->external($src, $relative);
}
@@ -860,10 +811,9 @@ class CI_Jquery extends CI_Javascript {
*
* Creates a jQuery sortable
*
- * @access public
* @return void
*/
- function sortable($element, $options = array())
+ public function sortable($element, $options = array())
{
if (count($options) > 0)
@@ -888,16 +838,15 @@ class CI_Jquery extends CI_Javascript {
/**
* Table Sorter Plugin
*
- * @access public
* @param string table name
* @param string plugin location
* @return string
*/
- function tablesorter($table = '', $options = '')
+ public function tablesorter($table = '', $options = '')
{
$this->jquery_code_for_compile[] = "\t$(" . $this->_prep_element($table) . ").tablesorter($options);\n";
}
-
+
// --------------------------------------------------------------------
// Class functions
// --------------------------------------------------------------------
@@ -907,13 +856,12 @@ class CI_Jquery extends CI_Javascript {
*
* 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)
+ */
+ protected function _add_event($element, $js, $event)
{
if (is_array($js))
{
@@ -934,65 +882,61 @@ class CI_Jquery extends CI_Javascript {
* 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)
+ protected 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 )
+ 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 .= '});';
-
+ $script = '$(document).ready(function() {'."\n"
+ . implode('', $this->jquery_code_for_compile)
+ . '});';
+
$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()
+ protected 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)
+ protected function _document_ready($js)
{
if ( ! is_array($js))
{
- $js = array ($js);
-
+ $js = array($js);
}
-
+
foreach ($js as $script)
{
$this->jquery_code_for_compile[] = $script;
@@ -1006,17 +950,16 @@ class CI_Jquery extends CI_Javascript {
*
* 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)
+ public function script($library_src = '', $relative = FALSE)
{
$library_src = $this->external($library_src, $relative);
$this->jquery_code_for_load[] = $library_src;
return $library_src;
}
-
+
// --------------------------------------------------------------------
/**
@@ -1026,20 +969,19 @@ class CI_Jquery extends CI_Javascript {
* 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)
+ protected function _prep_element($element)
{
if ($element != 'this')
{
$element = '"'.$element.'"';
}
-
+
return $element;
}
-
+
// --------------------------------------------------------------------
/**
@@ -1047,25 +989,24 @@ class CI_Jquery extends CI_Javascript {
*
* Ensures the speed parameter is valid for jQuery
*
- * @access private
* @param string
* @return string
- */
- function _validate_speed($speed)
+ */
+ protected function _validate_speed($speed)
{
if (in_array($speed, array('slow', 'normal', 'fast')))
{
- $speed = '"'.$speed.'"';
+ return '"'.$speed.'"';
}
elseif (preg_match("/[^0-9]/", $speed))
{
- $speed = '';
+ return '';
}
-
+
return $speed;
}
}
/* End of file Jquery.php */
-/* Location: ./system/libraries/Jquery.php */ \ No newline at end of file
+/* Location: ./system/libraries/Jquery.php */
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
deleted file mode 100644
index 76a0bcb19..000000000
--- a/user_guide/changelog.html
+++ /dev/null
@@ -1,1465 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<style type='text/css' media='all'>@import url('userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='userguide.css' />
-
-<script type="text/javascript" src="./nav/nav.js"></script>
-<script type="text/javascript" src="./nav/prototype.lite.js"></script>
-<script type="text/javascript" src="./nav/moo.fx.js"></script>
-<script type="text/javascript" src="./nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Change Log : CodeIgniter User Guide</title>
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('./');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="./images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.1</h1></td>
-<td id="breadcrumb_right"><a href="./toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Change Log
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Change Log</h1>
-
-<h2>Version 2.1.1</h2>
-<p>Release Date: not yet released</p>
-
-<ul>
- <li>General Changes
- <ul>
- <li>Fixed support for docx, xlsx files in mimes.php.</li>
- </ul>
- </li>
- <li>Libraries
- <ul>
- <li>Further improved MIME type detection in the <a href="libraries/file_uploading.html">File Uploading Library</a>.</li>
- </ul>
- </li>
-</ul>
-
-<h3>Bug fixes for 2.1.1</h3>
-<ul>
- <li>Fixed a bug (#697) - A wrong array key was used in the Upload library to check for mime-types.</li>
- <li>Fixed a bug - form_open() compared $action against site_url() instead of base_url()</li>
- <li>Fixed a bug - CI_Upload::_file_mime_type() could've failed if mime_content_type() is used for the detection and returns FALSE.</li>
- <li>Fixed a bug (#538) - Windows paths were ignored when using the <a href="libraries/image_lib.html">Image Manipulation Class</a> to create a new file.</li>
-</ul>
-
-
-<h2>Version 2.1.0</h2>
-<p>Release Date: November 14, 2011</p>
-
-<ul>
- <li>General Changes
- <ul>
- <li>Fixed a potential parameter injection flaw in the <a href="libraries/security.html">Security Library</a> and strengthened the XSS filter for HTML5 vulnerabilites.</li>
- <li>Callback validation rules can now accept parameters like any other validation rule.</li>
- <li>Added html_escape() to the <a href="general/common_functions.html">Common functions</a> to escape HTML output for preventing XSS easliy.</li>
- </ul>
- </li>
- <li>Helpers
- <ul>
- <li>Added <samp>increment_string()</samp> to <a href="helpers/string_helper.html">String Helper</a> to turn "foo" into "foo-1" or "foo-1" into "foo-2".</li>
- <li>Altered form helper - made action on form_open_multipart helper function call optional. Fixes (#65)</li>
- <li><samp>url_title()</samp> will now trim extra dashes from beginning and end.</li>
- <li>Improved speed of <a href="helpers/string_helper.html">String Helper</a>'s <b>random_string()</b> method</li>
- </ul>
- </li>
- <li>Database
- <ul>
- <li>Added a <a href="http://www.cubrid.org/" target="_blank">CUBRID</a> driver to the <a href="libraries/database.html">Database driver</a>. Thanks to the CUBRID team for supplying this patch.</li>
- <li>Added a <a href="http://www.php.net/manual/en/intro.pdo.php" target="_blank">PDO</a> driver to the <a href="libraries/database.html">Database driver</a>.</li>
- <li>Typecast limit and offset in the <a href="database/queries.html">Database driver</a> to integers to avoid possible injection.</li>
- <li>Added additional option 'none' for the optional third argument for <kbd>$this->db->like()</kbd> in the <a href="database/active_record.html">Database driver</a>.
- </li>
- <li>Added <kbd>$this->db->insert_batch()</kbd> support to the OCI8 (Oracle) driver.</li>
- </ul>
- </li>
- <li>Libraries
- <ul>
- <li>Changed <kbd>$this->cart->insert()</kbd> in the <a href="libraries/cart.html">Cart library</a> to return the Row ID if a single item was inserted successfully.</li>
- <li>Added support to set an optional parameter in your callback rules of validation using the <a href="libraries/form_validation.html">Form Validation library</a>.</li>
- <li>Added a <a href="libraries/migration.html">Migration library</a> to assist with applying incremental updates to your database schema.</li>
- <li>Driver children can be located in any package path.</li>
- <li>Added <samp>is_unique</samp> to the <a href="libraries/form_validation.html">Form Validation library</a>.</li>
- <li>Added <kbd>$config['use_page_numbers']</kbd> to the <a href="libraries/pagination.html">Pagination library</a>, which enables real page numbers in the URI.</li>
- <li>Added TLS and SSL Encryption for SMTP.</li>
- </ul>
- </li>
- <li>Core
- <ul>
- <li>Changed private functions in <a href="libraries/cart.html">URI library</a> to protected so <kdb>MY_URI</kdb> can override them.</li>
- <li>Removed <samp>CI_CORE</samp> boolean constant from CodeIgniter.php (there are no longer different Reactor and Core versions).</li>
- </ul>
- </li>
-</ul>
-
-<h3>Bug fixes for 2.1.0</h3>
-<ul>
- <li>Fixed #378 Robots identified as regular browsers by the <a href="libraries/user_agent.html">User Agent class</a>.</li>
- <li>If a config class was loaded first then a library with the same name is loaded, the config would be ignored.</li>
- <li>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.</li>
- <li>Fixed a bug (Reactor #89) where MySQL export would fail if the table had hyphens or other non alphanumeric/underscore characters.</li>
- <li>Fixed a bug (#200) where MySQL queries would be malformed after calling <kbd>$this->db->count_all()</kbd> then <kdb>$this->db->get()</kdb></li>
- <li>Fixed bug #105 that stopped query errors from being logged unless database debugging was enabled</li>
- <li>Fixed a bug (#160) - Removed unneeded array copy in the file cache driver.</li>
- <li>Fixed a bug (#150) - <samp>field_data()</samp> now correctly returns column length.</li>
- <li>Fixed a bug (#8) - <samp>load_class()</samp> now looks for core classes in <samp>APPPATH</samp> first, allowing them to be replaced.</li>
- <li>Fixed a bug (#24) - ODBC database driver called incorrect parent in __construct().</li>
- <li>Fixed a bug (#85) - OCI8 (Oracle) database <kbd>escape_str()</kbd> function did not escape correct.</li>
- <li>Fixed a bug (#344) - Using schema found in <a href="libraries/sessions.html">Saving Session Data to a Database</a>, system would throw error "user_data does not have a default value" when deleting then creating a session.</li>
- <li>Fixed a bug (#112) - OCI8 (Oracle) driver didn't pass the configured database character set when connecting.</li>
- <li>Fixed a bug (#182) - OCI8 (Oracle) driver used to re-execute the statement whenever num_rows() is called.</li>
- <li>Fixed a bug (#82) - WHERE clause field names in the DB <kbd>update_string()</kbd> method were not escaped, resulting in failed queries in some cases.</li>
- <li>Fixed a bug (#89) - Fix a variable type mismatch in DB <kbd>display_error()</kbd> where an array is expected, but a string could be set instead.</li>
- <li>Fixed a bug (#467) - Suppress warnings generated from <kbd>get_magic_quotes_gpc()</kbd> (deprecated in PHP 5.4)</li>
- <li>Fixed a bug (#484) - First time <kbd>_csrf_set_hash()</kbd> is called, hash is never set to the cookie (in Security.php).</li>
- <li>Fixed a bug (#60) - Added <kbd>_file_mime_type()</kbd> method to the <a href="libraries/file_uploading.html">File Uploading Library</a> in order to fix a possible MIME-type injection (also fixes bug #394).</li>
- <li>Fixed a bug (#537) - Support for all wav type in browser.</li>
- <li>Fixed a bug (#576) - Using <kbd>ini_get()</kbd> function to detect if apc is enabled or not.</li>
- <li>Fixed invalid date time format in <a href="helpers/date_helper.html">Date helper</a> and <a href="libraries/xmlrpc.html">XMLRPC library</a>.</li>
-</ul>
-
-<h2>Version 2.0.3</h2>
-<p>Release Date: August 20, 2011</p>
-
-<ul>
- <li>Security
- <ul>
- <li>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. <p>An incompatibility in PHP versions &lt; 5.2.3 and MySQL &lt; 5.0.7 with <em>mysql_set_charset()</em> 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.</p> <p class="critical">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.</p></li>
- </ul>
- </li>
- <li>General Changes
- <ul>
- <li>Fixed a bug where there was a misspelling within a code comment in the index.php file.</li>
- <li>Added Session Class userdata to the output profiler. Additionally, added a show/hide toggle on HTTP Headers, Session Data and Config Variables.</li>
- <li>Removed internal usage of the <samp>EXT</samp> constant.</li>
- <li>Visual updates to the welcome_message view file and default error templates. Thanks to <a href="https://bitbucket.org/danijelb">danijelb</a> for the pull request.</li>
- <li>Added "application/x-csv" to mimes.php.</li>
- <li>Fixed a bug where <a href="libraries/email.html">Email library</a> attachments with a "." in the name would using invalid MIME-types.</li>
- <li>Callback validation rules can now accept parameters like any other validation rule.</li>
- </ul>
- </li>
- <li>Helpers
- <ul>
- <li>Added an optional third parameter to <samp>heading()</samp> which allows adding html attributes to the rendered heading tag.</li>
- <li><kbd>form_open()</kbd> 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)</li>
- <li>Re-worked <samp>plural()</samp> and <samp>singular()</samp> functions in the <a href="helpers/inflector_helper.html">Inflector helper</a> to support considerably more words.</li>
- </ul>
- </li>
- <li>Libraries
- <ul>
- <li>Altered Session to use a longer match against the user_agent string. See upgrade notes if using database sessions.</li>
- <li>Added <kbd>is_unique</kbd> to the <a href="libraries/form_validation.html">Form Validation library</a>.</li>
- <li>Added <kbd>$this->db->set_dbprefix()</kbd> to the <a href="database/queries.html">Database Driver</a>.</li>
- <li>Changed <kbd>$this->cart->insert()</kbd> in the <a href="libraries/cart.html">Cart Library</a> to return the Row ID if a single item was inserted successfully.</li>
- <li>Added <kbd>$this->load->get_var()</kbd> to the <a href="libraries/loader.html">Loader library</a> to retrieve global vars set with <kbd>$this->load->view()</kbd> and <kbd>$this->load->vars()</kbd>.</li>
- <li>Changed <kbd>$this->db->having()</kbd> to insert quotes using escape() rather than escape_str().</li>
- </ul>
- </li>
-</ul>
-
-<h3>Bug fixes for 2.0.3</h3>
-<ul>
- <li>Added ENVIRONMENT to reserved constants. (Reactor #196)</li>
- <li>Changed server check to ensure SCRIPT_NAME is defined. (Reactor #57)</li>
- <li>Removed <samp>APPPATH.'third_party'</samp> 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.</li>
- <li>Fixed a bug (Reactor #231) where Sessions Library database table example SQL did not contain an index on last_activity. See <a href="installation/upgrade_203.html">Upgrade Notes</a>.</li>
- <li>Fixed a bug (Reactor #229) where the Sessions Library example SQL in the documentation contained incorrect SQL.</li>
- <li>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.</li>
- <li>Fixed issue #199 - Attributes passed as string does not include a space between it and the opening tag.</li>
- <li>Fixed a bug where the method <kbd>$this->cart->total_items()</kbd> from <a href="libraries/cart.html">Cart Library</a> now returns the sum of the quantity of all items in the cart instead of your total count.</li>
- <li>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.</li>
- <li>Fixed a bug where using <kbd>$this->db->select_max()</kdb>, <kbd>$this->db->select_min()</kdb>, etc could throw notices. Thanks to w43l for the patch.</li>
- <li>Replace checks for STDIN with php_sapi_name() == 'cli' which on the whole is more reliable. This should get parameters in crontab working.</li>
-</ul>
-
-<h2>Version 2.0.2</h2>
-<p>Release Date: April 7, 2011<br />
-Hg Tag: v2.0.2</p>
-
-<ul>
- <li>General changes
- <ul>
- <li>The <a href="./libraries/security.html">Security library</a> was moved to the core and is now loaded automatically. Please remove your loading calls.</li>
- <li>The CI_SHA class is now deprecated. All supported versions of PHP provide a <kbd>sha1()</kbd> function.</li>
- <li><kbd>constants.php</kbd> will now be loaded from the environment folder if available.</li>
- <li>Added language key error logging</li>
- <li>Made Environment Support optional. Comment out or delete the constant to stop environment checks.</li>
- <li>Added Environment Support for Hooks.</li>
- <li>Added CI_ Prefix to the <a href="libraries/caching.html">Cache driver</a>.</li>
- <li>Added <a href="./general/cli.html">CLI usage</a> documentation.</li>
- </ul>
- </li>
- <li>Helpers
- <ul>
- <li>Removed the previously deprecated <kbd>dohash()</kbd> from the <a href="./helpers/security_helper.html">Security helper</a>; use <kbd>do_hash()</kbd> instead.</li>
- <li>Changed the 'plural' function so that it doesn't ruin the captalization of your string. It also take into consideration acronyms which are all caps.</li>
- </ul>
- </li>
- <li>Database
- <ul>
- <li><kbd>$this->db->count_all_results()</kbd> will now return an integer instead of a string.</li>
- </ul>
- </li>
-</ul>
-
-<h3>Bug fixes for 2.0.2</h3>
-<ul>
- <li>Fixed a bug (Reactor #145) where the Output Library had parse_exec_vars set to protected.</li>
- <li>Fixed a bug (Reactor #80) where is_really_writable would create an empty file when on Windows or with safe_mode enabled.</li>
- <li>Fixed various bugs with User Guide.</li>
- <li>Added is_cli_request() method to documentation for <a href="libraries/input.html">Input class</a>.</li>
- <li>Added form_validation_lang entries for <kbd>decimal</kbd>, <kbd>less_than</kbd> and <kbd>greater_than</kbd>.</li>
- <li><a href="https://bitbucket.org/ellislab/codeigniter-reactor/issue/153/escape-str-bug-in-mssql-driver">Fixed issue #153</a> Escape Str Bug in MSSQL driver.</li>
- <li><a href="https://bitbucket.org/ellislab/codeigniter-reactor/issue/172/bug-in-chrome-and-form_open-in-201">Fixed issue #172</a> Google Chrome 11 posts incorrectly when action is empty.</li>
-
-</ul>
-
-<h2>Version 2.0.1</h2>
-<p>Release Date: March 15, 2011<br />
-Hg Tag: v2.0.1</p>
-
-<ul>
- <li>General changes
- <ul>
- <li>Added <kbd>$config['cookie_secure']</kbd> to the config file to allow requiring a secure (HTTPS) in order to set cookies.</li>
- <li>Added the constant <kbd>CI_CORE</kbd> to help differentiate between Core: TRUE and Reactor: FALSE.</li>
- <li>Added an <kbd>ENVIRONMENT</kbd> constant in index.php, which affects PHP error reporting settings, and optionally,
- which configuration files are loaded (see below). Read more on the <a href="general/environments.html">Handling Environments</a> page.</li>
- <li>Added support for <a href="libraries/config.html#environments">environment-specific</a> configuration files.</li>
- </ul>
- </li>
- <li>Libraries
- <ul>
- <li>Added <kbd>decimal</kbd>, <kbd>less_than</kbd> and <kbd>greater_than</kbd> rules to the <a href="libraries/form_validation.html">Form validation Class</a>.</li>
- <li><a href="libraries/input.html">Input Class</a> methods <kbd>post()</kbd> and <kbd>get()</kbd> will now return a full array if the first argument is not provided.</li>
- <li>Secure cookies can now be made with the <kbd>set_cookie()</kbd> helper and <a href="libraries/input.html">Input Class</a> method.</li>
- <li>Added <kbd>set_content_type()</kbd> to <a href="libraries/output.html">Output Class</a> to set the output <kbd>Content-Type</kbd> HTTP header based on a MIME Type or a config/mimes.php array key.</li>
- <li><a href="libraries/output.html">Output Class</a> will now support method chaining.</li>
- </ul>
- </li>
- <li>Helpers
- <ul>
- <li>Changed the logic for <kbd>form_open()</kbd> in <a href="helpers/form_helper.html">Form helper</a>. If no value is passed it will submit to the current URL.</li>
- </ul>
- </li>
-</ul>
-
-<h3>Bug fixes for 2.0.1</h3>
-<ul>
- <li>CLI requests can now be run from any folder, not just when CD'ed next to index.php.</li>
- <li>Fixed issue #41: Added audio/mp3 mime type to mp3.</li>
- <li>Fixed a bug (Core #329) where the file caching driver referenced the incorrect cache directory.</li>
- <li>Fixed a bug (Reactor #69) where the SHA1 library was named incorrectly.</li>
-</ul>
-
-<h2>Version 2.0.0</h2>
-<p>Release Date: January 28, 2011<br />
-Hg Tag: v2.0.0</p>
-
-<ul>
- <li>General changes
- <ul>
- <li>PHP 4 support is removed. CodeIgniter now requires PHP 5.1.6.</li>
- <li>Scaffolding, having been deprecated for a number of versions, has been removed.</li>
- <li>Plugins have been removed, in favor of Helpers. The CAPTCHA plugin has been converted to a Helper and <a href="./helpers/captcha_helper.html">documented</a>. The JavaScript calendar plugin was removed due to the ready availability of great JavaScript calendars, particularly with jQuery.</li>
- <li>Added new special Library type: <a href="./general/drivers.html">Drivers</a>.</li>
- <li>Added full query-string support. See the config file for details.</li>
- <li>Moved the application folder outside of the system folder.</li>
- <li>Moved system/cache and system/logs directories to the application directory.</li>
- <li>Added routing overrides to the main index.php file, enabling the normal routing to be overridden on a per "index" file basis.</li>
- <li>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.</li>
- <li>Added <kbd>$config['directory_trigger']</kbd> to the config file so that a controller sub-directory can be specified when running _GET strings instead of URI segments.</li>
- <li>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 <a href="libraries/loader.html">Loader class</a> documentation for more details.</li>
- <li>In-development code is now hosted at <a href="http://bitbucket.org/ellislab/codeigniter-reactor/">BitBucket</a>.</li>
- <li>Removed the deprecated Validation Class.</li>
- <li>Added CI_ Prefix to all core classes.</li>
- <li>Package paths can now be set in application/config/autoload.php.</li>
- <li><a href="libraries/file_uploading.html">Upload library</a> file_name can now be set without an extension, the extension will be taken from the uploaded file instead of the given name.</li>
- <li>In <a href="database/forge.html">Database Forge</a> the name can be omitted from $this->dbforge->modify_column()'s 2nd param if you aren't changing the name.</li>
- <li><kbd>$config['base_url']</kbd> is now empty by default and will guess what it should be.</li>
- <li>Enabled full Command Line Interface compatibility with <kbd>config['uri_protocol'] = 'CLI';</kbd>.</li>
- </ul>
- <li>Libraries
- <ul>
- <li>Added a <a href="libraries/caching.html">Cache driver</a> with APC, memcached, and file-based support.</li>
- <li>Added <var>$prefix</var>, <var>$suffix</var> and <var>$first_url</var> properties to <a href="./libraries/pagination.html">Pagination library</a>.</li>
- <li>Added the ability to suppress first, previous, next, last, and page links by setting their values to FALSE in the <a href="./libraries/pagination.html">Pagination library</a>.</li>
- <li>Added <a href="./libraries/security.html">Security library</a>, which now contains the <dfn>xss_clean</dfn> function, <dfn>filename_security</dfn> function and other security related functions.</li>
- <li>Added CSRF (Cross-site Reference Forgery) protection to the <a href="./libraries/security.html">Security library</a>.</li>
- <li>Added <var>$parse_exec_vars</var> property to Output library.</li>
- <li>Added ability to enable / disable individual sections of the <a href="general/profiling.html">Profiler</a></li>
- <li>Added a wildcard option <kbd>$config['allowed_types'] = '*'</kbd> to the <a href="./libraries/file_uploading.html">File Uploading Class</a>.</li>
- <li>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.</li>
- <li>Added "is_object" into the list of unit tests capable of being run.</li>
- <li>Table library will generate an empty cell with a blank string, or NULL value.</li>
- <li>Added ability to set tag attributes for individual cells in the Table library</li>
- <li>Added a <kbd>parse_string()</kbd> method to the <a href="libraries/parser.html">Parser Class</a>.</li>
- <li>Added HTTP headers and Config information to the <a href="general/profiling.html">Profiler</a> output.</li>
- <li>Added Chrome and Flock to the list of detectable browsers by <kbd>browser()</kbd> in the <a href="libraries/user_agent.html">User Agent Class</a>.</li>
- <li>The <a href="libraries/unit_testing.html">Unit Test Class</a> now has an optional "notes" field available to it, and allows for discrete display of test result items using <kbd>$this->unit->set_test_items()</kbd>.</li>
- <li>Added a <kbd>$xss_clean</kbd> class variable to the XMLRPC library, enabling control over the use of the Security library's <kbd>xss_clean()</kbd> method.</li>
- <li>Added a <kbd>download()</kbd> method to the <a href="libraries/ftp.html">FTP library</a></li>
- <li>Changed <kbd>do_xss_clean()</kbd> to return FALSE if the uploaded file fails XSS checks.</li>
- <li>Added stripslashes() and trim()ing of double quotes from $_FILES type value to standardize input in Upload library.</li>
- <li>Added a second parameter (boolean) to <kbd>$this->zip->read_dir('/path/to/directory', FALSE)</kbd> 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.</li>
- <li>Added ability in the Image Library to handle PNG transparency for resize operations when using the GD lib.</li>
- <li>Modified the Session class to prevent use if no encryption key is set in the config file.</li>
- <li>Added a new config item to the Session class <kbd>sess_expire_on_close</kbd> to allow sessions to auto-expire when the browser window is closed.</li>
- <li>Improved performance of the Encryption library on servers where Mcrypt is available.</li>
- <li>Changed the default encryption mode in the Encryption library to CBC.</li>
- <li>Added an <kbd>encode_from_legacy()</kbd> method to provide a way to transition encrypted data from CodeIgniter 1.x to CodeIgniter 2.x.
- Please see the <a href="./installation/upgrade_200.html">upgrade instructions</a> for details.</li>
- <li>Altered Form_Validation library to allow for method chaining on <kbd>set_rules()</kbd>, <kbd>set_message()</kbd> and <kbd>set_error_delimiters()</kbd> functions.</li>
- <li>Altered Email Library to allow for method chaining.</li>
- <li>Added <kbd>request_headers()</kbd>, <kbd>get_request_header()</kbd> and <kbd>is_ajax_request()</kbd> to the input class.</li>
- <li>Altered <a href="libraries/user_agent.html">User agent library</a> so that <kbd>is_browser()</kbd>, <kbd>is_mobile()</kbd> and <kbd>is_robot()</kbd> can optionally check for a specific browser or mobile device.</li>
- <li>Altered <a href="libraries/input.html">Input library</a> so that <kbd>post()</kbd> and <kbd>get()</kbd> will return all POST and GET items (respectively) if there are no parameters passed in.</li>
- </ul>
- </li>
- <li>Database
- <ul>
- <li><a href="./database/configuration.html">database configuration</a>.</li>
- <li>Added <kbd>autoinit</kbd> value to <a href="./database/configuration.html">database configuration</a>.</li>
- <li>Added <kbd>stricton</kbd> value to <a href="./database/configuration.html">database configuration</a>.</li>
- <li>Added <kbd>database_exists()</kbd> to the <a href="database/utilities.html">Database Utilities Class</a>.</li>
- <li>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.</li>
- <li>Fixed a bug where driver specific table identifier protection could lead to malformed queries in the <kbd>field_data()</kbd> functions.</li>
- <li>Fixed a bug where an undefined class variable was referenced in database drivers.</li>
- <li>Modified the database errors to show the filename and line number of the problematic query.</li>
- <li>Removed the following deprecated functions: orwhere, orlike, groupby, orhaving, orderby, getwhere.</li>
- <li>Removed deprecated _drop_database() and _create_database() functions from the db utility drivers.</li>
- <li>Improved dbforge create_table() function for the Postgres driver.</li>
- </ul>
- </li>
- <li>Helpers
- <ul>
- <li>Added <kbd>convert_accented_characters()</kbd> function to <a href="./helpers/text_helper.html">text helper</a>.</li>
- <li>Added accept-charset to the list of inserted attributes of <kbd>form_open()</kbd> in the <a href="helpers/form_helper.html">Form Helper</a>.</li>
- <li>Deprecated the <kbd>dohash()</kbd> function in favour of <kbd>do_hash()</kbd> for naming consistency.</li>
- <li>Non-backwards compatible change made to <kbd>get_dir_file_info()</kbd> in the <a href="helpers/file_helper.html">File Helper</a>. No longer recurses
- by default so as to encourage responsible use (this function can cause server performance issues when used without caution).</li>
- <li>Modified the second parameter of <kbd>directory_map()</kbd> in the <a href="helpers/directory_helper.html">Directory Helper</a> to accept an integer to specify recursion depth.</li>
- <li>Modified <kbd>delete_files()</kbd> in the <a href="helpers/file_helper.html">File Helper</a> to return FALSE on failure.</li>
- <li>Added an optional second parameter to <kbd>byte_format()</kbd> in the <a href="helpers/number_helper.html">Number Helper</a> to allow for decimal precision.</li>
- <li>Added alpha, and sha1 string types to <kbd>random_string()</kbd> in the <a href="helpers/string_helper.html">String Helper</a>.</li>
- <li>Modified <kbd>prep_url()</kbd> so as to not prepend http:// if the supplied string already has a scheme.</li>
- <li>Modified <kbd>get_file_info</kbd> in the file helper, changing filectime() to filemtime() for dates.</li>
- <li>Modified <kbd>smiley_js()</kbd> to add optional third parameter to return only the javascript with no script tags.</li>
- <li>The <kbd>img()</kbd> function of the <a href="./helpers/html_helper.html">HTML helper</a> will now generate an empty string as an alt attribute if one is not provided.</li>
- <li>If CSRF is enabled in the application config file, <kbd>form_open()</kbd> will automatically insert it as a hidden field.</li>
- <li>Added <kbd>sanitize_filename()</kbd> into the <a href="./helpers/security_helper.html">Security helper</a>.</li>
- <li>Added <kbd>ellipsize()</kbd> to the <a href="./helpers/text_helper.html">Text Helper</a></li>
- <li>Added <kbd>elements()</kbd> to the <a href="./helpers/array_helper.html">Array Helper</a></li>
- </ul>
- </li>
- <li>Other Changes
- <ul>
- <li>Added an optional second parameter to <kbd>show_404()</kbd> to disable logging.</li>
- <li>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.</li>
- <li>Increased randomness with <kbd>is_really_writable()</kbd> to avoid file collisions when hundreds or thousands of requests occur at once.</li>
- <li>Switched some DIR_WRITE_MODE constant uses to FILE_WRITE_MODE where files and not directories are being operated on.</li>
- <li><kbd>get_mime_by_extension()</kbd> is now case insensitive.</li>
- <li>Added "default" to the list <a href="general/reserved_names.html">Reserved Names</a>.</li>
- <li>Added 'application/x-msdownload' for .exe files and ''application/x-gzip-compressed' for .tgz files to config/mimes.php.</li>
- <li>Updated the output library to no longer compress output or send content-length headers if the server runs with zlib.output_compression enabled.</li>
- <li>Eliminated a call to is_really_writable() on each request unless it is really needed (Output caching)</li>
- <li>Documented <kbd>append_output()</kbd> in the <a href="libraries/output.html">Output Class</a>.</li>
- <li>Documented a second argument in the <kbd>decode()</kbd> function for the <a href="libraries/encryption.html">Encryption Class</a>.</li>
- <li>Documented db->close().</li>
- <li>Updated the router to support a default route with any number of segments.</li>
- <li>Moved _remove_invisible_characters() function from the <a href="libraries/security.html">Security Library</a> to <a href="general/common_functions.html">common functions.</a></li>
- <li>Added audio/mpeg3 as a valid mime type for MP3.</li>
- </ul>
- </li>
-</ul>
-
-<h3>Bug fixes for 2.0.0</h3>
-<ul>
- <li>Fixed a bug where you could not change the User-Agent when sending email.</li>
- <li>Fixed a bug where the Output class would send incorrect cached output for controllers implementing their own <dfn>_output()</dfn> method.</li>
- <li>Fixed a bug where a failed query would not have a saved query execution time causing errors in the Profiler</li>
- <li>Fixed a bug that was writing log entries when multiple identical helpers and plugins were loaded.</li>
- <li>Fixed assorted user guide typos or examples (#10693, #8951, #7825, #8660, #7883, #6771, #10656).</li>
- <li>Fixed a language key in the profiler: "profiler_no_memory_usage" to "profiler_no_memory".</li>
- <li>Fixed an error in the Zip library that didn't allow downloading on PHP 4 servers.</li>
- <li>Fixed a bug in the Form Validation library where fields passed as rule parameters were not being translated (#9132)</li>
- <li>Modified inflector helper to properly pluralize words that end in 'ch' or 'sh'</li>
- <li>Fixed a bug in xss_clean() that was not allowing hyphens in query strings of submitted URLs.</li>
- <li>Fixed bugs in get_dir_file_info() and get_file_info() in the File Helper with recursion, and file paths on Windows.</li>
- <li>Fixed a bug where Active Record override parameter would not let you disable Active Record if it was enabled in your database config file.</li>
- <li>Fixed a bug in reduce_double_slashes() in the String Helper to properly remove duplicate leading slashes (#7585)</li>
- <li>Fixed a bug in values_parsing() of the XML-RPC library which prevented NULL variables typed as 'string' from being handled properly.</li>
- <li>Fixed a bug were form_open_multipart() didn't accept string attribute arguments (#10930).</li>
- <li>Fixed a bug (#10470) where <kdb>get_mime_by_extension()</kbd> was case sensitive.</li>
- <li>Fixed a bug where some error messages for the SQLite and Oracle drivers would not display.</li>
- <li>Fixed a bug where files created with the Zip Library would result in file creation dates of 1980.</li>
- <li>Fixed a bug in the Session library that would result in PHP error when attempting to store values with objects.</li>
- <li>Fixed a bug where extending the Controller class would result in a fatal PHP error.</li>
- <li>Fixed a PHP Strict Standards Error in the index.php file.</li>
- <li>Fixed a bug where getimagesize() was being needlessly checked on non-image files in is_allowed_type().</li>
- <li>Fixed a bug in the Encryption library where an empty key was not triggering an error.</li>
- <li>Fixed a bug in the Email library where CC and BCC recipients were not reset when using the clear() method (#109).</li>
- <li>Fixed a bug in the URL Helper where prep_url() could cause a PHP error on PHP versions &lt; 5.1.2.</li>
- <li>Added a log message in core/output if the cache directory config value was not found.</li>
- <li>Fixed a bug where multiple libraries could not be loaded by passing an array to load-&gt;library()</li>
- <li>Fixed a bug in the html helper where too much white space was rendered between the src and alt tags in the img() function.</li>
- <li>Fixed a bug in the profilers _compile_queries() function.</li>
- <li>Fixed a bug in the date helper where the DATE_ISO8601 variable was returning an incorrectly formatted date string.</li>
-</ul>
-
-<h2>Version 1.7.2</h2>
-<p>Release Date: September 11, 2009<br />
-Hg Tag: v1.7.2</p>
-
-<ul>
- <li>Libraries
- <ul>
- <li>Added a new <a href="libraries/cart.html">Cart Class</a>.</li>
- <li>Added the ability to pass $config['file_name'] for the <a href="libraries/file_uploading.html">File Uploading Class</a> and rename the uploaded file.</li>
- <li>Changed order of listed user-agents so Safari would more accurately report itself. (#6844)</li>
- </ul>
- </li>
- <li>Database
- <ul>
- <li>Switched from using gettype() in escape() to is_* methods, since future PHP versions might change its output.</li>
- <li>Updated all database drivers to handle arrays in escape_str()</li>
- <li>Added escape_like_str() method for escaping strings to be used in LIKE conditions</li>
- <li>Updated Active Record to utilize the new LIKE escaping mechanism.</li>
- <li>Added reconnect() method to DB drivers to try to keep alive / reestablish a connection after a long idle.</li>
- <li>Modified MSSQL driver to use mssql_get_last_message() for error messages.</li>
- </ul>
- </li>
- <li>Helpers
- <ul>
- <li>Added <kbd>form_multiselect()</kbd> to the <a href="helpers/form_helper.html">Form helper</a>.</li>
- <li>Modified <kbd>form_hidden()</kbd> in the <a href="helpers/form_helper.html">Form helper</a> to accept multi-dimensional arrays.</li>
- <li>Modified <kbd>form_prep()</kbd> in the <a href="helpers/form_helper.html">Form helper</a> 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.</li>
- <li>Modified <kbd>directory_map()</kbd> in the <a href="helpers/directory_helper.html">Directory helper</a> to allow the inclusion of hidden files, and to return FALSE on failure to read directory.</li>
- <li>Modified the <a href="helpers/smiley_helper.html">Smiley helper</a> to work with multiple fields and insert the smiley at the last known cursor position.</li>
- </ul>
- </li>
- <li>General
- <ul>
- <li>Compatible with PHP 5.3.0</li>
- <li>Modified <a href="general/errors.html">show_error()</a> to allow sending of HTTP server response codes.</li>
- <li>Modified <a href="general/errors.html">show_404()</a> to send 404 status code, removing non-CGI compatible header() statement from error_404.php template.</li>
- <li>Added set_status_header() to the <a href="general/common_functions.html">Common functions<a> to allow use when the Output class is unavailable.</li>
- <li>Added is_php() to <a href="general/common_functions.html">Common functions</a> to facilitate PHP version comparisons.</p>
- <li>Added 2 CodeIgniter "cheatsheets" (thanks to DesignFellow.com for this contribution).</li>
- </ul>
- </li>
-</ul>
-
-<h3>Bug fixes for 1.7.2</h3>
-<ul>
- <li>Fixed assorted user guide typos or examples (#6743, #7214, #7516, #7287, #7852, #8224, #8324, #8349).</li>
- <li>Fixed a bug in the Form Validation library where multiple callbacks weren't working (#6110)</li>
- <li>doctype helper default value was missing a "1".</li>
- <li>Fixed a bug in the language class when outputting an error for an unfound file.</li>
- <li>Fixed a bug in the Calendar library where the shortname was output for "May".</li>
- <li>Fixed a bug with ORIG_PATH_INFO that was allowing URIs of just a slash through.</li>
- <li>Fixed a fatal error in the Oracle and ODBC drivers (#6752)</li>
- <li>Fixed a bug where xml_from_result() was checking for a nonexistent method.</li>
- <li>Fixed a bug where Database Forge's add_column and modify_column were not looping through when sent multiple fields.</li>
- <li>Fixed a bug where the File Helper was using '/' instead of the DIRECTORY_SEPARATOR constant.</li>
- <li>Fixed a bug to prevent PHP errors when attempting to use sendmail on servers that have manually disabled the PHP popen() function.</li>
- <li>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.</li>
- <li>Fixed a bug in the XML-RPC class with parsing dateTime.iso8601 data types.</li>
- <li>Fixed a case sensitive string replacement in xss_clean()</li>
- <li>Fixed a bug in form_textarea() where form data was not prepped correctly.</li>
- <li>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</li>
- <li>Fixed a bug in _protect_identifiers() where the swap prefix ($swap_pre) was not being observed.</li>
- <li>Fixed a bug where the 400 status header sent with the 'disallowed URI characters' was not compatible with CGI environments.</li>
- <li>Fixed a bug in the typography class where heading tags could have paragraph tags inserted when using auto_typography().</li>
-</ul>
-
-<h2>Version 1.7.1</h2>
-<p>Release Date: February 10, 2009<br />
-Hg Tag: 1.7.1</p>
-
-<ul>
- <li>Libraries
- <ul>
- <li>Fixed an arbitrary script execution security flaw (#6068) in the Form Validation library (thanks to hkk)</li>
- <li>Changed default current page indicator in the Pagination library to use &lt;strong&gt; instead of &lt;b&gt;</li>
- <li>A "HTTP/1.1 400 Bad Request" header is now sent when disallowed characters are encountered.</li>
- <li>Added &lt;big&gt;, &lt;small&gt;, &lt;q&gt;, and &lt;tt&gt; to the Typography parser's inline elements.</li>
- <li>Added more accurate error reporting for the Email library when using sendmail.</li>
- <li>Removed a strict type check from the <kbd>rotate()</kbd> function of the <a href="libraries/image_lib.html">Image Manipulation Class</a>.</li>
- <li>Added enhanced error checking in file saving in the Image library when using the GD lib.</li>
- <li>Added an additional newline between multipart email headers and the MIME message text for better compatibility with a variety of MUAs.</li>
- <li>Made modest improvements to efficiency and accuracy of explode_name() in the Image lib.</li>
- </ul>
- </li>
- <li>Database
- <ul>
- <li>Added where_in to the list of expected arguments received by <kbd>delete()</kbd>.</li>
- </ul>
- </li>
- <li>Helpers
- <ul>
- <li>Added the ability to have optgroups in <kbd>form_dropdown()</kbd> within the <a href="helpers/form_helper.html">form helper</a>.</li>
- <li>Added a doctype() function to the <a href="helpers/html_helper.html">HTML helper</a>.</li>
- <li>Added ability to force lowercase for <kbd>url_title()</kbd> in the <a href="helpers/url_helper.html">URL helper</a>.</li>
- <li>Changed the default "type" of <kbd>form_button()</kbd> to "button" from "submit" in the <a href="helpers/form_helper.html">form helper</a>.</li>
- <li>Changed redirect() in the URL helper to allow redirections to URLs outside of the CI site.</li>
- <li>Updated get_cookie() to try to fetch the cookie using the global cookie prefix if the requested cookie name doesn't exist.</li>
- </ul>
- </li>
- <li>Other Changes
- <ul>
- <li>Improved security in <kbd>xss_clean()</kbd> to help prevent attacks targeting Internet Explorer.</li>
- <li>Added 'application/msexcel' to config/mimes.php for .xls files.</li>
- <li>Added 'proxy_ips' config item to whitelist reverse proxy servers from which to trust the HTTP_X_FORWARDED_FOR header to
- to determine the visitor's IP address.</li>
- <li>Improved accuracy of Upload::is_allowed_filetype() for images (#6715)</li>
- </ul>
- </li>
-</ul>
-
-<h3>Bug fixes for 1.7.1</h3>
-<ul>
- <li>Database
- <ul>
- <li>Fixed a bug when doing 'random' on order_by() (#5706).</li>
- <li>Fixed a bug where adding a primary key through Forge could fail (#5731).</li>
- <li>Fixed a bug when using DB cache on multiple databases (#5737).</li>
- <li>Fixed a bug where TRUNCATE was not considered a "write" query (#6619).</li>
- <li>Fixed a bug where csv_from_result() was checking for a nonexistent method.</li>
- <li>Fixed a bug _protect_identifiers() where it was improperly removing all pipe symbols from items</li>
- </ul>
- </li>
- <li>Fixed assorted user guide typos or examples (#5998, #6093, #6259, #6339, #6432, #6521).</li>
- <li>Fixed a bug in the MySQLi driver when no port is specified</li>
- <li>Fixed a bug (#5702), in which the field label was not being fetched properly, when "matching" one field to another.</li>
- <li>Fixed a bug in which identifers were not being escaped properly when reserved characters were used.</li>
- <li>Fixed a bug with the regular expression used to protect submitted paragraph tags in auto typography.</li>
- <li>Fixed a bug where double dashes within tag attributes were being converted to em dash entities.</li>
- <li>Fixed a bug where double spaces within tag attributes were being converted to non-breaking space entities.</li>
- <li>Fixed some accuracy issues with curly quotes in Typography::format_characters()</li>
- <li>Changed a few docblock comments to reflect actual return values.</li>
- <li>Fixed a bug with high ascii characters in subject and from email headers.</li>
- <li>Fixed a bug in xss_clean() where whitespace following a validated character entity would not be preserved.</li>
- <li>Fixed a bug where HTML comments and &lt;pre&gt; tags were being parsed in Typography::auto_typography().</li>
- <li>Fixed a bug with non-breaking space cleanup in Typography::auto_typography().</li>
- <li>Fixed a bug in database escaping where a compound statement (ie: SUM()) wasn't handled correctly with database prefixes.</li>
- <li>Fixed a bug when an opening quote is preceded by a paragraph tag and immediately followed by another tag.</li>
- <li>Fixed a bug in the Text Helper affecting some locales where word_censor() would not work on words beginning or ending with an accented character.</li>
- <li>Fixed a bug in the Text Helper character limiter where the provided limit intersects the last word of the string.</li>
- <li>Fixed a bug (#6342) with plural() in the Inflection helper with words ending in "y".</li>
- <li>Fixed bug (#6517) where Routed URI segments returned by URI::rsegment() method were incorrect for the default controller.</li>
- <li>Fixed a bug (#6706) in the Security Helper where xss_clean() was using a deprecated second argument.</li>
- <li>Fixed a bug in the URL helper url_title() function where trailing periods were allowed at the end of a URL.</li>
- <li>Fixed a bug (#6669) in the Email class when CRLF's are used for the newline character with headers when used with the "mail" protocol.</li>
- <li>Fixed a bug (#6500) where URI::A_filter_uri() was exit()ing an error instead of using show_error().</li>
- <li>Fixed a bug (#6592) in the File Helper where get_dir_file_info() where recursion was not occurring properly.</li>
- <li>Tweaked Typography::auto_typography() for some edge-cases.</li>
-</ul>
-
-
-<h2>Version 1.7</h2>
-<p>Release Date: October 23, 2008<br />
-Hg Tag: 1.7.0</p>
-
-<ul>
- <li>Libraries
- <ul>
- <li>Added a new <a href="libraries/form_validation.html">Form Validation Class</a>. 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. <strong>Please note that the old Validation class is now deprecated</strong>. 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.</li>
- <li>Updated the <a href="libraries/sessions.html">Sessions class</a> 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.</li>
- <li>Added the ability to store libraries in subdirectories within either the main "libraries" or the local application "libraries" folder. Please see the <a href="libraries/loader.html">Loader class</a> for more info.</li>
- <li>Added the ability to assign library objects to your own variable names when you use <kbd>$this->load->library()</kbd>. Please see the <a href="libraries/loader.html">Loader class</a> for more info.</li>
- <li>Added controller class/method info to <a href="general/profiling.html">Profiler class</a> and support for multiple database connections.</li>
- <li>Improved the "auto typography" feature and moved it out of the helper into its own <a href="libraries/typography.html">Typography Class</a>.</li>
- <li>Improved performance and accuracy of <kbd>xss_clean()</kbd>, including reduction of false positives on image/file tests.</li>
- <li>Improved <a href="./libraries/parser.html">Parser class</a> to allow multiple calls to the parse() function. The output of each is appended in the output.</li>
- <li>Added <dfn>max_filename</dfn> option to set a file name length limit in the <a href="libraries/file_uploading.html">File Upload Class</a>.</li>
- <li>Added <dfn>set_status_header()</dfn> function to <a href="libraries/output.html">Output class</a>.</li>
- <li>Modified <a href="libraries/pagination.html">Pagination</a> class to only output the "First" link when the link for page one would not be shown.</li>
- <li>Added support for mb_strlen in the <a href="libraries/form_validation.html">Form Validation</a> class so that multi-byte languages will calculate string lengths properly.</li>
- </ul>
- </li>
- <li>Database
- <ul>
- <li>Improved Active Record class to allow full path column and table names: hostname.database.table.column. Also improved the alias handling.</li>
- <li>Improved how table and column names are escaped and prefixed. It now honors full path names when adding prefixes and escaping.</li>
- <li>Added Active Record caching feature to "update" and "delete" functions.</li>
- <li>Added removal of non-printing control characters in <kbd>escape_str()</kbd> 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.</li>
- <li>Added port support to MySQL, MySQLi, and MS SQL database drivers.</li>
- <li>Added driver name variable in each DB driver, based on bug report #4436.</li>
- </ul>
- </li>
- <li>Helpers
- <ul>
- <li>Added several new "setting" functions to the <a href="helpers/form_helper.html">Form helper</a> that allow POST data to be retrieved and set into forms. These are intended to be used on their own, or with the new <a href="libraries/form_validation.html">Form Validation Class</a>.</li>
- <li>Added <kbd>current_url()</kbd> and uri_segments() to <a href="helpers/url_helper.html">URL helper</a>.</li>
- <li>Altered <kbd>auto_link()</kbd> in the <a href="helpers/url_helper.html">URL helper</a> so that email addresses with "+" included will be linked.</li>
- <li>Added <kbd>meta()</kbd> function to <a href="helpers/html_helper.html">HTML helper</a>.</li>
- <li>Improved accuracy of calculations in <a href="helpers/number_helper.html">Number helper</a>.</li>
- <li>Removed added newlines ("\n") from most form and html helper functions.</li>
- <li>Tightened up validation in the <a href="helpers/date_helper.html">Date helper</a> function <kbd>human_to_unix()</kbd>, and eliminated the POSIX regex.</li>
- <li>Updated <a href="helpers/date_helper.html">Date helper</a> to match the world's current time zones and offsets.</li>
- <li>Modified url_title() in the <a href="helpers/url_helper.html">URL helper</a> 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.</li>
- <li>Added support for arbitrary attributes in anchor_popup() of the <a href="helpers/url_helper.html">URL helper</a>.</li>
- </ul>
- </li>
- <li>Other Changes
- <ul>
- <li>Added <a href="./general/styleguide.html">PHP Style Guide</a> to docs.</li>
- <li>Added sanitization in <kbd>xss_clean()</kbd> for a deprecated HTML tag that could be abused in user input in Internet Explorer.</li>
- <li>Added a few openxml document mime types, and an additional mobile agent to mimes.php and user_agents.php respectively.</li>
- <li>Added a file lock check during caching, before trying to write to the file.</li>
- <li>Modified Cookie key cleaning to unset a few troublesome key names that can be present in certain environments, preventing CI from halting execution.</li>
- <li>Changed the output of the profiler to use style attribute rather than clear, and added the id "codeigniter_profiler" to the container div.</li>
- </ul>
- </li>
-</ul>
-
-<h3>Bug fixes for 1.7.0</h3>
-<ul>
- <li>Fixed bug in <kbd>xss_clean()</kbd> that could remove some desirable tag attributes.</li>
- <li>Fixed assorted user guide typos or examples (#4807, #4812, #4840, #4862, #4864, #4899, #4930, #5006, #5071, #5158, #5229, #5254, #5351).</li>
- <li>Fixed an edit from 1.6.3 that made the $robots array in user_agents.php go poof.</li>
- <li>Fixed a bug in the <a href="libraries/email.html">Email library</a> with quoted-printable encoding improperly encoding space and tab characters.</li>
- <li>Modified XSS sanitization to no longer add semicolons after &amp;[single letter], such as in M&amp;M's, B&amp;B, etc.</li>
- <li>Modified XSS sanitization to no longer strip XHTML image tags of closing slashes.</li>
- <li>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.</li>
- <li>Fixed a bug (#4536) in backups with the MySQL driver where some legacy code was causing certain characters to be double escaped.</li>
- <li>Fixed a routing bug (#4661) that occurred when the default route pointed to a subfolder.</li>
- <li>Fixed the spelling of "Dhaka" in the <kbd>timezone_menu()</kbd> function of the <a href="helpers/date_helper.html">Date helper.</a></li>
- <li>Fixed the spelling of "raspberry" in config/smileys.php.</li>
- <li>Fixed incorrect parenthesis in <kbd>form_open()</kbd> function (#5135).</li>
- <li>Fixed a bug that was ignoring case when comparing controller methods (#4560).</li>
- <li>Fixed a bug (#4615) that was not setting SMTP authorization settings when using the initialize function.</li>
- <li>Fixed a bug in <kbd>highlight_code()</kbd> in the <a href="helpers/text_helper.html">Text helper</a> that would leave a stray &lt;/span&gt; in certain cases.</li>
- <li>Fixed Oracle bug (#3306) that was preventing multiple queries in one action.</li>
- <li>Fixed ODBC bug that was ignoring connection params due to its use of a constructor.</li>
- <li>Fixed a DB driver bug with num_rows() that would cause an error with the Oracle driver.</li>
- <li>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.</li>
- <li>Fixed a DB caching bug (4718) in which the path was incorrect when no URI segments were present.</li>
- <li>Fixed Image_lib class bug #4562. A path was not defined for NetPBM.</li>
- <li>Fixed Image_lib class bug #4532. When cropping an image with identical height/width settings on output, a copy is made.</li>
- <li>Fixed DB_driver bug (4900), in which a database error was not being logged correctly.</li>
- <li>Fixed DB backup bug in which field names were not being escaped.</li>
- <li>Fixed a DB Active Record caching bug in which multiple calls to cached data were not being honored.</li>
- <li>Fixed a bug in the Session class that was disallowing slashes in the serialized array.</li>
- <li>Fixed a Form Validation bug in which the "isset" error message was being trigged by the "required" rule.</li>
- <li>Fixed a spelling error in a Loader error message.</li>
- <li>Fixed a bug (5050) with IP validation with empty segments.</li>
- <li>Fixed a bug in which the parser was being greedy if multiple identical sets of tags were encountered.</li>
-</ul>
-
-<h2>Version 1.6.3</h2>
-<p>Release Date: June 26, 2008<br />
-Hg Tag: v1.6.3</p>
-
-<p>Version 1.6.3 is a security and maintenance release and is recommended for all users.</p>
-<ul>
- <li>Database
- <ul>
- <li>Modified MySQL/MySQLi Forge class to give explicit names to keys</li>
- <li>Added ability to set multiple column non-primary keys to the <a href="database/forge.html">Forge class</a></li>
- <li>Added ability to set additional database config values in <a href="database/connecting.html">DSN connections</a> via the query string.</li>
- </ul>
- </li>
- <li>Libraries
- <ul>
- <li>Set the mime type check in the <a href="libraries/file_uploading.html">Upload class</a> to reference the global mimes variable.</li>
- <li>Added support for query strings to the <a href="libraries/pagination.html">Pagination class</a>, automatically detected or explicitly declared.</li>
- <li>Added <kbd>get_post()</kbd> to the <a href="libraries/input.html">Input class</a>.</li>
- <li>Documented <kbd>get()</kbd> in the <a href="libraries/input.html">Input class</a>.</li>
- <li>Added the ability to automatically output language items as form labels in the <a href="libraries/language.html">Language class</a>.</li>
- </ul>
- </li>
- <li>Helpers
- <ul>
- <li>Added a <a href="helpers/language_helper.html">Language helper</a>.</li>
- <li>Added a <a href="helpers/number_helper.html">Number helper</a>.</li>
- <li><a href="helpers/form_helper.html">Form helper</a> refactored to allow <kbd>form_open()</kbd> and <kbd>form_fieldset()</kbd> to accept arrays or strings as arguments.</li>
- </ul>
- </li>
- <li>Other changes
- <ul>
- <li>Improved security in <kbd>xss_clean()</kbd>.</li>
- <li>Removed an unused Router reference in <kbd>_display_cache()</kbd>.</li>
- <li>Added ability to <a href="libraries/input.html">use xss_clean() to test images</a> for XSS, useful for upload security.</li>
- <li>Considerably expanded list of mobile user-agents in config/user_agents.php.</li>
- <li>Charset information in the userguide has been moved above title for internationalization purposes (#4614).</li>
- <li>Added &quot;Using Associative Arrays In a Request Parameter&quot; example to the <a href="libraries/xmlrpc.html">XMLRPC userguide page</a>.</li>
- <li>Removed maxlength and size as automatically added attributes of form_input() in the <a href="helpers/form_helper.html">form helper</a>.</li>
- <li>Documented the language file use of <kbd>byte_format()</kbd> in the <a href="helpers/number_helper.html">number helper</a>.</li>
- </ul>
- </li>
-</ul>
-
-
-<h3>Bug fixes for 1.6.3</h3>
-
-<ul>
- <li>Added a language key for valid_emails in validation_lang.php.</li>
- <li>Amended fixes for bug (#3419) with parsing DSN database connections.</li>
- <li>Moved the <kbd>_has_operators()</kbd> function (#4535) into DB_driver from DB_active_rec.</li>
- <li>Fixed a syntax error in upload_lang.php.</li>
- <li>Fixed a bug (#4542) with a regular expression in the Image library.</li>
- <li>Fixed a bug (#4561) where <kbd>orhaving()</kbd> wasn't properly passing values.</li>
- <li>Removed some unused variables from the code (#4563).</li>
- <li>Fixed a bug where <kbd>having()</kbd> was not adding an = into the statement (#4568).</li>
- <li>Fixed assorted user guide typos or examples (#4574, #4706).</li>
- <li>Added quoted-printable headers to Email class when the multi-part override is used.</li>
- <li>Fixed a double opening &lt;p&gt; tag in the index pages of each system directory.</li>
-</ul>
-
-<h2>Version 1.6.2</h2>
-<p>Release Date: May 13, 2008<br />
-Hg Tag: 1.6.2</p>
-<ul>
- <li>Active Record
- <ul>
- <li>Added the ability to prevent escaping in <kbd>having()</kbd> clauses.</li>
- <li>Added <kbd>rename_table()</kbd> into <a href="./database/forge.html">DBForge</a>.</li>
- <li>Fixed a bug that wasn't allowing escaping to be turned off if the value of a query was NULL.</li>
- <li>DB Forge is now assigned to any models that exist after loading (#3457).</li>
- </ul>
- </li>
- <li>Database
- <ul>
- <li>Added <a href="./database/transactions.html">Strict Mode</a> to database transactions.</li>
- <li>Escape behaviour in where() clauses has changed; values in those with the &quot;FALSE&quot; argument are no longer escaped (ie: quoted).</li>
- </ul>
- </li>
- <li>Config
- <ul>
- <li>Added 'application/vnd.ms-powerpoint' to list of mime types.</li>
- <li>Added 'audio/mpg' to list of mime types.</li>
- <li>Added new user-modifiable file constants.php containing file mode and fopen constants.</li>
- <li>Added the ability to set CRLF settings via config in the <a href="libraries/email.html">Email</a> class.</li>
- </ul>
- </li>
- <li>Libraries
- <ul>
- <li>Added increased security for filename handling in the Upload library.</li>
- <li>Added increased security for sessions for client-side data tampering.</li>
- <li>The MySQLi forge class is now in sync with MySQL forge. </li>
- <li>Added the ability to set CRLF settings via config in the <a href="libraries/email.html">Email</a> class.</li>
- <li><a href="libraries/unit_testing.html">Unit Testing</a> results are now colour coded, and a change was made to the default template of results.</li>
- <li>Added a valid_emails rule to the Validation class.</li>
- <li>The <a href="libraries/zip.html">Zip class</a> now exits within <kbd>download()</kbd>.</li>
- <li>The <a href="libraries/zip.html">Zip class</a> has undergone a substantial re-write for speed and clarity (thanks stanleyxu for the hard work and code contribution in bug report #3425!)</li>
- </ul>
- </li>
- <li>Helpers
- <ul>
- <li>Added a <a href="helpers/compatibility_helper.html">Compatibility Helper</a> 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!)</li>
- <li>Added <kbd>form_button()</kbd> in the <a href="helpers/form_helper.html">Form helper</a>.</li>
- <li>Changed the <kbd>radio()</kbd> and <kbd>checkbox()</kbd> functions to default to not checked by default.</li>
- <li>Added the ability to include an optional HTTP Response Code in the <kbd>redirect()</kbd> function of the <a href="helpers/url_helper.html">URL Helper</a>.</li>
- <li>Modified <kbd>img()</kbd> in the <a href="helpers/html_helper.html">HTML Helper</a> to remove an unneeded space (#4208).</li>
- <li>Modified <kbd>anchor()</kbd> in the <a href="helpers/url_helper.html">URL helper</a> to no longer add a default title= attribute (#4209).</li>
- <li>The <a href="helpers/download_helper.html">Download helper</a> now exits within <kbd>force_download()</kbd>.</li>
- <li>Added <kbd>get_dir_file_info()</kbd>, <kbd>get_file_info()</kbd>, and <kbd>get_mime_by_extension()</kbd> to the <a href="helpers/file_helper.html">File Helper</a>.</li>
- <li>Added <kbd>symbolic_permissions()</kbd> and <kbd>octal_permissions()</kbd> to the <a href='helpers/file_helper.html'>File helper</a>.</li>
- </ul>
- </li>
- <li>Plugins
- <ul>
- <li>Modified captcha generation to first look for the function imagecreatetruecolor, and fallback to imagecreate if it isn't available (#4226).</li>
- </ul>
- </li>
- <li>Other
- Changes
- <ul>
- <li>Added ability for <a href="libraries/input.html">xss_clean()</a> to accept arrays.</li>
- <li>Removed closing PHP tags from all PHP files to avoid accidental output and potential 'cannot modify headers' errors.</li>
- <li>Removed &quot;scripts&quot; 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.</li>
- <li>Added a <a href="general/reserved_names.html">Reserved Names</a> page to the userguide, and migrated reserved controller names into it.</li>
- <li>Added a <a href="general/common_functions.html">Common Functions</a> page to the userguide for globally available functions.</li>
- <li>Improved security and performance of xss_clean().</li>
- </ul>
- </li>
- </ul>
-
-<h3>Bugfixes for 1.6.2</h3>
-<ul>
- <li>Fixed a bug where SET queries were not being handled as "write" queries.</li>
- <li>Fixed a bug (#3191) with ORIG_PATH_INFO URI parsing.</li>
- <li>Fixed a bug in DB Forge, when inserting an id field (#3456).</li>
- <li>Fixed a bug in the table library that could cause identically constructed rows to be dropped (#3459).</li>
- <li>Fixed DB Driver and MySQLi result driver checking for resources instead of objects (#3461).</li>
- <li>Fixed an AR_caching error where it wasn't tracking table aliases (#3463).</li>
- <li>Fixed a bug in AR compiling, where select statements with arguments got incorrectly escaped (#3478).</li>
- <li>Fixed an incorrect documentation of $this-&gt;load-&gt;language (#3520).</li>
- <li>Fixed bugs (#3523, #4350) in get_filenames() with recursion and problems with Windows when $include_path is used.</li>
- <li>Fixed a bug (#4153) in the XML-RPC class preventing dateTime.iso8601 from being used.</li>
- <li>Fixed an AR bug with or_where_not_in() (#4171).</li>
- <li>Fixed a bug with <a href="libraries/input.html">xss_clean()</a> that would add semicolons to GET URI variable strings.</li>
- <li>Fixed a bug (#4206) in the Directory Helper where the directory resource was not being closed, and minor improvements.</li>
- <li>Fixed a bug in the FTP library where delete_dir() was not working recursively (#4215).</li>
- <li>Fixed a Validation bug when set_rules() is used with a non-array field name and rule (#4220).</li>
- <li>Fixed a bug (#4223) where DB caching would not work for returned DB objects or multiple DB connections.</li>
- <li>Fixed a bug in the Upload library that might output the same error twice (#4390).</li>
- <li>Fixed an AR bug when joining with a table alias and table prefix (#4400).</li>
- <li>Fixed a bug in the DB class testing the $params argument.</li>
- <li>Fixed a bug in the Table library where the integer 0 in cell data would be displayed as a blank cell.</li>
- <li>Fixed a bug in <kbd>link_tag()</kbd> of the <a href="helpers/url_helper.html">URL helper</a> where a key was passed instead of a value.</li>
- <li>Fixed a bug in DB_result::row() that prevented it from returning individual fields with MySQL NULL values.</li>
- <li>Fixed a bug where SMTP emails were not having dot transformation performed on lines that begin with a dot.</li>
- <li>Fixed a bug in display_error() in the DB driver that was instantiating new Language and Exception objects, and not using the error heading.</li>
- <li>Fixed a bug (#4413) where a URI containing slashes only e.g. 'http://example.com/index.php?//' would result in PHP errors</li>
- <li>Fixed an array to string conversion error in the Validation library (#4425)</li>
- <li>Fixed bug (#4451, #4299, #4339) where failed transactions will not rollback when debug mode is enabled.</li>
- <li>Fixed a bug (#4506) with overlay_watermark() in the Image library preventing support for PNG-24s with alpha transparency</li>
- <li>Fixed assorted user guide typos (#3453, #4364, #4379, #4399, #4408, #4412, #4448, #4488).</li>
- </ul>
-
-<h2>Version 1.6.1</h2>
-<p>Release Date: February 12, 2008<br />
-Hg Tag: 1.6.1</p>
-<ul>
- <li>Active Record
- <ul>
- <li>Added <a href="./database/active_record.html#caching">Active Record Caching</a>.</li>
- <li>Made Active Record fully database-prefix aware.</li>
- </ul>
- </li>
- <li>Database drivers
- <ul>
- <li>Added support for setting client character set and collation for MySQLi.</li>
- </ul>
- </li>
- <li>Core Changes
- <ul>
- <li>Modified <kbd>xss_clean()</kbd> to be more intelligent with its handling of URL encoded strings.</li>
- <li>Added $_SERVER, $_FILES, $_ENV, and $_SESSION to sanitization of globals.</li>
- <li>Added a <a href="./helpers/path_helper.html">Path Helper</a>.</li>
- <li>Simplified <kbd>_reindex_segments()</kbd> in the URI class.</li>
- <li>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.</li>
- <li>Modified method calling to controllers to show a 404 when a private or protected method is accessed via a URL.</li>
- <li>Modified framework initiated 404s to log the controller and method for invalid requests.</li>
- </ul>
- </li>
- <li>Helpers
- <ul>
- <li>Modified <kbd>get_filenames()</kbd> in the File Helper to return FALSE if the $source_dir is not readable.</li>
- </ul>
- </li>
-</ul>
-
-
-<h3>Bugfixes for 1.6.1</h3>
-<ul>
- <li>Deprecated is_numeric as a validation rule. Use of numeric and integer are preferred.</li>
- <li>Fixed bug (#3379) in DBForge with SQLite for table creation.</li>
- <li>Made Active Record fully database prefix aware (#3384).</li>
- <li>Fixed a bug where DBForge was outputting invalid SQL in Postgres by adding brackets around the tables in FROM.</li>
- <li>Changed the behaviour of Active Record's update() to make the WHERE clause optional (#3395).</li>
- <li>Fixed a bug (#3396) where certain POST variables would cause a PHP warning.</li>
- <li>Fixed a bug in query binding (#3402).</li>
- <li>Changed order of SQL keywords in the Profiler $highlight array so OR would not be highlighted before ORDER BY.</li>
- <li>Fixed a bug (#3404) where the MySQLi driver was testing if $this->conn_id was a resource instead of an object.</li>
- <li>Fixed a bug (#3419) connecting to a database via a DSN string.</li>
- <li>Fixed a bug (#3445) where the routed segment array was not re-indexed to begin with 1 when the default controller is used.</li>
- <li>Fixed assorted user guide typos.</li>
-</ul>
-
-
-
-<h2>Version 1.6.0</h2>
-<p>Release Date: January 30, 2008 </p>
-<ul>
- <li>DBForge
- <ul>
- <li>Added <a href="./database/forge.html">DBForge</a> to the database tools.</li>
- <li>Moved <kbd>create_database()</kbd> and <kbd>drop_database()</kbd> into <a href="./database/forge.html">DBForge</a>.</li>
- <li>Added <kbd>add_field()</kbd>, <kbd>add_key()</kbd>, <kbd>create_table()</kbd>, <kbd>drop_table()</kbd>, <kbd>add_column()</kbd>, <kbd>drop_column()</kbd>, <kbd>modify_column()</kbd> into <a href="./database/forge.html">DBForge</a>.</li>
- </ul>
- </li>
-
- <li>Active Record
- <ul>
- <li>Added <kbd>protect_identifiers()</kbd> in <a href="./database/active_record.html">Active Record</a>.</li>
- <li>All AR queries are backticked if appropriate to the database.</li>
- <li>Added <kbd>where_in()</kbd>, <kbd>or_where_in()</kbd>, <kbd>where_not_in()</kbd>, <kbd>or_where_not_in()</kbd>, <kbd>not_like()</kbd> and <kbd>or_not_like()</kbd> to <a href="./database/active_record.html">Active Record</a>.</li>
- <li>Added support for <kbd>limit()</kbd> into <kbd>update()</kbd> and <kbd>delete()</kbd> statements in <a href="./database/active_record.html">Active Record</a>.</li>
- <li>Added <kbd>empty_table()</kbd> and <kbd>truncate_table()</kbd> to <a href="./database/active_record.html">Active Record</a>.</li>
- <li>Added the ability to pass an array of tables to the <kbd>delete()</kbd> statement in <a href="./database/active_record.html">Active Record</a>.</li>
- <li>Added <kbd>count_all_results()</kbd> function to <a href="./database/active_record.html">Active Record</a>.</li>
- <li>Added <kbd>select_max()</kbd>, <kbd>select_min()</kbd>, <kbd>select_avg()</kbd> and <kbd>select_sum()</kbd> to <a href="./database/active_record.html">Active Record</a>.</li>
- <li>Added the ability to use aliases with joins in <a href="./database/active_record.html">Active Record</a>.</li>
- <li>Added a third parameter to Active Record's <kbd>like()</kbd> clause to control where the wildcard goes. </li>
- <li>Added a third parameter to <kbd>set()</kbd> in <a href="./database/active_record.html">Active Record</a> that withholds escaping data.</li>
- <li>Changed the behaviour of variables submitted to the where() clause with no values to auto set &quot;IS NULL&quot;</li>
- </ul>
- </li>
-
- <li>Other Database Related
- <ul>
- <li>MySQL driver now requires MySQL 4.1+</li>
- <li>Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or not. Previously they were always saved.</li>
- <li>Added $this->db->dbprefix() to manually add database prefixes.</li>
- <li>Added 'random' as an <kbd>order_by()</kbd> option , and removed &quot;rand()&quot; as a listed option as it was MySQL only.</li>
- <li>Added a check for NULL fields in the MySQL database backup utility.</li>
- <li>Added &quot;constrain_by_prefix&quot; parameter to db-&gt;list_table() function. If set to TRUE it will limit the result to only table names with the current prefix.</li>
- <li>Deprecated from Active Record; <kbd>getwhere()</kbd> for <kbd>get_where()</kbd>; <kbd>groupby()</kbd> for <kbd>group_by()</kbd>; <kbd>havingor()</kbd> for <kbd>having_or()</kbd>; <kbd>orderby()</kbd> for <kbd>order_by</kbd>; <kbd>orwhere()</kbd> for <kbd>or_where()</kbd>; and <kbd>orlike()</kbd> for <kbd>or_like()</kbd>.</li>
- <li>Modified <kbd>csv_from_result()</kbd> to output CSV data more in the spirit of basic rules of RFC 4180.</li>
- <li>Added 'char_set' and 'dbcollat' database configuration settings, to explicitly set the client communication properly.</li>
- <li>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).</li>
- </ul>
- </li>
-
- <li>Core changes
- <ul>
- <li>Added ability to load multiple views, whose content will be appended to the output in the order loaded.</li>
- <li>Added the ability to <a href="./general/autoloader.html">auto-load</a> <a href="./general/models.html">Models</a>.</li>
- <li>Reorganized the URI and Routes classes for better clarity.</li>
- <li>Added Compat.php to allow function overrides for older versions of PHP or PHP environments missing certain extensions / libraries</li>
- <li>Added memory usage, GET, URI string data, and individual query execution time to Profiler output.</li>
- <li>Deprecated Scaffolding.</li>
- <li>Added is_really_writable() to Common.php to provide a cross-platform reliable method of testing file/folder writability.</li>
- </ul>
- </li>
-
- <li>Libraries
- <ul>
- <li>Changed the load protocol of Models to allow for extension.</li>
- <li>Strengthened the Encryption library to help protect against man in the middle attacks when MCRYPT_MODE_CBC mode is used.</li>
- <li>Added Flashdata variables, session_id regeneration and configurable session update times to the <a href="./libraries/sessions.html">Session class.</a></li>
- <li>Removed 'last_visit' from the Session class.</li>
- <li>Added a language entry for valid_ip validation error.</li>
- <li>Modified prep_for_form() in the Validation class to accept arrays, adding support for POST array validation (via callbacks only)</li>
- <li>Added an &quot;integer&quot; rule into the Validation library.</li>
- <li>Added valid_base64() to the Validation library.</li>
- <li>Documented clear() in the <a href="../libraries/image_lib.html">Image Processing</a> library.</li>
- <li>Changed the behaviour of custom callbacks so that they no longer trigger the &quot;required&quot; rule. </li>
- <li>Modified Upload class $_FILES error messages to be more precise.</li>
- <li>Moved the safe mode and auth checks for the Email library into the constructor. </li>
- <li>Modified variable names in _ci_load() method of Loader class to avoid conflicts with view variables.</li>
- <li>Added a few additional mime type variations for CSV.</li>
- <li>Enabled the 'system' methods for the XML-RPC Server library, except for 'system.multicall' which is still disabled.</li>
- </ul>
- </li>
-
- <li>Helpers &amp; Plugins
- <ul>
- <li>Added link_tag() to the <a href="./helpers/html_helper.html">HTML helper.</a></li>
- <li>Added img() to the <a href="./helpers/html_helper.html">HTML helper.</a></li>
- <li>Added ability to <a href="./general/helpers.html">"extend" Helpers</a>.</li>
- <li>Added an <a href="./helpers/email_helper.html">email helper</a> into core helpers.</li>
- <li>Added <kbd>strip_quotes()</kbd> function to <a href="./helpers/string_helper.html">string helper</a>.</li>
- <li>Added <kbd>reduce_multiples()</kbd> function to <a href="./helpers/string_helper.html">string helper</a>.</li>
- <li>Added <kbd>quotes_to_entities()</kbd> function to <a href="./helpers/string_helper.html">string helper</a>.</li>
- <li>Added <kbd>form_fieldset()</kbd>, <kbd>form_fieldset_close()</kbd>, <kbd>form_label()</kbd>, and <kbd>form_reset()</kbd> function to <a href="./helpers/form_helper.html">form helper</a>.</li>
- <li>Added support for external urls in <kbd>form_open()</kbd>.</li>
- <li>Removed support for db_backup in MySQLi due to incompatible functions.</li>
- <li>Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.</li>
- </ul>
- </li>
-
-
- <li>Documentation Changes
- <ul>
- <li>Added <a href="./doc_style/index.html">Writing Documentation</a> section for the community to use in writing their own documentation.</li>
- <li>Added titles to all user manual pages.</li>
- <li>Added attributes into &lt;html&gt; of userguide for valid html.</li>
- <li>Added <a href="http://codeigniter.com/user_guide/libraries/zip.html">Zip Encoding Class</a> to the table of contents of the userguide.</li>
- <li>Moved part of the userguide menu javascript to an external file.</li>
- <li>Documented <kbd>distinct()</kbd> in <a href="./database/active_record.html">Active Record</a>. </li>
- <li>Documented the <kbd>timezones()</kbd> function in the <a href="./helpers/date_helper.html">Date Helper</a>.</li>
- <li>Documented unset_userdata in the <a href="./libraries/sessions.html">Session class</a>.</li>
- <li>Documented 2 config options to the <a href="./database/configuration.html">Database configuration</a> page.</li>
- </ul>
- </li>
-</ul>
-
-<h3>Bug fixes for Version 1.6.0</h3>
-
-<ul>
- <li>Fixed a bug (#1813) preventing using $CI->db in the same application with returned database objects.</li>
- <li>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.</li>
- <li>Fixed a bug (#1872) where word_limiter() was not retaining whitespace.</li>
- <li>Fixed a bug (#1890) in csv_from_result() where content that included the delimiter would break the file.</li>
- <li>Fixed a bug (#2542)in the clean_email() method of the Email class to allow for non-numeric / non-sequential array keys.</li>
- <li>Fixed a bug (#2545) in <kbd>_html_entity_decode_callback()</kbd> when 'global_xss_filtering' is enabled.</li>
- <li>Fixed a bug (#2668) in the <a href="./libraries/parser.html">parser class</a> where numeric data was ignored.</li>
- <li>Fixed a bug (#2679) where the &quot;previous&quot; pagination link would get drawn on the first page.</li>
- <li>Fixed a bug (#2702) in _object_to_array that broke some types of inserts and updates.</li>
- <li>Fixed a bug (#2732) in the SQLite driver for PHP 4.</li>
- <li>Fixed a bug (#2754) in Pagination to scan for non-positive num_links.</li>
- <li>Fixed a bug (#2762) in the <a href="./libraries/sessions.html">Session library</a> where user agent matching would fail on user agents ending with a space. </li>
- <li>Fixed a bug (#2784) $field_names[] vs $Ffield_names[] in postgres and sqlite drivers.</li>
- <li>Fixed a bug (#2810) in the typography helper causing extraneous paragraph tags when string contains tags.</li>
- <li>Fixed a bug (#2849) where arguments passed to a subfolder controller method would be incorrectly shifted, dropping the 3rd segment value.</li>
- <li>Fixed a bug (#2858) which referenced a wrong variable in the Image class.</li>
- <li>Fixed a bug (#2875)when loading plugin files as _plugin. and not _pi.</li>
- <li>Fixed a bug (#2912) in <kbd>get_filenames()</kbd> in the <a href="./helpers/file_helper.html">File Helper </a>where the array wasn't cleared after each call.</li>
- <li>Fixed a bug (#2974) in <kbd>highlight_phrase()</kbd> that caused an error with slashes.</li>
- <li>Fixed a bug (#3003) in the Encryption Library to support modes other than MCRYPT_MODE_ECB</li>
- <li>Fixed a bug (#3015) in the <a href="./libraries/user_agent.html">User Agent library</a> where more then 2 languages where not reported with languages().</li>
- <li>Fixed a bug (#3017) in the <a href="./libraries/email.html">Email</a> library where some timezones were calculated incorrectly. </li>
- <li>Fixed a bug (#3024) in which master_dim wasn't getting reset by clear() in the Image library.</li>
- <li>Fixed a bug (#3156) in Text Helper highlight_code() causing PHP tags to be handled incorrectly.</li>
- <li>Fixed a bug (#3166) that prevented num_rows from working in Oracle.</li>
- <li>Fixed a bug (#3175) preventing certain libraries from working properly when autoloaded in PHP 4.</li>
- <li>Fixed a bug (#3267) in the Typography Helper where unordered list was listed &quot;un.</li>
- <li>Fixed a bug (#3268) where the Router could leave '/' as the path.</li>
- <li>Fixed a bug (#3279) where the Email class was sending the wrong Content-Transfer-Encoding for some character sets.</li>
- <li>Fixed a bug (#3284) where the rsegment array would not be set properly if the requested URI contained more segments than the routed URI.</li>
- <li>Removed extraneous load of $CFG in _display_cache() of the Output class (#3285).</li>
- <li>Removed an extraneous call to loading models (#3286).</li>
- <li>Fixed a bug (#3310) with sanitization of globals in the Input class that could unset CI's global variables.</li>
- <li>Fixed a bug (#3314) which would cause the top level path to be deleted in delete_files() of the File helper.</li>
- <li>Fixed a bug (#3328) where the smiley helper might return an undefined variable.</li>
- <li>Fixed a bug (#3330) in the FTP class where a comparison wasn't getting made.</li>
- <li>Removed an unused parameter from Profiler (#3332).</li>
- <li>Fixed a bug in database driver where num_rows property wasn't getting updated.</li>
- <li>Fixed a bug in the <a href="./libraries/file_uploading.html">upload library</a> when allowed_files wasn't defined.</li>
- <li>Fixed a bug in <kbd>word_wrap()</kbd> of the Text Helper that incorrectly referenced an object. </li>
- <li>Fixed a bug in Validation where <kbd>valid_ip()</kbd> wasn't called properly.</li>
- <li>Fixed a bug in Validation where individual error messages for checkboxes wasn't supported.</li>
- <li>Fixed a bug in captcha calling an invalid PHP function.</li>
- <li>Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.</li>
- <li>Fixed a bug that was making validation callbacks required even when not set as such.</li>
- <li>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.</li>
- <li>Fixed an example of comma-separated emails in the email library documentation.</li>
- <li>Fixed an example in the Calendar library for Showing Next/Previous Month Links.</li>
- <li>Fixed a typo in the database language file.</li>
- <li>Fixed a typo in the image language file &quot;suppor&quot; to &quot;support&quot;.</li>
- <li>Fixed an example for XML RPC.</li>
- <li>Fixed an example of <kbd>accept_charset()</kbd> in the <a href="./libraries/user_agent.html">User Agent Library</a>.</li>
- <li>Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.</li>
- <li>Fixed a typo in the <a href="./helpers/string_helper.html">String Helper</a> (uniquid changed to uniqid).</li>
- <li>Fixed typos in the email Language class (email_attachment_unredable, email_filed_smtp_login), and FTP Class (ftp_unable_to_remame).</li>
- <li>Added a stripslashes() into the Upload Library.</li>
- <li>Fixed a series of grammatical and spelling errors in the language files.</li>
- <li>Fixed assorted user guide typos.</li>
-</ul>
-<h2>Version 1.5.4</h2>
-<p>Release Date: July 12, 2007 </p>
-<ul>
- <li>Added <a href="./libraries/language.html">custom Language files</a> to the <a href="./general/autoloader.html">autoload</a> options. </li>
- <li>Added stripslashes() to the _clean_input_data() function in the <a href="./libraries/input.html">Input class</a> when magic quotes is on so that data will always be un-slashed within the framework.</li>
- <li>Added array to string into the <a href="general/profiling.html">profiler</a>.</li>
- <li>Added some additional mime types in application/config/mimes.php.</li>
- <li>Added filename_security() method to <a href="./libraries/input.html">Input library</a>.</li>
- <li>Added some additional arguments to the <a href="./helpers/inflector_helper.html">Inflection helper</a> singular() to compensate for words ending in "s". Also added a force parameter to pluralize().</li>
- <li>Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.</li>
- <li>Fixed MSSQL insert_id().</li>
- <li>Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.</li>
- <li>Fixed a bug that was allowing multiple load attempts on extended classes.</li>
- <li>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.</li>
- <li>Fixed a bug in the escape_str() function in the MySQL driver.</li>
- <li>Fixed a typo in the <a href="./libraries/calendar.html">Calendar library </a> </li>
- <li>Fixed a typo in rpcs.php library</li>
- <li>Fixed a bug in the <a href="./libraries/zip.html">Zip library</a>, providing PC Zip file compatibility with Mac OS X</li>
- <li>Fixed a bug in router that was ignoring the scaffolding route for optimization </li>
- <li>Fixed an IP validation bug.</li>
- <li>Fixed a bug in display of POST keys in the <a href="./general/profiling.html">Profiler</a> output</li>
- <li>Fixed a bug in display of queries with characters that would be interpreted as HTML in the <a href="./general/profiling.html">Profiler</a> output</li>
- <li>Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output</li>
- <li>Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type</li>
- <li>Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data</li>
- <li>Fixed an undefined function error in the insert_id() function of the PostgreSQL driver</li>
- <li>Fixed various doc typos. </li>
- <li>Documented two functions from the <a href="./helpers/string_helper.html">String helper </a> that were missing from the user guide: trim_slashes() and reduce_double_slashes().</li>
- <li>Docs now validate to XHTML 1 transitional</li>
- <li>Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits</li>
- <li>Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.</li>
- <li>Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs</li>
- <li>Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.</li>
- <li>Modified the <a href="./helpers/url_helper.html">URL Helper</a> to type cast the $title as a string in case a numeric value is supplied</li>
- <li>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'</li>
- <li>Deprecated the use if <kbd>is_numeric()</kbd> in various places since it allows periods. Due to compatibility problems with <kbd>ctype_digit()</kbd>, making it unreliable in some installations, the following regular expression was used instead: <kbd>preg_match("/[^0-9]/", $n)</kbd></li>
- <li>Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity. </li>
-</ul>
-<h2>Version 1.5.3</h2>
-<p>Release Date: April 15, 2007 </p>
-<ul>
- <li>Added array to string into the profiler </li>
- <li>Code Igniter references updated to CodeIgniter </li>
- <li>pMachine references updated to EllisLab </li>
- <li>Fixed a bug in the repeater function of <a href="./helpers/string_helper.html">string helper</a>. </li>
- <li>Fixed a bug in ODBC driver </li>
- <li>Fixed a bug in result_array() that was returning an empty array when no result is produced.</li>
- <li>Fixed a bug in the redirect function of the <a href="./helpers/url_helper.html">url helper</a>. </li>
- <li>Fixed an undefined variable in Loader </li>
- <li>Fixed a version bug in the Postgres driver </li>
- <li>Fixed a bug in the textarea function of the form helper for use with strings</li>
- <li>Fixed doc typos. </li>
-</ul>
-<h2>Version 1.5.2</h2>
-<p>Release Date: February 13, 2007 </p>
-<ul>
- <li>Added <a href="./installation/downloads.html#svn">subversion information</a> to the <a href="./installation/downloads.html">downloads</a> page. </li>
- <li>Added support for captions in the <a href="./libraries/table.html">Table Library</a> </li>
- <li>Fixed a bug in the <a href="./helpers/download_helper.html">download_helper</a> that was causing Internet Explorer to load rather than download </li>
- <li>Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.</li>
- <li>Removed unescaped variables in error messages of Input and Router classes</li>
- <li>Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log. </li>
- <li>Fixed a bug in the <a href="./helpers/form_helper.html">form helper</a> that gave textarea a value attribute </li>
- <li>Fixed a bug in the <a href="./libraries/image_lib.php">Image Library</a> that was ignoring resizing the same size image </li>
- <li>Fixed some doc typos.</li>
-</ul>
-
-
-<h2>Version 1.5.1</h2>
-<p>Release Date: November 23, 2006</p>
-<ul>
- <li>Added support for submitting arrays of libraries in the $this-&gt;load-&gt;library function.</li>
- <li>Added support for naming custom library files in lower or uppercase.</li>
- <li>Fixed a bug related to output buffering.</li>
- <li>Fixed a bug in the active record class that was not resetting query data after a completed query.</li>
- <li>Fixed a bug that was suppressing errors in controllers.</li>
- <li>Fixed a problem that can cause a loop to occur when the config file is missing.</li>
- <li>Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.</li>
- <li>Fixed an oversight that was not unsetting globals properly in the input sanitize function.</li>
- <li>Fixed some bugs in the Oracle DB driver.</li>
- <li>Fixed an incorrectly named variable in the MySQLi result driver.</li>
- <li>Fixed some doc typos.</li>
-</ul>
-<h2>Version 1.5.0.1</h2>
-<p>Release Date: October 31, 2006</p>
-<ul>
-<li>Fixed a problem in which duplicate attempts to load helpers and classes were not being stopped.</li>
-<li>Fixed a bug in the word_wrap() helper function.</li>
-<li>Fixed an invalid color Hex number in the Profiler class.</li>
-<li>Fixed a corrupted image in the user guide.</li>
-</ul>
-
-
-
-<h2>Version 1.5.0</h2>
-<p>Release Date: October 30, 2006</p>
-
-<ul>
-<li>Added <a href="./database/utilities.html">DB utility class</a>, permitting DB backups, CVS or XML files from DB results, and various other functions.</li>
-<li>Added <a href="./database/caching.html">Database Caching Class</a>.</li>
-<li>Added <a href="./database/transactions.html">transaction support</a> to the database classes.</li>
-<li>Added <a href="./general/profiling.html">Profiler Class</a> which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.</li>
-<li>Added <a href="./libraries/user_agent.html">User Agent Library</a> which allows browsers, robots, and mobile devises to be identified.</li>
-<li>Added <a href="./libraries/table.html">HTML Table Class</a> , enabling tables to be generated from arrays or database results.</li>
-<li>Added <a href="./libraries/zip.html">Zip Encoding Library</a>.</li>
-<li>Added <a href="./libraries/ftp.html">FTP Library</a>.</li>
-<li>Added the ability to <a href="./general/creating_libraries.html">extend libraries</a> and <a href="./general/core_classes.html">extend core classes</a>, in addition to being able to replace them.</li>
-<li>Added support for storing <a href="./general/models.html">models within sub-folders</a>.</li>
-<li>Added <a href="./helpers/download_helper.html">Download Helper</a>.</li>
-<li>Added <a href="./database/queries.html">simple_query()</a> function to the database classes</li>
-<li>Added <a href="./helpers/date_helper.html">standard_date()</a> function to the Date Helper.</li>
-<li>Added <a href="./database/results.html">$query->free_result()</a> to database class.</li>
-<li>Added <a href="./database/fields.html">$query->list_fields()</a> function to database class</li>
-<li>Added <a href="./database/helpers.html">$this->db->platform()</a> function</li>
-<li>Added new <a href="./helpers/file_helper.html">File Helper</a>: get_filenames()</li>
-<li>Added new helper: <a href="./helpers/smiley_helper.html">Smiley Helper</a></li>
-<li>Added support for &lt;ul> and &lt;ol> lists in the <a href="./helpers/html_helper.html">HTML Helper</a></li>
-<li>Added the ability to rewrite <a href="./general/alternative_php.html">short tags</a> 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.</li>
-<li>Added the ability to <a href="./general/managing_apps.html">rename or relocate the "application" folder</a>.</li>
-<li>Added more thorough initialization in the upload class so that all class variables are reset.</li>
-<li>Added "is_numeric" to validation, which uses the native PHP is_numeric function.</li>
-<li>Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.</li>
-<li>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.</li>
-<li>Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.</li>
-<li>Updated the <dfn>input->cookie()</dfn> and <dfn>input->post()</dfn> functions in <a href="./libraries/input.html">Input Class</a> to permit arrays contained cookies that are arrays to be run through the XSS filter.</li>
-<li>Documented three functions from the <a href="./libraries/validation.html">Validation class</a> that were missing from the user guide: set_select(), set_radio(), and set_checkbox().</li>
-<li>Fixed a bug in the Email class related to SMTP Helo data.</li>
-<li>Fixed a bug in the word wrapping helper and function in the email class.</li>
-<li>Fixed a bug in the validation class.</li>
-<li>Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.</li>
-<li>Fixed a problem in the form_prep() function that was double encoding entities.</li>
-<li>Fixed a bug that affects some versions of PHP when output buffering is nested.</li>
-<li>Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.</li>
-<li>Fixed a pagination bug that was permitting negative values in the URL.</li>
-<li>Fixed an oversight in which the Loader class was not allowed to be extended.</li>
-<li>Changed <dfn>_get_config()</dfn> to <dfn>get_config()</dfn> since the function is not a private one.</li>
-<li><strong>Deprecated "init" folder</strong>. Initialization happens automatically now. <a href="./general/creating_libraries.html">Please see documentation</a>.</li>
-<li><strong>Deprecated</strong> $this->db->field_names() USE $this->db->list_fields()</li>
-<li><strong>Deprecated</strong> the <dfn>$config['log_errors']</dfn> item from the config.php file. Instead, <dfn>$config['log_threshold']</dfn> can be set to "0" to turn it off.</li>
-</ul>
-
-
-
-
-<h2>Version 1.4.1</h2>
-<p>Release Date: September 21, 2006</p>
-
-<ul>
-<li>Added a new feature that passes URI segments directly to your function calls as parameters. See the <a href="./general/controllers.html">Controllers</a> page for more info.</li>
-<li>Added support for a function named <dfn>_output()</dfn>, which when used in your controllers will received the final rendered output from the output class. More info in the <a href="controllers.html">Controllers</a> page.</li>
-<li>Added several new functions in the <a href="./libraries/uri.html">URI Class</a> to let you retrieve and manipulate URI segments that have been re-routed using the <a href="routing.html">URI Routing</a> feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.</li>
-<li>Added <a href="./libraries/output.html">$this->output->set_header()</a> function, which allows you to set server headers.</li>
-<li>Updated plugins, helpers, and language classes to allow your <dfn>application</dfn> 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 <em>instead</em> the global ones.</li>
-<li>Added <a href="./helpers/inflector_helper.html">Inflector helper</a>.</li>
-<li>Added <dfn>element()</dfn> function in the <a href="./helpers/array_helper.html">array helper</a>.</li>
-<li>Added <dfn>RAND()</dfn> to active record <dfn>orderby()</dfn> function.</li>
-<li>Added <dfn>delete_cookie()</dfn> and <dfn>get_cookie()</dfn> to <a href="./helpers/cookie_helper.html">Cookie helper</a>, even though the input class has a cookie fetching function.</li>
-<li>Added Oracle database driver (still undergoing testing so it might have some bugs).</li>
-<li>Added the ability to combine pseudo-variables and php variables in the template parser class.</li>
-<li>Added output compression option to the config file.</li>
-<li>Removed the is_numeric test from the db->escape() function.</li>
-<li>Fixed a MySQLi bug that was causing error messages not to contain proper error data.</li>
-<li>Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.</li>
-<li>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.</li>
-<li>Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.</li>
-<li>Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.</li>
-<li>Added some code to allow email attachments to be reset when sending batches of email.</li>
-<li>Deprecated the <dfn>application/scripts</dfn> folder. It will continue to work for legacy users, but it is recommended that you create your own
-<a href="./general/libraries.html">libraries</a> or <a href="./general/models.html">models</a> instead. It was originally added before CI had user libraries or models, but it's not needed anymore.</li>
-<li>Deprecated the <dfn>$autoload['core']</dfn> item from the <kbd>autoload.php</kbd> file. Instead, please now use: <kbd>$autoload['libraries']</kbd></li>
-<li>Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().</li>
-</ul>
-
-
-
-<h2>Version 1.4.0</h2>
-<p>Release Date: September 17, 2006</p>
-
-<ul>
-<li>Added <a href="./general/hooks.html">Hooks</a> feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.</li>
-<li>Added the ability to organize controller files <a href="./general/controllers.html">into sub-folders</a>. Kudos to Marco for <a href="http://codeigniter.com/forums/viewthread/627/">suggesting</a> this (and the next two) feature.</li>
-<li>Added regular expressions support for <a href="./general/routing.html">routing rules</a>.</li>
-<li>Added the ability to <a href="./general/controllers.html">remap function calls</a> within your controllers.</li>
-<li>Added the ability to <a href="./general/core_classes.html">replace core system classes</a> with your own classes.</li>
-<li>Added support for % character in URL.</li>
-<li>Added the ability to supply full URLs using the <a href="./helpers/url_helper.html">anchor()</a> helper function.</li>
-<li>Added mode parameter to <a href="./helpers/file_helper.html">file_write()</a> helper.</li>
-<li>Added support for changing the port number in the <a href="./database/configuration.html">Postgres driver</a>.</li>
-<li>Moved the list of "allowed URI characters" out of the Router class and into the config file.</li>
-<li>Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.</li>
-<li>Updated the Upload class to allow the upload field name to be set when calling <a href="./libraries/file_uploading.html">do_upload()</a>.</li>
-<li>Updated the <a href="./libraries/config.html">Config Library</a> 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).</li>
-<li>Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.</li>
-<li>Updated the <dfn>form_open()</dfn> helper to allow the GET method to be used.</li>
-<li>Updated the MySQLi <dfn>execute()</dfn> function with some code to help prevent lost connection errors.</li>
-<li>Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.</li>
-<li>Updated the Models loader function to allow multiple loads of the same model.</li>
-<li>Updated the MS SQL driver so that single quotes are escaped.</li>
-<li>Updated the Postgres and ODBC drivers for better compatibility.</li>
-<li>Removed a strtolower() call that was changing URL segments to lower case.</li>
-<li>Removed some references that were interfering with PHP 4.4.1 compatibility.</li>
-<li>Removed backticks from Postgres class since these are not needed.</li>
-<li>Renamed <dfn>display()</dfn> to <dfn>_display()</dfn> in the Output class to make it clear that it's a private function.</li>
-<li>Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use <kbd>dohash()</kbd> instead.</li>
-<li>Fixed an bug that was preventing the input class from unsetting GET variables.</li>
-<li>Fixed a router bug that was making it too greedy when matching end segments.</li>
-<li>Fixed a bug that was preventing multiple discrete database calls.</li>
-<li>Fixed a bug in which loading a language file was producing a "file contains no data" message.</li>
-<li>Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.</li>
-<li>Fixed some missing prefixes when using the database prefix feature.</li>
-<li>Fixed a typo in the Calendar class (cal_november).</li>
-<li>Fixed a bug in the <dfn>form_checkbox()</dfn> helper.</li>
-<li>Fixed a bug that was allowing the second segment of the URI to be identical to the class name.</li>
-<li>Fixed an evaluation bug in the database initialization function.</li>
-<li>Fixed a minor bug in one of the error messages in the language class.</li>
-<li>Fixed a bug in the date helper <dfn>timespan</dfn> function.</li>
-<li>Fixed an undefined variable in the DB Driver class.</li>
-<li>Fixed a bug in which dollar signs used as binding replacement values in the DB class would be treated as RegEx back-references.</li>
-<li>Fixed a bug in the <dfn>set_hash()</dfn> function which was preventing MD5 from being used.</li>
-<li>Fixed a couple bugs in the Unit Testing class.</li>
-<li>Fixed an incorrectly named variable in the Validation class.</li>
-<li>Fixed an incorrectly named variable in the URI class.</li>
-<li>Fixed a bug in the config class that was preventing the base URL from being called properly.</li>
-<li>Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.</li>
-<li>Fixed a problem that was preventing scaffolding from working properly with MySQLi.</li>
-<li>Fixed some MS SQL bugs.</li>
-<li>Fixed some doc typos.</li>
-</ul>
-
-
-
-<h2>Version 1.3.3</h2>
-<p>Release Date: June 1, 2006</p>
-
-<ul>
-
-<li>Models do <strong>not</strong> connect automatically to the database as of this version. <a href="./general/models.html">More info here</a>.</li>
-<li>Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.</li>
-<li>Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.</li>
-<li>Fixed a bug in the active record "having" function.</li>
-<li>Fixed a problem in the validation class which was making checkboxes be ignored when required.</li>
-<li>Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.</li>
-<li>Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.</li>
-<li>Fixed a validation bug that was preventing rules from being set twice in one controller.</li>
-<li>Fixed a calendar bug that was not letting it use dynamically loaded languages.</li>
-<li>Fixed a bug in the active record class when using WHERE clauses with LIKE</li>
-<li>Fixed a bug in the hash() security helper.</li>
-<li>Fixed some typos.</li>
-</ul>
-
-
-
-
-<h2>Version 1.3.2</h2>
-<p>Release Date: April 17, 2006</p>
-
-<ul>
-<li>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.</li>
-<li>Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.</li>
-<li>Fixed a bug in the init_pagination file. The $config item was not being set correctly.</li>
-<li>Fixed a bug in the auto typography helper that was causing inconsistent behavior.</li>
-<li>Fixed a couple bugs in the Model class.</li>
-<li>Fixed some documentation typos and errata.</li>
-</ul>
-
-
-
-<h2>Version 1.3.1</h2>
-<p>Release Date: April 11, 2006</p>
-
-<ul>
-<li>Added a <a href="./libraries/unit_testing.html">Unit Testing Library</a>.</li>
-<li>Added the ability to pass objects to the <strong>insert()</strong> and <strong>update()</strong> database functions.
-This feature enables you to (among other things) use your <a href="./general/models.html">Model class</a> variables to run queries with. See the Models page for details.</li>
-<li>Added the ability to pass objects to the <a href="./general/views.html">view loading function</a>: $this->load->view('my_view', <var>$object</var>);</li>
-<li>Added <kbd>getwhere</kbd> function to <a href="./database/active_record.html">Active Record class</a>.</li>
-<li>Added <kbd>count_all</kbd> function to <a href="./database/active_record.html">Active Record class</a>.</li>
-<li>Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.</li>
-<li>Added <a href="./database/queries.html">$this->db->last_query()</a>, which allows you to view your last query that was run.</li>
-<li>Added a new mime type to the upload class for better compatibility.</li>
-<li>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.</li>
-<li>Fixed a bug in a couple of the active record functions (where and orderby).</li>
-<li>Fixed a bug in the image library when realpath() returns false.</li>
-<li>Fixed a bug in the Models that was preventing libraries from being used within them.</li>
-<li>Fixed a bug in the "exact_length" function of the validation class.</li>
-<li>Fixed some typos in the user guide</li>
-</ul>
-
-
-<h2>Version 1.3</h2>
-<p>Release Date: April 3, 2006</p>
-
-<ul>
-<li>Added support for <a href="models.html">Models</a>.</li>
-<li>Redesigned the database libraries to support additional RDBMs (Postgres, MySQLi, etc.).</li>
-<li>Redesigned the <a href="./database/active_record.html">Active Record class</a> to enable more varied types of queries with simpler syntax, and advanced features like JOINs.</li>
-<li>Added a feature to the database class that lets you run <a href="./database/call_function.html">custom function calls</a>.</li>
-<li>Added support for <a href="controllers.html">private functions</a> in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.</li>
-<li>Added the ability to pass your own initialization parameters to your <a href="creating_libraries.html">custom core libraries</a> when using $this->load->library()</li>
-<li>Added support for running standard <a href="urls.html">query string URLs</a>. These can be optionally enabled in your config file.</li>
-<li>Added the ability to <a href="urls.html">specify a "suffix"</a>, 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.</li>
-<li>Added a new error template for use with native PHP errors.</li>
-<li>Added "alternator" function in the <a href="./helpers/string_helper.html">string helpers</a>.</li>
-<li>Removed slashing from the input class. After much debate we decided to kill this feature.</li>
-<li>Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.</li>
-<li>Added better class and function name-spacing to avoid collisions with user developed classes. All CodeIgniter classes are now prefixed with <dfn>CI_</dfn> and
-all controller methods are prefixed with <dfn>_ci</dfn> to avoid controller collisions. A list of reserved function names can be <a href="controllers.html">found here</a>.</li>
-<li>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.</li>
-<li>Deprecated: <var>$this->db->use_table()</var> has been deprecated. Please read the <a href="./database/active_record.html">Active Record</a> page for information.</li>
-<li>Deprecated: <var>$this->db->smart_escape_str()</var> has been deprecated. Please use this instead: <var>$this->db->escape()</var></li>
-<li>Fixed a bug in the exception handler which was preventing some PHP errors from showing up.</li>
-<li>Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()</li>
-<li>Fixed some typos in the default calendar template</li>
-<li>Fixed some typos in the user guide</li>
-</ul>
-
-
-
-
-
-
-
-
-<h2>Version 1.2</h2>
-<p>Release Date: March 21, 2006</p>
-
-<ul>
-<li>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.</li>
-<li>Added a global function named <a href="ancillary_classes.html">get_instance()</a> allowing the main CodeIgniter object to be accessible throughout your own classes.</li>
-<li>Added new <a href="./helpers/file_helper.html">File Helper</a>: delete_files()</li>
-<li>Added new <a href="./helpers/url_helper.html">URL Helpers</a>: base_url(), index_page()</li>
-<li>Added the ability to create your own <a href="creating_libraries.html">core libraries</a> and store them in your local application directory.</li>
-<li>Added an <kbd>overwrite</kbd> option to the <a href="./libraries/file_uploading.html">Upload class</a>, enabling files to be overwritten rather than having the file name appended.</li>
-<li>Added Javascript Calendar plugin.</li>
-<li>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.</li>
-<li>Updated the parser class so that it allows tag pars within other tag pairs.</li>
-<li>Fixed a bug in the DB "where" function.</li>
-<li>Fixed a bug that was preventing custom config files to be auto-loaded.</li>
-<li>Fixed a bug in the mysql class bind feature that prevented question marks in the replacement data.</li>
-<li>Fixed some bugs in the xss_clean function</li>
-</ul>
-
-
-
-
-
-<h2>Version Beta 1.1</h2>
-<p>Release Date: March 10, 2006</p>
-
-<ul>
-<li>Added a <a href="./libraries/calendar.html">Calendaring class</a>.</li>
-<li>Added support for running <a href="managing_apps.html">multiple applications</a> that share a common CodeIgniter backend.</li>
-<li>Moved the "uri protocol" variable from the index.php file into the config.php file</li>
-<li>Fixed a problem that was preventing certain function calls from working within constructors.</li>
-<li>Fixed a problem that was preventing the $this->load->library function from working in constructors.</li>
-<li>Fixed a bug that occurred when the session class was loaded using the auto-load routine.</li>
-<li>Fixed a bug that can happen with PHP versions that do not support the E_STRICT constant</li>
-<li>Fixed a data type error in the form_radio function (form helper)</li>
-<li>Fixed a bug that was preventing the xss_clean function from being called from the validation class.</li>
-<li>Fixed the cookie related config names, which were incorrectly specified as $conf rather than $config</li>
-<li>Fixed a pagination problem in the scaffolding.</li>
-<li>Fixed a bug in the mysql class "where" function.</li>
-<li>Fixed a regex problem in some code that trimmed duplicate slashes.</li>
-<li>Fixed a bug in the br() function in the HTML helper</li>
-<li>Fixed a syntax mistake in the form_dropdown function in the Form Helper.</li>
-<li>Removed the "style" attributes form the form helpers.</li>
-<li>Updated the documentation. Added "next/previous" links to each page and fixed various typos.</li>
-</ul>
-
-<h2>Version Beta 1.0 </h2>
-<p>Release Date: February 28, 2006</p>
-<p>First publicly released version.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="license.html">License Agreement</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="./general/credits.html">Credits</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html>
diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html
deleted file mode 100644
index 17c58c9f1..000000000
--- a/user_guide/database/active_record.html
+++ /dev/null
@@ -1,824 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Active Record : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-<a href="index.html">Database Library</a> &nbsp;&#8250;&nbsp;
-Active Record
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Active Record Class</h1>
-
-<p>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.</p>
-
-<p>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.</p>
-
-<p class="important"><strong>Note:</strong> 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.<br /></p>
-
-<ul>
-<li><a href="#select">Selecting Data</a></li>
-<li><a href="#insert">Inserting Data</a></li>
-<li><a href="#update">Updating Data</a></li>
-<li><a href="#delete">Deleting Data</a></li>
-<li><a href="#chaining">Method Chaining</a></li>
-<li><a href="#caching">Active Record Caching</a></li>
-</ul>
-
-<h1><a name="select">&nbsp;</a>Selecting Data</h1>
-
-<p>The following functions allow you to build SQL <strong>SELECT</strong> statements.</p>
-
-<p><strong>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.</strong></p>
-
-
-<h2>$this->db->get();</h2>
-
-<p>Runs the selection query and returns the result. Can be used by itself to retrieve all records from a table:</p>
-
-<code>$query = $this->db->get('mytable');<br />
-<br />
-// Produces: SELECT * FROM mytable</code>
-
-<p>The second and third parameters enable you to set a limit and offset clause:</p>
-
-<code>$query = $this->db->get('mytable', 10, 20);<br />
-<br />
-// Produces: SELECT * FROM mytable LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)</code>
-
-<p>You'll notice that the above function is assigned to a variable named <kbd>$query</kbd>, which can be used to show the results:</p>
-
-<code>$query = $this->db->get('mytable');<br />
-<br />
-foreach ($query->result() as $row)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo $row->title;<br />
-}</code>
-
-<p>Please visit the <a href="results.html">result functions</a> page for a full discussion regarding result generation.</p>
-
-
-<h2>$this->db->get_where();</h2>
-
-<p>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:</p>
-
-<code>$query = $this->db->get_where('mytable', array('id' => $id), $limit, $offset);</code>
-
-<p>Please read the about the where function below for more information.</p>
-<p class="important">Note: get_where() was formerly known as getwhere(), which has been removed</p>
-
-<h2>$this->db->select();</h2>
-<p>Permits you to write the SELECT portion of your query:</p>
-<p><code>
-$this->db->select('title, content, date');<br />
-<br />
-$query = $this->db->get('mytable');<br />
-<br />
-// Produces: SELECT title, content, date FROM mytable</code></p>
-<p class="important"><strong>Note:</strong> If you are selecting all (*) from a table you do not need to use this function. When omitted, CodeIgniter assumes you wish to SELECT *</p>
-
-<p>$this-&gt;db-&gt;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.</p>
-<p><code>$this-&gt;db-&gt;select('(SELECT SUM(payments.amount) FROM payments WHERE payments.invoice_id=4') AS amount_paid', FALSE); <br />
-$query = $this-&gt;db-&gt;get('mytable');<br />
-</code></p>
-<h2>$this->db->select_max();</h2>
-<p>Writes a "SELECT MAX(field)" portion for your query. You can optionally include a second parameter to rename the resulting field.</p>
-<p><code>
-$this->db->select_max('age');<br />
-$query = $this->db->get('members');<br />
-
-// Produces: SELECT MAX(age) as age FROM members<br />
-<br />
-$this-&gt;db-&gt;select_max('age', 'member_age');<br />
-$query = $this-&gt;db-&gt;get('members');<br />
-// Produces: SELECT MAX(age) as member_age FROM members</code></p>
-
-<h2>$this->db->select_min();</h2>
-<p>Writes a "SELECT MIN(field)" portion for your query. As with <dfn>select_max()</dfn>, You can optionally include a second parameter to rename the resulting field.</p>
-<p><code>
-$this->db->select_min('age');<br />
-$query = $this->db->get('members');<br />
-// Produces: SELECT MIN(age) as age FROM members</code></p>
-
-<h2>$this->db->select_avg();</h2>
-<p>Writes a "SELECT AVG(field)" portion for your query. As with <dfn>select_max()</dfn>, You can optionally include a second parameter to rename the resulting field.</p>
-<p><code>
-$this->db->select_avg('age');<br />
-$query = $this->db->get('members');<br />
-// Produces: SELECT AVG(age) as age FROM members</code></p>
-
-<h2>$this->db->select_sum();</h2>
-<p>Writes a "SELECT SUM(field)" portion for your query. As with <dfn>select_max()</dfn>, You can optionally include a second parameter to rename the resulting field.</p>
-<p><code>
-$this->db->select_sum('age');<br />
-$query = $this->db->get('members');<br />
-// Produces: SELECT SUM(age) as age FROM members</code></p>
-
-<h2>$this->db->from();</h2>
-
-<p>Permits you to write the FROM portion of your query:</p>
-
-<code>
-$this->db->select('title, content, date');<br />
-$this->db->from('mytable');<br />
-<br />
-$query = $this->db->get();<br />
-<br />
-// Produces: SELECT title, content, date FROM mytable</code>
-
-<p class="important">Note: As shown earlier, the FROM portion of your query can be specified in the <dfn>$this->db->get()</dfn> function, so use whichever method
-you prefer.</p>
-
-<h2>$this->db->join();</h2>
-
-<p>Permits you to write the JOIN portion of your query:</p>
-
-<code>
-$this->db->select('*');<br />
-$this->db->from('blogs');<br />
-$this->db->join('comments', 'comments.id = blogs.id');<br />
-<br />
-$query = $this->db->get();<br />
-<br />
-// Produces: <br />
-// SELECT * FROM blogs<br />
-// JOIN comments ON comments.id = blogs.id<br />
-</code>
-
-<p>Multiple function calls can be made if you need several joins in one query.</p>
-
-<p>If you need a specific type of JOIN you can specify it via the third parameter of the function.
-Options are: left, right, outer, inner, left outer, and right outer.</p>
-
-<code>
-$this->db->join('comments', 'comments.id = blogs.id', <strong>'left'</strong>);<br />
-<br />
-// Produces: LEFT JOIN comments ON comments.id = blogs.id</code>
-
-
-
-
-
-<h2>$this->db->where();</h2>
-<p>This function enables you to set <strong>WHERE</strong> clauses using one of four methods:</p>
-
-<p class="important"><strong>Note:</strong> All values passed to this function are escaped automatically, producing safer queries.</p>
-
-<ol>
- <li><strong>Simple key/value method:</strong>
-
- <code>$this->db->where('name', $name);
- <br /><br />// Produces: WHERE name = 'Joe' </code>
-
- <p>Notice that the equal sign is added for you.</p>
-
- <p>If you use multiple function calls they will be chained together with <var>AND</var> between them:</p>
-
- <code>$this->db->where('name', $name);<br />
- $this->db->where('title', $title);<br />
- $this->db->where('status', $status);
- <br /><br />// WHERE name = 'Joe' AND title = 'boss' AND status = 'active' </code> </li>
-
- <li><strong>Custom key/value method:</strong>
-
- <p>You can include an operator in the first parameter in order to control the comparison:</p>
-
- <code>$this->db->where('name !=', $name);<br />
- $this->db->where('id <', $id);
- <br /><br />// Produces: WHERE name != 'Joe' AND id < 45 </code> </li>
- <li><strong>Associative array method:</strong>
-
-
- <code>
- $array = array('name' => $name, 'title' => $title, 'status' => $status);<br /><br />
-
- $this->db->where($array);
- <br /><br />// Produces: WHERE name = 'Joe' AND title = 'boss' AND status = 'active' </code>
-
- <p>You can include your own operators using this method as well:</p>
-
- <code>
- $array = array('name !=' => $name, 'id <' => $id, 'date >' => $date);<br /><br />
-
- $this->db->where($array);</code> </li>
- <li><strong>Custom string:</strong>
-
- <p>You can write your own clauses manually:</p>
-
- <code>
- $where = "name='Joe' AND status='boss' OR status='active'";<br /><br />
- $this->db->where($where);</code></li>
- </ol>
-
-
-<p>$this-&gt;db-&gt;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.</p>
-<p><code> $this-&gt;db-&gt;where('MATCH (field) AGAINST (&quot;value&quot;)', NULL, FALSE);<br />
-</code></p>
-<h2>$this->db->or_where();</h2>
-<p>This function is identical to the one above, except that multiple instances are joined by OR:</p>
-
-<code>
-$this->db->where('name !=', $name);<br />
-$this->db->or_where('id >', $id);
-<br />
-<br />// Produces: WHERE name != 'Joe' OR id > 50</code>
-
-<p class="important">Note: or_where() was formerly known as orwhere(), which has been removed.</p>
-
-
-<h2>$this->db->where_in();</h2>
-<p>Generates a WHERE field IN ('item', 'item') SQL query joined with AND if appropriate</p>
-<p><code>
- $names = array('Frank', 'Todd', 'James');<br />
- $this->db->where_in('username', $names);<br />
- // Produces: WHERE username IN ('Frank', 'Todd', 'James')</code></p>
-
-<h2>$this->db->or_where_in();</h2>
-<p>Generates a WHERE field IN ('item', 'item') SQL query joined with OR if appropriate</p>
-<p><code>
- $names = array('Frank', 'Todd', 'James');<br />
- $this->db->or_where_in('username', $names);<br />
- // Produces: OR username IN ('Frank', 'Todd', 'James')</code></p>
-
-<h2>$this->db->where_not_in();</h2>
-<p>Generates a WHERE field NOT IN ('item', 'item') SQL query joined with AND if appropriate</p>
-<p><code>
- $names = array('Frank', 'Todd', 'James');<br />
- $this->db->where_not_in('username', $names);<br />
- // Produces: WHERE username NOT IN ('Frank', 'Todd', 'James')</code></p>
-
-<h2>$this->db->or_where_not_in();</h2>
-<p>Generates a WHERE field NOT IN ('item', 'item') SQL query joined with OR if appropriate</p>
-<p><code>
- $names = array('Frank', 'Todd', 'James');<br />
- $this->db->or_where_not_in('username', $names);<br />
- // Produces: OR username NOT IN ('Frank', 'Todd', 'James')</code></p>
-
-<h2>$this->db->like();</h2>
-<p>This function enables you to generate <strong>LIKE</strong> clauses, useful for doing searches.</p>
-
-<p class="important"><strong>Note:</strong> All values passed to this function are escaped automatically.</p>
-
-
-<ol>
- <li><strong>Simple key/value method:</strong>
-
- <code>$this->db->like('title', 'match');
- <br /><br />// Produces: WHERE title LIKE '%match%' </code>
-
- <p>If you use multiple function calls they will be chained together with <var>AND</var> between them:</p>
-
- <code>$this->db->like('title', 'match');<br />
- $this->db->like('body', 'match');
- <br /><br />
- // WHERE title LIKE '%match%' AND body LIKE '%match%</code>
- 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).
- <code>$this->db->like('title', 'match', 'before');
- <br />
- // Produces: WHERE title LIKE '%match' <br />
- <br />
- $this-&gt;db-&gt;like('title', 'match', 'after'); <br />
-// Produces: WHERE title LIKE 'match%' <br />
-<br />
- $this-&gt;db-&gt;like('title', 'match', 'both'); <br />
-// Produces: WHERE title LIKE '%match%' </code> </li>
-
-If you do not want to use the wildcard (%) you can pass to the optional third argument the option 'none'.
-
-<code>
- $this-&gt;db-&gt;like('title', 'match', 'none'); <br />
-// Produces: WHERE title LIKE 'match'
-</code>
-
- <li><strong>Associative array method:</strong>
-
- <code>
- $array = array('title' => $match, 'page1' => $match, 'page2' => $match);<br /><br />
-
- $this->db->like($array);
- <br /><br />// WHERE title LIKE '%match%' AND page1 LIKE '%match%' AND page2 LIKE '%match%'</code></li>
- </ol>
-
-
-<h2>$this->db->or_like();</h2>
-<p>This function is identical to the one above, except that multiple instances are joined by OR:</p>
-
-<code>
-$this->db->like('title', 'match');<br />
-$this->db->or_like('body', $match);
-<br />
-<br />// WHERE title LIKE '%match%' OR body LIKE '%match%'</code>
-
-
-
-
-<p class="important">Note: or_like() was formerly known as orlike(), which has been removed.</p>
-<h2>$this-&gt;db-&gt;not_like();</h2>
-<p>This function is identical to <strong>like()</strong>, except that it generates NOT LIKE statements:</p>
-<code> $this-&gt;db-&gt;not_like('title', 'match');<br />
-<br />
-// WHERE title NOT LIKE '%match%</code>
-<h2>$this-&gt;db-&gt;or_not_like();</h2>
-<p>This function is identical to <strong>not_like()</strong>, except that multiple instances are joined by OR:</p>
-<code> $this-&gt;db-&gt;like('title', 'match');<br />
-$this-&gt;db-&gt;or_not_like('body', 'match'); <br />
-<br />
-// WHERE title LIKE '%match% OR body NOT LIKE '%match%'</code>
-<h2>$this->db->group_by();</h2>
-<p>Permits you to write the GROUP BY portion of your query:</p>
-
-<code>$this->db->group_by("title");
-<br /><br />// Produces: GROUP BY title
-</code>
-
-<p>You can also pass an array of multiple values as well:</p>
-
-<code>$this->db->group_by(array("title", "date"));
-<br />
-<br />// Produces: GROUP BY title, date</code>
-
-<p class="important">Note: group_by() was formerly known as groupby(), which has been removed. </p>
-
-<h2> $this-&gt;db-&gt;distinct();<br />
-</h2>
-<p>Adds the &quot;DISTINCT&quot; keyword to a query</p>
-<p><code>$this-&gt;db-&gt;distinct();<br />
- $this-&gt;db-&gt;get('table');<br />
- <br />
- // Produces: SELECT DISTINCT * FROM table</code></p>
-<h2>$this->db->having();</h2>
-<p>Permits you to write the HAVING portion of your query. There are 2 possible syntaxes, 1 argument or 2:</p>
-
-<code>$this->db->having('user_id = 45');
-<br />
-// Produces: HAVING user_id = 45<br />
-<br />
-$this-&gt;db-&gt;having('user_id', 45); <br />
-// Produces: HAVING user_id = 45<br />
-<br />
-</code>
-
-<p>You can also pass an array of multiple values as well:</p>
-
-
-<p><code>$this->db->having(array('title =' => 'My Title', 'id <' => $id)); <br />
- <br />
- // Produces: HAVING title = 'My Title', id < 45</code></p>
-<p>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.</p>
-<p><code>$this-&gt;db-&gt;having('user_id', 45); <br />
-// Produces: HAVING `user_id` = 45 in some databases such as MySQL
- <br />
- $this-&gt;db-&gt;having('user_id', 45, FALSE); <br />
-// Produces: HAVING user_id = 45</code></p>
-<h2>$this-&gt;db-&gt;or_having();</h2>
-<p>Identical to having(), only separates multiple clauses with &quot;OR&quot;.</p>
-<h2>$this->db->order_by();</h2>
-<p>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 <kbd>asc</kbd> or <kbd>desc</kbd>, or <kbd>random</kbd>. </p>
-
-<code>$this->db->order_by("title", "desc");
-<br />
-<br />// Produces: ORDER BY title DESC
-</code>
-
-<p>You can also pass your own string in the first parameter:</p>
-
-<code>$this->db->order_by('title desc, name asc');
-<br />
-<br />// Produces: ORDER BY title DESC, name ASC
-</code>
-
-<p>Or multiple function calls can be made if you need multiple fields.</p>
-
-<p><code>$this->db->order_by("title", "desc");<br />
- $this->db->order_by("name", "asc"); <br />
- <br />
- // Produces: ORDER BY title DESC, name ASC
- </code></p>
-<p class="important">Note: order_by() was formerly known as orderby(), which has been removed.</p>
-<p class="important">Note: random ordering is not currently supported in Oracle or MSSQL drivers. These will default to 'ASC'.</p>
-<h2>$this->db->limit();</h2>
-<p>Lets you limit the number of rows you would like returned by the query:</p>
-
-<code>
-$this->db->limit(10);<br />
-<br />
-// Produces: LIMIT 10</code>
-
-
-<p>The second parameter lets you set a result offset.</p>
-
-<code>
-$this->db->limit(10, 20);<br />
-<br />
-// Produces: LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)</code>
-
-
-<h2>$this->db->count_all_results();</h2>
-
-<p>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:</p>
-<code>echo $this->db->count_all_results('<var>my_table</var>');<br />
-
-// Produces an integer, like 25<br />
-<br />
-$this-&gt;db-&gt;like('title', 'match');<br />
-$this-&gt;db-&gt;from('<var>my_table</var>');<br />
-echo $this-&gt;db-&gt;count_all_results();<br />
-// Produces an integer, like 17 </code>
-
-<h2>$this->db->count_all();</h2>
-
-<p>Permits you to determine the number of rows in a particular table. Submit the table name in the first parameter. Example:</p>
-
-<code>echo $this->db->count_all('<var>my_table</var>');<br />
-<br />
-// Produces an integer, like 25</code>
-
-
-
-<a name="insert">&nbsp;</a>
-<h1>Inserting Data</h1>
-
-<h2>$this->db->insert();</h2>
-<p>Generates an insert string based on the data you supply, and runs the query. You can either pass an
-<strong>array</strong> or an <strong>object</strong> to the function. Here is an example using an array:</p>
-
-<code>
-$data = array(<br />
-&nbsp;&nbsp;&nbsp;'title' => 'My title' ,<br />
-&nbsp;&nbsp;&nbsp;'name' => 'My Name' ,<br />
-&nbsp;&nbsp;&nbsp;'date' => 'My date'<br />
-);<br />
-<br />
-$this->db->insert('mytable', $data);
-<br /><br />
-// Produces: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date')</code>
-
-<p>The first parameter will contain the table name, the second is an associative array of values.</p>
-
-<p>Here is an example using an object:</p>
-
-<code>
-/*<br />
-&nbsp;&nbsp;&nbsp;&nbsp;class Myclass {<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var $title = 'My Title';<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var $content = 'My Content';<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var $date = 'My Date';<br />
-&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-*/<br />
-<br />
-$object = new Myclass;<br />
-<br />
-$this->db->insert('mytable', $object);
-<br /><br />
-// Produces: INSERT INTO mytable (title, content, date) VALUES ('My Title', 'My Content', 'My Date')</code>
-
-<p>The first parameter will contain the table name, the second is an object.</p>
-
-<p class="important"><strong>Note:</strong> All values are escaped automatically producing safer queries.</p>
-
-<h2>$this->db->insert_batch();</h2>
-<p>Generates an insert string based on the data you supply, and runs the query. You can either pass an
-<strong>array</strong> or an <strong>object</strong> to the function. Here is an example using an array:</p>
-
-<code>
-$data = array(<br/>
-&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'title' => 'My title' ,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name' => 'My Name' ,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'date' => 'My date'<br />
-&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'title' => 'Another title' ,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name' => 'Another Name' ,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'date' => 'Another date'<br />
-&nbsp;&nbsp;&nbsp;)<br/>
-);<br />
-<br />
-$this->db->insert_batch('mytable', $data);
-<br /><br />
-// Produces: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date'), ('Another title', 'Another name', 'Another date')</code>
-
-<p>The first parameter will contain the table name, the second is an associative array of values.</p>
-
-<p class="important"><strong>Note:</strong> All values are escaped automatically producing safer queries.</p>
-
-
-
-<h2>$this->db->set();</h2>
-<p>This function enables you to set values for <dfn>inserts</dfn> or <dfn>updates</dfn>.</p>
-
-<p><strong>It can be used instead of passing a data array directly to the insert or update functions:</strong> </p>
-
-<code>$this->db->set('name', $name);
-<br />
-$this->db->insert('mytable');
-<br /><br />
-// Produces: INSERT INTO mytable (name) VALUES ('{$name}')</code>
-
-<p>If you use multiple function called they will be assembled properly based on whether you are doing an insert or an update:</p>
-
-<code>$this-&gt;db-&gt;set('name', $name);<br />
-$this-&gt;db-&gt;set('title', $title);<br />
-$this-&gt;db-&gt;set('status', $status);<br />
-$this-&gt;db-&gt;insert('mytable'); </code>
-<p><strong>set()</strong> 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.</p>
-<p><code>$this-&gt;db-&gt;set('field', 'field+1', FALSE);<br />
- $this-&gt;db-&gt;insert('mytable'); <br />
- // gives INSERT INTO mytable (field) VALUES (field+1)<br />
- <br />
- $this-&gt;db-&gt;set('field', 'field+1');<br />
- $this-&gt;db-&gt;insert('mytable'); <br />
- // gives INSERT INTO mytable (field) VALUES ('field+1')</code></p>
-<p>You can also pass an associative array to this function:</p>
-<code>
-$array = array('name' => $name, 'title' => $title, 'status' => $status);<br /><br />
-
-$this->db->set($array);<br />
-$this->db->insert('mytable');
-</code>
-
-<p>Or an object:</p>
-
-
-<code>
-/*<br />
-&nbsp;&nbsp;&nbsp;&nbsp;class Myclass {<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var $title = 'My Title';<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var $content = 'My Content';<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var $date = 'My Date';<br />
-&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-*/<br />
-<br />
-$object = new Myclass;<br />
-<br />
-$this->db->set($object);<br />
-$this->db->insert('mytable');
-</code>
-
-
-
-<a name="update">&nbsp;</a>
-<h1>Updating Data</h1>
-
-<h2>$this->db->update();</h2>
-<p>Generates an update string and runs the query based on the data you supply. You can pass an
-<strong>array</strong> or an <strong>object</strong> to the function. Here is an example using
-an array:</p>
-
-<code>
-$data = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'title' => $title,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name' => $name,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'date' => $date<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-$this->db->where('id', $id);<br />
-$this->db->update('mytable', $data);
-<br /><br />
-// Produces:<br />
-// UPDATE mytable <br />
-// SET title = '{$title}', name = '{$name}', date = '{$date}'<br />
-// WHERE id = $id</code>
-
-<p>Or you can supply an object:</p>
-
-<code>
-/*<br />
-&nbsp;&nbsp;&nbsp;&nbsp;class Myclass {<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var $title = 'My Title';<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var $content = 'My Content';<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var $date = 'My Date';<br />
-&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-*/<br />
-<br />
-$object = new Myclass;<br />
-<br />
-$this->db->where('id', $id);<br />
-$this->db->update('mytable', $object);
-<br />
-<br />
-// Produces:<br />
-// UPDATE mytable <br />
-// SET title = '{$title}', name = '{$name}', date = '{$date}'<br />
-// WHERE id = $id</code>
-
-
-
-<p class="important"><strong>Note:</strong> All values are escaped automatically producing safer queries.</p>
-
-<p>You'll notice the use of the <dfn>$this->db->where()</dfn> function, enabling you to set the WHERE clause.
-You can optionally pass this information directly into the update function as a string:</p>
-
-<code>$this->db->update('mytable', $data, "id = 4");</code>
-
-<p>Or as an array:</p>
-
-<code>$this->db->update('mytable', $data, array('id' => $id));</code>
-
-<p>You may also use the <dfn>$this->db->set()</dfn> function described above when performing updates.</p>
-
-<h2>$this->db->update_batch();</h2>
-<p>Generates an update string based on the data you supply, and runs the query. You can either pass an
-<strong>array</strong> or an <strong>object</strong> to the function. Here is an example using an array:</p>
-
-<code>
-$data = array(<br/>
-&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'title' => 'My title' ,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name' => 'My Name 2' ,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'date' => 'My date 2'<br />
-&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'title' => 'Another title' ,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name' => 'Another Name 2' ,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'date' => 'Another date 2'<br />
-&nbsp;&nbsp;&nbsp;)<br/>
-);<br />
-<br />
-$this->db->update_batch('mytable', $data, 'title');
-<br /><br />
-// Produces: <br />
-// UPDATE `mytable` SET `name` = CASE<br />
-// WHEN `title` = 'My title' THEN 'My Name 2'<br />
-// WHEN `title` = 'Another title' THEN 'Another Name 2'<br />
-// ELSE `name` END,<br />
-// `date` = CASE <br />
-// WHEN `title` = 'My title' THEN 'My date 2'<br />
-// WHEN `title` = 'Another title' THEN 'Another date 2'<br />
-// ELSE `date` END<br />
-// WHERE `title` IN ('My title','Another title')</code>
-
-<p>The first parameter will contain the table name, the second is an associative array of values, the third parameter is the where key.</p>
-
-<p class="important"><strong>Note:</strong> All values are escaped automatically producing safer queries.</p>
-
-
-<a name="delete">&nbsp;</a>
-<h1>Deleting Data</h1>
-
-
-
-<h2>$this->db->delete();</h2>
-<p>Generates a delete SQL string and runs the query.</p>
-
-<code>
-$this->db->delete('mytable', array('id' => $id));
-<br /><br />
-// Produces:<br />
-// DELETE FROM mytable <br />
-// WHERE id = $id</code>
-
-<p>The first parameter is the table name, the second is the where clause. You can also use the <dfn>where()</dfn> or <dfn>or_where()</dfn> functions instead of passing
-the data to the second parameter of the function:</p>
-
-<p><code> $this->db->where('id', $id);<br />
- $this->db->delete('mytable'); <br />
- <br />
- // Produces:<br />
- // DELETE FROM mytable <br />
- // WHERE id = $id</code></p>
-<p>An array of table names can be passed into delete() if you would like to delete data from more than 1 table.</p>
-<p><code>$tables = array('table1', 'table2', 'table3');<br />
-$this-&gt;db-&gt;where('id', '5');<br />
-$this-&gt;db-&gt;delete($tables);</code></p>
-<p>If you want to delete all data from a table, you can use the <dfn>truncate()</dfn> function, or <dfn>empty_table()</dfn>.</p>
-<h2>$this-&gt;db-&gt;empty_table();</h2>
-<p>Generates a delete SQL string and runs the query.<code> $this-&gt;db-&gt;empty_table('mytable'); <br />
- <br />
-// Produces<br />
-// DELETE FROM mytable</code></p>
-<h2>$this-&gt;db-&gt;truncate();</h2>
-<p>Generates a truncate SQL string and runs the query.</p>
-<code> $this-&gt;db-&gt;from('mytable'); <br />
-$this-&gt;db-&gt;truncate(); <br />
-// or <br />
-$this-&gt;db-&gt;truncate('mytable'); <br />
-<br />
-// Produce:<br />
-// TRUNCATE mytable <br />
-</code>
-<p class="important"><strong>Note:</strong> If the TRUNCATE command isn't available, truncate() will execute as &quot;DELETE FROM table&quot;.</p>
-
-<h1><a name="chaining">&nbsp;</a>Method Chaining</h1>
-
-<p>Method chaining allows you to simplify your syntax by connecting multiple functions. Consider this example:</p>
-
-<code>
-<dfn>$this->db</dfn><kbd>-></kbd><var>select</var>('title')<kbd>-></kbd><var>from</var>('mytable')<kbd>-></kbd><var>where</var>('id', $id)<kbd>-></kbd><var>limit</var>(10, 20);<br />
-<br />
-$query = $this->db->get();</code>
-
-<p class="important"><strong>Note:</strong> Method chaining only works with PHP 5.</p>
-
-<p>&nbsp;</p>
-
-<h1><a name="caching">&nbsp;</a>Active Record Caching</h1>
-
-<p>While not &quot;true&quot; caching, Active Record enables you to save (or &quot;cache&quot;) 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.</p>
-
-<p>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:</p>
-
-<h2>$this-&gt;db-&gt;start_cache()</h2>
-
-<p>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.</p>
-
-<h2>$this-&gt;db-&gt;stop_cache()</h2>
-
-<p>This function can be called to stop caching.</p>
-
-<h2>$this-&gt;db-&gt;flush_cache()</h2>
-
-<p>This function deletes all items from the Active Record cache.</p>
-
-<p>Here's a usage example:</p>
-
-<p><code>$this-&gt;db-&gt;start_cache();<br />
-$this-&gt;db-&gt;select('field1');<br />
-$this-&gt;db-&gt;stop_cache();<br /><br />
-$this-&gt;db-&gt;get('tablename');<br />
-<br />
-//Generates: SELECT `field1` FROM (`tablename`)<br />
-<br />
-$this-&gt;db-&gt;select('field2');<br />
-$this-&gt;db-&gt;get('tablename');<br />
-<br />
-//Generates: SELECT `field1`, `field2` FROM (`tablename`)<br />
-<br />
-$this-&gt;db-&gt;flush_cache();<br />
-<br />
-$this-&gt;db-&gt;select('field2');<br />
-$this-&gt;db-&gt;get('tablename');<br />
-<br />
-//Generates: SELECT `field2` FROM (`tablename`)</code></p>
-
-<p class="important"> <strong>Note:</strong> The following statements can be cached: select, from, join, where, like, group_by, having, order_by, set</p>
-<p>&nbsp;</p>
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="helpers.html">Query Helper Functions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="transactions.html">Transactions</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html>
diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html
deleted file mode 100644
index e6e72f269..000000000
--- a/user_guide/database/caching.html
+++ /dev/null
@@ -1,220 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Database Caching Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-<a href="index.html">Database Library</a> &nbsp;&#8250;&nbsp;
-Database Caching Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Database Caching Class</h1>
-
-<p>The Database Caching Class permits you to cache your queries as text files for reduced database load.</p>
-
-<p class="important"><strong>Important:</strong>&nbsp; This class is initialized automatically by the database driver
-when caching is enabled. Do NOT load this class manually.<br /><br />
-
-<strong>Also note:</strong>&nbsp; Not all query result functions are available when you use caching. Please read this page carefully.</p>
-
-<h2>Enabling Caching</h2>
-
-<p>Caching is enabled in three steps:</p>
-
-<ul>
-<li>Create a writable directory on your server where the cache files can be stored.</li>
-<li>Set the path to your cache folder in your <dfn>application/config/database.php</dfn> file.</li>
-<li>Enable the caching feature, either globally by setting the preference in your <dfn>application/config/database.php</dfn> file, or manually as described below.</li>
-</ul>
-
-<p>Once enabled, caching will happen automatically whenever a page is loaded that contains database queries.</p>
-
-
-<h2>How Does Caching Work?</h2>
-
-<p>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.</p>
-
-<p>Only <dfn>read-type</dfn> (SELECT) queries can be cached, since these are the only type of queries that produce a result.
-<dfn>Write-type</dfn> (INSERT, UPDATE, etc.) queries, since they don't generate a result, will not be cached by the system.</p>
-
-<p>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.</p>
-
-<h2>Will Caching Improve Your Site's Performance?</h2>
-
-<p>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.</p>
-
-<p>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.</p>
-
-<h2>How are Cache Files Stored?</h2>
-
-<p>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).</p>
-
-<p>For example, let's say you have a controller called <dfn>blog</dfn> with a function called <dfn>comments</dfn> that
-contains three queries. The caching system will create a cache folder
-called <kbd>blog+comments</kbd>, into which it will write three cache files.</p>
-
-<p>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.</p>
-
-
-<h2>Managing your Cache Files</h2>
-
-<p>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.</p>
-
-
-<h2>Not All Database Functions Work with Caching</h2>
-
-<p>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.</p>
-
-<p>The following functions <kbd>ARE NOT</kbd> available when using a cached result object:</p>
-
-<ul>
-<li>num_fields()</li>
-<li>field_names()</li>
-<li>field_data()</li>
-<li>free_result()</li>
-</ul>
-
-<p>Also, the two database resources (result_id and conn_id) are not available when caching, since result resources only
-pertain to run-time operations.</p>
-
-
-<br />
-
-<h1>Function Reference</h1>
-
-
-
-<h2>$this->db->cache_on()&nbsp; / &nbsp; $this->db->cache_off()</h2>
-
-<p>Manually enables/disables caching. This can be useful if you want to
-keep certain queries from being cached. Example:</p>
-
-<code>
-// Turn caching on<br />
-$this->db->cache_on();<br />
-$query = $this->db->query("SELECT * FROM mytable");<br />
-<br />
-// Turn caching off for this one query<br />
-$this->db->cache_off();<br />
-$query = $this->db->query("SELECT * FROM members WHERE member_id = '$current_user'");<br />
-<br />
-// Turn caching back on<br />
-$this->db->cache_on();<br />
-$query = $this->db->query("SELECT * FROM another_table");
-</code>
-
-
-<h2>$this->db->cache_delete()</h2>
-
-<p>Deletes the cache files associated with a particular page. This is useful if you need to clear caching after you update your database.</p>
-
-<p>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 <dfn>example.com/index.php/blog/comments</dfn>, the caching system will put all cache files associated with it in a folder
-called <dfn>blog+comments</dfn>. To delete those particular cache files you will use:</p>
-
-<code>$this->db->cache_delete('blog', 'comments');</code>
-
-<p>If you do not use any parameters the current URI will be used when determining what should be cleared.</p>
-
-
-<h2>$this->db->cache_delete_all()</h2>
-
-<p>Clears all existing cache files. Example:</p>
-
-<code>$this->db->cache_delete_all();</code>
-
-
-
-
-
-
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="call_function.html">Custom Function Calls</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="forge.html">Database manipulation with Database Forge</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html
deleted file mode 100644
index 4fc894743..000000000
--- a/user_guide/database/call_function.html
+++ /dev/null
@@ -1,118 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Custom Function Calls : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-<a href="index.html">Database Library</a> &nbsp;&#8250;&nbsp;
-Custom Function Calls
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Custom Function Calls</h1>
-
-<h2>$this->db->call_function();</h2>
-
-<p>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 <dfn>mysql_get_client_info()</dfn> function, which is <strong>not</strong> natively supported
-by CodeIgniter. You could do so like this:
-</p>
-
-<code>$this->db->call_function('<var>get_client_info</var>');</code>
-
-<p>You must supply the name of the function, <strong>without</strong> the <var>mysql_</var> 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.</p>
-
-<p>Any parameters needed by the function you are calling will be added to the second parameter.</p>
-
-<code>$this->db->call_function('<var>some_function</var>', $param1, $param2, etc..);</code>
-
-
-<p>Often, you will either need to supply a database connection ID or a database result ID. The connection ID can be accessed using:</p>
-
-<code>$this->db->conn_id;</code>
-
-<p>The result ID can be accessed from within your result object, like this:</p>
-
-<code>$query = $this->db->query("SOME QUERY");<br />
-<br />
-<var>$query->result_id;</var></code>
-
-
-
-
-
-
-
-
-
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="fields.html">Field MetaData</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="caching.html">Query Caching</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html
deleted file mode 100644
index 17a291ac2..000000000
--- a/user_guide/database/configuration.html
+++ /dev/null
@@ -1,164 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Database Configuration : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-<a href="index.html">Database Library</a> &nbsp;&#8250;&nbsp;
-Configuration
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Database Configuration</h1>
-
-<p>CodeIgniter has a config file that lets you store your database connection values (username, password, database name, etc.).
-The config file is located at <samp>application/config/database.php</samp>. You can also set database connection values for specific <a href="../libraries/config.html">environments</a> by placing <strong>database.php</strong> it the respective environment config folder.</p>
-
-<p>The config settings are stored in a multi-dimensional array with this prototype:</p>
-
-<code>$db['default']['hostname'] = "localhost";<br />
-$db['default']['username'] = "root";<br />
-$db['default']['password'] = "";<br />
-$db['default']['database'] = "database_name";<br />
-$db['default']['dbdriver'] = "mysql";<br />
-$db['default']['dbprefix'] = "";<br />
-$db['default']['pconnect'] = TRUE;<br />
-$db['default']['db_debug'] = FALSE;<br />
-$db['default']['cache_on'] = FALSE;<br />
-$db['default']['cachedir'] = &quot;&quot;;<br />
-$db['default']['char_set'] = "utf8";<br />
-$db['default']['dbcollat'] = "utf8_general_ci";<br />
-$db['default']['swap_pre'] = "";<br />
-$db['default']['autoinit'] = TRUE;<br />
-$db['default']['stricton'] = FALSE;</code>
-
-<p>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:</p>
-
-<code>$db['test']['hostname'] = "localhost";<br />
-$db['test']['username'] = "root";<br />
-$db['test']['password'] = "";<br />
-$db['test']['database'] = "database_name";<br />
-$db['test']['dbdriver'] = "mysql";<br />
-$db['test']['dbprefix'] = "";<br />
-$db['test']['pconnect'] = TRUE;<br />
-$db['test']['db_debug'] = FALSE;<br />
-$db['test']['cache_on'] = FALSE;<br />
-$db['test']['cachedir'] = &quot;&quot;;<br />
-$db['test']['char_set'] = "utf8";<br />
-$db['test']['dbcollat'] = "utf8_general_ci";<br />
-$db['test']['swap_pre'] = "";<br />
-$db['test']['autoinit'] = TRUE;<br />
-$db['test']['stricton'] = FALSE;</code>
-
-
-<p>Then, to globally tell the system to use that group you would set this variable located in the config file:</p>
-
-<code>$active_group = "test";</code>
-
-<p>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.</p>
-
-<h3>Active Record</h3>
-
-<p>The <a href="active_record.html">Active Record Class</a> 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.</p>
-
-<code>$active_record = TRUE;</code>
-
-<p class="important"><strong>Note:</strong> that some CodeIgniter classes such as Sessions require Active Records be enabled to access certain functionality.</p>
-
-<h3>Explanation of Values:</h3>
-
-<ul>
-<li><strong>hostname</strong> - The hostname of your database server. Often this is "localhost".</li>
-<li><strong>username</strong> - The username used to connect to the database.</li>
-<li><strong>password</strong> - The password used to connect to the database.</li>
-<li><strong>database</strong> - The name of the database you want to connect to.</li>
-<li><strong>dbdriver</strong> - The database type. ie: mysql, postgres, odbc, etc. Must be specified in lower case.</li>
-<li><strong>dbprefix</strong> - An optional table prefix which will added to the table name when running <a href="active_record.html">Active Record</a> queries. This permits multiple CodeIgniter installations to share one database.</li>
-<li><strong>pconnect</strong> - TRUE/FALSE (boolean) - Whether to use a persistent connection.</li>
-<li><strong>db_debug</strong> - TRUE/FALSE (boolean) - Whether database errors should be displayed.</li>
-<li><strong>cache_on</strong> - TRUE/FALSE (boolean) - Whether database query caching is enabled, see also <a href="caching.html">Database Caching Class</a>.</li>
-<li><strong>cachedir</strong> - The absolute server path to your database query cache directory.</li>
-<li><strong>char_set</strong> - The character set used in communicating with the database.</li>
-<li><strong>dbcollat</strong> - The character collation used in communicating with the database. <p class="important"><strong>Note:</strong> For MySQL and MySQLi databases, this setting is only used as a backup if your server is running PHP &lt; 5.2.3 or MySQL &lt; 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.</p></li>
-<li><strong>swap_pre</strong> - A default table prefix that should be swapped with <var>dbprefix</var>. 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.</li>
-<li><strong>autoinit</strong> - 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.</li>
-<li><strong>stricton</strong> - TRUE/FALSE (boolean) - Whether to force "Strict Mode" connections, good for ensuring strict SQL while developing an application.</li>
-<li><strong>port</strong> - The database port number. To use this value you have to add a line to the database config array.<code>$db['default']['port'] = 5432;</code>
-</ul>
-
-<p class="important"><strong>Note:</strong> 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.</p>
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="examples.html">Quick Start: Usage Examples</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="connecting.html">Connecting to your Database</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html
deleted file mode 100644
index f86602269..000000000
--- a/user_guide/database/connecting.html
+++ /dev/null
@@ -1,188 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Connecting to your Database : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-<a href="index.html">Database Library</a> &nbsp;&#8250;&nbsp;
-Connecting
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Connecting to your Database</h1>
-
-<p>There are two ways to connect to a database:</p>
-
-<h2>Automatically Connecting</h2>
-
-<p>The "auto connect" feature will load and instantiate the database class with every page load.
-To enable "auto connecting", add the word <var>database</var> to the library array, as indicated in the following file:</p>
-
-<p><kbd>application/config/autoload.php</kbd></p>
-
-<h2>Manually Connecting</h2>
-
-<p>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.</p>
-
-<code>$this->load->database();</code>
-
-<p class="important">If the above function does <strong>not</strong> 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.</p>
-
-<h3>Available Parameters</h3>
-
-<ol>
- <li>The database connection values, passed either as an array or a DSN string.</li>
- <li>TRUE/FALSE (boolean). Whether to return the connection ID (see Connecting to Multiple Databases below).</li>
- <li>TRUE/FALSE (boolean). Whether to enable the Active Record class. Set to TRUE by default.</li>
-</ol>
-
-
-<h3>Manually Connecting to a Database</h3>
-
-<p>The first parameter of this function can <strong>optionally</strong> 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:</p>
-
-<p>To choose a specific group from your config file you can do this:</p>
-
-<code>$this->load->database('<samp>group_name</samp>');</code>
-
-<p>Where <samp>group_name</samp> is the name of the connection group from your config file.</p>
-
-
-<p>To connect manually to a desired database you can pass an array of values:</p>
-
-<code>$config['hostname'] = "localhost";<br />
-$config['username'] = "myusername";<br />
-$config['password'] = "mypassword";<br />
-$config['database'] = "mydatabase";<br />
-$config['dbdriver'] = "mysql";<br />
-$config['dbprefix'] = "";<br />
-$config['pconnect'] = FALSE;<br />
-$config['db_debug'] = TRUE;<br />
-$config['cache_on'] = FALSE;<br />
-$config['cachedir'] = "";<br />
-$config['char_set'] = "utf8";<br />
-$config['dbcollat'] = "utf8_general_ci";<br />
-<br />
-$this->load->database(<samp>$config</samp>);</code>
-
-<p>For information on each of these values please see the <a href="configuration.html">configuration page</a>.</p>
-
-<p>Or you can submit your database values as a Data Source Name. DSNs must have this prototype:</p>
-
-<code>$dsn = 'dbdriver://username:password@hostname/database';<br />
-<br />
-$this->load->database(<samp>$dsn</samp>);</code>
-
-<p>To override default config values when connecting with a DSN string, add the config variables as a query string.</p>
-
-<code>$dsn = 'dbdriver://username:password@hostname/database?char_set=utf8&amp;dbcollat=utf8_general_ci&amp;cache_on=true&amp;cachedir=/path/to/cache';<br />
-<br />
-$this->load->database(<samp>$dsn</samp>);</code>
-
-<h2>Connecting to Multiple Databases</h2>
-
-<p>If you need to connect to more than one database simultaneously you can do so as follows:</p>
-
-
-<code>$DB1 = $this->load->database('group_one', TRUE);<br />
-$DB2 = $this->load->database('group_two', TRUE);
-</code>
-
-<p>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).</p>
-
-<p>By setting the second parameter to TRUE (boolean) the function will return the database object.</p>
-
-<div class="important">
-<p>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:</p>
-
-<p>$this->db->query();<br />$this->db->result();<br /> etc...</p>
-
-<p>You will instead use:</p>
-
-<p>$DB1->query();<br />$DB1->result();<br /> etc...</p>
-
-</div>
-
-<h2>Reconnecting / Keeping the Connection Alive</h2>
-
-<p>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 <dfn>reconnect()</dfn> method before sending further queries, which can gracefully keep the connection alive or re-establish it.</p>
-
-<code>$this->db->reconnect();</code>
-
-<h2>Manually closing the Connection</h2>
-
-<p>While CodeIgniter intelligently takes care of closing your database connections, you can explicitly close the connection.</p>
-
-<code>$this->db->close();</code>
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="configuration.html">Database Configuration</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="queries.html">Queries</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html
deleted file mode 100644
index 58035557d..000000000
--- a/user_guide/database/examples.html
+++ /dev/null
@@ -1,217 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Database Quick Start : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-<a href="index.html">Database Library</a> &nbsp;&#8250;&nbsp;
-Database Example Code
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Database Quick Start: Example Code</h1>
-
-<p>The following page contains example code showing how the database class is used. For complete details please
-read the individual pages describing each function.</p>
-
-
-<h2>Initializing the Database Class</h2>
-
-<p>The following code loads and initializes the database class based on your <a href="configuration.html">configuration</a> settings:</p>
-
-<code>$this->load->database();</code>
-
-<p>Once loaded the class is ready to be used as described below.</p>
-
-<p>Note: If all your pages require database access you can connect automatically. See the <a href="connecting.html">connecting</a> page for details.</p>
-
-
-<h2>Standard Query With Multiple Results (Object Version)</h2>
-
-<code>$query = $this->db->query('SELECT name, title, email FROM my_table');<br />
-<br />
-foreach ($query->result() as $row)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo $row->title;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo $row->name;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo $row->email;<br />
-}<br />
-<br />
-echo 'Total Results: ' . $query->num_rows();
-</code>
-
-<p>The above <dfn>result()</dfn> function returns an array of <strong>objects</strong>. Example: $row->title</p>
-
-
-<h2>Standard Query With Multiple Results (Array Version)</h2>
-
-<code>$query = $this->db->query('SELECT name, title, email FROM my_table');<br />
-<br />
-foreach ($query->result_array() as $row)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo $row['title'];<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo $row['name'];<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo $row['email'];<br />
-}</code>
-
-<p>The above <dfn>result_array()</dfn> function returns an array of standard array indexes. Example: $row['title']</p>
-
-
-<h2>Testing for Results</h2>
-
-<p>If you run queries that might <strong>not</strong> produce a result, you are encouraged to test for a result first
-using the <dfn>num_rows()</dfn> function:</p>
-
-<code>
-$query = $this->db->query("YOUR QUERY");<br />
-<br />
-if ($query->num_rows() > 0)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;foreach ($query->result() as $row)<br />
-&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo $row->title;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo $row->name;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo $row->body;<br />
-&nbsp;&nbsp;&nbsp;}<br />
-}
-</code>
-
-
-
-
-<h2>Standard Query With Single Result</h2>
-
-<code>$query = $this->db->query('SELECT name FROM my_table LIMIT 1');<br />
-<br />
-$row = $query->row();<br />
-echo $row->name;<br />
-</code>
-
-<p>The above <dfn>row()</dfn> function returns an <strong>object</strong>. Example: $row->name</p>
-
-
-<h2>Standard Query With Single Result (Array version)</h2>
-
-<code>$query = $this->db->query('SELECT name FROM my_table LIMIT 1');<br />
-<br />
-$row = $query->row_array();<br />
-echo $row['name'];<br />
-</code>
-
-<p>The above <dfn>row_array()</dfn> function returns an <strong>array</strong>. Example: $row['name']</p>
-
-
-<h2>Standard Insert</h2>
-
-<code>
-$sql = "INSERT INTO mytable (title, name) <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VALUES (".$this->db->escape($title).", ".$this->db->escape($name).")";<br />
-<br />
-$this->db->query($sql);<br />
-<br />
-echo $this->db->affected_rows();
-</code>
-
-
-
-
-<h2>Active Record Query</h2>
-
-<p>The <a href="active_record.html">Active Record Pattern</a> gives you a simplified means of retrieving data:</p>
-
-<code>
-$query = $this->db->get('table_name');<br />
-<br />
-foreach ($query->result() as $row)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo $row->title;<br />
-}</code>
-
-<p>The above <dfn>get()</dfn> function retrieves all the results from the supplied table.
-The <a href="active_record.html">Active Record</a> class contains a full compliment of functions
-for working with data.</p>
-
-
-<h2>Active Record Insert</h2>
-
-<code>
-$data = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'title' => $title,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name' => $name,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'date' => $date<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-$this->db->insert('mytable', $data);
-<br /><br />
-// Produces: INSERT INTO mytable (title, name, date) VALUES ('{$title}', '{$name}', '{$date}')</code>
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Database Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="configuration.html">Database Configuration</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html
deleted file mode 100644
index 56c9d9fdf..000000000
--- a/user_guide/database/fields.html
+++ /dev/null
@@ -1,163 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Field Data : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-<a href="index.html">Database Library</a> &nbsp;&#8250;&nbsp;
-Field Names
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Field Data</h1>
-
-
-<h2>$this->db->list_fields()</h2>
-<p>Returns an array containing the field names. This query can be called two ways:</p>
-
-
-<p>1. You can supply the table name and call it from the <dfn>$this->db-></dfn> object:</p>
-
-<code>
-$fields = $this->db->list_fields('table_name');<br /><br />
-
-foreach ($fields as $field)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;echo $field;<br />
-}
-</code>
-
-<p>2. You can gather the field names associated with any query you run by calling the function
-from your query result object:</p>
-
-<code>
-$query = $this->db->query('SELECT * FROM some_table');
-<br /><br />
-
-foreach ($query->list_fields() as $field)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;echo $field;<br />
-}
-</code>
-
-
-<h2>$this->db->field_exists()</h2>
-
-<p>Sometimes it's helpful to know whether a particular field exists before performing an action.
-Returns a boolean TRUE/FALSE. Usage example:</p>
-
-<code>
-if ($this->db->field_exists('field_name', 'table_name'))<br />
-{<br />
-&nbsp;&nbsp; // some code...<br />
-}
-</code>
-
-<p>Note: Replace <em>field_name</em> with the name of the column you are looking for, and replace
-<em>table_name</em> with the name of the table you are looking for.</p>
-
-
-<h2>$this->db->field_data()</h2>
-<p>Returns an array of objects containing field information.</p>
-<p>Sometimes it's helpful to gather the field names or other metadata, like the column type, max length, etc.</p>
-
-
-<p class="important">Note: Not all databases provide meta-data.</p>
-
-<p>Usage example:</p>
-
-<code>
-$fields = $this->db->field_data('table_name');<br /><br />
-
-foreach ($fields as $field)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;echo $field->name;<br />
-&nbsp;&nbsp;&nbsp;echo $field->type;<br />
-&nbsp;&nbsp;&nbsp;echo $field->max_length;<br />
-&nbsp;&nbsp;&nbsp;echo $field->primary_key;<br />
-}
-</code>
-
-<p>If you have run a query already you can use the result object instead of supplying the table name:</p>
-
-<code>
-$query = $this->db->query("YOUR QUERY");<br />
-$fields = $query->field_data();
-</code>
-
-
-<p>The following data is available from this function if supported by your database:</p>
-
-<ul>
-<li>name - column name</li>
-<li>max_length - maximum length of the column</li>
-<li>primary_key - 1 if the column is a primary key</li>
-<li>type - the type of the column</li>
-</ul>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="table_data.html"> Table Data</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="call_function.html">Custom Function Calls</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/database/forge.html b/user_guide/database/forge.html
deleted file mode 100644
index 2289e148e..000000000
--- a/user_guide/database/forge.html
+++ /dev/null
@@ -1,234 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Database Forge Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-<a href="index.html">Database Library</a> &nbsp;&#8250;&nbsp;
-Database Forge Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Database Forge Class</h1>
-
-<p>The Database Forge Class contains functions that help you manage your database.</p>
-
-<h3>Table of Contents</h3>
-
-<ul>
-<li><a href="#init">Initializing the Forge Class</a></li>
-<li><a href="#create">Creating a Database</a></li>
-<li><a href="#drop">Dropping a Database</a></li>
-<li><a href="#add_field">Adding Fields</a></li>
-<li><a href="#add_key">Adding Keys</a></li>
-<li><a href="#create_table">Creating a Table</a></li>
-<li><a href="#drop_table">Dropping a Table</a></li>
-<li><a href="#rename_table">Renaming a Table</a></li>
-<li><a href="#modifying_tables">Modifying a Table</a></li>
-</ul>
-
-
-<h2><a name="init"></a>Initializing the Forge Class</h2>
-
-<p class="important"><strong>Important:</strong>&nbsp; In order to initialize the Forge class, your database driver must
-already be running, since the forge class relies on it.</p>
-
-<p>Load the Forge Class as follows:</p>
-
-<code>$this->load->dbforge()</code>
-
-<p>Once initialized you will access the functions using the <dfn>$this->dbforge</dfn> object:</p>
-
-<code>$this->dbforge->some_function()</code>
-<h2><a name="create"></a>$this->dbforge->create_database('db_name')</h2>
-
-<p>Permits you to create the database specified in the first parameter. Returns TRUE/FALSE based on success or failure:</p>
-
-<code>if ($this->dbforge->create_database('my_db'))<br />
-{<br />
-&nbsp;&nbsp;&nbsp; echo 'Database created!';<br />
-}</code>
-
-
-
-
-<h2><a name="drop"></a>$this->dbforge->drop_database('db_name')</h2>
-
-<p>Permits you to drop the database specified in the first parameter. Returns TRUE/FALSE based on success or failure:</p>
-
-<code>if ($this->dbforge->drop_database('my_db'))<br />
-{<br />
-&nbsp;&nbsp;&nbsp; echo 'Database deleted!';<br />
-}</code>
-
-
-<h1>Creating and Dropping Tables</h1>
-<p>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.</p>
-<h2><a name="add_field" id="add_field"></a>Adding fields</h2>
-<p>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.</p>
-<p><code>$fields = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'users' =&gt; array(<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'type' =&gt; 'VARCHAR',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'constraint' =&gt; '100',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
- <br />
-// will translate to &quot;users VARCHAR(100)&quot; when the field is added.</code></p>
-<p>Additionally, the following key/values can be used:</p>
-<ul>
- <li>unsigned/true : to generate &quot;UNSIGNED&quot; in the field definition.</li>
- <li>default/value : to generate a default value in the field definition.</li>
- <li>null/true : to generate &quot;NULL&quot; in the field definition. Without this, the field will default to &quot;NOT NULL&quot;.</li>
- <li>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.</li>
- </ul>
-<p><code>$fields = array(<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'blog_id' =&gt; array(<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'type' =&gt; 'INT',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'constraint' =&gt; 5, <br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'unsigned' =&gt; TRUE,<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'auto_increment' =&gt; TRUE<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'blog_title' =&gt; array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'type' =&gt; 'VARCHAR',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'constraint' =&gt; '100',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'blog_author' =&gt; array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'type' =&gt;'VARCHAR',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'constraint' =&gt; '100',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'default' =&gt; 'King of Town',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'blog_description' =&gt; array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'type' =&gt; 'TEXT',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'null' =&gt; TRUE,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-</code></p>
-<p>After the fields have been defined, they can be added using <dfn>$this-&gt;dbforge-&gt;add_field($fields);</dfn> followed by a call to the <dfn>create_table()</dfn> function.</p>
-<h3>$this-&gt;dbforge-&gt;add_field()</h3>
-<p>The add fields function will accept the above array.</p>
-<h3>Passing strings as fields</h3>
-<p>If you know exactly how you want a field to be created, you can pass the string into the field definitions with add_field()</p>
-<p><code>$this-&gt;dbforge-&gt;add_field(&quot;label varchar(100) NOT NULL DEFAULT 'default label'&quot;);</code></p>
-<p class="important">Note: Multiple calls to <dfn>add_field()</dfn> are cumulative.</p>
-<h3>Creating an id field</h3>
-<p>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.</p>
-<p><code>$this-&gt;dbforge-&gt;add_field('id');<br />
- // gives id INT(9) NOT NULL AUTO_INCREMENT</code></p>
-<h2><a name="add_key" id="add_key"></a>Adding Keys</h2>
-<p>Generally speaking, you'll want your table to have Keys. This is accomplished with <dfn>$this-&gt;dbforge-&gt;add_key('field')</dfn>. An optional second parameter set to TRUE will make it a primary key. Note that <dfn>add_key()</dfn> must be followed by a call to <dfn>create_table()</dfn>.</p>
-<p>Multiple column non-primary keys must be sent as an array. Sample output below is for MySQL.</p>
-<p><code>$this-&gt;dbforge-&gt;add_key('blog_id', TRUE);<br />
- // gives PRIMARY KEY `blog_id` (`blog_id`)<br />
- <br />
- $this-&gt;dbforge-&gt;add_key('blog_id', TRUE);<br />
- $this-&gt;dbforge-&gt;add_key('site_id', TRUE);<br />
- // gives PRIMARY KEY `blog_id_site_id` (`blog_id`, `site_id`)<br />
- <br />
- $this-&gt;dbforge-&gt;add_key('blog_name');<br />
- // gives KEY `blog_name` (`blog_name`)<br />
- <br />
- $this-&gt;dbforge-&gt;add_key(array('blog_name', 'blog_label'));<br />
- // gives KEY `blog_name_blog_label` (`blog_name`, `blog_label`)</code></p>
-<h2><a name="create_table" id="create_table"></a>Creating a table</h2>
-<p>After fields and keys have been declared, you can create a new table with</p>
-<p><code>$this-&gt;dbforge-&gt;create_table('table_name');<br />
-// gives CREATE TABLE table_name</code></p>
-<p>An optional second parameter set to TRUE adds an &quot;IF NOT EXISTS&quot; clause into the definition</p>
-<p><code>$this-&gt;dbforge-&gt;create_table('table_name', TRUE);<br />
-// gives CREATE TABLE IF NOT EXISTS table_name</code></p>
-<h2><a name="drop_table" id="drop_table"></a>Dropping a table</h2>
-<p>Executes a DROP TABLE sql</p>
-<p><code>$this-&gt;dbforge-&gt;drop_table('table_name');<br />
- // gives DROP TABLE IF EXISTS table_name</code></p>
-<h2><a name="rename_table" id="rename_table"></a>Renaming a table</h2>
-<p>Executes a TABLE rename</p>
-<p><code>$this-&gt;dbforge-&gt;rename_table('old_table_name', 'new_table_name');<br />
- // gives ALTER TABLE old_table_name RENAME TO new_table_name</code></p>
-<h1><a name="modifying_tables" id="modifying_tables"></a>Modifying Tables</h1>
-<h2>$this-&gt;dbforge-&gt;add_column()</h2>
-<p>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.</p>
-<p><code>$fields = array(<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'preferences' =&gt; array('type' =&gt; 'TEXT')<br />
-);<br />
-$this-&gt;dbforge-&gt;add_column('table_name', $fields);<br />
-<br />
-// gives ALTER TABLE table_name ADD preferences TEXT</code></p>
-<h2>$this-&gt;dbforge-&gt;drop_column()</h2>
-<p>Used to remove a column from a table. </p>
-<p><code>$this-&gt;dbforge-&gt;drop_column('table_name', 'column_to_drop');</code></p>
-<h2>$this-&gt;dbforge-&gt;modify_column()</h2>
-<p>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 change the name you can add a &quot;name&quot; key into the field defining array.</p>
-<p><code>$fields = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'old_name' =&gt; array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name' =&gt; 'new_name',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'type' =&gt; 'TEXT',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-);<br />
-$this-&gt;dbforge-&gt;modify_column('table_name', $fields);<br />
- <br />
- // gives ALTER TABLE table_name CHANGE old_name new_name TEXT </code></p>
-<p>&nbsp;</p>
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="caching.html">DB Caching Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="utilities.html">Database Utilities Class</a><a href="../libraries/email.html"></a></p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html
deleted file mode 100644
index 82f5c1d21..000000000
--- a/user_guide/database/helpers.html
+++ /dev/null
@@ -1,151 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Query Helper Functions : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-<a href="index.html">Database Library</a> &nbsp;&#8250;&nbsp;
-Query Helpers
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Query Helper Functions</h1>
-
-
-<h2>$this->db->insert_id()</h2>
-<p>The insert ID number when performing database inserts.</p>
-
-<h2>$this->db->affected_rows()</h2>
-<p>Displays the number of affected rows, when doing "write" type queries (insert, update, etc.).</p>
-<p>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.</p>
-
-
-<h2>$this->db->count_all();</h2>
-<p>Permits you to determine the number of rows in a particular table. Submit the table name in the first parameter. Example:</p>
-<code>echo $this->db->count_all('<var>my_table</var>');<br />
-<br />
-// Produces an integer, like 25
-</code>
-
-
-<h2>$this->db->platform()</h2>
-<p>Outputs the database platform you are running (MySQL, MS SQL, Postgres, etc...):</p>
-<code>echo $this->db->platform();</code>
-
-
-<h2>$this->db->version()</h2>
-<p>Outputs the database version you are running:</p>
-<code>echo $this->db->version();</code>
-
-
-<h2>$this->db->last_query();</h2>
-<p>Returns the last query that was run (the query string, not the result). Example:</p>
-
-<code>$str = $this->db->last_query();<br />
-<br />
-// Produces: SELECT * FROM sometable....
-</code>
-
-
-<p>The following two functions help simplify the process of writing database INSERTs and UPDATEs.</p>
-
-
-<h2>$this->db->insert_string(); </h2>
-<p>This function simplifies the process of writing database inserts. It returns a correctly formatted SQL insert string. Example:</p>
-
-<code>$data = array('name' => $name, 'email' => $email, 'url' => $url);<br />
-<br />
-$str = $this->db->insert_string('table_name', $data);
-</code>
-
-<p>The first parameter is the table name, the second is an associative array with the data to be inserted. The above example produces:</p>
-<code>INSERT INTO table_name (name, email, url) VALUES ('Rick', 'rick@example.com', 'example.com')</code>
-
-<p class="important">Note: Values are automatically escaped, producing safer queries.</p>
-
-
-
-<h2>$this->db->update_string(); </h2>
-<p>This function simplifies the process of writing database updates. It returns a correctly formatted SQL update string. Example:</p>
-
-<code>$data = array('name' => $name, 'email' => $email, 'url' => $url);<br />
-<br />
-$where = "author_id = 1 AND status = 'active'";
-<br /><br />
-$str = $this->db->update_string('table_name', $data, $where);
-</code>
-
-<p>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:</p>
-<code> UPDATE table_name SET name = 'Rick', email = 'rick@example.com', url = 'example.com' WHERE author_id = 1 AND status = 'active'</code>
-
-<p class="important">Note: Values are automatically escaped, producing safer queries.</p>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="results.html">Query Results</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="active_record.html">Active Record Pattern</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/database/index.html b/user_guide/database/index.html
deleted file mode 100644
index 8a957ecef..000000000
--- a/user_guide/database/index.html
+++ /dev/null
@@ -1,99 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>The Database Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Database Library
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>The Database Class</h1>
-
-<p>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.</p>
-
- <ul>
- <li><a href="examples.html">Quick Start: Usage Examples</a></li>
- <li><a href="configuration.html">Database Configuration</a></li>
- <li><a href="connecting.html">Connecting to a Database</a></li>
- <li><a href="queries.html">Running Queries</a></li>
- <li><a href="results.html">Generating Query Results</a></li>
- <li><a href="helpers.html">Query Helper Functions</a></li>
- <li><a href="active_record.html">Active Record Class</a></li>
- <li><a href="transactions.html">Transactions</a></li>
- <li><a href="table_data.html">Table MetaData</a></li>
- <li><a href="fields.html">Field MetaData</a></li>
- <li><a href="call_function.html">Custom Function Calls</a></li>
- <li><a href="caching.html">Query Caching</a></li>
- <li><a href="forge.html">Database manipulation with Database Forge</a></li>
- <li><a href="utilities.html">Database Utilities Class</a></li>
- </ul>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="../libraries/caching.html">Caching Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="examples.html">Quick Start: Usage Examples</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html
deleted file mode 100644
index 3152997ca..000000000
--- a/user_guide/database/queries.html
+++ /dev/null
@@ -1,158 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Queries : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-<a href="index.html">Database Library</a> &nbsp;&#8250;&nbsp;
-Queries
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Queries</h1>
-
-<h2>$this->db->query();</h2>
-
-<p>To submit a query, use the following function:</p>
-
-<code>$this->db->query('YOUR QUERY HERE');</code>
-
-<p>The <dfn>query()</dfn> function returns a database result <strong>object</strong> when "read" type queries are run,
-which you can use to <a href="results.html">show your results</a>. 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:</p>
-
-<code><var>$query</var> = $this->db->query('YOUR QUERY HERE');</code>
-
-<h2>$this->db->simple_query();</h2>
-
-<p>This is a simplified version of the <dfn>$this->db->query()</dfn> 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.</p>
-
-
-<h1>Working with Database prefixes manually</h1>
-<p>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:</p>
-<p><code>$this-&gt;db-&gt;dbprefix('tablename');<br />
-// outputs prefix_tablename</code></p>
-
-<p>If for any reason you would like to change the prefix programatically without needing to create a new connection, you can use this method:</p>
-<p><code>$this-&gt;db-&gt;set_dbprefix('newprefix');<br /><br />
-$this-&gt;db-&gt;dbprefix('tablename');<br />
-// outputs newprefix_tablename</code></p>
-
-
-<h1>Protecting identifiers</h1>
-<p>In many databases it is advisable to protect table and field names - for example with backticks in MySQL. <strong>Active Record queries are automatically protected</strong>, however if you need to manually protect an identifier you can use:</p>
-<p><code>$this-&gt;db-&gt;protect_identifiers('table_name');</code></p>
-
-<p>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 <kbd>TRUE</kbd> (boolen) via the second parameter:</p>
-<p><code>$this-&gt;db-&gt;protect_identifiers('table_name', <kbd>TRUE</kbd>);</code></p>
-
-
-<h1>Escaping Queries</h1>
-<p>It's a very good security practice to escape your data before submitting it into your database.
-CodeIgniter has three methods that help you do this:</p>
-
-<ol>
-<li><strong>$this->db->escape()</strong> 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:
-
-<code>$sql = "INSERT INTO table (title) VALUES(".$this->db->escape($title).")";</code></li>
-
-<li><strong>$this->db->escape_str()</strong> 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:
-
-<code>$sql = "INSERT INTO table (title) VALUES('".$this->db->escape_str($title)."')";</code></li>
-
-<li><strong>$this->db->escape_like_str()</strong> 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.
-
-<code>$search = '20% raise';<br />
-$sql = "SELECT id FROM table WHERE column LIKE '%".$this->db->escape_like_str($search)."%'";</code></li>
-
-</ol>
-
-
-<h1>Query Bindings</h1>
-
-
-<p>Bindings enable you to simplify your query syntax by letting the system put the queries together for you. Consider the following example:</p>
-
-<code>
-$sql = "SELECT * FROM some_table WHERE id = <var>?</var> AND status = <var>?</var> AND author = <var>?</var>";
-<br /><br />
-$this->db->query($sql, array(3, 'live', 'Rick'));
-</code>
-
-<p>The question marks in the query are automatically replaced with the values in the array in the second parameter of the query function.</p>
-<p class="important">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.</p>
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="connecting.html">Connecting to your Database</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="results.html">Query Results</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/database/results.html b/user_guide/database/results.html
deleted file mode 100644
index 0baf992fb..000000000
--- a/user_guide/database/results.html
+++ /dev/null
@@ -1,259 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Generating Query Results : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-<a href="index.html">Database Library</a> &nbsp;&#8250;&nbsp;
-Query Results
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-
-<h1>Generating Query Results</h1>
-
-
-<p>There are several ways to generate query results:</p>
-
- <h2>result()</h2>
-
- <p>This function returns the query result as an array of <strong>objects</strong>, or <strong>an empty array</strong> on failure.
-
- Typically you'll use this in a foreach loop, like this:</p>
-
- <code>
- $query = $this->db->query("YOUR QUERY");<br />
- <br />
- foreach ($query->result() as $row)<br />
- {<br />
- &nbsp;&nbsp;&nbsp;echo $row->title;<br />
- &nbsp;&nbsp;&nbsp;echo $row->name;<br />
- &nbsp;&nbsp;&nbsp;echo $row->body;<br />
- }</code>
-
- <p>The above <dfn>function</dfn> is an alias of <dfn>result_object()</dfn>.</p>
-
- <p>If you run queries that might <strong>not</strong> produce a result, you are encouraged to test the result first:</p>
-
- <code>
- $query = $this->db->query("YOUR QUERY");<br />
- <br />
- if ($query->num_rows() > 0)<br />
- {<br />
- &nbsp;&nbsp;&nbsp;foreach ($query->result() as $row)<br />
- &nbsp;&nbsp;&nbsp;{<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo $row->title;<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo $row->name;<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo $row->body;<br />
- &nbsp;&nbsp;&nbsp;}<br />
- }
- </code>
-
- <p>You can also pass a string to result() which represents a class to instantiate for each result object (note: this class must be loaded)</p>
-
- <code>
- $query = $this->db->query("SELECT * FROM users;");<br />
- <br />
- foreach ($query->result('User') as $row)<br />
- {<br />
- &nbsp;&nbsp;&nbsp;echo $row->name; // call attributes<br />
- &nbsp;&nbsp;&nbsp;echo $row->reverse_name(); // or methods defined on the 'User' class<br />
- }
- </code>
-
- <h2>result_array()</h2>
-
- <p>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:</p>
- <code>
- $query = $this->db->query("YOUR QUERY");<br />
- <br />
- foreach ($query->result_array() as $row)<br />
- {<br />
- &nbsp;&nbsp;&nbsp;echo $row['title'];<br />
- &nbsp;&nbsp;&nbsp;echo $row['name'];<br />
- &nbsp;&nbsp;&nbsp;echo $row['body'];<br />
- }</code>
-
-
- <h2>row()</h2>
-
- <p>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 <strong>object</strong>. Here's a usage example:</p>
- <code>
- $query = $this->db->query("YOUR QUERY");<br />
- <br />
- if ($query->num_rows() > 0)<br />
- {<br />
- &nbsp;&nbsp;&nbsp;$row = $query->row();
- <br /><br />
- &nbsp;&nbsp;&nbsp;echo $row->title;<br />
- &nbsp;&nbsp;&nbsp;echo $row->name;<br />
- &nbsp;&nbsp;&nbsp;echo $row->body;<br />
- }
- </code>
-
- <p>If you want a specific row returned you can submit the row number as a digit in the first parameter:</p>
-
- <code>$row = $query->row(<dfn>5</dfn>);</code>
-
- <p>You can also add a second String parameter, which is the name of a class to instantiate the row with:</p>
-
- <code>
- $query = $this->db->query("SELECT * FROM users LIMIT 1;");<br />
- <br />
- $query->row(0, 'User')<br />
- echo $row->name; // call attributes<br />
- echo $row->reverse_name(); // or methods defined on the 'User' class<br />
- </code>
-
- <h2>row_array()</h2>
-
- <p>Identical to the above <var>row()</var> function, except it returns an array. Example:</p>
-
- <code>
- $query = $this->db->query("YOUR QUERY");<br />
- <br />
- if ($query->num_rows() > 0)<br />
- {<br />
- &nbsp;&nbsp;&nbsp;$row = $query->row_array();
- <br /><br />
- &nbsp;&nbsp;&nbsp;echo $row['title'];<br />
- &nbsp;&nbsp;&nbsp;echo $row['name'];<br />
- &nbsp;&nbsp;&nbsp;echo $row['body'];<br />
- }
- </code>
-
-
- <p>If you want a specific row returned you can submit the row number as a digit in the first parameter:</p>
-
- <code>$row = $query->row_array(<dfn>5</dfn>);</code>
-
-
- <p>In addition, you can walk forward/backwards/first/last through your results using these variations:</p>
-
-<p>
- <strong>$row = $query->first_row()</strong><br />
- <strong>$row = $query->last_row()</strong><br />
- <strong>$row = $query->next_row()</strong><br />
- <strong>$row = $query->previous_row()</strong>
-</p>
-
-<p>By default they return an object unless you put the word "array" in the parameter:</p>
-
-<p>
- <strong>$row = $query->first_row('array')</strong><br />
- <strong>$row = $query->last_row('array')</strong><br />
- <strong>$row = $query->next_row('array')</strong><br />
- <strong>$row = $query->previous_row('array')</strong>
-</p>
-
-
-
-<h1>Result Helper Functions</h1>
-
-
-<h2>$query->num_rows()</h2>
-<p>The number of rows returned by the query. Note: In this example, <dfn>$query</dfn> is the variable that the query result object is assigned to:</p>
-
-<code>$query = $this->db->query('SELECT * FROM my_table');<br /><br />
-echo $query->num_rows();
-</code>
-
-<h2>$query->num_fields()</h2>
-<p>The number of FIELDS (columns) returned by the query. Make sure to call the function using your query result object:</p>
-
-<code>$query = $this->db->query('SELECT * FROM my_table');<br /><br />
-echo $query->num_fields();
-</code>
-
-
-
-<h2>$query->free_result()</h2>
-<p>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:
-</p>
-
-<code>$query = $this->db->query('SELECT title FROM my_table');<br /><br />
-foreach ($query->result() as $row)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;echo $row->title;<br />
-}<br />
-$query->free_result(); // The $query result object will no longer be available<br />
-<br />
-$query2 = $this->db->query('SELECT name FROM some_table');<br /><br />
-$row = $query2->row();<br />
-echo $row->name;<br />
-$query2->free_result(); // The $query2 result object will no longer be available
-</code>
-
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="queries.html">Queries</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="helpers.html">Query Helper Functions</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html>
diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html
deleted file mode 100644
index dc5b54198..000000000
--- a/user_guide/database/table_data.html
+++ /dev/null
@@ -1,113 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Table Data : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-<a href="index.html">Database Library</a> &nbsp;&#8250;&nbsp;
-Table Data
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-
-<h1>Table Data</h1>
-
-<p>These functions let you fetch table information.</p>
-
-<h2>$this->db->list_tables();</h2>
-
-<p>Returns an array containing the names of all the tables in the database you are currently connected to. Example:</p>
-
-<code>$tables = $this->db->list_tables();<br />
-<br />
-foreach ($tables as $table)<br />
-{<br />
-&nbsp;&nbsp; echo $table;<br />
-}
-</code>
-
-
-<h2>$this->db->table_exists();</h2>
-
-<p>Sometimes it's helpful to know whether a particular table exists before running an operation on it.
-Returns a boolean TRUE/FALSE. Usage example:</p>
-
-<code>
-if ($this->db->table_exists('table_name'))<br />
-{<br />
-&nbsp;&nbsp; // some code...<br />
-}
-</code>
-
-<p>Note: Replace <em>table_name</em> with the name of the table you are looking for.</p>
-
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="transactions.html"> Transactions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="fields.html"> Field Metadata</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html
deleted file mode 100644
index dd5f73ed1..000000000
--- a/user_guide/database/transactions.html
+++ /dev/null
@@ -1,200 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Transactions : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-<a href="index.html">Database Library</a> &nbsp;&#8250;&nbsp;
-Transactions
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Transactions</h1>
-
-<p>CodeIgniter's database abstraction allows you to use <dfn>transactions</dfn> 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.</p>
-
-<p>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.
-</p>
-
-<h2>CodeIgniter's Approach to Transactions</h2>
-
-<p>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.</p>
-
-<p>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 <dfn>commit</dfn> or <dfn>rollback</dfn> 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).</p>
-
-<h2>Running Transactions</h2>
-
-<p>To run your queries using transactions you will use the <dfn>$this->db->trans_start()</dfn> and <dfn>$this->db->trans_complete()</dfn> functions as follows:</p>
-
-<code>
-<kbd>$this->db->trans_start();</kbd><br />
-$this->db->query('AN SQL QUERY...');<br />
-$this->db->query('ANOTHER QUERY...');<br />
-$this->db->query('AND YET ANOTHER QUERY...');<br />
-<kbd>$this->db->trans_complete();</kbd>
-</code>
-
-<p>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.</p>
-
-
-<h2>Strict Mode</h2>
-
-<p>By default CodeIgniter runs all transactions in <dfn>Strict Mode</dfn>. 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.</p>
-
-<p>Strict Mode can be disabled as follows:</p>
-
-<code>$this->db->trans_strict(FALSE);</code>
-
-
-<h2>Managing Errors</h2>
-
-<p>If you have error reporting enabled in your <dfn>config/database.php</dfn> 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:</p>
-
-<code>
-$this->db->trans_start();<br />
-$this->db->query('AN SQL QUERY...');<br />
-$this->db->query('ANOTHER QUERY...');<br />
-$this->db->trans_complete();<br />
-<br />
-if (<kbd>$this->db->trans_status()</kbd> === FALSE)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;// generate an error... or use the log_message() function to log your error<br />
-}
-</code>
-
-
-<h2>Enabling Transactions</h2>
-
-<p>Transactions are enabled automatically the moment you use <dfn>$this->db->trans_start()</dfn>. If you would like to disable transactions you
-can do so using <dfn>$this->db->trans_off()</dfn>:</p>
-
-<code>
-<kbd>$this->db->trans_off()</kbd><br /><br />
-
-$this->db->trans_start();<br />
-$this->db->query('AN SQL QUERY...');<br />
-$this->db->trans_complete();
-</code>
-
-<p class="important">When transactions are disabled, your queries will be auto-commited, just as they are when running queries without transactions.</p>
-
-
-<h2>Test Mode</h2>
-
-<p>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 <dfn>$this->db->trans_start()</dfn> function to <samp>TRUE</samp>:</p>
-
-<code>
-$this->db->trans_start(<samp>TRUE</samp>); // Query will be rolled back<br />
-$this->db->query('AN SQL QUERY...');<br />
-$this->db->trans_complete();
-</code>
-
-
-<h2>Running Transactions Manually</h2>
-
-<p>If you would like to run transactions manually you can do so as follows:</p>
-
-<code>
-$this->db->trans_begin();<br /><br />
-
-$this->db->query('AN SQL QUERY...');<br />
-$this->db->query('ANOTHER QUERY...');<br />
-$this->db->query('AND YET ANOTHER QUERY...');<br />
-
-<br />
-
-if ($this->db->trans_status() === FALSE)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$this->db->trans_rollback();<br />
-}<br />
-else<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$this->db->trans_commit();<br />
-}<br />
-</code>
-
-<p class="important"><strong>Note:</strong> Make sure to use <kbd>$this->db->trans_begin()</kbd> when running manual transactions, <strong>NOT</strong>
-<dfn>$this->db->trans_start()</dfn>.</p>
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp; <a href="fields.html">Field MetaData</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="table_data.html">Table Metadata</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html
deleted file mode 100644
index 7c30070f6..000000000
--- a/user_guide/database/utilities.html
+++ /dev/null
@@ -1,314 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Database Utility Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-<a href="index.html">Database Library</a> &nbsp;&#8250;&nbsp;
-Database Utility Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Database Utility Class</h1>
-
-<p>The Database Utility Class contains functions that help you manage your database.</p>
-
-<h3>Table of Contents</h3>
-
-<ul>
-<li><a href="#init">Initializing the Utility Class</a></li>
-<li><a href="#list">Listing your Databases</a></li>
-<li><a href="#exists">Checking for a specific Database</a></li>
-<li><a href="#opttb">Optimizing your Tables</a></li>
-<li><a href="#repair">Repairing your Databases</a></li>
-<li><a href="#optdb">Optimizing your Database</a></li>
-<li><a href="#csv">CSV Files from a Database Result</a></li>
-<li><a href="#xml">XML Files from a Database Result</a></li>
-<li><a href="#backup">Backing up your Database</a></li>
-</ul>
-
-
-
-<h2><a name="init"></a>Initializing the Utility Class</h2>
-
-<p class="important"><strong>Important:</strong>&nbsp; In order to initialize the Utility class, your database driver must
-already be running, since the utilities class relies on it.</p>
-
-<p>Load the Utility Class as follows:</p>
-
-<code>$this->load->dbutil()</code>
-
-<p>Once initialized you will access the functions using the <dfn>$this->dbutil</dfn> object:</p>
-
-<code>$this->dbutil->some_function()</code>
-
-<h2><a name="list"></a>$this->dbutil->list_databases()</h2>
-<p>Returns an array of database names:</p>
-
-<code>
-$dbs = $this->dbutil->list_databases();<br />
-<br />
-foreach ($dbs as $db)<br />
-{<br />
-&nbsp;&nbsp;&nbsp; echo $db;<br />
-}</code>
-
-
-<h2><a name="exists"></a>$this->dbutil->database_exists();</h2>
-
-<p>Sometimes it's helpful to know whether a particular database exists.
-Returns a boolean TRUE/FALSE. Usage example:</p>
-
-<code>
-if ($this->dbutil->database_exists('database_name'))<br />
-{<br />
-&nbsp;&nbsp; // some code...<br />
-}
-</code>
-
-<p>Note: Replace <em>database_name</em> with the name of the table you are looking for. This function is case sensitive.</p>
-
-
-
-<h2><a name="opttb"></a>$this->dbutil->optimize_table('table_name');</h2>
-
-<p class="important"><strong>Note:</strong>&nbsp; This features is only available for MySQL/MySQLi databases.</p>
-
-
-<p>Permits you to optimize a table using the table name specified in the first parameter. Returns TRUE/FALSE based on success or failure:</p>
-
-<code>
-if ($this->dbutil->optimize_table('table_name'))<br />
-{<br />
-&nbsp;&nbsp;&nbsp; echo 'Success!';<br />
-}
-</code>
-
-<p><strong>Note:</strong> Not all database platforms support table optimization.</p>
-
-
-<h2><a name="repair"></a>$this->dbutil->repair_table('table_name');</h2>
-
-<p class="important"><strong>Note:</strong>&nbsp; This features is only available for MySQL/MySQLi databases.</p>
-
-
-<p>Permits you to repair a table using the table name specified in the first parameter. Returns TRUE/FALSE based on success or failure:</p>
-
-<code>
-if ($this->dbutil->repair_table('table_name'))<br />
-{<br />
-&nbsp;&nbsp;&nbsp; echo 'Success!';<br />
-}
-</code>
-
-<p><strong>Note:</strong> Not all database platforms support table repairs.</p>
-
-
-<h2><a name="optdb"></a>$this->dbutil->optimize_database();</h2>
-
-<p class="important"><strong>Note:</strong>&nbsp; This features is only available for MySQL/MySQLi databases.</p>
-
-<p>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.</p>
-
-<code>
-$result = $this->dbutil->optimize_database();<br />
-<br />
-if ($result !== FALSE)<br />
-{<br />
-&nbsp;&nbsp;&nbsp; print_r($result);<br />
-}
-</code>
-
-<p><strong>Note:</strong> Not all database platforms support table optimization.</p>
-
-
-<h2><a name="csv"></a>$this->dbutil->csv_from_result($db_result)</h2>
-
-<p>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:</p>
-
-<code>
-$this->load->dbutil();<br />
-<br />
-$query = $this->db->query("SELECT * FROM mytable");<br />
-<br />
-echo $this->dbutil->csv_from_result($query);
-</code>
-
-<p>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:</p>
-
-<code>
-$delimiter = ",";<br />
-$newline = "\r\n";<br />
-<br />
-echo $this->dbutil->csv_from_result($query, $delimiter, $newline);
-</code>
-
-<p><strong>Important:</strong>&nbsp; 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 <a href="../helpers/file_helper.html">File Helper</a>.</p>
-
-
-<h2><a name="xml"></a>$this->dbutil->xml_from_result($db_result)</h2>
-
-<p>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:</p>
-
-<code>
-$this->load->dbutil();<br />
-<br />
-$query = $this->db->query("SELECT * FROM mytable");<br />
-<br />
-$config = array (<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'root'&nbsp;&nbsp;&nbsp; => 'root',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'element' => 'element', <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'newline' => "\n", <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'tab'&nbsp;&nbsp;&nbsp;&nbsp;=> "\t"<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-echo $this->dbutil->xml_from_result($query, $config);
-</code>
-
-<p><strong>Important:</strong>&nbsp; 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 <a href="../helpers/file_helper.html">File Helper</a>.</p>
-
-
-<h2><a name="backup"></a>$this->dbutil->backup()</h2>
-
-<p>Permits you to backup your full database or individual tables. The backup data can be compressed in either Zip or Gzip format.</p>
-
-<p class="important"><strong>Note:</strong>&nbsp; This features is only available for MySQL databases.</p>
-
-<p>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.</p>
-
-<h3>Usage Example</h3>
-
-<code>
-<dfn>// Load the DB utility class</dfn><br />
-$this->load->dbutil();<br /><br />
-
-<dfn>// Backup your entire database and assign it to a variable</dfn><br />
-$backup =& $this->dbutil->backup();
-
-<br /><br />
-<dfn>// Load the file helper and write the file to your server</dfn><br />
-$this->load->helper('file');<br />
-write_file('/path/to/mybackup.gz', $backup);
-
-<br /><br />
-<dfn>// Load the download helper and send the file to your desktop</dfn><br />
-$this->load->helper('download');<br />
-force_download('mybackup.gz', $backup);
-</code>
-
-<h3>Setting Backup Preferences</h3>
-
-<p>Backup preferences are set by submitting an array of values to the first parameter of the backup function. Example:</p>
-
-<code>$prefs = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'tables'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> array('table1', 'table2'),&nbsp;&nbsp;// Array of tables to backup.<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'ignore'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> array(),&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// List of tables to omit from the backup<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'format'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> 'txt',&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// gzip, zip, txt<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'filename'&nbsp;&nbsp;&nbsp;&nbsp;=> 'mybackup.sql',&nbsp;&nbsp;&nbsp;&nbsp;// File name - NEEDED ONLY WITH ZIP FILES<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'add_drop'&nbsp;&nbsp;&nbsp;&nbsp;=> TRUE,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Whether to add DROP TABLE statements to backup file<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'add_insert'&nbsp;&nbsp;=> TRUE,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Whether to add INSERT data to backup file<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'newline'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> "\n"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Newline character used in backup file<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-$this->dbutil->backup($prefs);
-</code>
-
-
-<h3>Description of Backup Preferences</h3>
-
-<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
-<tr>
-<th>Preference</th>
-<th>Default&nbsp;Value</th>
-<th>Options</th>
-<th>Description</th>
-</tr><tr>
-<td class="td"><strong>tables</strong></td><td class="td">empty array</td><td class="td">None</td><td class="td">An array of tables you want backed up. If left blank all tables will be exported.</td>
-</tr><tr>
-<td class="td"><strong>ignore</strong></td><td class="td">empty array</td><td class="td">None</td><td class="td">An array of tables you want the backup routine to ignore.</td>
-</tr><tr>
-<td class="td"><strong>format</strong></td><td class="td">gzip</td><td class="td">gzip, zip, txt</td><td class="td">The file format of the export file.</td>
-</tr><tr>
-<td class="td"><strong>filename</strong></td><td class="td">the current date/time</td><td class="td">None</td><td class="td">The name of the backed-up file. The name is needed only if you are using zip compression.</td>
-</tr><tr>
-<td class="td"><strong>add_drop</strong></td><td class="td">TRUE</td><td class="td">TRUE/FALSE</td><td class="td">Whether to include DROP TABLE statements in your SQL export file.</td>
-</tr><tr>
-<td class="td"><strong>add_insert</strong></td><td class="td">TRUE</td><td class="td">TRUE/FALSE</td><td class="td">Whether to include INSERT statements in your SQL export file.</td>
-</tr><tr>
-<td class="td"><strong>newline</strong></td><td class="td">"\n"</td><td class="td">"\n", "\r", "\r\n"</td><td class="td">Type of newline to use in your SQL export file.</td>
-
-</tr>
-</table>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="forge.html">DB Forge Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="../libraries/javascript.html">Javascript Class</a></p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/doc_style/index.html b/user_guide/doc_style/index.html
deleted file mode 100644
index aa7fff43d..000000000
--- a/user_guide/doc_style/index.html
+++ /dev/null
@@ -1,87 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Writing Documentation : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Writing Documentation
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Writing Documentation</h1>
-
-<p>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.</p>
-
-<h2>Files</h2>
-
-<ul>
- <li><a href="../userguide.css">Stylesheet</a></li>
- <li><a href="./template.html">Page Template</a></li>
-</ul>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="../general/styleguide.html">PHP Style Guide</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="../libraries/benchmark.html">Benchmarking Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/doc_style/template.html b/user_guide/doc_style/template.html
deleted file mode 100644
index d59d5e4ed..000000000
--- a/user_guide/doc_style/template.html
+++ /dev/null
@@ -1,128 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter Project Documentation Template</title>
-
-<style type='text/css' media='all'>@import url('./userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"></div></div>
-<div id="nav2"><a name="top">&nbsp;</a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>Project Title</h1></td>
-<td id="breadcrumb_right"><a href="#">Right Breadcrumb</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://example.com/">Project Home</a> &nbsp;&#8250;&nbsp;
-<a href="#">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Foo Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="example.com/user_guide/" />Search Project User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Foo Class</h1>
-
-<p>Brief description of Foo Class. If it extends a native CodeIgniter class, please link to the class in the CodeIgniter documents here.</p>
-
-<p class="important"><strong>Important:</strong>&nbsp; This is an important note with <kbd>EMPHASIS</kbd>.</p>
-
-<p>Features:</p>
-
-<ul>
- <li>Foo</li>
- <li>Bar</li>
-</ul>
-
-<h2>Usage Heading</h2>
-
-<p>Within a text string, <var>highlight variables</var> using <var>&lt;var&gt;&lt;/var&gt;</var> tags, and <dfn>highlight code</dfn> using the <dfn>&lt;dfn&gt;&lt;/dfn&gt;</dfn> tags.</p>
-
-<h3>Sub-heading</h3>
-
-<p>Put code examples within <dfn>&lt;code&gt;&lt;/code&gt;</dfn> tags:</p>
-
-<code>
- $this->load->library('foo');<br />
- <br />
- $this->foo->bar('bat');
-</code>
-
-
-<h2>Table Preferences</h2>
-
-<p>Use tables where appropriate for long lists of preferences.</p>
-
-
-<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
-<tr>
- <th>Preference</th>
- <th>Default&nbsp;Value</th>
- <th>Options</th>
- <th>Description</th>
-</tr>
-<tr>
- <td class="td"><strong>foo</strong></td>
- <td class="td">Foo</td>
- <td class="td">None</td>
- <td class="td">Description of foo.</td>
-</tr>
-<tr>
- <td class="td"><strong>bar</strong></td>
- <td class="td">Bar</td>
- <td class="td">bat, bag, or bak</td>
- <td class="td">Description of bar.</td>
-</tr>
-</table>
-
-<h2>Foo Function Reference</h2>
-
-<h3>$this->foo->bar()</h3>
-<p>Description</p>
-<code>$this->foo->bar('<var>baz</var>')</code>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="#">Previous Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="#">Next Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html
deleted file mode 100644
index 6e601af44..000000000
--- a/user_guide/general/alternative_php.html
+++ /dev/null
@@ -1,147 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Alternate PHP Syntax for View Files : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Alternate PHP Syntax
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Alternate PHP Syntax for View Files</h1>
-
-<p>If you do not utilize CodeIgniter's <a href="../libraries/parser.html">template engine</a>, 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.</p>
-
-<h2>Automatic Short Tag Support</h2>
-
-<p><strong>Note:</strong> 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
-<dfn>config/config.php</dfn> file.</p>
-
-<p class="important">Please note that if you do use this feature, if PHP errors are encountered
-in your <strong>view files</strong>, the error message and line number will not be accurately shown. Instead, all errors
-will be shown as <kbd>eval()</kbd> errors.</p>
-
-
-<h2>Alternative Echos</h2>
-
-<p>Normally to echo, or print out a variable you would do this:</p>
-
-<code>&lt;?php echo $variable; ?></code>
-
-<p>With the alternative syntax you can instead do it this way:</p>
-
-<code>&lt;?=$variable?></code>
-
-
-
-<h2>Alternative Control Structures</h2>
-
-<p>Controls structures, like <var>if</var>, <var>for</var>, <var>foreach</var>, and <var>while</var> can be
-written in a simplified format as well. Here is an example using foreach:</p>
-
-<code>
-&lt;ul><br />
-<br />
-<var>&lt;?php foreach ($todo as $item): ?></var><br />
-<br />
-&lt;li><var>&lt;?=$item?></var>&lt;/li><br />
-<br />
-<var>&lt;?php endforeach; ?></var><br />
-<br />
-&lt;/ul></code>
-
-<p>Notice that there are no braces. Instead, the end brace is replaced with <var>endforeach</var>.
-Each of the control structures listed above has a similar closing syntax:
-<var>endif</var>, <var>endfor</var>, <var>endforeach</var>, and <var>endwhile</var></p>
-
-<p>Also notice that instead of using a semicolon after each structure (except the last one), there is a colon. This is
-important!</p>
-
-<p>Here is another example, using if/elseif/else. Notice the colons:</p>
-
-
-<code><var>&lt;?php if ($username == 'sally'): ?></var><br />
-<br />
-&nbsp;&nbsp;&nbsp;&lt;h3>Hi Sally&lt;/h3><br />
-<br />
-<var>&lt;?php elseif ($username == 'joe'): ?></var><br />
-<br />
-&nbsp;&nbsp;&nbsp;&lt;h3>Hi Joe&lt;/h3><br />
-<br />
-<var>&lt;?php else: ?></var><br />
-<br />
-&nbsp;&nbsp;&nbsp;&lt;h3>Hi unknown user&lt;/h3><br />
-<br />
-<var>&lt;?php endif; ?></var></code>
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="managing_apps.html">Managing Applications</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="security.html">Security</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html
deleted file mode 100644
index 0e3d54deb..000000000
--- a/user_guide/general/ancillary_classes.html
+++ /dev/null
@@ -1,117 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Creating Ancillary Classes : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Creating Ancillary Classes
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Creating Ancillary Classes</h1>
-
-<p>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.</p>
-
-<h2>get_instance()</h2>
-
-
-<p><strong>Any class that you instantiate within your controller functions can access CodeIgniter's native resources</strong> simply by using the <kbd>get_instance()</kbd> function.
-This function returns the main CodeIgniter object.</p>
-
-<p>Normally, to call any of the available CodeIgniter functions requires you to use the <kbd>$this</kbd> construct:</p>
-
-<code>
-<strong>$this</strong>->load->helper('url');<br />
-<strong>$this</strong>->load->library('session');<br />
-<strong>$this</strong>->config->item('base_url');<br />
-etc.
-</code>
-
-<p><kbd>$this</kbd>, 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:</p>
-
-
-<p>First, assign the CodeIgniter object to a variable:</p>
-
-<code>$CI =& get_instance();</code>
-
-<p>Once you've assigned the object to a variable, you'll use that variable <em>instead</em> of <kbd>$this</kbd>:</p>
-
-<code>
-$CI =& get_instance();<br /><br />
-$CI->load->helper('url');<br />
-$CI->load->library('session');<br />
-$CI->config->item('base_url');<br />
-etc.
-</code>
-
-<p class="important"><strong>Note:</strong> You'll notice that the above get_instance() function is being passed by reference:
-<br /><br />
-<var>$CI =& get_instance();</var>
-<br /><br />
-This is very important. Assigning by reference allows you to use the original CodeIgniter object rather than creating a copy of it.</p>
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="creating_libraries.html">Creating Core Libraries</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="autoloader.html">Auto-loading Resources</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html
deleted file mode 100644
index 699751202..000000000
--- a/user_guide/general/autoloader.html
+++ /dev/null
@@ -1,100 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Auto-loading Resources : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Auto-loading Resources
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Auto-loading Resources</h1>
-
-<p>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.</p>
-
-<p>The following items can be loaded automatically:</p>
-
-<ul>
-<li>Core classes found in the "libraries" folder</li>
-<li>Helper files found in the "helpers" folder</li>
-<li>Custom config files found in the "config" folder</li>
-<li>Language files found in the "system/language" folder </li>
-<li>Models found in the &quot;models&quot; folder</li>
-</ul>
-
-<p>To autoload resources, open the <var>application/config/autoload.php</var> file and add the item you want
-loaded to the <samp>autoload</samp> array. You'll find instructions in that file corresponding to each
-type of item.</p>
-
-<p class="important"><strong>Note:</strong> Do not include the file extension (.php) when adding items to the autoload array.</p>
-
-
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="hooks.html">Hooks - Extending the Core</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="common_functions.html">Common Functions</a></p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html
deleted file mode 100644
index a0d7596ed..000000000
--- a/user_guide/general/caching.html
+++ /dev/null
@@ -1,115 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Web Page Caching : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Page Caching
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Web Page Caching</h1>
-
-<p>CodeIgniter lets you cache your pages in order to achieve maximum performance.</p>
-
-<p>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.</p>
-
-
-<h2>How Does Caching Work?</h2>
-
-<p>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 <dfn>application/cache</dfn> 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.</p>
-
-<p>Note: The Benchmark tag is not cached so you can still view your page load speed when caching is enabled.</p>
-
-<h2>Enabling Caching</h2>
-
-<p>To enable caching, put the following tag in any of your controller functions:</p>
-
-<code>$this->output->cache(<var>n</var>);</code>
-
-<p>Where <var>n</var> is the number of <strong>minutes</strong> you wish the page to remain cached between refreshes.</p>
-
-<p>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.</p>
-
-<p class="important"><strong>Warning:</strong> Because of the way CodeIgniter stores content for output, caching will only work if you are generating display for your controller with a <a href="./views.html">view</a>.</p>
-<p class="important"><strong>Note:</strong> Before the cache files can be written you must set the file permissions on your
-<dfn>application/cache</dfn> folder such that it is writable.</p>
-
-<h2>Deleting Caches</h2>
-
-<p>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.</p>
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="errors.html">Error Handling</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="profiling.html">Profiling Your Application</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/cli.html b/user_guide/general/cli.html
deleted file mode 100644
index 5dda24b56..000000000
--- a/user_guide/general/cli.html
+++ /dev/null
@@ -1,150 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Running via the CLI : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Running via the CLI
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Running via the CLI</h1>
-
-<p>
- As well as calling an applications <a href="./controllers.html">Controllers</a> via the URL in a browser they can also be loaded via the command-line interface (CLI).
-</p>
-
-
-<ul>
-<li><a href="#what">What is the CLI?</a></li>
-<li><a href="#why">Why use this method?</a></li>
-<li><a href="#how">How does it work?</a></li>
-</ul>
-
-
-<a name="what"></a>
-<h2>What is the CLI?</h2>
-
-<p><dfn>The command-line interface is a text-based method of interacting with computers.</dfn> For more information, check the <a href="http://en.wikipedia.org/wiki/Command-line_interface">Wikipedia article</a>.</p>
-
-<a name="why"></a>
-
-<h2>Why run via the command-line?</h2>
-
-<p>
- There are many reasons for running CodeIgniter from the command-line, but they are not always obvious.</p>
-
-<ul>
- <li>Run your cron-jobs without needing to use wget or curl</li>
- <li>Make your cron-jobs inaccessible from being loaded in the URL by checking for <kbd>$this->input->is_cli_request()</kbd></li>
- <li>Make interactive "tasks" that can do things like set permissions, prune cache folders, run backups, etc.</li>
- <li>Integrate with other applications in other languages. For example, a random C++ script could call one command and run code in your models!</li>
-</ul>
-
-<a name="how"></a>
-<h2>Let's try it:&nbsp; Hello World!</h2>
-
-<p>Let's create a simple controller so you can see it in action. Using your text editor, create a file called <dfn>tools.php</dfn>, and put the following code in it:</p>
-
-<textarea class="textarea" style="width:100%" cols="50" rows="10">
-&lt;?php
-class Tools extends CI_Controller {
-
- public function message($to = 'World')
- {
- echo "Hello {$to}!".PHP_EOL;
- }
-}
-?&gt;
-</textarea>
-
-<p>Then save the file to your <dfn>application/controllers/</dfn> folder.</p>
-
-<p>Now normally you would visit the your site using a URL similar to this:</p>
-
-<code>example.com/index.php/<var>tools</var>/<var>message</var>/<var>to</var></code>
-
-<p>Instead, we are going to open Terminal in Mac/Lunix or go to Run > "cmd" in Windows and navigate to our CodeIgniter project.</p>
-
-<blockquote>
- $ cd /path/to/project;<br/>
- $ php index.php tools message
-</blockquote>
-
-<p>If you did it right, you should see <samp>Hello World!</samp>.</p>
-
-<blockquote>
- $ php index.php tools message "John Smith"
-</blockquote>
-
-<p>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: <samp>Hello John Smith!</samp>.</p>
-
-<h2>That's it!</h2>
-
-<p>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.</p>
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="urls.html">CodeIgniter URLs</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="reserved_names.html">Reserved Names</a></p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/common_functions.html b/user_guide/general/common_functions.html
deleted file mode 100644
index f290521a9..000000000
--- a/user_guide/general/common_functions.html
+++ /dev/null
@@ -1,127 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Common Functions : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Auto-loading Resources
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Common Functions</h1>
-
-<p>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.</p>
-
-<h2>is_php('<var>version_number</var>')</h2>
-
-<p>is_php() determines of the PHP version being used is greater than the supplied <var>version_number</var>.</p>
-
-<code>if (is_php('5.3.0'))<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$str = quoted_printable_encode($str);<br />
-}</code>
-
-<p>Returns boolean <kbd>TRUE</kbd> if the installed version of PHP is equal to or greater than the supplied version number. Returns <kbd>FALSE</kbd> if the installed version of PHP is lower than the supplied version number.</p>
-
-
-<h2>is_really_writable('<var>path/to/file</var>')</h2>
-
-<p>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.</p>
-
-<code>if (is_really_writable('file.txt'))<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;I could write to this if I wanted to&quot;;<br />
-}<br />
-else<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;File is not writable&quot;;<br />
-}</code>
-
-<h2>config_item('<var>item_key</var>')</h2>
-<p>The <a href="../libraries/config.html">Config library</a> 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.</p>
-
-<h2>show_error('<var>message</var>'), show_404('<var>page</var>'), log_message('<var>level</var>', '<samp>message</samp>')</h2>
-<p>These are each outlined on the <a href="errors.html">Error Handling</a> page.</p>
-
-<h2>set_status_header(<var>code</var>, '<var>text</var>');</h2>
-
-<p>Permits you to manually set a server status header. Example:</p>
-
-<code>set_status_header(401);<br />
-// Sets the header as: Unauthorized</code>
-
-<p><a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">See here</a> for a full list of headers.</p>
-
-
-<h2>remove_invisible_characters(<var>$str</var>)</h2>
-<p>This function prevents inserting null characters between ascii characters, like Java\0script.</p>
-
-
-<h2>html_escape(<var>$mixed</var>)</h2>
-<p>This function provides short cut for htmlspecialchars() function. It accepts string and array. To prevent Cross Site Scripting (XSS), it is very useful.</p>
-
-</div>
-
-
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="autoloader.html">Auto-loading Resources</a><a href="hooks.html"></a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="routing.html">URI Routing</a></p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html
deleted file mode 100644
index 91dd95a00..000000000
--- a/user_guide/general/controllers.html
+++ /dev/null
@@ -1,388 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Controllers : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Controllers
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Controllers</h1>
-
-<p>Controllers are the heart of your application, as they determine how HTTP requests should be handled.</p>
-
-
-<ul>
-<li><a href="#what">What is a Controller?</a></li>
-<li><a href="#hello">Hello World</a></li>
-<li><a href="#functions">Functions</a></li>
-<li><a href="#passinguri">Passing URI Segments to Your Functions</a></li>
-<li><a href="#default">Defining a Default Controller</a></li>
-<li><a href="#remapping">Remapping Function Calls</a></li>
-<li><a href="#output">Controlling Output Data</a></li>
-<li><a href="#private">Private Functions</a></li>
-<li><a href="#subfolders">Organizing Controllers into Sub-folders</a></li>
-<li><a href="#constructors">Class Constructors</a></li>
-<li><a href="#reserved">Reserved Function Names</a></li>
-</ul>
-
-
-<a name="what"></a>
-<h2>What is a Controller?</h2>
-
-<p><dfn>A Controller is simply a class file that is named in a way that can be associated with a URI.</dfn></p>
-
-<p>Consider this URI:</p>
-
-<code>example.com/index.php/<var>blog</var>/</code>
-
-<p>In the above example, CodeIgniter would attempt to find a controller named <dfn>blog.php</dfn> and load it.</p>
-
-<p><strong>When a controller's name matches the first segment of a URI, it will be loaded.</strong></p>
-
-<a name="hello"></a>
-<h2>Let's try it:&nbsp; Hello World!</h2>
-
-<p>Let's create a simple controller so you can see it in action. Using your text editor, create a file called <dfn>blog.php</dfn>, and put the following code in it:</p>
-
-
-<textarea class="textarea" style="width:100%" cols="50" rows="10">
-&lt;?php
-class Blog extends CI_Controller {
-
- public function index()
- {
- echo 'Hello World!';
- }
-}
-?&gt;
-</textarea>
-
-
-
-<p>Then save the file to your <dfn>application/controllers/</dfn> folder.</p>
-
-<p>Now visit the your site using a URL similar to this:</p>
-
-<code>example.com/index.php/<var>blog</var>/</code>
-
-<p>If you did it right, you should see <samp>Hello World!</samp>.</p>
-
-<p>Note: Class names must start with an uppercase letter. In other words, this is valid:</p>
-
-<code>&lt;?php<br />
-class <var>Blog</var> extends CI_Controller {<br />
-<br />
-}<br />
-?&gt;</code>
-
-<p>This is <strong>not</strong> valid:</p>
-
-<code>&lt;?php<br />
-class <var>blog</var> extends CI_Controller {<br />
-<br />
-}<br />
-?&gt;</code>
-
-<p>Also, always make sure your controller <dfn>extends</dfn> the parent controller class so that it can inherit all its functions.</p>
-
-
-
-<a name="functions"></a>
-<h2>Functions</h2>
-
-<p>In the above example the function name is <dfn>index()</dfn>. The "index" function is always loaded by default if the
-<strong>second segment</strong> of the URI is empty. Another way to show your "Hello World" message would be this:</p>
-
-<code>example.com/index.php/<var>blog</var>/<samp>index</samp>/</code>
-
-<p><strong>The second segment of the URI determines which function in the controller gets called.</strong></p>
-
-<p>Let's try it. Add a new function to your controller:</p>
-
-
-<textarea class="textarea" style="width:100%" cols="50" rows="15">
-&lt;?php
-class Blog extends CI_Controller {
-
- public function index()
- {
- echo 'Hello World!';
- }
-
- public function comments()
- {
- echo 'Look at this!';
- }
-}
-?&gt;
-</textarea>
-
-<p>Now load the following URL to see the <dfn>comment</dfn> function:</p>
-
-<code>example.com/index.php/<var>blog</var>/<samp>comments</samp>/</code>
-
-<p>You should see your new message.</p>
-
-<a name="passinguri"></a>
-<h2>Passing URI Segments to your Functions</h2>
-
-<p>If your URI contains more then two segments they will be passed to your function as parameters.</p>
-
-<p>For example, lets say you have a URI like this:</p>
-
-<code>example.com/index.php/<var>products</var>/<samp>shoes</samp>/<kbd>sandals</kbd>/<dfn>123</dfn></code>
-
-<p>Your function will be passed URI segments 3 and 4 ("sandals" and "123"):</p>
-
-<code>
-&lt;?php<br />
-class Products extends CI_Controller {<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;public function shoes($sandals, $id)<br />
-&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo $sandals;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo $id;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-}<br />
-?&gt;
-</code>
-
-<p class="important"><strong>Important:</strong>&nbsp; If you are using the <a href="routing.html">URI Routing</a> feature, the segments
-passed to your function will be the re-routed ones.</p>
-
-
-<a name="default"></a>
-<h2>Defining a Default Controller</h2>
-
-<p>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 <dfn>application/config/routes.php</dfn> file and set this variable:</p>
-
-<code>$route['default_controller'] = '<var>Blog</var>';</code>
-
-<p>Where <var>Blog</var> 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.</p>
-
-
-
-<a name="remapping"></a>
-<h2>Remapping Function Calls</h2>
-
-<p>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 <kbd>_remap()</kbd> function:</p>
-
-<code>public function _remap()<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;// Some code here...<br />
-}</code>
-
-<p class="important"><strong>Important:</strong>&nbsp; If your controller contains a function named <kbd>_remap()</kbd>, it will <strong>always</strong>
-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.</p>
-
-<p>The overridden function call (typically the second segment of the URI) will be passed as a parameter to the <kbd>_remap()</kbd> function:</p>
-
-<code>public function _remap(<var>$method</var>)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;if ($method == 'some_method')<br />
-&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this->$method();<br />
-&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-&nbsp;&nbsp;&nbsp;&nbsp;else<br />
-&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this->default_method();<br />
-&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-}</code>
-
-<p>Any extra segments after the method name are passed into <kbd>_remap()</kbd> as an optional second parameter. This array can be used in combination with PHP's <a href="http://php.net/call_user_func_array">call_user_func_array</a> to emulate CodeIgniter's default behavior.</p>
-
-<code>public function _remap($method, $params = array())<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$method = 'process_'.$method;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;if (method_exists($this, $method))<br />
-&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return call_user_func_array(array($this, $method), $params);<br />
-&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-&nbsp;&nbsp;&nbsp;&nbsp;show_404();<br />
-}</code>
-
-
-<a name="output"></a>
-<h2>Processing Output</h2>
-
-<p>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
-<a href="views.html">Views</a> and <a href="../libraries/output.html">Output class</a> 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 <dfn>_output()</dfn> to your controller that will receive the finalized output data.</p>
-
-<p><strong>Important:</strong>&nbsp; If your controller contains a function named <kbd>_output()</kbd>, it will <strong>always</strong>
-be called by the output class instead of echoing the finalized data directly. The first parameter of the function will contain the finalized output.</p>
-
-<p>Here is an example:</p>
-
-<code>
-public function _output($output)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo $output;<br />
-}</code>
-
-<p class="important">Please note that your <dfn>_output()</dfn> 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 <a href="../libraries/output.html">feature</a>)
-before it is handed off to the _output() function.<br />
-<br />
-To have your controller's output cached properly, its <dfn>_output()</dfn> method can use:<br />
-
-<code>if ($this-&gt;output-&gt;cache_expiration &gt; 0)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;output-&gt;_write_cache($output);<br />
-}</code>
-
-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 <em>before</em> any of the final processing is done, please see
-the available methods in the <a href="../libraries/output.html">Output Class</a>.</p>
-
-<a name="private"></a>
-<h2>Private Functions</h2>
-
-
-<p>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:</p>
-
-<code>
-private function _utility()<br />
-{<br />
-&nbsp;&nbsp;// some code<br />
-}</code>
-
-<p>Trying to access it via the URL, like this, will not work:</p>
-
-<code>example.com/index.php/<var>blog</var>/<samp>_utility</samp>/</code>
-
-
-
-<a name="subfolders"></a>
-<h2>Organizing Your Controllers into Sub-folders</h2>
-
-<p>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.</p>
-
-<p>Simply create folders within your <dfn>application/controllers</dfn> directory and place your controller classes within them.</p>
-
-<p><strong>Note:</strong>&nbsp; When using this feature the first segment of your URI must specify the folder. For example, lets say you have a controller
-located here:</p>
-
-<code>application/controllers/<kbd>products</kbd>/shoes.php</code>
-
-<p>To call the above controller your URI will look something like this:</p>
-
-<code>example.com/index.php/products/shoes/show/123</code>
-
-<p>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
-<dfn>application/config/routes.php</dfn> file</p>
-
-
-<p>CodeIgniter also permits you to remap your URIs using its <a href="routing.html">URI Routing</a> feature.</p>
-
-
-<h2><a name="constructors"></a>Class Constructors</h2>
-
-
-<p>If you intend to use a constructor in any of your Controllers, you <strong>MUST</strong> place the following line of code in it:</p>
-
-<code>parent::__construct();</code>
-
-<p>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.</p>
-
-<code>
-&lt;?php<br />
-class <kbd>Blog</kbd> extends CI_Controller {<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public function <kbd>__construct()</kbd><br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<var>parent::__construct();</var><br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Your own constructor code<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-}<br />
-?&gt;</code>
-
-<p>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.</p>
-
-<a name="reserved"></a>
-<h2>Reserved Function Names</h2>
-
-<p>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 <a href="reserved_names.html">Reserved Names</a> for a full list.</p>
-
-<h2>That's it!</h2>
-
-<p>That, in a nutshell, is all there is to know about controllers.</p>
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="urls.html">CodeIgniter URLs</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="reserved_names.html">Reserved Names</a></p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html
deleted file mode 100644
index be711903c..000000000
--- a/user_guide/general/core_classes.html
+++ /dev/null
@@ -1,186 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Creating Core System Classes : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Creating Core System Classes
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Creating Core System Classes</h1>
-
-<p>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.</p>
-
-<p><strong>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.</strong>
-</p>
-
-<p class="important"><strong>Note:</strong>&nbsp; Messing with a core system class has a lot of implications, so make sure you
-know what you are doing before attempting it.</p>
-
-
-<h2>System Class List</h2>
-
-<p>The following is a list of the core system files that are invoked every time CodeIgniter runs:</p>
-
-<ul>
-<li>Benchmark</li>
-<li>Config</li>
-<li>Controller</li>
-<li>Exceptions</li>
-<li>Hooks</li>
-<li>Input</li>
-<li>Language</li>
-<li>Loader</li>
-<li>Log</li>
-<li>Output</li>
-<li>Router</li>
-<li>URI</li>
-<li>Utf8</li>
-</ul>
-
-<h2>Replacing Core Classes</h2>
-
-<p>To use one of your own system classes instead of a default one simply place your version inside your local <dfn>application/core</dfn> directory:</p>
-
-<code>application/core/<dfn>some-class.php</dfn></code>
-
-<p>If this directory does not exist you can create it.</p>
-
-<p>Any file named identically to one from the list above will be used instead of the one normally used.</p>
-
-<p>Please note that your class must use <kbd>CI</kbd> as a prefix. For example, if your file is named <kbd>Input.php</kbd> the class will be named:</p>
-
-<code>
-class CI_Input {<br /><br />
-
-}
-</code>
-
-
-
-<h2>Extending Core Class</h2>
-
-<p>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:</p>
-
-<ul>
-<li>The class declaration must extend the parent class.</li>
-<li>Your new class name and filename must be prefixed with <kbd>MY_</kbd> (this item is configurable. See below.).</li>
-</ul>
-
-<p>For example, to extend the native <kbd>Input</kbd> class you'll create a file named <dfn>application/core/</dfn><kbd>MY_Input.php</kbd>, and declare your class with:</p>
-
-<code>
-class MY_Input extends CI_Input {<br /><br />
-
-}</code>
-
-<p>Note: If you need to use a constructor in your class make sure you extend the parent constructor:</p>
-
-<code>
-class MY_Input extends CI_Input {<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;function __construct()<br />
-&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::__construct();<br />
-&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-}</code>
-
-<p class="important"><strong>Tip:</strong>&nbsp; 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.</p>
-
-<p>If you are extending the Controller core class, then be sure to extend your new class in your application controller's constructors.</p>
-
-<code>class Welcome extends MY_Controller {<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;function __construct()<br />
-&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::__construct();<br />
-&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;function index()<br />
-&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this->load->view('welcome_message');<br />
-&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-}</code>
-
-<h3>Setting Your Own Prefix</h3>
-
-<p>To set your own sub-class prefix, open your <dfn>application/config/config.php</dfn> file and look for this item:</p>
-
-<code>$config['subclass_prefix'] = 'MY_';</code>
-
-<p>Please note that all native CodeIgniter libraries are prefixed with <kbd>CI_</kbd> so DO NOT use that as your prefix.</p>
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="creating_libraries.html">Creating Your Own Libraries</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="hooks.html">Hooks - Extending the Core</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/creating_drivers.html b/user_guide/general/creating_drivers.html
deleted file mode 100644
index 77cccd03c..000000000
--- a/user_guide/general/creating_drivers.html
+++ /dev/null
@@ -1,100 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Creating Drivers : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Creating Drivers
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Creating Drivers</h1>
-
-<h2>Driver Directory and File Structure</h2>
-
-<p>Sample driver directory and file structure layout:</p>
-
-<ul>
- <li>/application/libraries/Driver_name
- <ul>
- <li>Driver_name.php</li>
- <li>drivers
- <ul>
- <li>Driver_name_subclass_1.php</li>
- <li>Driver_name_subclass_2.php</li>
- <li>Driver_name_subclass_3.php</li>
- </ul>
- </li>
- </ul>
- </li>
-</ul>
-
-<p class="important"><strong>NOTE:</strong> In order to maintain compatibility on case-sensitive file systems, the <samp>Driver_name</samp> directory must be <var>ucfirst()</var></p>
-
-<!-- @todo write this! -->
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="drivers.html">Using CodeIgniter Drivers</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="core_classes.html">Creating Core System Classes</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html
deleted file mode 100644
index f905bb7c3..000000000
--- a/user_guide/general/creating_libraries.html
+++ /dev/null
@@ -1,293 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Creating Libraries : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Creating Libraries
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Creating Libraries</h1>
-
-<p>When we use the term "Libraries" we are normally referring to the classes that are located in the <kbd>libraries</kbd>
-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 <dfn>application/libraries</dfn> directory in order to maintain separation between your local resources
-and the global framework resources.</p>
-
-<p>As an added bonus, CodeIgniter permits your libraries to <kbd>extend</kbd> 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 <dfn>application/libraries</dfn> folder.</p>
-
-<p>In summary:</p>
-
-<ul>
-<li>You can create entirely new libraries.</li>
-<li>You can extend native libraries.</li>
-<li>You can replace native libraries.</li>
-</ul>
-
-<p>The page below explains these three concepts in detail.</p>
-
-<p class="important"><strong>Note:</strong> The Database classes can not be extended or replaced with your own classes. All other classes are able to be replaced/extended.</p>
-
-
-<h2>Storage</h2>
-
-<p>Your library classes should be placed within your <dfn>application/libraries</dfn> folder, as this is where CodeIgniter will look for them when
-they are initialized.</p>
-
-
-<h2>Naming Conventions</h2>
-
-<ul>
-<li>File names must be capitalized. For example:&nbsp; <dfn>Myclass.php</dfn></li>
-<li>Class declarations must be capitalized. For example:&nbsp; <kbd>class Myclass</kbd></li>
-<li>Class names and file names must match.</li>
-</ul>
-
-
-<h2>The Class File</h2>
-
-<p>Classes should have this basic prototype (Note: We are using the name <kbd>Someclass</kbd> purely as an example):</p>
-
-<code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
-<br /><br />
-class Someclass {<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;public function some_function()<br />
-&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-}<br /><br />
-/* End of file Someclass.php */</code>
-
-
-<h2>Using Your Class</h2>
-
-<p>From within any of your <a href="controllers.html">Controller</a> functions you can initialize your class using the standard:</p>
-
-<code>$this->load->library('<kbd>someclass</kbd>');</code>
-
-<p>Where <em>someclass</em> is the file name, without the ".php" file extension. You can submit the file name capitalized or lower case.
-CodeIgniter doesn't care.</p>
-
-<p>Once loaded you can access your class using the <kbd>lower case</kbd> version:</p>
-
-<code>$this-><kbd>someclass</kbd>->some_function();&nbsp; // Object instances will always be lower case
-</code>
-
-
-
-<h2>Passing Parameters When Initializing Your Class</h2>
-
-<p>In the library loading function you can dynamically pass data as an array via the second parameter and it will be passed to your class
-constructor:</p>
-
-<code>
-$params = array('type' => 'large', 'color' => 'red');<br />
-<br />
-$this->load->library('Someclass', <kbd>$params</kbd>);</code>
-
-<p>If you use this feature you must set up your class constructor to expect data:</p>
-
-<code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');<br />
-<br />
-class Someclass {<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;public function __construct($params)<br />
-&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Do something with $params<br />
-&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-}<br /><br />
-?&gt;</code>
-
-<p class="important">You can also pass parameters stored in a config file. Simply create a config file named identically to the class <kbd>file name</kbd>
-and store it in your <dfn>application/config/</dfn> folder. Note that if you dynamically pass parameters as described above,
-the config file option will not be available.</p>
-
-
-
-
-
-
-
-<h2>Utilizing CodeIgniter Resources within Your Library</h2>
-
-
-<p>To access CodeIgniter's native resources within your library use the <kbd>get_instance()</kbd> function.
-This function returns the CodeIgniter super object.</p>
-
-<p>Normally from within your controller functions you will call any of the available CodeIgniter functions using the <kbd>$this</kbd> construct:</p>
-
-<code>
-<strong>$this</strong>->load->helper('url');<br />
-<strong>$this</strong>->load->library('session');<br />
-<strong>$this</strong>->config->item('base_url');<br />
-etc.
-</code>
-
-<p><kbd>$this</kbd>, 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:</p>
-
-
-<p>First, assign the CodeIgniter object to a variable:</p>
-
-<code>$CI =&amp; get_instance();</code>
-
-<p>Once you've assigned the object to a variable, you'll use that variable <em>instead</em> of <kbd>$this</kbd>:</p>
-
-<code>
-$CI =&amp; get_instance();<br />
-<br />
-$CI->load->helper('url');<br />
-$CI->load->library('session');<br />
-$CI->config->item('base_url');<br />
-etc.
-</code>
-
-<p class="important"><strong>Note:</strong> You'll notice that the above get_instance() function is being passed by reference:
-<br /><br />
-<var>$CI =&amp; get_instance();</var>
-<br />
-<br />
-<kbd>This is very important.</kbd> Assigning by reference allows you to use the original CodeIgniter object rather than creating a copy of it.</p>
-
-
-<h2>Replacing Native Libraries with Your Versions</h2>
-
-<p>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 <kbd>Email</kbd> library
-you'll create a file named <dfn>application/libraries/Email.php</dfn>, and declare your class with:</p>
-
-<code>
-class CI_Email {<br /><br />
-
-}</code>
-
-<p>Note that most native classes are prefixed with <kbd>CI_</kbd>.</p>
-
-<p>To load your library you'll see the standard loading function:</p>
-
-<code>$this->load->library('<kbd>email</kbd>');</code>
-
-<p class="important"><strong>Note:</strong> At this time the Database classes can not be replaced with your own versions.</p>
-
-
-<h2>Extending Native Libraries</h2>
-
-<p>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:</p>
-
-<ul>
-<li>The class declaration must extend the parent class.</li>
-<li>Your new class name and filename must be prefixed with <kbd>MY_</kbd> (this item is configurable. See below.).</li>
-</ul>
-
-<p>For example, to extend the native <kbd>Email</kbd> class you'll create a file named <dfn>application/libraries/</dfn><kbd>MY_Email.php</kbd>, and declare your class with:</p>
-
-<code>
-class MY_Email extends CI_Email {<br /><br />
-
-}</code>
-
-<p>Note: If you need to use a constructor in your class make sure you extend the parent constructor:</p>
-
-
-<code>
-class MY_Email extends CI_Email {<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;public function __construct()<br />
-&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::__construct();<br />
-&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-}</code>
-
-
-<h3>Loading Your Sub-class</h3>
-
-<p>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:</p>
-
-<code>$this->load->library('<kbd>email</kbd>');</code>
-
-<p>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:</p>
-
-
-<code>$this-><kbd>email</kbd>->some_function();</code>
-
-
-<h3>Setting Your Own Prefix</h3>
-
-<p>To set your own sub-class prefix, open your <dfn>application/config/config.php</dfn> file and look for this item:</p>
-
-<code>$config['subclass_prefix'] = 'MY_';</code>
-
-<p>Please note that all native CodeIgniter libraries are prefixed with <kbd>CI_</kbd> so DO NOT use that as your prefix.</p>
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="libraries.html">Using CodeIgniter Libraries</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="drivers.html">Using CodeIgniter Drivers</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html
deleted file mode 100644
index 00c577871..000000000
--- a/user_guide/general/credits.html
+++ /dev/null
@@ -1,87 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Credits : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Credits
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Credits</h1>
-
-<p>CodeIgniter was originally developed by <a href="http://www.ellislab.com/">Rick Ellis</a> (CEO of
-<a href="http://ellislab.com/">EllisLab, Inc.</a>). 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
-<a href="http://www.expressionengine.com/">ExpressionEngine</a>.</p>
-
-<p>It is currently developed and maintained by the ExpressionEngine Development Team.<br />
-Bleeding edge development is spearheaded by the handpicked contributors of the Reactor Team.</p>
-
-<p>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.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="../changelog.html">Change Log</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="../installation/downloads.html">Downloading CodeIgniter</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/drivers.html b/user_guide/general/drivers.html
deleted file mode 100644
index f463adb10..000000000
--- a/user_guide/general/drivers.html
+++ /dev/null
@@ -1,104 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Using CodeIgniter Drivers : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Using CodeIgniter Drivers
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Using CodeIgniter Drivers</h1>
-
-
-<p>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 <a href="controllers.html">controllers</a> for libraries that benefit from or require being broken down into discrete classes.</p>
-
-<p>Drivers are found in the <dfn>system/libraries</dfn> folder, in their own folder which is identically named to the parent library class. Also inside that folder is a subfolder named <kbd>drivers</kbd>, which contains all of the possible child class files.</p>
-
-<p>To use a driver you will initialize it within a controller using the following initialization function:</p>
-
-<code>$this->load->driver('<var>class name</var>'); </code>
-
-<p>Where <var>class name</var> is the name of the driver class you want to invoke. For example, to load a driver named "Some Parent" you would do this:</p>
-
-<code>$this->load->driver('<var>some_parent</var>');</code>
-
-<p>Methods of that class can then be invoked with:</p>
-
-<code>$this->some_parent->some_method();</code>
-
-<p>The child classes, the drivers themselves, can then be called directly through the parent class, without initializing them:</p>
-
-<code>$this->some_parent->child_one->some_method();<br />
-$this->some_parent->child_two->another_method();</code>
-
-<h2>Creating Your Own Drivers</h2>
-
-<p>Please read the section of the user guide that discusses how to <a href="creating_drivers.html">create your own drivers</a>.</p>
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="creating_libraries.html">Creating Libraries</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="creating_drivers.html">Creating Drivers</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/environments.html b/user_guide/general/environments.html
deleted file mode 100644
index 0245b085d..000000000
--- a/user_guide/general/environments.html
+++ /dev/null
@@ -1,126 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Handling Multiple Environments : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Handling Multiple Environments
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Handling Multiple Environments</h1>
-
-<p>
- Developers often desire different system behavior depending on whether
- an application is running in a development or production
- environment. For example, verbose error output is something that would
- be useful while developing an application, but it may also pose a security issue when "live".
-</p>
-
-<h2>The ENVIRONMENT Constant</h2>
-
-<p>
- By default, CodeIgniter comes with the environment constant set to
- '<kbd>development</kbd>'. At the top of index.php, you will see:
-</p>
-
-<code>
-define('<var>ENVIRONMENT</var>', '<var>development</var>');
-</code>
-
-<p>
- In addition to affecting some basic framework behavior (see the next section),
- you may use this constant in your own development to differentiate
- between which environment you are running in.
-</p>
-
-<h2>Effects On Default Framework Behavior</h2>
-
-<p>
- There are some places in the CodeIgniter system where the <kbd>ENVIRONMENT</kbd>
- constant is used. This section describes how default framework behavior is
- affected.
-</p>
-
-<h3>Error Reporting</h3>
-
-<p>
- Setting the <kbd>ENVIRONMENT</kbd> constant to a value of '<kbd>development</kbd>' will
- cause all PHP errors to be rendered to the browser when they occur. Conversely,
- setting the constant to '<kbd>production</kbd>' will disable all error output. Disabling
- error reporting in production is a <a href="security.html">good security practice</a>.
-</p>
-
-<h3>Configuration Files</h3>
-
-<p>
- Optionally, you can have CodeIgniter load environment-specific
- configuration files. This may be useful for managing things like differing API keys
- across multiple environments. This is described in more detail in the
- environment section of the <a href="../libraries/config.html#environments">Config Class</a> documentation.
-</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="managing_apps.html">Managing Applications</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="alternative_php.html">Alternative PHP Syntax</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html
deleted file mode 100644
index d6bed9ea1..000000000
--- a/user_guide/general/errors.html
+++ /dev/null
@@ -1,140 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Error Handling : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Error Handling
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Error Handling</h1>
-
-<p>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.</p>
-
-<p class="important"><strong>Note:</strong> By default, CodeIgniter displays all PHP errors. You might
-wish to change this behavior once your development is complete. You'll find the <dfn>error_reporting()</dfn>
-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.</p>
-
-<p>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.</p>
-
-<p>The following functions let you generate errors:</p>
-
-<h2>show_error('<var>message</var>' [, int <var>$status_code</var>= 500 ] )</h2>
-<p>This function will display the error message supplied to it using the following error template:</p>
-<p><dfn>application/errors/</dfn><kbd>error_general.php</kbd></p>
-<p>The optional parameter $status_code determines what HTTP status code should be sent with the error.</p>
-
-<h2>show_404('<var>page</var>' [, '<var>log_error</var>'])</h2>
-<p>This function will display the 404 error message supplied to it using the following error template:</p>
-<p><dfn>application/errors/</dfn><kbd>error_404.php</kbd></p>
-
-<p>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.</p>
-
-<p>CodeIgniter automatically logs any show_404() calls. Setting the optional second parameter to FALSE will skip logging.</p>
-
-
-<h2>log_message('<var>level</var>', '<samp>message</samp>')</h2>
-
-<p>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:</p>
-
-<code>
-if ($some_var == "")<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;log_message('error', 'Some variable did not contain a value.');<br />
-}<br />
-else<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;log_message('debug', 'Some variable was correctly set');<br />
-}<br />
-<br />
-log_message('info', 'The purpose of some variable is to provide some value.');<br />
-</code>
-
-<p>There are three message types:</p>
-
-<ol>
-<li>Error Messages. These are actual errors, such as PHP errors or user errors.</li>
-<li>Debug Messages. These are messages that assist in debugging. For example, if a class has been initialized, you could log this as debugging info.</li>
-<li>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.</li>
-</ol>
-
-
-<p class="important"><strong>Note:</strong> 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 in <dfn>application/config/config.php</dfn>.
-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.</p>
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="routing.html">URI Routing</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="caching.html">Page Caching</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html
deleted file mode 100644
index 619e9ff78..000000000
--- a/user_guide/general/helpers.html
+++ /dev/null
@@ -1,185 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Helper Functions : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Helper Functions
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Helper Functions</h1>
-
-<p>Helpers, as the name suggests, help you with tasks. Each helper file is simply a collection of functions in a particular
-category. There are <dfn>URL Helpers</dfn>, that assist in creating links, there are <dfn>Form Helpers</dfn>
-that help you create form elements, <dfn>Text Helpers</dfn> perform various text formatting routines,
-<dfn>Cookie Helpers</dfn> set and read cookies, <dfn>File Helpers</dfn> help you deal with files, etc.
-</p>
-
-<p>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.</p>
-
-<p>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 <a href="../general/controllers.html">controller</a> and <a href="../general/views.html">views</a>.</p>
-
-<p>Helpers are typically stored in your <dfn>system/helpers</dfn>, or <dfn>application/helpers </dfn>directory. CodeIgniter will look first in your <dfn>application/helpers</dfn>
-directory. If the directory does not exist or the specified helper is not located there CI will instead look in your global
-<dfn>system/helpers</dfn> folder.</p>
-
-
-<h2>Loading a Helper</h2>
-
-<p>Loading a helper file is quite simple using the following function:</p>
-
-<code>$this->load->helper('<var>name</var>');</code>
-
-<p>Where <var>name</var> is the file name of the helper, without the .php file extension or the "helper" part.</p>
-
-<p>For example, to load the <dfn>URL Helper</dfn> file, which is named <var>url_helper.php</var>, you would do this:</p>
-
-<code>$this->load->helper('<var>url</var>');</code>
-
-<p>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.</p>
-
-<p class="important">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.</p>
-
-
-<h2>Loading Multiple Helpers</h2>
-
-<p>If you need to load more than one helper you can specify them in an array, like this:</p>
-
-<code>$this->load->helper( <samp>array(</samp>'<var>helper1</var>', '<var>helper2</var>', '<var>helper3</var>'<samp>)</samp> );</code>
-
-<h2>Auto-loading Helpers</h2>
-
-<p>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 <var>application/config/autoload.php</var> file and adding the helper to the autoload array.</p>
-
-
-<h2>Using a Helper</h2>
-
-<p>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.</p>
-
-<p>For example, to create a link using the <dfn>anchor()</dfn> function in one of your view files you would do this:</p>
-
-<code>&lt;?php echo anchor('blog/comments', 'Click Here');?&gt;</code>
-
-<p>Where "Click Here" is the name of the link, and "blog/comments" is the URI to the controller/function you wish to link to.</p>
-
-<h2>"Extending" Helpers</h2>
-
-<p>To "extend" Helpers, create a file in your <dfn>application/helpers/</dfn> folder with an identical name to the existing Helper, but prefixed with <kbd>MY_</kbd> (this item is configurable. See below.).</p>
-
-<p>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.</p>
-
-<p>For example, to extend the native <kbd>Array Helper</kbd> you'll create a file named <dfn>application/helpers/</dfn><kbd>MY_array_helper.php</kbd>, and add or override functions:</p>
-
-<code>
-// any_in_array() is not in the Array Helper, so it defines a new function<br />
-function any_in_array($needle, $haystack)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$needle = (is_array($needle)) ? $needle : array($needle);<br />
- <br />
-&nbsp;&nbsp;&nbsp;&nbsp;foreach ($needle as $item)<br />
-&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (in_array($item, $haystack))<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return TRUE;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
- <br />
-&nbsp;&nbsp;&nbsp;&nbsp;return FALSE;<br />
-}<br />
-<br />
-// random_element() is included in Array Helper, so it overrides the native function<br />
-function random_element($array)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;shuffle($array);<br />
-&nbsp;&nbsp;&nbsp;&nbsp;return array_pop($array);<br />
-}<br />
-</code>
-
-<h3>Setting Your Own Prefix</h3>
-
-<p>The filename prefix for "extending" Helpers is the same used to extend libraries and Core classes. To set your own prefix, open your <dfn>application/config/config.php</dfn> file and look for this item:</p>
-
-<code>$config['subclass_prefix'] = 'MY_';</code>
-
-<p>Please note that all native CodeIgniter libraries are prefixed with <kbd>CI_</kbd> so DO NOT use that as your prefix.</p>
-
-
-<h2>Now What?</h2>
-
-<p>In the Table of Contents you'll find a list of all the available Helper Files. Browse each one to see what they do.</p>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="models.html">Models</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="libraries.html">Using Libraries</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html
deleted file mode 100644
index 07d302a7d..000000000
--- a/user_guide/general/hooks.html
+++ /dev/null
@@ -1,165 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Hooks : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Hooks - Extending the Framework Core
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Hooks - Extending the Framework Core</h1>
-
-<p>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 <a href="../overview/appflow.html">Application Flow</a> 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.
-</p>
-
-<h2>Enabling Hooks</h2>
-
-<p>The hooks feature can be globally enabled/disabled by setting the following item in the <kbd>application/config/config.php</kbd> file:</p>
-
-<code>$config['enable_hooks'] = TRUE;</code>
-
-
-<h2>Defining a Hook</h2>
-
-<p>Hooks are defined in <dfn>application/config/hooks.php</dfn> file. Each hook is specified as an array with this prototype:</p>
-
-<code>
-$hook['pre_controller'] = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'class'&nbsp;&nbsp;&nbsp;&nbsp;=> 'MyClass',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'function' => 'Myfunction',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'filename' => 'Myclass.php',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'filepath' => 'hooks',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'params'&nbsp;&nbsp;&nbsp;=> array('beer', 'wine', 'snacks')<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);</code>
-
-<p><strong>Notes:</strong><br />The array index correlates to the name of the particular hook point you want to
-use. In the above example the hook point is <kbd>pre_controller</kbd>. A list of hook points is found below.
-The following items should be defined in your associative hook array:</p>
-
-<ul>
-<li><strong>class</strong>&nbsp; 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.</li>
-<li><strong>function</strong>&nbsp; The function name you wish to call.</li>
-<li><strong>filename</strong>&nbsp; The file name containing your class/function.</li>
-<li><strong>filepath</strong>&nbsp; The name of the directory containing your script. Note: Your script must be located in a directory INSIDE your <kbd>application</kbd> folder, so the file path is relative to that folder. For example, if your script is located in <dfn>application/hooks</dfn>, you will simply use <samp>hooks</samp> as your filepath. If your script is located in <dfn>application/hooks/utilities</dfn> you will use <samp>hooks/utilities</samp> as your filepath. No trailing slash.</li>
-<li><strong>params</strong>&nbsp; Any parameters you wish to pass to your script. This item is optional.</li>
-</ul>
-
-
-<h2>Multiple Calls to the Same Hook</h2>
-
-<p>If want to use the same hook point with more then one script, simply make your array declaration multi-dimensional, like this:</p>
-
-<code>
-$hook['pre_controller']<kbd>[]</kbd> = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'class'&nbsp;&nbsp;&nbsp;&nbsp;=> 'MyClass',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'function' => 'Myfunction',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'filename' => 'Myclass.php',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'filepath' => 'hooks',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'params'&nbsp;&nbsp;&nbsp;=> array('beer', 'wine', 'snacks')<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-$hook['pre_controller']<kbd>[]</kbd> = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'class'&nbsp;&nbsp;&nbsp;&nbsp;=> 'MyOtherClass',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'function' => 'MyOtherfunction',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'filename' => 'Myotherclass.php',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'filepath' => 'hooks',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'params'&nbsp;&nbsp;&nbsp;=> array('red', 'yellow', 'blue')<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);</code>
-
-<p>Notice the brackets after each array index:</p>
-
-<code>$hook['pre_controller']<kbd>[]</kbd></code>
-
-<p>This permits you to have the same hook point with multiple scripts. The order you define your array will be the execution order.</p>
-
-
-<h2>Hook Points</h2>
-
-<p>The following is a list of available hook points.</p>
-
-<ul>
- <li><strong>pre_system</strong><br />
- 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.</li>
- <li><strong>pre_controller</strong><br />
- Called immediately prior to any of your controllers being called. All base classes, routing, and security checks have been done.</li>
- <li><strong>post_controller_constructor</strong><br />
- Called immediately after your controller is instantiated, but prior to any method calls happening.</li>
- <li><strong>post_controller</strong><br />
- Called immediately after your controller is fully executed.</li>
- <li><strong>display_override</strong><br />
- Overrides the <dfn>_display()</dfn> 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 <dfn>$this->CI =&amp; get_instance()</dfn> and then the finalized data will be available by calling <dfn>$this->CI->output->get_output()</dfn></li>
- <li><strong>cache_override</strong><br />
- Enables you to call your own function instead of the <dfn>_display_cache()</dfn> function in the output class. This permits you to use your own cache display mechanism.</li>
- <li><strong>post_system</strong><br />
- 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.</li>
- </ul>
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="core_classes.html">Creating Core Classes</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="autoloader.html">Auto-loading Resources</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html
deleted file mode 100644
index 73b642bef..000000000
--- a/user_guide/general/libraries.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Using CodeIgniter Libraries : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Using CodeIgniter Libraries
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Using CodeIgniter Libraries</h1>
-
-
-<p>All of the available libraries are located in your <dfn>system/libraries</dfn> folder.
-In most cases, to use one of these classes involves initializing it within a <a href="controllers.html">controller</a> using the following initialization function:</p>
-
-<code>$this->load->library('<var>class name</var>'); </code>
-
-<p>Where <var>class name</var> is the name of the class you want to invoke. For example, to load the form validation class you would do this:</p>
-
-<code>$this->load->library('<var>form_validation</var>'); </code>
-
-<p>Once initialized you can use it as indicated in the user guide page corresponding to that class.</p>
-
-<p>Additionally, multiple libraries can be loaded at the same time by passing an array of libraries to the load function.</p>
-
-<code>$this->load->library(array('<var>email</var>', '<var>table</var>'));</code>
-
-<h2>Creating Your Own Libraries</h2>
-
-<p>Please read the section of the user guide that discusses how to <a href="creating_libraries.html">create your own libraries</a></p>
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="helpers.html">Helpers</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="creating_libraries.html">Creating Libraries</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html
deleted file mode 100644
index 388519796..000000000
--- a/user_guide/general/managing_apps.html
+++ /dev/null
@@ -1,133 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Managing your Applications : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Managing your Applications
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Managing your Applications</h1>
-
-<p>By default it is assumed that you only intend to use CodeIgniter to manage one application, which you will build in your
-<dfn>application/</dfn> directory. It is possible, however, to have multiple sets of applications that share a single
-CodeIgniter installation, or even to rename or relocate your <dfn>application</dfn> folder.</p>
-
-<h2>Renaming the Application Folder</h2>
-
-<p>If you would like to rename your <dfn>application</dfn> folder you may do so as long as you open your main <kbd>index.php</kbd>
-file and set its name using the <samp>$application_folder</samp> variable:</p>
-
-<code>$application_folder = "application";</code>
-
-<h2>Relocating your Application Folder</h2>
-
-<p>It is possible to move your <dfn>application</dfn> folder to a different location on your server than your <kbd>system</kbd> folder.
-To do so open your main <kbd>index.php</kbd> and set a <em>full server path</em> in the <samp>$application_folder</samp> variable.</p>
-
-
-<code>$application_folder = "/Path/to/your/application";</code>
-
-
-<h2>Running Multiple Applications with one CodeIgniter Installation</h2>
-
-<p>If you would like to share a common CodeIgniter installation to manage several different applications simply
-put all of the directories located inside your <kbd>application</kbd> folder into their
-own sub-folder.</p>
-
-<p>For example, let's say you want to create two applications, "foo" and "bar". You could structure your
-application folders like this:</p>
-
-<code>applications/<var>foo</var>/<br />
-applications/<var>foo</var>/config/<br />
-applications/<var>foo</var>/controllers/<br />
-applications/<var>foo</var>/errors/<br />
-applications/<var>foo</var>/libraries/<br />
-applications/<var>foo</var>/models/<br />
-applications/<var>foo</var>/views/<br />
-applications/<samp>bar</samp>/<br />
-applications/<samp>bar</samp>/config/<br />
-applications/<samp>bar</samp>/controllers/<br />
-applications/<samp>bar</samp>/errors/<br />
-applications/<samp>bar</samp>/libraries/<br />
-applications/<samp>bar</samp>/models/<br />
-applications/<samp>bar</samp>/views/</code>
-
-
-<p>To select a particular application for use requires that you open your main <kbd>index.php</kbd> file and set the <dfn>$application_folder</dfn>
-variable. For example, to select the "foo" application for use you would do this:</p>
-
-<code>$application_folder = "applications/foo";</code>
-
-<p class="important"><strong>Note:</strong>&nbsp; Each of your applications will need its own <dfn>index.php</dfn> file which
-calls the desired application. The index.php file can be named anything you want.</p>
-
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="profiling.html">Profiling Your Application</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="alternative_php.html">Alternative PHP Syntax</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/models.html b/user_guide/general/models.html
deleted file mode 100644
index 7bda4d9a9..000000000
--- a/user_guide/general/models.html
+++ /dev/null
@@ -1,251 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Models : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Models
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Models</h1>
-
-<p>Models are <strong>optionally</strong> available for those who want to use a more traditional MVC approach.</p>
-
-
-
-<ul>
-<li><a href="#what">What is a Model?</a></li>
-<li><a href="#anatomy">Anatomy of a Model</a></li>
-<li><a href="#loading">Loading a Model</a></li>
-<li><a href="#auto_load_model">Auto-Loading a Model</a> </li>
-<li><a href="#conn">Connecting to your Database</a></li>
-</ul>
-
-
-
-<h2><a name="what"></a>What is a Model?</h2>
-
-<p>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:</p>
-
-<code>
-class&nbsp;Blogmodel&nbsp;extends&nbsp;CI_Model&nbsp;{<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;var $title&nbsp;&nbsp; = '';<br />
-&nbsp;&nbsp;&nbsp;&nbsp;var $content = '';<br />
-&nbsp;&nbsp;&nbsp;&nbsp;var $date&nbsp;&nbsp;&nbsp; = '';<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;__construct()<br />
-&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Call the Model constructor<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::__construct();<br />
-&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-&nbsp;&nbsp;&nbsp;&nbsp;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;get_last_ten_entries()<br />
-&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$query = $this->db->get('entries', 10);<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return $query->result();<br />
-&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;insert_entry()<br />
-&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this->title&nbsp;&nbsp; = $_POST['title']; // please read the below note<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this->content = $_POST['content'];<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this->date&nbsp;&nbsp;&nbsp; = time();<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this->db->insert('entries',&nbsp;$this);<br />
-&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;update_entry()<br />
-&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this->title&nbsp;&nbsp; = $_POST['title'];<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this->content = $_POST['content'];<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this->date&nbsp;&nbsp;&nbsp; = time();<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this->db->update('entries',&nbsp;$this, array('id' => $_POST['id']));<br />
-&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-<br />
-}</code>
-
-<p>Note: The functions in the above example use the <a href="../database/active_record.html">Active Record</a> database functions.</p>
-<p class="important"><strong>Note:</strong> 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 <a href="../libraries/input.html">Input Class</a> $this-&gt;input-&gt;post('title')</p>
-<h2><a name="anatomy"></a>Anatomy of a Model</h2>
-
-<p>Model classes are stored in your <dfn>application/models/</dfn> folder. They can be nested within sub-folders if you
-want this type of organization.</p>
-
-<p>The basic prototype for a model class is this:</p>
-
-
-<code>
-class&nbsp;<var>Model_name</var>&nbsp;extends&nbsp;CI_Model&nbsp;{<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;<var>__construct</var>()<br />
-&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::__construct();<br />
-&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-}</code>
-
-<p>Where <var>Model_name</var> is the name of your class. Class names <strong>must</strong> have the first letter capitalized with the rest of the name lowercase.
-Make sure your class extends the base Model class.</p>
-
-<p>The file name will be a lower case version of your class name. For example, if your class is this:</p>
-
-<code>
-class&nbsp;<var>User_model</var>&nbsp;extends&nbsp;CI_Model&nbsp;{<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;<var>__construct</var>()<br />
-&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::__construct();<br />
-&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-}</code>
-
-<p>Your file will be this:</p>
-
-<code>application/models/<var>user_model.php</var></code>
-
-
-
-<h2><a name="loading"></a>Loading a Model</h2>
-
-<p>Your models will typically be loaded and called from within your <a href="controllers.html">controller</a> functions.
-To load a model you will use the following function:</p>
-
-<code>$this->load->model('<var>Model_name</var>');</code>
-
-<p>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 <dfn>application/models/blog/queries.php</dfn> you'll load it using:</p>
-
-<code>$this->load->model('<var>blog/queries</var>');</code>
-
-
-<p>Once loaded, you will access your model functions using an object with the same name as your class:</p>
-
-<code>
-$this->load->model('<var>Model_name</var>');<br />
-<br />
-$this-><var>Model_name</var>->function();
-</code>
-
-<p>If you would like your model assigned to a different object name you can specify it via the second parameter of the loading
-function:</p>
-
-
-<code>
-$this->load->model('<var>Model_name</var>', '<kbd>fubar</kbd>');<br />
-<br />
-$this-><kbd>fubar</kbd>->function();
-</code>
-
-<p>Here is an example of a controller, that loads a model, then serves a view:</p>
-
-<code>
-class&nbsp;Blog_controller&nbsp;extends&nbsp;CI_Controller&nbsp;{<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;blog()<br />
-&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this->load->model('Blog');<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$data['query'] = $this->Blog->get_last_ten_entries();<br /><br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this->load->view('blog', $data);<br />
-&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-}</code>
-
-<h2><a name="auto_load_model" id="auto_load_model"></a>Auto-loading Models</h2>
-<p>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.</p>
-
-
-<h2><a name="conn"></a>Connecting to your Database</h2>
-
-<p>When a model is loaded it does <strong>NOT</strong> connect automatically to your database. The following options for connecting are available to you:</p>
-
-<ul>
-<li>You can connect using the standard database methods <a href="../database/connecting.html">described here</a>, either from within your Controller class or your Model class.</li>
-<li>You can tell the model loading function to auto-connect by passing <kbd>TRUE</kbd> (boolean) via the third parameter,
-and connectivity settings, as defined in your database config file will be used:
-
- <code>$this->load->model('<var>Model_name</var>', '', <kbd>TRUE</kbd>);</code>
- </li>
-
-
-<li>You can manually pass database connectivity settings via the third parameter:
-
-
- <code>$config['hostname'] = "localhost";<br />
- $config['username'] = "myusername";<br />
- $config['password'] = "mypassword";<br />
- $config['database'] = "mydatabase";<br />
- $config['dbdriver'] = "mysql";<br />
- $config['dbprefix'] = "";<br />
- $config['pconnect'] = FALSE;<br />
- $config['db_debug'] = TRUE;<br />
- <br />
- $this->load->model('<var>Model_name</var>', '', <kbd>$config</kbd>);</code></li>
-</ul>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="views.html">Views</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="helpers.html">Helpers</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html
deleted file mode 100644
index 451b6f9e6..000000000
--- a/user_guide/general/profiling.html
+++ /dev/null
@@ -1,181 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Profiling Your Application : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Profiling Your Application
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Profiling Your Application</h1>
-
-<p>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.</p>
-
-
-<h2>Initializing the Class</h2>
-
-<p class="important"><strong>Important:</strong>&nbsp; This class does <kbd>NOT</kbd> need to be initialized. It is loaded automatically by the
-<a href="../libraries/output.html">Output Class</a> if profiling is enabled as shown below.</p>
-
-<h2>Enabling the Profiler</h2>
-
- <p>To enable the profiler place the following function anywhere within your <a href="controllers.html">Controller</a> functions:</p>
- <code>$this->output->enable_profiler(TRUE);</code>
-
- <p>When enabled a report will be generated and inserted at the bottom of your pages.</p>
-
- <p>To disable the profiler you will use:</p>
- <code>$this->output->enable_profiler(FALSE);</code>
-
-
-<h2>Setting Benchmark Points</h2>
-
- <p>In order for the Profiler to compile and display your benchmark data you must name your mark points using specific syntax.</p>
-
- <p>Please read the information on setting Benchmark points in <a href="../libraries/benchmark.html">Benchmark Class</a> page.</p>
-
-
-<h2>Enabling and Disabling Profiler Sections</h2>
-
- <p>Each section of Profiler data can be enabled or disabled by setting a corresponding config variable to <var>TRUE</var> or <var>FALSE</var>. This can be done one of two ways. First, you can set application wide defaults with the <dfn>application/config/profiler.php</dfn> config file.</p>
-
- <code>$config['config']&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= FALSE;<br />
- $config['queries']&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= FALSE;<br /></code>
-
- <p>In your controllers, you can override the defaults and config file values by calling the <kbd>set_profiler_sections()</kbd> method of the <a href="../libraries/output.html">Output class</a>:</p>
-
- <code>$sections = array(<br />
- &nbsp;&nbsp;&nbsp;&nbsp;'config' &nbsp;=> TRUE,<br />
- &nbsp;&nbsp;&nbsp;&nbsp;'queries' => TRUE<br />
- &nbsp;&nbsp;&nbsp;&nbsp;);<br />
- <br />
- $this->output->set_profiler_sections($sections);</code>
-
- <p>Available sections and the array key used to access them are described in the table below.</p>
-
- <table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
- <tr>
- <th>Key</th>
- <th>Description</th>
- <th>Default</th>
- </tr>
- <tr>
- <td class="td"><strong>benchmarks</strong></td>
- <td class="td">Elapsed time of Benchmark points and total execution time</td>
- <td class="td">TRUE</td>
- </tr>
- <tr>
- <td class="td"><strong>config</strong></td>
- <td class="td">CodeIgniter Config variables</td>
- <td class="td">TRUE</td>
- </tr>
- <tr>
- <td class="td"><strong>controller_info</strong></td>
- <td class="td">The Controller class and method requested</td>
- <td class="td">TRUE</td>
- </tr>
- <tr>
- <td class="td"><strong>get</strong></td>
- <td class="td">Any GET data passed in the request</td>
- <td class="td">TRUE</td>
- </tr>
- <tr>
- <td class="td"><strong>http_headers</strong></td>
- <td class="td">The HTTP headers for the current request</td>
- <td class="td">TRUE</td>
- </tr>
- <tr>
- <td class="td"><strong>memory_usage</strong></td>
- <td class="td">Amount of memory consumed by the current request, in bytes</td>
- <td class="td">TRUE</td>
- </tr>
- <tr>
- <td class="td"><strong>post</strong></td>
- <td class="td">Any POST data passed in the request</td>
- <td class="td">TRUE</td>
- </tr>
- <tr>
- <td class="td"><strong>queries</strong></td>
- <td class="td">Listing of all database queries executed, including execution time</td>
- <td class="td">TRUE</td>
- </tr>
- <tr>
- <td class="td"><strong>uri_string</strong></td>
- <td class="td">The URI of the current request</td>
- <td class="td">TRUE</td>
- </tr>
- <tr>
- <td class="td"><strong>query_toggle_count</strong></td>
- <td class="td">The number of queries after which the query block will default to hidden.</td>
- <td class="td">25</td>
- </tr>
- </table>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="caching.html">Caching</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="managing_apps.html">Managing Applications</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html
deleted file mode 100644
index 6c07b335c..000000000
--- a/user_guide/general/quick_reference.html
+++ /dev/null
@@ -1,77 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Quick Reference Chart : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Quick Reference Chart
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Quick Reference Chart</h1>
-
-<p>For a PDF version of this chart, <a href="http://codeigniter.com/download_files/ci_quick_ref.pdf">click here</a>.</p>
-
-<p><img src="../images/ci_quick_ref.png" width="763" height="994" border="0" /></p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html
deleted file mode 100644
index 1393b40e0..000000000
--- a/user_guide/general/requirements.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Server Requirements : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Server Requirements
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Server Requirements</h1>
-
-<ul>
- <li><a href="http://www.php.net/">PHP</a> version 5.1.6 or newer.</li>
- <li>A Database is required for most web application programming. Current supported databases are MySQL (4.1+), MySQLi, MS SQL, Postgres, Oracle, SQLite, and ODBC.</li>
-</ul>
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-
-<div id="footer">
-<p>
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="../license.html">License Agreement</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/reserved_names.html b/user_guide/general/reserved_names.html
deleted file mode 100644
index 450c0f667..000000000
--- a/user_guide/general/reserved_names.html
+++ /dev/null
@@ -1,128 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Reserved Names : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Controllers
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Reserved Names</h1>
-
-<p>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.</p>
-<h3>Controller names</h3>
-<p>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 any of these:</p>
-<ul>
- <li>Controller</li>
- <li>CI_Base</li>
- <li>_ci_initialize</li>
- <li>Default</li>
- <li>index</li>
-</ul>
-<h3>Functions</h3>
-<ul>
- <li>is_really_writable()</li>
- <li>load_class()</li>
- <li>get_config()</li>
- <li>config_item()</li>
- <li>show_error()</li>
- <li>show_404()</li>
- <li>log_message()</li>
- <li>_exception_handler()</li>
- <li>get_instance()</li>
- </ul>
-<h3>Variables</h3>
-<ul>
- <li>$config</li>
- <li>$mimes</li>
- <li>$lang</li>
-</ul>
-<h3>Constants</h3>
-<ul>
- <li>ENVIRONMENT</li>
- <li>EXT</li>
- <li>FCPATH</li>
- <li>SELF</li>
- <li>BASEPATH</li>
- <li>APPPATH</li>
- <li>CI_VERSION</li>
- <li>FILE_READ_MODE</li>
- <li>FILE_WRITE_MODE</li>
- <li>DIR_READ_MODE</li>
- <li>DIR_WRITE_MODE</li>
- <li>FOPEN_READ</li>
- <li>FOPEN_READ_WRITE</li>
- <li>FOPEN_WRITE_CREATE_DESTRUCTIVE</li>
- <li>FOPEN_READ_WRITE_CREATE_DESTRUCTIVE</li>
- <li>FOPEN_WRITE_CREATE</li>
- <li>FOPEN_READ_WRITE_CREATE</li>
- <li>FOPEN_WRITE_CREATE_STRICT</li>
- <li>FOPEN_READ_WRITE_CREATE_STRICT</li>
-</ul>
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="controllers.html">Controllers</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="views.html">Views</a></p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html
deleted file mode 100644
index d5c90a1b8..000000000
--- a/user_guide/general/routing.html
+++ /dev/null
@@ -1,171 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>URI Routing : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-URI Routing
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>URI Routing</h1>
-
-<p>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:</p>
-
-<code>example.com/<dfn>class</dfn>/<samp>function</samp>/<var>id</var>/</code>
-
-<p>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.</p>
-
-<p>For example, lets say you want your URLs to have this prototype:</p>
-
-<p>
-example.com/product/1/<br />
-example.com/product/2/<br />
-example.com/product/3/<br />
-example.com/product/4/
-</p>
-
-<p>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.</p>
-
-
-<h2>Setting your own routing rules</h2>
-
-<p>Routing rules are defined in your <var>application/config/routes.php</var> file. In it you'll see an array called <dfn>$route</dfn> that
-permits you to specify your own routing criteria. Routes can either be specified using <dfn>wildcards</dfn> or <dfn>Regular Expressions</dfn></p>
-
-
-<h2>Wildcards</h2>
-
-<p>A typical wildcard route might look something like this:</p>
-
-<code>$route['product/:num'] = "catalog/product_lookup";</code>
-
-<p>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.</p>
-
-<p>You can match literal values or you can use two wildcard types:</p>
-
-<p><strong>(:num)</strong> will match a segment containing only numbers.<br />
-<strong>(:any)</strong> will match a segment containing any character.
-</p>
-
-<p class="important"><strong>Note:</strong> Routes will run in the order they are defined.
-Higher routes will always take precedence over lower ones.</p>
-
-<h2>Examples</h2>
-
-<p>Here are a few routing examples:</p>
-
-<code>$route['journals'] = "blogs";</code>
-<p>A URL containing the word "journals" in the first segment will be remapped to the "blogs" class.</p>
-
-<code>$route['blog/joe'] = "blogs/users/34";</code>
-<p>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".</p>
-
-<code>$route['product/(:any)'] = "catalog/product_lookup";</code>
-<p>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.</p>
-
-<code>$route['product/(:num)'] = "catalog/product_lookup_by_id/$1";</code>
-<p>A URL with "product" as the first segment, and a number 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.</p>
-
-<p class="important"><strong>Important:</strong> Do not use leading/trailing slashes.</p>
-
-<h2>Regular Expressions</h2>
-
-<p>If you prefer you can use regular expressions to define your routing rules. Any valid regular expression is allowed, as are back-references.</p>
-
-<p class="important"><strong>Note:</strong>&nbsp; If you use back-references you must use the dollar syntax rather than the double backslash syntax.</p>
-
-<p>A typical RegEx route might look something like this:</p>
-
-<code>$route['products/([a-z]+)/(\d+)'] = "$1/id_$2";</code>
-
-<p>In the above example, a URI similar to <dfn>products/shirts/123</dfn> would instead call the <dfn>shirts</dfn> controller class and the <dfn>id_123</dfn> function.</p>
-
-<p>You can also mix and match wildcards with regular expressions.</p>
-
-<h2>Reserved Routes</h2>
-
-<p>There are two reserved routes:</p>
-
-<code>$route['default_controller'] = 'welcome';</code>
-
-<p>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.</p>
-
-<code>$route['404_override'] = '';</code>
-
-<p>This route indicates which controller class should be loaded if the requested controller is not found. It will override the default 404
-error page. It won't affect to the <samp>show_404()</samp> function, which will continue loading the default <dfn>error_404.php</dfn> file at <var>application/errors/error_404.php</var>.</p>
-
-<p class="important"><strong>Important:</strong>&nbsp; The reserved routes must come before any wildcard or regular expression routes.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="common_functions.html">Common Functions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="errors.html">Error Handling</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/security.html b/user_guide/general/security.html
deleted file mode 100644
index 9e78d4c68..000000000
--- a/user_guide/general/security.html
+++ /dev/null
@@ -1,164 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Security : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Security
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Security</h1>
-
-<p>This page describes some "best practices" regarding web security, and details
-CodeIgniter's internal security features.</p>
-
-
-<h2>URI Security</h2>
-
-<p>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:
-</p>
-
-<ul>
-<li>Alpha-numeric text</li>
-<li>Tilde: ~ </li>
-<li>Period: .</li>
-<li>Colon: :</li>
-<li>Underscore: _</li>
-<li>Dash: -</li>
-</ul>
-
-<h2>Register_globals</h2>
-
-<p>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.</p>
-
-<a name="error_reporting"></a>
-<h2>error_reporting</h2>
-
-<p>
- In production environments, it is typically desirable to disable PHP's
- error reporting by setting the internal error_reporting flag to a value of 0. This disables native PHP
- errors from being rendered as output, which may potentially contain
- sensitive information.
-</p>
-
-<p>
- Setting CodeIgniter's <kbd>ENVIRONMENT</kbd> constant in index.php to a
- value of '<kbd>production</kbd>' will turn off these errors. In development
- mode, it is recommended that a value of '<kbd>development</kbd>' is used.
- More information about differentiating between environments can be found
- on the <a href="environments.html">Handling Environments</a> page.
-</p>
-
-<h2>magic_quotes_runtime</h2>
-
-<p>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.</p>
-
-<h1>Best Practices</h1>
-
-<p>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:</p>
-
-<ol>
-<li>Filter the data as if it were tainted.</li>
-<li>Validate the data to ensure it conforms to the correct type, length, size, etc. (sometimes this step can replace step one)</li>
-<li>Escape the data before submitting it into your database.</li>
-</ol>
-
-<p>CodeIgniter provides the following functions to assist in this process:</p>
-
-<ul>
-
-<li><h2>XSS Filtering</h2>
-
-<p>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 <a href="../libraries/security.html">here</a>.
-</p>
-</li>
-
-<li><h2>Validate the data</h2>
-
-<p>CodeIgniter has a <a href="../libraries/form_validation.html">Form Validation Class</a> that assists you in validating, filtering, and prepping
-your data.</p>
-</li>
-
-<li><h2>Escape all data before database insertion</h2>
-
-<p>Never insert information into your database without escaping it. Please see the section that discusses
-<a href="../database/queries.html">queries</a> for more information.</p>
-
-</li>
-
-</ul>
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="alternative_php.html">Alternative PHP</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="styleguide.html">PHP Style Guide</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/styleguide.html b/user_guide/general/styleguide.html
deleted file mode 100644
index c94313365..000000000
--- a/user_guide/general/styleguide.html
+++ /dev/null
@@ -1,679 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Style Guide : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<style type="text/css" media="screen">
- code {
- white-space: pre;
- }
-</style>
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Style Guide
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>General Style and Syntax</h1>
-
-<p>The following page describes the use of coding rules adhered to when developing CodeIgniter.</p>
-
-
-<h2>Table of Contents</h2>
-<ul class="minitoc">
- <li><a href="#file_format">File Format</a></li>
- <li><a href="#php_closing_tag">PHP Closing Tag</a></li>
- <li><a href="#class_and_method_naming">Class and Method Naming</a></li>
- <li><a href="#variable_names">Variable Names</a></li>
- <li><a href="#commenting">Commenting</a></li>
- <li><a href="#constants">Constants</a></li>
- <li><a href="#true_false_and_null">TRUE, FALSE, and NULL</a></li>
- <li><a href="#logical_operators">Logical Operators</a></li>
- <li><a href="#comparing_return_values_and_typecasting">Comparing Return Values and Typecasting</a></li>
- <li><a href="#debugging_code">Debugging Code</a></li>
- <li><a href="#whitespace_in_files">Whitespace in Files</a></li>
- <li><a href="#compatibility">Compatibility</a></li>
- <li><a href="#class_and_file_names_using_common_words">Class and File Names using Common Words</a></li>
- <li><a href="#database_table_names">Database Table Names</a></li>
- <li><a href="#one_file_per_class">One File per Class</a></li>
- <li><a href="#whitespace">Whitespace</a></li>
- <li><a href="#line_breaks">Line Breaks</a></li>
- <li><a href="#code_indenting">Code Indenting</a></li>
- <li><a href="#bracket_spacing">Bracket and Parenthetic Spacing</li>
- <li><a href="#localized_text">Localized Text</a></li>
- <li><a href="#private_methods_and_variables">Private Methods and Variables</a></li>
- <li><a href="#php_errors">PHP Errors</a></li>
- <li><a href="#short_open_tags">Short Open Tags</a></li>
- <li><a href="#one_statement_per_line">One Statement Per Line</a></li>
- <li><a href="#strings">Strings</a></li>
- <li><a href="#sql_queries">SQL Queries</a></li>
- <li><a href="#default_function_arguments">Default Function Arguments</a></li>
-</ul>
-
-<li>
-
- <h2><a name="file_format"></a>File Format</h2>
- <div class="guidelineDetails">
- <p>Files should be saved with Unicode (UTF-8) encoding. The <abbr title="Byte Order Mark">BOM</abbr>
- should <em>not</em> be used. Unlike UTF-16 and UTF-32, there's no byte order to indicate in
- a UTF-8 encoded file, and the <abbr title="Byte Order Mark">BOM</abbr> 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).</p>
-
- <p>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.</p>
-
- <h5>TextMate</h5>
-
- <ol>
- <li>Open the Application Preferences</li>
- <li>Click Advanced, and then the "Saving" tab</li>
- <li>In "File Encoding", select "UTF-8 (recommended)"</li>
- <li>In "Line Endings", select "LF (recommended)"</li>
- <li><em>Optional:</em> Check "Use for existing files as well" if you wish to modify the line
- endings of files you open to your new preference.</li>
- </ol>
-
- <h5>BBEdit</h5>
-
- <ol>
- <li>Open the Application Preferences</li>
- <li>Select "Text Encodings" on the left.</li>
- <li>In "Default text encoding for new documents", select "Unicode (UTF-8, no BOM)"</li>
- <li><em>Optional:</em> In "If file's encoding can't be guessed, use", select
- "Unicode (UTF-8, no BOM)"</li>
- <li>Select "Text Files" on the left.</li>
- <li>In "Default line breaks", select "Mac OS X and Unix (LF)"</li>
- </ol>
- </div>
-
- <h2><a name="php_closing_tag"></a>PHP Closing Tag</h2>
- <div class="guidelineDetails">
- <p>The PHP closing tag on a PHP document <strong>?&gt;</strong> 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
- <strong>OMIT</strong> 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.</p>
-<code><strong>INCORRECT</strong>:
-&lt;?php
-
-echo "Here's my code!";
-
-?&gt;
-
-<strong>CORRECT</strong>:
-&lt;?php
-
-echo "Here's my code!";
-
-/* End of file myfile.php */
-/* Location: ./system/modules/mymodule/myfile.php */
-</code>
- </div>
-
-
- <h2><a name="class_and_method_naming"></a>Class and Method Naming</h2>
- <div class="guidelineDetails">
- <p>Class names should always start with an uppercase letter. 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.</p>
-
- <code><strong>INCORRECT</strong>:
-class superclass
-class SuperClass
-
-<strong>CORRECT</strong>:
-class Super_class</code>
-
-
- <code>class Super_class {
-
- function __construct()
- {
-
- }
-}</code>
-
- <p>Examples of improper and proper method naming:</p>
-
- <code><strong>INCORRECT</strong>:
-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
-
-<strong>CORRECT</strong>:
-function get_file_properties() // descriptive, underscore separator, and all lowercase letters</code>
-
- </div>
-
-
- <h2><a name="variable_names"></a>Variable Names</h2>
- <div class="guidelineDetails">
- <p>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.</p>
-<code><strong>INCORRECT</strong>:
-$j = &apos;foo&apos;; // 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
-
-<strong>CORRECT</strong>:
-for ($j = 0; $j &lt; 10; $j++)
-$str
-$buffer
-$group_id
-$last_city
-</code>
- </div>
-
-
- <h2><a name="commenting"></a>Commenting</h2>
- <div class="guidelineDetails">
- <p>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.</p>
-
- <p><a href="http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#basics.docblock">DocBlock</a> style comments preceding class and method declarations so they can be picked up by IDEs:</p>
-
-<code>/**
- * Super Class
- *
- * @package Package Name
- * @subpackage Subpackage
- * @category Category
- * @author Author Name
- * @link http://example.com
- */
-class Super_class {</code>
-
-<code>/**
- * Encodes string for use in XML
- *
- * @access public
- * @param string
- * @return string
- */
-function xml_encode($str)</code>
-
- <p>Use single line comments within code, leaving a blank line between large comment blocks and code.</p>
-
-<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);
-</code>
- </div>
-
-
- <h2><a name="constants"></a>Constants</h2>
- <div class="guidelineDetails">
- <p>Constants follow the same guidelines as do variables, except constants should always be fully uppercase. <em>Always use CodeIgniter constants when appropriate, i.e. SLASH, LD, RD, PATH_CACHE, etc.</em></p>
-<code><strong>INCORRECT</strong>:
-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
-
-<strong>CORRECT</strong>:
-MY_CONSTANT
-NEWLINE
-SUPER_CLASS_VERSION
-$str = str_replace(LD.'foo'.RD, 'bar', $str);
-</code>
- </div>
-
-
- <h2><a name="true_false_and_null"></a>TRUE, FALSE, and NULL</h2>
- <div class="guidelineDetails">
- <p><strong>TRUE</strong>, <strong>FALSE</strong>, and <strong>NULL</strong> keywords should always be fully uppercase.</p>
-<code><strong>INCORRECT</strong>:
-if ($foo == true)
-$bar = false;
-function foo($bar = null)
-
-<strong>CORRECT</strong>:
-if ($foo == TRUE)
-$bar = FALSE;
-function foo($bar = NULL)</code>
- </div>
-
-
-
- <h2><a name="logical_operators"></a>Logical Operators</h2>
- <div class="guidelineDetails">
- <p>Use of <strong>||</strong> is discouraged as its clarity on some output devices is low (looking like the number 11 for instance).
- <strong>&amp;&amp;</strong> is preferred over <strong>AND</strong> but either are acceptable, and a space should always precede and follow <strong>!</strong>.</p>
-<code><strong>INCORRECT</strong>:
-if ($foo || $bar)
-if ($foo AND $bar) // okay but not recommended for common syntax highlighting applications
-if (!$foo)
-if (! is_array($foo))
-
-<strong>CORRECT</strong>:
-if ($foo OR $bar)
-if ($foo && $bar) // recommended
-if ( ! $foo)
-if ( ! is_array($foo))
-</code>
- </div>
-
-
-
- <h2><a name="comparing_return_values_and_typecasting"></a>Comparing Return Values and Typecasting</h2>
- <div class="guidelineDetails">
- <p>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.</p>
- <p>Use the same stringency in returning and checking your own variables. Use <strong>===</strong> and <strong>!==</strong> as necessary.
-
-<code><strong>INCORRECT</strong>:
-// 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)
-
-<strong>CORRECT</strong>:
-if (strpos($str, 'foo') === FALSE)
-</code>
-
-<code><strong>INCORRECT</strong>:
-function build_string($str = "")
-{
- if ($str == "") // uh-oh! What if FALSE or the integer 0 is passed as an argument?
- {
-
- }
-}
-
-<strong>CORRECT</strong>:
-function build_string($str = "")
-{
- if ($str === "")
- {
-
- }
-}</code>
-
- <p>See also information regarding <a href="http://us3.php.net/manual/en/language.types.type-juggling.php#language.types.typecasting">typecasting</a>, 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":</p>
-
-<code>$str = (string) $str; // cast $str as a string</code>
-
- </div>
-
-
- <h2><a name="debugging_code"></a>Debugging Code</h2>
- <div class="guidelineDetails">
- <p>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.</p>
-
-<code>// print_r($foo);</code>
- </div>
-
-
-
- <h2><a name="whitespace_in_files"></a>Whitespace in Files</h2>
- <div class="guidelineDetails">
- <p>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.</p>
-
- <p><strong>INCORRECT</strong>:</p>
-<code>
-&lt;?php
- // ...there is whitespace and a linebreak above the opening PHP tag
- // as well as whitespace after the closing PHP tag
-?&gt;
-</code>
- <p><strong>CORRECT</strong>:</p>
-<code>&lt;?php
- // this sample has no whitespace before or after the opening and closing PHP tags
-?&gt;</code>
-
- </div>
-
-
- <h2><a name="compatibility"></a>Compatibility</h2>
- <div class="guidelineDetails">
- <p>Unless specifically mentioned in your add-on's documentation, all code must be compatible with PHP version 5.1+. 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.</p>
- </div>
-
-
-
- <h2><a name="class_and_file_names_using_common_words"></a>Class and File Names using Common Words</h2>
- <div class="guidelineDetails">
- <p>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.</p>
-
-<code><strong>INCORRECT</strong>:
-class Email pi.email.php
-class Xml ext.xml.php
-class Import mod.import.php
-
-<strong>CORRECT</strong>:
-class Pre_email pi.pre_email.php
-class Pre_xml ext.pre_xml.php
-class Pre_import mod.pre_import.php
-</code>
- </div>
-
-
- <h2><a name="database_table_names"></a>Database Table Names</h2>
- <div class="guidelineDetails">
- <p>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.</p>
-
-<code><strong>INCORRECT</strong>:
-email_addresses // missing both prefixes
-pre_email_addresses // missing exp_ prefix
-exp_email_addresses // missing unique prefix
-
-<strong>CORRECT</strong>:
-exp_pre_email_addresses
-</code>
-
- <p class="important"><strong>NOTE:</strong> 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? <strong>exp_pre_email_addresses_of_registered_users_in_seattle_washington</strong>
- </div>
-
-
-
- <h2><a name="one_file_per_class"></a>One File per Class</h2>
- <div class="guidelineDetails">
- <p>Use separate files for each class your add-on uses, unless the classes are <em>closely related</em>. 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.</p>
- </div>
-
-
-
- <h2><a name="whitespace"></a>Whitespace</h2>
- <div class="guidelineDetails">
- <p>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.</p>
- </div>
-
-
-
- <h2><a name="line_breaks"></a>Line Breaks</h2>
- <div class="guidelineDetails">
- <p>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.</p>
- </div>
-
-
-
- <h2><a name="code_indenting"></a>Code Indenting</h2>
- <div class="guidelineDetails">
- <p>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.</p>
-
-<code><strong>INCORRECT</strong>:
-function foo($bar) {
- // ...
-}
-
-foreach ($arr as $key => $val) {
- // ...
-}
-
-if ($foo == $bar) {
- // ...
-} else {
- // ...
-}
-
-for ($i = 0; $i &lt; 10; $i++)
- {
- for ($j = 0; $j &lt; 10; $j++)
- {
- // ...
- }
- }
-
-<strong>CORRECT</strong>:
-function foo($bar)
-{
- // ...
-}
-
-foreach ($arr as $key => $val)
-{
- // ...
-}
-
-if ($foo == $bar)
-{
- // ...
-}
-else
-{
- // ...
-}
-
-for ($i = 0; $i &lt; 10; $i++)
-{
- for ($j = 0; $j &lt; 10; $j++)
- {
- // ...
- }
-}</code>
- </div>
-
-
- <h2><a name="bracket_spacing"></a>Bracket and Parenthetic Spacing</h2>
- <div class="guidelineDetails">
- <p>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.</p>
-
-<code>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
-</code>
- </div>
-
-
-
- <h2><a name="localized_text"></a>Localized Text</h2>
- <div class="guidelineDetails">
- <p>Any text that is output in the control panel should use language variables in your lang file to allow localization.</p>
-
-<code>INCORRECT:
-return "Invalid Selection";
-
-CORRECT:
-return $this->lang->line('invalid_selection');</code>
- </div>
-
-
-
- <h2><a name="private_methods_and_variables"></a>Private Methods and Variables</h2>
- <div class="guidelineDetails">
- <p>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.</p>
-
-<code>convert_text() // public method
-_convert_text() // private method</code>
- </div>
-
-
-
- <h2><a name="php_errors"></a>PHP Errors</h2>
- <div class="guidelineDetails">
- <p>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().</p>
-
- <p>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:</p>
-
-<code>if (ini_get('display_errors') == 1)
-{
- exit "Enabled";
-}</code>
-
- <p>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:</p>
-
-<code>ini_set('display_errors', 1);</code>
-
- <p class="important"><strong>NOTE:</strong> Setting the <a href="http://us.php.net/manual/en/ref.errorfunc.php#ini.display-errors">display_errors</a> 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</p>
- </div>
-
-
-
- <h2><a name="short_open_tags"></a>Short Open Tags</h2>
- <div class="guidelineDetails">
- <p>Always use full PHP opening tags, in case a server does not have short_open_tag enabled.</p>
-
-<code><strong>INCORRECT</strong>:
-&lt;? echo $foo; ?&gt;
-
-&lt;?=$foo?&gt;
-
-<strong>CORRECT</strong>:
-&lt;?php echo $foo; ?&gt;</code>
- </div>
-
-
-
- <h2><a name="one_statement_per_line"></a>One Statement Per Line</h2>
- <div class="guidelineDetails">
- <p>Never combine statements on one line.</p>
-
-<code><strong>INCORRECT</strong>:
-$foo = 'this'; $bar = 'that'; $bat = str_replace($foo, $bar, $bag);
-
-<strong>CORRECT</strong>:
-$foo = 'this';
-$bar = 'that';
-$bat = str_replace($foo, $bar, $bag);
-</code>
- </div>
-
-
-
- <h2><a name="strings"></a>Strings</h2>
- <div class="guidelineDetails">
- <p>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.</p>
-
-<code><strong>INCORRECT</strong>:
-"My String" // no variable parsing, so no use for double quotes
-"My string $foo" // needs braces
-'SELECT foo FROM bar WHERE baz = \'bag\'' // ugly
-
-<strong>CORRECT</strong>:
-'My String'
-"My string {$foo}"
-"SELECT foo FROM bar WHERE baz = 'bag'"</code>
- </div>
-
-
-
- <h2><a name="sql_queries"></a>SQL Queries</h2>
- <div class="guidelineDetails">
- <p>MySQL keywords are always capitalized: SELECT, INSERT, UPDATE, WHERE, AS, JOIN, ON, IN, etc.</p>
-
- <p>Break up long queries into multiple lines for legibility, preferably breaking for each clause.</p>
-
-<code><strong>INCORRECT</strong>:
-// 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");
-
-<strong>CORRECT</strong>:
-$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");</code>
- </div>
-
-
-
- <h2><a name="default_function_arguments"></a>Default Function Arguments</h2>
- <div class="guidelineDetails">
- <p>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:</p>
-
-<code>function foo($bar = '', $baz = FALSE)</code>
- </div>
-
-
-
-</div>
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="security.html">Security</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="../doc_style/index.html">Writing Documentation</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html
deleted file mode 100644
index edf03309b..000000000
--- a/user_guide/general/urls.html
+++ /dev/null
@@ -1,151 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter URLs : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-URLS
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>CodeIgniter URLs</h1>
-
-<p>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 <strong>segment-based</strong> approach:</p>
-
-<code>example.com/<var>news</var>/<dfn>article</dfn>/<samp>my_article</samp></code>
-
-<p class="important"><strong>Note:</strong> Query string URLs can be optionally enabled, as described below.</p>
-
-<h2>URI Segments</h2>
-
-<p>The segments in the URL, in following with the Model-View-Controller approach, usually represent:</p>
-
-<code>example.com/<var>class</var>/<dfn>function</dfn>/<samp>ID</samp></code>
-
-<ol>
-<li>The first segment represents the controller <strong>class</strong> that should be invoked.</li>
-<li>The second segment represents the class <strong>function</strong>, or method, that should be called.</li>
-<li>The third, and any additional segments, represent the ID and any variables that will be passed to the controller.</li>
-</ol>
-
-<p>The <a href="../libraries/uri.html">URI Class</a> and the <a href="../helpers/url_helper.html">URL Helper</a>
-contain functions that make it easy to work with your URI data. In addition, your URLs can be remapped using the
-<a href="routing.html">URI Routing</a> feature for more flexibility.</p>
-
-
-
-<h2>Removing the index.php file</h2>
-
-<p>By default, the <strong>index.php</strong> file will be included in your URLs:</p>
-
-<code>example.com/<var>index.php</var>/news/article/my_article</code>
-
-<p>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:</p>
-
-<code>RewriteEngine on<br />
-RewriteCond $1 !^(index\.php|images|robots\.txt)<br />
-RewriteRule ^(.*)$ /index.php/$1 [L]</code>
-
-<p>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.</p>
-
-
-<h2>Adding a URL Suffix</h2>
-
-<p>In your <dfn>config/config.php</dfn> file you can specify a suffix that will be added to all URLs generated
-by CodeIgniter. For example, if a URL is this:</p>
-
-<code>example.com/index.php/products/view/shoes</code>
-
-<p>You can optionally add a suffix, like <kbd>.html</kbd>, making the page appear to be of a certain type:</p>
-
-<code>example.com/index.php/products/view/shoes.html</code>
-
-
-<h2>Enabling Query Strings</h2>
-
-<p>In some cases you might prefer to use query strings URLs:</p>
-
-<code>index.php?c=products&amp;m=view&amp;id=345</code>
-
-<p>CodeIgniter optionally supports this capability, which can be enabled in your <dfn>application/config.php</dfn> file. If you
-open your config file you'll see these items:</p>
-
-<code>$config['enable_query_strings'] = FALSE;<br />
-$config['controller_trigger'] = 'c';<br />
-$config['function_trigger'] = 'm';</code>
-
-<p>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:</p>
-
-<code>index.php?c=controller&amp;m=method</code>
-
-<p class="important"><strong>Please note:</strong> 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.</p>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="controllers.html">Controllers</a></p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/general/views.html b/user_guide/general/views.html
deleted file mode 100644
index 5dc1d3250..000000000
--- a/user_guide/general/views.html
+++ /dev/null
@@ -1,274 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Views : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Views
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Views</h1>
-
-<p>A <dfn>view</dfn> 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.</p>
-
-<p>Views are never called directly, they must be loaded by a <a href="controllers.html">controller</a>. 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 <a href="controllers.html">Controllers</a> page
-you should do so before continuing.</p>
-
-<p>Using the example controller you created in the <a href="controllers.html">controller</a> page, let's add a view to it.</p>
-
-<h2>Creating a View</h2>
-
-<p>Using your text editor, create a file called <dfn>blogview.php</dfn>, and put this in it:</p>
-
-<textarea class="textarea" style="width:100%" cols="50" rows="10">
-&lt;html>
-&lt;head>
-&lt;title>My Blog&lt;/title>
-&lt;/head>
-&lt;body>
- &lt;h1>Welcome to my Blog!&lt;/h1>
-&lt;/body>
-&lt;/html>
-</textarea>
-
-<p>Then save the file in your <dfn>application/views/</dfn> folder.</p>
-
-<h2>Loading a View</h2>
-
-<p>To load a particular view file you will use the following function:</p>
-
-<code>$this->load->view('<var>name</var>');</code>
-
-<p>Where <var>name</var> is the name of your view file. Note: The .php file extension does not need to be specified unless you use something other than <kbd>.php</kbd>.</p>
-
-
-<p>Now, open the controller file you made earlier called <dfn>blog.php</dfn>, and replace the echo statement with the view loading function:</p>
-
-
-<textarea class="textarea" style="width:100%" cols="50" rows="10">
-&lt;?php
-class Blog extends CI_Controller {
-
- function index()
- {
- $this->load->view('blogview');
- }
-}
-?&gt;
-</textarea>
-
-
-<p>If you visit your site using the URL you did earlier you should see your new view. The URL was similar to this:</p>
-
-<code>example.com/index.php/<var>blog</var>/</code>
-
-<h2>Loading multiple views</h2>
-<p>CodeIgniter will intelligently handle multiple calls to $this-&gt;load-&gt;view from within a controller. If more than 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:</p>
-<p><code>&lt;?php<br />
-<br />
-class Page extends CI_Controller {<br /><br />
-
- &nbsp;&nbsp;&nbsp;function index()<br />
-&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$data['page_title'] = 'Your title';<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;load-&gt;view('header');<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;load-&gt;view('menu');<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;load-&gt;view('content', $data);<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;load-&gt;view('footer');<br />
-&nbsp;&nbsp;&nbsp;}<br />
-<br />
-}<br />
- ?&gt;</code></p>
-<p>In the example above, we are using &quot;dynamically added data&quot;, which you will see below.</p>
-<h2>Storing Views within Sub-folders</h2>
-<p>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:</p>
-
-<code>$this->load->view('<kbd>folder_name</kbd>/<var>file_name</var>');</code>
-
-
-<h2>Adding Dynamic Data to the View</h2>
-
-<p>Data is passed from the controller to the view by way of an <strong>array</strong> or an <strong>object</strong> in the second
-parameter of the view loading function. Here is an example using an array:</p>
-
-<code>$data = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'title' => 'My Title',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'heading' => 'My Heading',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'message' => 'My Message'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-$this->load->view('blogview', <var>$data</var>);</code>
-
-<p>And here's an example using an object:</p>
-
-<code>$data = new Someclass();<br />
-$this->load->view('blogview', <var>$data</var>);</code>
-
-<p>Note: If you use an object, the class variables will be turned into array elements.</p>
-
-
-<p>Let's try it with your controller file. Open it add this code:</p>
-
-<textarea class="textarea" style="width:100%" cols="50" rows="14">
-&lt;?php
-class Blog extends CI_Controller {
-
- function index()
- {
- $data['title'] = "My Real Title";
- $data['heading'] = "My Real Heading";
-
- $this->load->view('blogview', $data);
- }
-}
-?&gt;
-</textarea>
-
-
-<p>Now open your view file and change the text to variables that correspond to the array keys in your data:</p>
-
-
-<textarea class="textarea" style="width:100%" cols="50" rows="10">
-&lt;html>
-&lt;head>
-&lt;title>&lt;?php echo $title;?>&lt;/title>
-&lt;/head>
-&lt;body>
- &lt;h1>&lt;?php echo $heading;?>&lt;/h1>
-&lt;/body>
-&lt;/html>
-</textarea>
-
-<p>Then load the page at the URL you've been using and you should see the variables replaced.</p>
-
-<h2>Creating Loops</h2>
-
-<p>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.</p>
-
-<p>Here's a simple example. Add this to your controller:</p>
-
-<textarea class="textarea" style="width:100%" cols="50" rows="17">
-&lt;?php
-class Blog extends CI_Controller {
-
- function index()
- {
- $data['todo_list'] = array('Clean House', 'Call Mom', 'Run Errands');
-
- $data['title'] = "My Real Title";
- $data['heading'] = "My Real Heading";
-
- $this->load->view('blogview', $data);
- }
-}
-?&gt;
-</textarea>
-
-
-<p>Now open your view file and create a loop:</p>
-
-
-<textarea class="textarea" style="width:100%" cols="50" rows="24">
-&lt;html>
-&lt;head>
-&lt;title>&lt;?php echo $title;?>&lt;/title>
-&lt;/head>
-&lt;body>
-&lt;h1>&lt;?php echo $heading;?>&lt;/h1>
-
-&lt;h3>My Todo List&lt;/h3>
-
-&lt;ul>
-&lt;?php foreach ($todo_list as $item):?>
-
-&lt;li>&lt;?php echo $item;?>&lt;/li>
-
-&lt;?php endforeach;?>
-&lt;/ul>
-
-&lt;/body>
-&lt;/html>
-</textarea>
-<p><strong>Note:</strong> 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 <a href="alternative_php.html">here</a>.</p>
-
-<h2>Returning views as data</h2>
-
-<p>There is a third <strong>optional</strong> 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 <kbd>true</kbd> (boolean) it will return data. The default behavior is <kbd>false</kbd>, which sends it
-to your browser. Remember to assign it to a variable if you want the data returned:</p>
-
-<code>$string = $this->load->view('<var>myfile</var>', '', <kbd>true</kbd>);</code>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="reserved_names.html">Reserved Names</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="models.html">Models</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html
deleted file mode 100644
index 92a11ed69..000000000
--- a/user_guide/helpers/array_helper.html
+++ /dev/null
@@ -1,170 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Array Helper : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Array Helper
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Array Helper</h1>
-
-<p>The Array Helper file contains functions that assist in working with arrays.</p>
-
-
-<h2>Loading this Helper</h2>
-
-<p>This helper is loaded using the following code:</p>
-<code>$this->load->helper('array');</code>
-
-<p>The following functions are available:</p>
-
-<h2>element()</h2>
-
-<p>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:</p>
-
-<code>
-$array = array('color' => 'red', 'shape' => 'round', 'size' => '');<br />
-<br />
-// returns "red"<br />
-echo element('color', $array);<br />
-<br />
-// returns NULL<br />
-echo element('size', $array, NULL);
-</code>
-
-
-<h2>random_element()</h2>
-
-<p>Takes an array as input and returns a random element from it. Usage example:</p>
-
-<code>$quotes = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"I find that the harder I work, the more luck I seem to have. - Thomas Jefferson",<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"Don't stay in bed, unless you can make money in bed. - George Burns",<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"We didn't lose the game; we just ran out of time. - Vince Lombardi",<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"If everything seems under control, you're not going fast enough. - Mario Andretti",<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"Reality is merely an illusion, albeit a very persistent one. - Albert Einstein",<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"Chance favors the prepared mind - Louis Pasteur"<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-echo random_element($quotes);</code>
-
-
-<h2>elements()</h2>
-
-<p>Lets you fetch a number of items from an array. The function tests whether each of the array indices is set. If an index does not exist
-it is set to FALSE, or whatever you've specified as the default value via the third parameter. Example:</p>
-
-<code>
-$array = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'color' => 'red',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'shape' => 'round',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'radius' => '10',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'diameter' => '20'<br />
-);<br />
-<br />
-$my_shape = elements(array('color', 'shape', 'height'), $array);<br />
-</code>
-
-<p>The above will return the following array:</p>
-
-<code>
-array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'color' => 'red',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'shape' => 'round',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'height' => FALSE<br />
-);
-</code>
-
-<p>You can set the third parameter to any default value you like:</p>
-
-<code>
-$my_shape = elements(array('color', 'shape', 'height'), $array, NULL);<br />
-</code>
-
-<p>The above will return the following array:</p>
-
-<code>
-array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'color' => 'red',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'shape' => 'round',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'height' => NULL<br />
-);
-</code>
-
-<p>This is useful when sending the <kbd>$_POST</kbd> array to one of your Models. This prevents users from
-sending additional POST data to be entered into your tables:</p>
-
-<code>
-$this->load->model('post_model');<br />
-<br />
-$this->post_model->update(elements(array('id', 'title', 'content'), $_POST));
-</code>
-
-<p>This ensures that only the id, title and content fields are sent to be updated.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp; <a href="../libraries/javascript.html">Javascript Class</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="captcha_helper.html">CAPTCHA Helper</a></p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/helpers/captcha_helper.html b/user_guide/helpers/captcha_helper.html
deleted file mode 100644
index 6c2671ad0..000000000
--- a/user_guide/helpers/captcha_helper.html
+++ /dev/null
@@ -1,195 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CAPTCHA Helper : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-CAPTCHA Helper
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>CAPTCHA Helper</h1>
-
-<p>The CAPTCHA Helper file contains functions that assist in creating CAPTCHA images.</p>
-
-
-<h2>Loading this Helper</h2>
-
-<p>This helper is loaded using the following code:</p>
-<code>$this->load->helper('captcha');</code>
-
-<p>The following functions are available:</p>
-
-<h2>create_captcha(<var>$data</var>)</h2>
-
-<p>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.</p>
-
-<code>[array]<br />
-(<br />
-&nbsp;&nbsp;'image' => IMAGE TAG<br />
-&nbsp;&nbsp;'time' => TIMESTAMP (in microtime)<br />
-&nbsp;&nbsp;'word' => CAPTCHA WORD<br />
-)</code>
-
- <p>The "image" is the actual image tag:
-<code>&lt;img src=&quot;http://example.com/captcha/12345.jpg&quot; width=&quot;140&quot; height=&quot;50&quot; /&gt;</code></p>
-
- <p>The "time" is the micro timestamp used as the image name without the file
- extension. It will be a number like this: 1139612155.3422</p>
-
- <p>The "word" is the word that appears in the captcha image, which if not
- supplied to the function, will be a random string.</p>
-
- <h3>Using the CAPTCHA helper</h3>
-
- <p>Once loaded you can generate a captcha like this:</p>
-
-<code>$vals = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'word' => 'Random word',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'img_path' => './captcha/',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'img_url' => 'http://example.com/captcha/',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'font_path' => './path/to/fonts/texb.ttf',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'img_width' => '150',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'img_height' => 30,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'expiration' => 7200<br />
-&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-$cap = create_captcha($vals);<br />
-echo $cap['image'];</code>
-
- <ul>
- <li>The captcha function requires the GD image library.</li>
- <li>Only the img_path and img_url are required.</li>
- <li>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.</li>
- <li>If you do not specify a path to a TRUE TYPE font, the native ugly GD
- font will be used.</li>
- <li>The "captcha" folder must be writable (666, or 777)</li>
- <li>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.</li>
- </ul>
-
- <h3>Adding a Database</h3>
-
- <p>In order for the captcha function to prevent someone from submitting, you will need
- to add the information returned from <kbd>create_captcha()</kbd> 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.</p>
-
- <p>Here is a table prototype:</p>
-
-<code>CREATE TABLE captcha (<br />
-&nbsp;captcha_id bigint(13) unsigned NOT NULL auto_increment,<br />
-&nbsp;captcha_time int(10) unsigned NOT NULL,<br />
-&nbsp;ip_address varchar(16) default '0' NOT NULL,<br />
-&nbsp;word varchar(20) NOT NULL,<br />
-&nbsp;PRIMARY KEY `captcha_id` (`captcha_id`),<br />
-&nbsp;KEY `word` (`word`)<br />
-);</code>
-
- <p>Here is an example of usage with a database. On the page where the CAPTCHA will be shown you'll have something like this:</p>
-
-<code>$this-&gt;load-&gt;helper(&#x27;captcha&#x27;);<br />
-$vals = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&#x27;img_path&#x27; =&gt; &#x27;./captcha/&#x27;,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&#x27;img_url&#x27; =&gt; &#x27;http://example.com/captcha/&#x27;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-$cap = create_captcha($vals);<br />
-<br />
-$data = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&#x27;captcha_time&#x27; =&gt; $cap[&#x27;time&#x27;],<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&#x27;ip_address&#x27; =&gt; $this-&gt;input-&gt;ip_address(),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&#x27;word&#x27; =&gt; $cap[&#x27;word&#x27;]<br />
-&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-$query = $this-&gt;db-&gt;insert_string(&#x27;captcha&#x27;, $data);<br />
-$this-&gt;db-&gt;query($query);<br />
-<br />
-echo &#x27;Submit the word you see below:&#x27;;<br />
-echo $cap[&#x27;image&#x27;];<br />
-echo &#x27;&lt;input type=&quot;text&quot; name=&quot;captcha&quot; value=&quot;&quot; /&gt;&#x27;;</code>
-
- <p>Then, on the page that accepts the submission you'll have something like this:</p>
-
-<code>// First, delete old captchas<br />
-$expiration = time()-7200; // Two hour limit<br />
-$this-&gt;db-&gt;query(&quot;DELETE FROM captcha WHERE captcha_time &lt; &quot;.$expiration); <br />
-<br />
-// Then see if a captcha exists:<br />
-$sql = &quot;SELECT COUNT(*) AS count FROM captcha WHERE word = ? AND ip_address = ? AND captcha_time &gt; ?&quot;;<br />
-$binds = array($_POST[&#x27;captcha&#x27;], $this-&gt;input-&gt;ip_address(), $expiration);<br />
-$query = $this-&gt;db-&gt;query($sql, $binds);<br />
-$row = $query-&gt;row();<br />
-<br />
-if ($row-&gt;count == 0)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;You must submit the word that appears in the image&quot;;<br />
-}</code>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="array_helper.html">Array Helper</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="cookie_helper.html">Cookie Helper</a></p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html>
diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html
deleted file mode 100644
index 2fde7f841..000000000
--- a/user_guide/helpers/cookie_helper.html
+++ /dev/null
@@ -1,107 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Cookie Helper : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Cookie Helper
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Cookie Helper</h1>
-
-<p>The Cookie Helper file contains functions that assist in working with cookies.</p>
-
-
-<h2>Loading this Helper</h2>
-
-<p>This helper is loaded using the following code:</p>
-<code>$this->load->helper('cookie');</code>
-
-<p>The following functions are available:</p>
-
-<h2>set_cookie()</h2>
-
-<p>This helper function gives you view file friendly syntax to set browser cookies. Refer to the <a href="../libraries/input.html">Input class</a> for a description of use, as this function is an alias to $this->input->set_cookie().</p>
-
-<h2>get_cookie()</h2>
-
-<p>This helper function gives you view file friendly syntax to get browser cookies. Refer to the <a href="../libraries/input.html">Input class</a> for a description of use, as this function is an alias to $this->input->cookie().</p>
-
-
-<h2>delete_cookie()</h2>
-
-<p>Lets you delete a cookie. Unless you've set a custom path or other values, only the name of the cookie is needed:</p>
-
-<code>delete_cookie("name");</code>
-
-<p>This function is otherwise identical to <dfn>set_cookie()</dfn>, 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.</p>
-
-<code>delete_cookie($name, $domain, $path, $prefix)</code>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="captcha_helper.html">CAPTCHA Helper</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="date_helper.html">Date Helper</a></p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html
deleted file mode 100644
index e705593b0..000000000
--- a/user_guide/helpers/date_helper.html
+++ /dev/null
@@ -1,408 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Date Helper : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Date Helper
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Date Helper</h1>
-
-<p>The Date Helper file contains functions that help you work with dates.</p>
-
-
-<h2>Loading this Helper</h2>
-
-<p>This helper is loaded using the following code:</p>
-<code>$this->load->helper('date');</code>
-
-
-<p>The following functions are available:</p>
-
-<h2>now()</h2>
-
-<p>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.
-</p>
-
-
-
-
-<h2>mdate()</h2>
-
-<p>This function is identical to PHPs <a href="http://www.php.net/date">date()</a> 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.</p>
-
-<p>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:</p>
-
-<code>$datestring = "Year: %Y Month: %m Day: %d - %h:%i %a";<br />
-$time = time();<br />
-<br />
-echo mdate($datestring, $time);</code>
-
-<p>If a timestamp is not included in the second parameter the current time will be used.</p>
-
-
-<h2>standard_date()</h2>
-
-<p>Lets you generate a date string in one of several standardized formats. Example:</p>
-
-<code>
-$format = 'DATE_RFC822';<br />
-$time = time();<br />
-<br />
-echo standard_date($format, $time);
-</code>
-
-<p>The first parameter must contain the format, the second parameter must contain the date as a Unix timestamp.</p>
-
-<p>Supported formats:</p>
-
-<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
- <tr>
- <th>Constant</th>
- <th>Description</th>
- <th>Example</th>
- </tr>
- <tr>
- <td>DATE_ATOM</td>
- <td>Atom</td>
- <td>2005-08-15T16:13:03+0000</td>
- </tr>
- <tr>
- <td>DATE_COOKIE</td>
- <td>HTTP Cookies</td>
- <td>Sun, 14 Aug 2005 16:13:03 UTC</td>
- </tr>
- <tr>
- <td>DATE_ISO8601</td>
- <td>ISO-8601</td>
- <td>2005-08-14T16:13:03+00:00</td>
- </tr>
- <tr>
- <td>DATE_RFC822</td>
- <td>RFC 822</td>
- <td>Sun, 14 Aug 05 16:13:03 UTC</td>
- </tr>
- <tr>
- <td>DATE_RFC850</td>
- <td>RFC 850</td>
- <td>Sunday, 14-Aug-05 16:13:03 UTC</td>
- </tr>
- <tr>
- <td>DATE_RFC1036</td>
- <td>RFC 1036</td>
- <td>Sunday, 14-Aug-05 16:13:03 UTC</td>
- </tr>
- <tr>
- <td>DATE_RFC1123</td>
- <td>RFC 1123</td>
- <td>Sun, 14 Aug 2005 16:13:03 UTC</td>
- </tr>
- <tr>
- <td>DATE_RFC2822</td>
- <td>RFC 2822</td>
- <td>Sun, 14 Aug 2005 16:13:03 +0000</td>
- </tr>
- <tr>
- <td>DATE_RSS</td>
- <td>RSS</td>
- <td>Sun, 14 Aug 2005 16:13:03 UTC</td>
- </tr>
- <tr>
- <td>DATE_W3C</td>
- <td>World Wide Web Consortium</td>
- <td>2005-08-14T16:13:03+0000</td>
- </tr>
-</table>
-
-<h2>local_to_gmt()</h2>
-
-<p>Takes a Unix timestamp as input and returns it as GMT. Example:</p>
-
-<code>$now = time();<br />
-<br />
-$gmt = local_to_gmt($now);</code>
-
-
-<h2>gmt_to_local()</h2>
-
-<p>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:</p>
-
-<code>
-$timestamp = '1140153693';<br />
-$timezone = 'UM8';<br />
-$daylight_saving = TRUE;<br />
-<br />
-echo gmt_to_local($timestamp, $timezone, $daylight_saving);</code>
-
-<p><strong>Note:</strong> For a list of timezones see the reference at the bottom of this page.</p>
-
-<h2>mysql_to_unix()</h2>
-
-<p>Takes a MySQL Timestamp as input and returns it as Unix. Example:</p>
-
-<code>$mysql = '20061124092345';<br />
-<br />
-$unix = mysql_to_unix($mysql);</code>
-
-
-<h2>unix_to_human()</h2>
-
-<p>Takes a Unix timestamp as input and returns it in a human readable format with this prototype:</p>
-
-<code>YYYY-MM-DD HH:MM:SS AM/PM</code>
-
-<p>This can be useful if you need to display a date in a form field for submission.</p>
-
-<p>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:</p>
-
-<code>$now = time();<br />
-<br />
-echo unix_to_human($now); // U.S. time, no seconds<br />
-<br />
-echo unix_to_human($now, TRUE, 'us'); // U.S. time with seconds<br />
-<br />
-echo unix_to_human($now, TRUE, 'eu'); // Euro time with seconds</code>
-
-
-<h2>human_to_unix()</h2>
-
-<p>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:</p>
-
-<code>$now = time();<br />
-<br />
-$human = unix_to_human($now);<br />
-<br />
-$unix = human_to_unix($human);</code>
-
-
-
-
-
-<h2>timespan()</h2>
-
-<p>Formats a unix timestamp so that is appears similar to this:</p>
-
-<code>1 Year, 10 Months, 2 Weeks, 5 Days, 10 Hours, 16 Minutes</code>
-
-<p>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:</p>
-
-<code>$post_date = '1079621429';<br />
-$now = time();<br />
-<br />
-echo timespan($post_date, $now);</code>
-
-<p class="important"><strong>Note:</strong> The text generated by this function is found in the following language file: language/&lt;your_lang&gt;/date_lang.php</p>
-
-
-<h2>days_in_month()</h2>
-
-<p>Returns the number of days in a given month/year. Takes leap years into account. Example:</p>
-<code>echo days_in_month(06, 2005);</code>
-
-<p>If the second parameter is empty, the current year will be used.</p>
-<h2>timezones()</h2>
-<p> Takes a timezone reference (for a list of valid timezones, see the &quot;Timezone Reference&quot; below) and returns the number of hours offset from UTC.</p>
-<p><code>echo timezones('UM5');</code></p>
-<p>This function is useful when used with timezone_menu(). </p>
-<h2>timezone_menu()</h2>
-<p>Generates a pull-down menu of timezones, like this one:</p>
-
-<form action="#">
-<select name="timezones">
-<option value='UM12'>(UTC - 12:00) Enitwetok, Kwajalien</option>
-<option value='UM11'>(UTC - 11:00) Nome, Midway Island, Samoa</option>
-<option value='UM10'>(UTC - 10:00) Hawaii</option>
-<option value='UM9'>(UTC - 9:00) Alaska</option>
-<option value='UM8'>(UTC - 8:00) Pacific Time</option>
-<option value='UM7'>(UTC - 7:00) Mountain Time</option>
-<option value='UM6'>(UTC - 6:00) Central Time, Mexico City</option>
-<option value='UM5'>(UTC - 5:00) Eastern Time, Bogota, Lima, Quito</option>
-<option value='UM4'>(UTC - 4:00) Atlantic Time, Caracas, La Paz</option>
-<option value='UM25'>(UTC - 3:30) Newfoundland</option>
-<option value='UM3'>(UTC - 3:00) Brazil, Buenos Aires, Georgetown, Falkland Is.</option>
-<option value='UM2'>(UTC - 2:00) Mid-Atlantic, Ascention Is., St Helena</option>
-<option value='UM1'>(UTC - 1:00) Azores, Cape Verde Islands</option>
-<option value='UTC' selected='selected'>(UTC) Casablanca, Dublin, Edinburgh, London, Lisbon, Monrovia</option>
-<option value='UP1'>(UTC + 1:00) Berlin, Brussels, Copenhagen, Madrid, Paris, Rome</option>
-<option value='UP2'>(UTC + 2:00) Kaliningrad, South Africa, Warsaw</option>
-<option value='UP3'>(UTC + 3:00) Baghdad, Riyadh, Moscow, Nairobi</option>
-<option value='UP25'>(UTC + 3:30) Tehran</option>
-<option value='UP4'>(UTC + 4:00) Adu Dhabi, Baku, Muscat, Tbilisi</option>
-<option value='UP35'>(UTC + 4:30) Kabul</option>
-<option value='UP5'>(UTC + 5:00) Islamabad, Karachi, Tashkent</option>
-<option value='UP45'>(UTC + 5:30) Bombay, Calcutta, Madras, New Delhi</option>
-<option value='UP6'>(UTC + 6:00) Almaty, Colomba, Dhaka</option>
-<option value='UP7'>(UTC + 7:00) Bangkok, Hanoi, Jakarta</option>
-<option value='UP8'>(UTC + 8:00) Beijing, Hong Kong, Perth, Singapore, Taipei</option>
-<option value='UP9'>(UTC + 9:00) Osaka, Sapporo, Seoul, Tokyo, Yakutsk</option>
-<option value='UP85'>(UTC + 9:30) Adelaide, Darwin</option>
-<option value='UP10'>(UTC + 10:00) Melbourne, Papua New Guinea, Sydney, Vladivostok</option>
-<option value='UP11'>(UTC + 11:00) Magadan, New Caledonia, Solomon Islands</option>
-<option value='UP12'>(UTC + 12:00) Auckland, Wellington, Fiji, Marshall Island</option>
-</select>
-</form>
-
-<p>This menu is useful if you run a membership site in which your users are allowed to set their local timezone value.</p>
-
-<p>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:</p>
-
-<code>echo timezone_menu('UM8');</code>
-
-<p>Please see the timezone reference below to see the values of this menu.</p>
-
-<p>The second parameter lets you set a CSS class name for the menu.</p>
-
-<p class="important"><strong>Note:</strong> The text contained in the menu is found in the following language file: language/&lt;your_lang&gt;/date_lang.php</p>
-
-
-
-<h2>Timezone Reference</h2>
-
-<p>The following table indicates each timezone and its location.</p>
-
-<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
-<tr>
-<th>Time Zone</th>
-<th>Location</th>
-</tr><tr>
-
-<td class="td">UM12</td><td class="td">(UTC - 12:00) Enitwetok, Kwajalien</td>
-</tr><tr>
-<td class="td">UM11</td><td class="td">(UTC - 11:00) Nome, Midway Island, Samoa</td>
-</tr><tr>
-<td class="td">UM10</td><td class="td">(UTC - 10:00) Hawaii</td>
-</tr><tr>
-<td class="td">UM9</td><td class="td">(UTC - 9:00) Alaska</td>
-</tr><tr>
-<td class="td">UM8</td><td class="td">(UTC - 8:00) Pacific Time</td>
-</tr><tr>
-<td class="td">UM7</td><td class="td">(UTC - 7:00) Mountain Time</td>
-</tr><tr>
-<td class="td">UM6</td><td class="td">(UTC - 6:00) Central Time, Mexico City</td>
-</tr><tr>
-<td class="td">UM5</td><td class="td">(UTC - 5:00) Eastern Time, Bogota, Lima, Quito</td>
-</tr><tr>
-<td class="td">UM4</td><td class="td">(UTC - 4:00) Atlantic Time, Caracas, La Paz</td>
-</tr><tr>
-<td class="td">UM25</td><td class="td">(UTC - 3:30) Newfoundland</td>
-</tr><tr>
-<td class="td">UM3</td><td class="td">(UTC - 3:00) Brazil, Buenos Aires, Georgetown, Falkland Is.</td>
-</tr><tr>
-<td class="td">UM2</td><td class="td">(UTC - 2:00) Mid-Atlantic, Ascention Is., St Helena</td>
-</tr><tr>
-<td class="td">UM1</td><td class="td">(UTC - 1:00) Azores, Cape Verde Islands</td>
-</tr><tr>
-<td class="td">UTC</td><td class="td">(UTC) Casablanca, Dublin, Edinburgh, London, Lisbon, Monrovia</td>
-</tr><tr>
-<td class="td">UP1</td><td class="td">(UTC + 1:00) Berlin, Brussels, Copenhagen, Madrid, Paris, Rome</td>
-</tr><tr>
-<td class="td">UP2</td><td class="td">(UTC + 2:00) Kaliningrad, South Africa, Warsaw</td>
-</tr><tr>
-<td class="td">UP3</td><td class="td">(UTC + 3:00) Baghdad, Riyadh, Moscow, Nairobi</td>
-</tr><tr>
-<td class="td">UP25</td><td class="td">(UTC + 3:30) Tehran</td>
-</tr><tr>
-<td class="td">UP4</td><td class="td">(UTC + 4:00) Adu Dhabi, Baku, Muscat, Tbilisi</td>
-</tr><tr>
-<td class="td">UP35</td><td class="td">(UTC + 4:30) Kabul</td>
-</tr><tr>
-<td class="td">UP5</td><td class="td">(UTC + 5:00) Islamabad, Karachi, Tashkent</td>
-</tr><tr>
-<td class="td">UP45</td><td class="td">(UTC + 5:30) Bombay, Calcutta, Madras, New Delhi</td>
-</tr><tr>
-<td class="td">UP6</td><td class="td">(UTC + 6:00) Almaty, Colomba, Dhaka</td>
-</tr><tr>
-<td class="td">UP7</td><td class="td">(UTC + 7:00) Bangkok, Hanoi, Jakarta</td>
-</tr><tr>
-<td class="td">UP8</td><td class="td">(UTC + 8:00) Beijing, Hong Kong, Perth, Singapore, Taipei</td>
-</tr><tr>
-<td class="td">UP9</td><td class="td">(UTC + 9:00) Osaka, Sapporo, Seoul, Tokyo, Yakutsk</td>
-</tr><tr>
-<td class="td">UP85</td><td class="td">(UTC + 9:30) Adelaide, Darwin</td>
-</tr><tr>
-<td class="td">UP10</td><td class="td">(UTC + 10:00) Melbourne, Papua New Guinea, Sydney, Vladivostok</td>
-</tr><tr>
-<td class="td">UP11</td><td class="td">(UTC + 11:00) Magadan, New Caledonia, Solomon Islands</td>
-</tr><tr>
-<td class="td">UP12</td><td class="td">(UTC + 12:00) Auckland, Wellington, Fiji, Marshall Island</td>
-</tr>
-</table>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="cookie_helper.html">Cookie Helper</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="directory_helper.html">Directory Helper</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html
deleted file mode 100644
index 7fd7797af..000000000
--- a/user_guide/helpers/directory_helper.html
+++ /dev/null
@@ -1,143 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Directory Helper : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Directory Helper
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Directory Helper</h1>
-
-<p>The Directory Helper file contains functions that assist in working with directories.</p>
-
-
-<h2>Loading this Helper</h2>
-
-<p>This helper is loaded using the following code:</p>
-<code>$this->load->helper('directory');</code>
-
-<p>The following functions are available:</p>
-
-<h2>directory_map('<var>source directory</var>')</h2>
-
-<p>This function reads the directory path specified in the first parameter
-and builds an array representation of it and all its contained files. Example:</p>
-
-<code>$map = directory_map('./mydirectory/');</code>
-
-<p class="important"><strong>Note:</strong> Paths are almost always relative to your main index.php file.</p>
-
-<p>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:</p>
-
-<code>$map = directory_map('./mydirectory/', 1);</code>
-
-<p>By default, hidden files will not be included in the returned array. To override this behavior,
-you may set a third parameter to <var>true</var> (boolean):</p>
-
-<code>$map = directory_map('./mydirectory/', FALSE, TRUE);</code>
-
-<p>Each folder name will be an array index, while its contained files will be numerically indexed.
-Here is an example of a typical array:</p>
-
-<code>Array<br />
-(<br />
-&nbsp;&nbsp;&nbsp;[libraries] => Array<br />
-&nbsp;&nbsp;&nbsp;(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[0] => benchmark.html<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[1] => config.html<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[database] => Array<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[0] => active_record.html<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[1] => binds.html<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[2] => configuration.html<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[3] => connecting.html<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[4] => examples.html<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[5] => fields.html<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[6] => index.html<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[7] => queries.html<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[2] => email.html<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[3] => file_uploading.html<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[4] => image_lib.html<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[5] => input.html<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[6] => language.html<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[7] => loader.html<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[8] => pagination.html<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[9] => uri.html<br />
-)</code>
-
-
-
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="date_helper.html">Date Helper</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="download_helper.html">Download Helper</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html
deleted file mode 100644
index ccfe9ac72..000000000
--- a/user_guide/helpers/download_helper.html
+++ /dev/null
@@ -1,112 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Download Helper : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Download Helper
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Download Helper</h1>
-
-<p>The Download Helper lets you download data to your desktop.</p>
-
-
-<h2>Loading this Helper</h2>
-
-<p>This helper is loaded using the following code:</p>
-<code>$this->load->helper('download');</code>
-
-<p>The following functions are available:</p>
-
-<h2>force_download('<var>filename</var>', '<var>data</var>')</h2>
-
-<p>Generates server headers which force data to be downloaded to your desktop. Useful with file downloads.
-The first parameter is the <strong>name you want the downloaded file to be named</strong>, the second parameter is the file data.
-Example:</p>
-
-<code>
-$data = 'Here is some text!';<br />
-$name = 'mytext.txt';<br />
-<br />
-force_download($name, $data);
-</code>
-
-<p>If you want to download an existing file from your server you'll need to read the file into a string:</p>
-
-<code>
-$data = file_get_contents("/path/to/photo.jpg"); // Read the file's contents<br />
-$name = 'myphoto.jpg';<br />
-<br />
-force_download($name, $data);
-</code>
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="directory_helper.html">Directory Helper</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="email_helper.html">Email Helper</a></p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/helpers/email_helper.html b/user_guide/helpers/email_helper.html
deleted file mode 100644
index 13ae220fe..000000000
--- a/user_guide/helpers/email_helper.html
+++ /dev/null
@@ -1,102 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Email Helper : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Email Helper
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Email Helper</h1>
-
-<p>The Email Helper provides some assistive functions for working with Email. For a more robust email solution, see CodeIgniter's <a href="../libraries/email.html">Email Class</a>.</p>
-
-<h2>Loading this Helper</h2>
-
-<p>This helper is loaded using the following code:</p>
-<p><code>$this->load->helper('email');</code></p>
-
-<p>The following functions are available:</p>
-
-<h2>valid_email('<var>email</var>')</h2>
-
-<p>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.</p>
-<p>It returns TRUE/FALSE</p>
-<code> $this-&gt;load-&gt;helper('email');<br />
-<br />
-if (valid_email('email@somesite.com'))<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo 'email is valid';<br />
-}<br />
-else<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo 'email is not valid';<br />
-}</code>
-<h2>send_email('<var>recipient</var>', '<var>subject</var>', '<var>message</var>')</h2>
-<p>Sends an email using PHP's native <a href="http://www.php.net/function.mail">mail()</a> function. For a more robust email solution, see CodeIgniter's <a href="../libraries/email.html">Email Class</a>.</p>
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="download_helper.html">Download Helper</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="file_helper.html">File Helper</a></p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html
deleted file mode 100644
index 0296191ff..000000000
--- a/user_guide/helpers/file_helper.html
+++ /dev/null
@@ -1,179 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>File Helper : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-File Helper
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>File Helper</h1>
-
-<p>The File Helper file contains functions that assist in working with files.</p>
-
-
-<h2>Loading this Helper</h2>
-
-<p>This helper is loaded using the following code:</p>
-<code>$this->load->helper('file');</code>
-
-<p>The following functions are available:</p>
-
-<h2>read_file('<var>path</var>')</h2>
-
-<p>Returns the data contained in the file specified in the path. Example:</p>
-
-<code>$string = read_file('./path/to/file.php');</code>
-
-<p>The path can be a relative or full server path. Returns FALSE (boolean) on failure.</p>
-
-<p class="important"><strong>Note:</strong> 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.</p>
-
-<p>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.</p>
-
-<h2>write_file('<var>path</var>', <kbd>$data</kbd>)</h2>
-
-<p>Writes data to the file specified in the path. If the file does not exist the function will create it. Example:</p>
-
-<code>
-$data = 'Some file data';<br />
-<br />
-if ( ! write_file('./path/to/file.php', $data))<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp; echo 'Unable to write the file';<br />
-}<br />
-else<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp; echo 'File written!';<br />
-}</code>
-
-<p>You can optionally set the write mode via the third parameter:</p>
-
-<code>write_file('./path/to/file.php', $data, <var>'r+'</var>);</code>
-
-<p>The default mode is <kbd>wb</kbd>. Please see the <a href="http://php.net/fopen">PHP user guide</a> for mode options.</p>
-
-<p>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.</p>
-
-<p class="important"><strong>Note:</strong> 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.</p>
-
-<h2>delete_files('<var>path</var>')</h2>
-
-<p>Deletes ALL files contained in the supplied path. Example:</p>
-<code>delete_files('./path/to/directory/');</code>
-
-<p>If the second parameter is set to <kbd>true</kbd>, any directories contained within the supplied root path will be deleted as well. Example:</p>
-
-<code>delete_files('./path/to/directory/', TRUE);</code>
-
-<p class="important"><strong>Note:</strong> The files must be writable or owned by the system in order to be deleted.</p>
-
-<h2>get_filenames('<var>path/to/directory/</var>')</h2>
-
-<p>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.</p>
-
-<h2>get_dir_file_info('<var>path/to/directory/</var>', <kbd>$top_level_only</kbd> = TRUE)</h2>
-
-<p>Reads the specified directory and builds an array containing the filenames, filesize, dates, and permissions. Sub-folders contained within the specified path are only read if forced
- by sending the second parameter, <kbd>$top_level_only</kbd> to <samp>FALSE</samp>, as this can be an intensive operation.</p>
-
-<h2>get_file_info('<var>path/to/file</var>', <kbd>$file_information</kbd>)</h2>
-
-<p>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.</p>
-
-<p class="important"><strong>Note:</strong> The &quot;writable&quot; 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.</p>
-<h2>get_mime_by_extension('<var>file</var>')</h2>
-
-<p>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.</p>
-<p>
-<code>$file = &quot;somefile.png&quot;;<br />
-echo $file . ' is has a mime type of ' . get_mime_by_extension($file);</code>
-</p>
-<p class="critical"><strong>Note:</strong> 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.</p>
-
-<h2>symbolic_permissions(<kbd>$perms</kbd>)</h2>
-
-<p>Takes numeric permissions (such as is returned by <kbd>fileperms()</kbd> and returns standard symbolic notation of file permissions.</p>
-
-<code>echo symbolic_permissions(fileperms('./index.php'));<br />
-<br />
-// -rw-r--r--</code>
-
-<h2>octal_permissions(<kbd>$perms</kbd>)</h2>
-
-<p>Takes numeric permissions (such as is returned by <kbd>fileperms()</kbd> and returns a three character octal notation of file permissions.</p>
-
-<code>echo octal_permissions(fileperms('./index.php'));<br />
-<br />
-// 644</code>
-
-</div>
-
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="email_helper.html">Email Helper</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="form_helper.html">Form Helper</a></p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html
deleted file mode 100644
index ce809e946..000000000
--- a/user_guide/helpers/form_helper.html
+++ /dev/null
@@ -1,484 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Form Helper : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Form Helper
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Form Helper</h1>
-
-<p>The Form Helper file contains functions that assist in working with forms.</p>
-
-
-<h2>Loading this Helper</h2>
-
-<p>This helper is loaded using the following code:</p>
-<code>$this->load->helper('form');</code>
-
-<p>The following functions are available:</p>
-
-
-
-<h2>form_open()</h2>
-
-<p>Creates an opening form tag with a base URL <strong>built from your config preferences</strong>. It will optionally let you
-add form attributes and hidden input fields, and will always add the attribute <kbd>accept-charset</kbd> based on the charset value in your config file.</p>
-
-<p>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.</p>
-
-<p>Here's a simple example:</p>
-
-<code>echo form_open('email/send');</code>
-
-<p>The above example would create a form that points to your base URL plus the "email/send" URI segments, like this:</p>
-
-<code>&lt;form method="post" accept-charset="utf-8" action="http:/example.com/index.php/email/send" /></code>
-
-<h4>Adding Attributes</h4>
-
-<p>Attributes can be added by passing an associative array to the second parameter, like this:</p>
-
-<code>
-$attributes = array('class' => 'email', 'id' => 'myform');<br />
-<br />
-echo form_open('email/send', $attributes);</code>
-
-<p>The above example would create a form similar to this:</p>
-
-<code>&lt;form method="post" accept-charset="utf-8" action="http:/example.com/index.php/email/send" &nbsp;class="email" &nbsp;id="myform" /></code>
-
-<h4>Adding Hidden Input Fields</h4>
-
-<p>Hidden fields can be added by passing an associative array to the third parameter, like this:</p>
-
-<code>
-$hidden = array('username' => 'Joe', 'member_id' => '234');<br />
-<br />
-echo form_open('email/send', '', $hidden);</code>
-
-<p>The above example would create a form similar to this:</p>
-
-<code>&lt;form method="post" accept-charset="utf-8" action="http:/example.com/index.php/email/send"><br />
-&lt;input type="hidden" name="username" value="Joe" /><br />
-&lt;input type="hidden" name="member_id" value="234" /></code>
-
-
-<h2>form_open_multipart()</h2>
-
-<p>This function is absolutely identical to the <dfn>form_open()</dfn> tag above except that it adds a multipart attribute,
-which is necessary if you would like to use the form to upload files with.</p>
-
-<h2>form_hidden()</h2>
-
-<p>Lets you generate hidden input fields. You can either submit a name/value string to create one field:</p>
-
-<code>form_hidden('username', 'johndoe');<br />
-<br />
-// Would produce:<br /><br />
-&lt;input type="hidden" name="username" value="johndoe" /></code>
-
-<p>Or you can submit an associative array to create multiple fields:</p>
-
-<code>$data = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name'&nbsp;&nbsp;=> 'John Doe',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'email' => 'john@example.com',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'url'&nbsp;&nbsp;&nbsp;=> 'http://example.com'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-echo form_hidden($data);<br />
-<br />
-// Would produce:<br /><br />
-&lt;input type="hidden" name="name" value="John Doe" /><br />
-&lt;input type="hidden" name="email" value="john@example.com" /><br />
-&lt;input type="hidden" name="url" value="http://example.com" /></code>
-
-
-
-
-<h2>form_input()</h2>
-
-<p>Lets you generate a standard text input field. You can minimally pass the field name and value in the first
-and second parameter:</p>
-
-<code>echo form_input('username', 'johndoe');</code>
-
-<p>Or you can pass an associative array containing any data you wish your form to contain:</p>
-
-<code>$data = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> 'username',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'id'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> 'username',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'value'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> 'johndoe',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'maxlength'&nbsp;&nbsp;&nbsp;=> '100',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'size'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '50',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'style'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; => 'width:50%',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-echo form_input($data);<br />
-<br />
-// Would produce:<br /><br />
-&lt;input type="text" name="username" id="username" value="johndoe" maxlength="100" size="50" style="width:50%" /></code>
-
-<p>If you would like your form to contain some additional data, like Javascript, you can pass it as a string in the
-third parameter:</p>
-
-<code>$js = 'onClick="some_function()"';<br />
-<br />
-echo form_input('username', 'johndoe', $js);</code>
-
-<h2>form_password()</h2>
-
-<p>This function is identical in all respects to the <dfn>form_input()</dfn> function above
-except that is sets it as a "password" type.</p>
-
-<h2>form_upload()</h2>
-
-<p>This function is identical in all respects to the <dfn>form_input()</dfn> function above
-except that is sets it as a "file" type, allowing it to be used to upload files.</p>
-
-<h2>form_textarea()</h2>
-
-<p>This function is identical in all respects to the <dfn>form_input()</dfn> 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".</p>
-
-
-<h2>form_dropdown()</h2>
-
-<p>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 of multiple items through the third parameter, and CodeIgniter will create a multiple select for you. Example:</p>
-
-<code>$options = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'small'&nbsp;&nbsp;=> 'Small Shirt',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'med'&nbsp;&nbsp;&nbsp;&nbsp;=> 'Medium Shirt',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'large'&nbsp;&nbsp; => 'Large Shirt',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'xlarge' => 'Extra Large Shirt',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-$shirts_on_sale = array('small', 'large');<br />
-<br />
-echo form_dropdown('shirts', $options, 'large');<br />
-<br />
-// Would produce:<br />
-<br />
-&lt;select name=&quot;shirts&quot;&gt;<br />
-&lt;option value=&quot;small&quot;&gt;Small Shirt&lt;/option&gt;<br />
-&lt;option value=&quot;med&quot;&gt;Medium Shirt&lt;/option&gt;<br />
-&lt;option value=&quot;large&quot; selected=&quot;selected&quot;&gt;Large Shirt&lt;/option&gt;<br />
-&lt;option value=&quot;xlarge&quot;&gt;Extra Large Shirt&lt;/option&gt;<br />
-&lt;/select&gt;<br />
-<br />
-echo form_dropdown('shirts', $options, $shirts_on_sale);<br />
-<br />
-// Would produce:<br />
-<br />
-&lt;select name=&quot;shirts&quot; multiple=&quot;multiple&quot;&gt;<br />
-&lt;option value=&quot;small&quot; selected=&quot;selected&quot;&gt;Small Shirt&lt;/option&gt;<br />
-&lt;option value=&quot;med&quot;&gt;Medium Shirt&lt;/option&gt;<br />
-&lt;option value=&quot;large&quot; selected=&quot;selected&quot;&gt;Large Shirt&lt;/option&gt;<br />
-&lt;option value=&quot;xlarge&quot;&gt;Extra Large Shirt&lt;/option&gt;<br />
-&lt;/select&gt;</code>
-
-
-<p>If you would like the opening &lt;select> to contain additional data, like an <kbd>id</kbd> attribute or JavaScript, you can pass it as a string in the
-fourth parameter:</p>
-
-<code>$js = 'id="shirts" onChange="some_function();"';<br />
-<br />
-echo form_dropdown('shirts', $options, 'large', $js);</code>
-
-<p>If the array passed as $options is a multidimensional array, form_dropdown() will produce an &lt;optgroup&gt; with the array key as the label.</p>
-
-<h2>form_multiselect()</h2>
-
-<p>Lets you create a standard multiselect 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 or values you wish to be selected. The parameter usage is identical to using <kbd>form_dropdown()</kbd> above,
-except of course that the name of the field will need to use POST array syntax, e.g. <samp>foo[]</samp>.</p>
-
-
-<h2>form_fieldset()</h2>
-
-<p>Lets you generate fieldset/legend fields.</p>
-<code>echo form_fieldset('Address Information');<br />
-echo &quot;&lt;p&gt;fieldset content here&lt;/p&gt;\n&quot;;<br />
-echo form_fieldset_close();
-<br />
-<br />
-// Produces<br />
-&lt;fieldset&gt;
-<br />
-&lt;legend&gt;Address Information&lt;/legend&gt;
-<br />
-&lt;p&gt;form content here&lt;/p&gt;
-<br />
-&lt;/fieldset&gt;</code>
-<p>Similar to other functions, you can submit an associative array in the second parameter if you prefer to set additional attributes. </p>
-<p><code>$attributes = array('id' =&gt; 'address_info', 'class' =&gt; 'address_info');<br />
- echo form_fieldset('Address Information', $attributes);<br />
-echo &quot;&lt;p&gt;fieldset content here&lt;/p&gt;\n&quot;;<br />
-echo form_fieldset_close(); <br />
-<br />
-// Produces<br />
-&lt;fieldset id=&quot;address_info&quot; class=&quot;address_info&quot;&gt; <br />
-&lt;legend&gt;Address Information&lt;/legend&gt; <br />
-&lt;p&gt;form content here&lt;/p&gt; <br />
-&lt;/fieldset&gt;</code></p>
-<h2>form_fieldset_close()</h2>
-<p>Produces a closing &lt;/fieldset&gt; 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:</p>
-<code>$string = &quot;&lt;/div&gt;&lt;/div&gt;&quot;;<br />
-<br />
-echo form_fieldset_close($string);<br />
-<br />
-// Would produce:<br />
-&lt;/fieldset&gt;<br />
-&lt;/div&gt;&lt;/div&gt;</code>
-<h2>form_checkbox()</h2>
-<p>Lets you generate a checkbox field. Simple example:</p>
-<code>echo form_checkbox('newsletter', 'accept', TRUE);<br />
-<br />
-// Would produce:<br />
-<br />
-&lt;input type=&quot;checkbox&quot; name=&quot;newsletter&quot; value=&quot;accept&quot; checked=&quot;checked&quot; /&gt;</code>
-<p>The third parameter contains a boolean TRUE/FALSE to determine whether the box should be checked or not.</p>
-<p>Similar to the other form functions in this helper, you can also pass an array of attributes to the function:</p>
-
-<code>$data = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'name'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> 'newsletter',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'id'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> 'newsletter',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'value'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> 'accept',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'checked'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> TRUE,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'style'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; => 'margin:10px',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-echo form_checkbox($data);<br />
-<br />
-// Would produce:<br /><br />
-&lt;input type="checkbox" name="newsletter" id="newsletter" value="accept" checked="checked" style="margin:10px" /></code>
-
-<p>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:</p>
-
-<code>$js = 'onClick="some_function()"';<br />
-<br />
- echo form_checkbox('newsletter', 'accept', TRUE, $js)</code>
-
-
-<h2>form_radio()</h2>
-<p>This function is identical in all respects to the <dfn>form_checkbox()</dfn> function above except that is sets it as a "radio" type.</p>
-
-
-<h2>form_submit()</h2>
-
-<p>Lets you generate a standard submit button. Simple example:</p>
-<code>echo form_submit('mysubmit', 'Submit Post!');<br />
-<br />
-// Would produce:<br />
-<br />
-&lt;input type=&quot;submit&quot; name=&quot;mysubmit&quot; value=&quot;Submit Post!&quot; /&gt;</code>
-<p>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.</p>
-<h2>form_label()</h2>
-<p>Lets you generate a &lt;label&gt;. Simple example:</p>
-<code>echo form_label('What is your Name', 'username');<br />
-<br />
-// Would produce:
-<br />
-&lt;label for=&quot;username&quot;&gt;What is your Name&lt;/label&gt;</code>
-<p>Similar to other functions, you can submit an associative array in the third parameter if you prefer to set additional attributes. </p>
-<p><code>$attributes = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'class' =&gt; 'mycustomclass',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'style' =&gt; 'color: #000;',<br />
-);<br />
- echo form_label('What is your Name', 'username', $attributes);<br />
- <br />
-// Would produce: <br />
-&lt;label for=&quot;username&quot; class=&quot;mycustomclass&quot; style=&quot;color: #000;&quot;&gt;What is your Name&lt;/label&gt;</code></p>
-<h2>form_reset()</h2>
-
-<p>Lets you generate a standard reset button. Use is identical to <dfn>form_submit()</dfn>.</p>
-
-<h2>form_button()</h2>
-
-<p>Lets you generate a standard button element. You can minimally pass the button name and content in the first and second parameter:</p>
-<code>
-echo form_button('name','content');<br />
-<br />
-// Would produce<br />
-&lt;button name="name" type="button"&gt;Content&lt;/button&gt;
-</code>
-
-Or you can pass an associative array containing any data you wish your form to contain:
-<code>
-$data = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'name' => 'button',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'id' => 'button',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'value' => 'true',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'type' => 'reset',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'content' => 'Reset'<br />
-);<br />
-<br />
-echo form_button($data);<br />
-<br />
-// Would produce:<br />
-&lt;button name="button" id="button" value="true" type="reset"&gt;Reset&lt;/button&gt;
-</code>
-
-If you would like your form to contain some additional data, like JavaScript, you can pass it as a string in the third parameter:
-<code>
-$js = 'onClick="some_function()"';<br /><br />
-echo form_button('mybutton', 'Click Me', $js);
-</code>
-
-
-<h2>form_close()</h2>
-
-<p>Produces a closing &lt;/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:</p>
-
-<code>$string = "&lt;/div>&lt;/div>";<br />
-<br />
-echo form_close($string);<br />
-<br />
-// Would produce:<br />
-<br />
-&lt;/form><br />
-&lt;/div>&lt;/div></code>
-
-
-
-
-
-<h2>form_prep()</h2>
-
-<p>Allows you to safely use HTML and characters such as quotes within form elements without breaking out of the form. Consider this example:</p>
-
-<code>$string = 'Here is a string containing <strong>"quoted"</strong> text.';<br />
-<br />
-&lt;input type="text" name="myform" value="<var>$string</var>" /></code>
-
-<p>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:</p>
-
-<code>&lt;input type="text" name="myform" value="<var>&lt;?php echo form_prep($string); ?></var>" /></code>
-
-<p class="important"><strong>Note:</strong> 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.</p>
-
-
-<h2>set_value()</h2>
-
-<p>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:</p>
-
-<code>&lt;input type="text" name="quantity" value="<dfn>&lt;?php echo set_value('quantity', '0'); ?></dfn>" size="50" /></code>
-
-<p>The above form will show "0" when loaded for the first time.</p>
-
-<h2>set_select()</h2>
-
-<p>If you use a <dfn>&lt;select></dfn> 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).</p>
-
-<p>Example:</p>
-
-<code>
-&lt;select name="myselect"><br />
-&lt;option value="one" <dfn>&lt;?php echo set_select('myselect', 'one', TRUE); ?></dfn> >One&lt;/option><br />
-&lt;option value="two" <dfn>&lt;?php echo set_select('myselect', 'two'); ?></dfn> >Two&lt;/option><br />
-&lt;option value="three" <dfn>&lt;?php echo set_select('myselect', 'three'); ?></dfn> >Three&lt;/option><br />
-&lt;/select>
-</code>
-
-
-<h2>set_checkbox()</h2>
-
-<p>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:</p>
-
-<code>&lt;input type="checkbox" name="mycheck" value="1" <dfn>&lt;?php echo set_checkbox('mycheck', '1'); ?></dfn> /><br />
-&lt;input type="checkbox" name="mycheck" value="2" <dfn>&lt;?php echo set_checkbox('mycheck', '2'); ?></dfn> /></code>
-
-
-<h2>set_radio()</h2>
-
-<p>Permits you to display radio buttons in the state they were submitted. This function is identical to the <strong>set_checkbox()</strong> function above.</p>
-
-<code>&lt;input type="radio" name="myradio" value="1" <dfn>&lt;?php echo set_radio('myradio', '1', TRUE); ?></dfn> /><br />
-&lt;input type="radio" name="myradio" value="2" <dfn>&lt;?php echo set_radio('myradio', '2'); ?></dfn> /></code>
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="file_helper.html">File Helper</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="html_helper.html">HTML Helper</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html
deleted file mode 100644
index a8277febe..000000000
--- a/user_guide/helpers/html_helper.html
+++ /dev/null
@@ -1,390 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>HTML Helper : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-HTML Helper
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>HTML Helper</h1>
-
-<p>The HTML Helper file contains functions that assist in working with HTML.</p>
-
-<ul>
- <li><a href="#br">br()</a></li>
- <li><a href="#heading">heading()</a></li>
- <li><a href="#img">img()</a></li>
- <li><a href="#link_tag">link_tag()</a></li>
- <li><a href="#nbs">nbs()</a></li>
- <li><a href="#ol_and_ul">ol() and ul()</a></li>
- <li><a href="#meta">meta()</a></li>
- <li><a href="#doctype">doctype()</a></li>
-</ul>
-
-<h2>Loading this Helper</h2>
-
-<p>This helper is loaded using the following code:</p>
-<code>$this->load->helper('html');</code>
-
-<p>The following functions are available:</p>
-
-<h2><a name="br"></a>br()</h2>
-<p>Generates line break tags (&lt;br />) based on the number you submit. Example:</p>
-<code>echo br(3);</code>
-<p>The above would produce: &lt;br />&lt;br />&lt;br /></p>
-
-<h2><a name="heading"></a>heading()</h2>
-<p>Lets you create HTML &lt;h1> tags. The first parameter will contain the data, the
-second the size of the heading. Example:</p>
-<code>echo heading('Welcome!', 3);</code>
-<p>The above would produce: &lt;h3>Welcome!&lt;/h3></p>
-
-<p>Additionally, in order to add attributes to the heading tag such as HTML classes, ids or inline styles, a third parameter is available.</p>
-<code>echo heading('Welcome!', 3, 'class="pink"')</code>
-<p>The above code produces: &lt;h3 class="pink">Welcome!<&lt;h3></p>
-
-
-<h2><a name="img"></a>img()</h2>
-<p>Lets you create HTML &lt;img /&gt; tags. The first parameter contains the image source. Example:</p>
-<code>echo img('images/picture.jpg');<br />
-// gives &lt;img src=&quot;http://site.com/images/picture.jpg&quot; /&gt;</code>
-<p>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.</p>
-<p><code>echo img('images/picture.jpg', TRUE);<br />
-// gives &lt;img src=&quot;http://site.com/index.php/images/picture.jpg&quot; alt=&quot;&quot; /&gt;</code></p>
-<p>Additionally, an associative array can be passed to the img() function for complete control over all attributes and values. If an alt attribute is not provided, CodeIgniter will generate an empty string.</p>
-<p><code> $image_properties = array(<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'src' =&gt; 'images/picture.jpg',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'alt' =&gt; 'Me, demonstrating how to eat 4 slices of pizza at one time',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'class' =&gt; 'post_images',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'width' =&gt; '200',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'height' =&gt; '200',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'title' =&gt; 'That was quite a night',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rel' =&gt; 'lightbox',<br />
- );<br />
- <br />
- img($image_properties);<br />
- // &lt;img src=&quot;http://site.com/index.php/images/picture.jpg&quot; alt=&quot;Me, demonstrating how to eat 4 slices of pizza at one time&quot; class=&quot;post_images&quot; width=&quot;200&quot; height=&quot;200&quot; title=&quot;That was quite a night&quot; rel=&quot;lightbox&quot; /&gt;</code></p>
-
-<h2><a name="link_tag"></a>link_tag()</h2>
-<p>Lets you create HTML &lt;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.<code>
-echo link_tag('css/mystyles.css');<br />
-// gives &lt;link href=&quot;http://site.com/css/mystyles.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;</code></p>
-<p>Further examples:</p>
-
-<code>
- echo link_tag('favicon.ico', 'shortcut icon', 'image/ico');<br />
- // &lt;link href=&quot;http://site.com/favicon.ico&quot; rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; /&gt;
- <br />
- <br />
- echo link_tag('feed', 'alternate', 'application/rss+xml', 'My RSS Feed');<br />
- // &lt;link href=&quot;http://site.com/feed&quot; rel=&quot;alternate&quot; type=&quot;application/rss+xml&quot; title=&quot;My RSS Feed&quot; /&gt; </code>
-<p>Additionally, an associative array can be passed to the link() function for complete control over all attributes and values.</p>
-<p><code>
- $link = array(<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'href' =&gt; 'css/printer.css',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rel' =&gt; 'stylesheet',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'type' =&gt; 'text/css',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'media' =&gt; 'print'<br />
- );<br />
- <br />
- echo link_tag($link);<br />
- // &lt;link href=&quot;http://site.com/css/printer.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;print&quot; /&gt;</code></p>
-
-<h2><a name="nbs"></a>nbs()</h2>
-<p>Generates non-breaking spaces (&amp;nbsp;) based on the number you submit. Example:</p>
-<code>echo nbs(3);</code>
-<p>The above would produce: &amp;nbsp;&amp;nbsp;&amp;nbsp;</p>
-
-<h2><a name="ol_and_ul"></a>ol()&nbsp; and&nbsp; ul()</h2>
-
-<p>Permits you to generate ordered or unordered HTML lists from simple or multi-dimensional arrays. Example:</p>
-
-<code>
-$this->load->helper('html');<br />
-<br />
-$list = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'red', <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'blue', <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'green',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'yellow'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-$attributes = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'class' => 'boldlist',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'id'&nbsp;&nbsp;&nbsp;&nbsp;=> 'mylist'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-echo ul($list, $attributes);<br />
-</code>
-
-<p>The above code will produce this:</p>
-
-<code>
-&lt;ul&nbsp;class="boldlist"&nbsp;id="mylist"><br />
-&nbsp;&nbsp;&lt;li>red&lt;/li><br />
-&nbsp;&nbsp;&lt;li>blue&lt;/li><br />
-&nbsp;&nbsp;&lt;li>green&lt;/li><br />
-&nbsp;&nbsp;&lt;li>yellow&lt;/li><br />
-&lt;/ul>
-</code>
-
-<p>Here is a more complex example, using a multi-dimensional array:</p>
-
-<code>
-$this->load->helper('html');<br />
-<br />
-$attributes = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'class' => 'boldlist',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'id'&nbsp;&nbsp;&nbsp;&nbsp;=> 'mylist'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-$list = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'colors' => array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'red',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'blue',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'green'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'shapes' => array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'round', <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'square',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'circles' => array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'ellipse', <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'oval', <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'sphere'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'moods'&nbsp;&nbsp;&nbsp;&nbsp;=> array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'happy', <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'upset' => array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'defeated' => array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'dejected',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'disheartened',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'depressed'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'annoyed',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'cross',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'angry'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-<br />
-echo ul($list, $attributes);</code>
-
-<p>The above code will produce this:</p>
-
-<code>
-&lt;ul&nbsp;class="boldlist"&nbsp;id="mylist"&gt;<br />
-&nbsp;&nbsp;&lt;li&gt;colors<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&lt;ul&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;red&lt;/li&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;blue&lt;/li&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;green&lt;/li&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ul&gt;<br />
-&nbsp;&nbsp;&lt;/li&gt;<br />
-&nbsp;&nbsp;&lt;li&gt;shapes<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&lt;ul&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;round&lt;/li&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;suare&lt;/li&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;circles<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ul&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;elipse&lt;/li&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;oval&lt;/li&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;sphere&lt;/li&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ul&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/li&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ul&gt;<br />
-&nbsp;&nbsp;&lt;/li&gt;<br />
-&nbsp;&nbsp;&lt;li&gt;moods<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&lt;ul&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;happy&lt;/li&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;upset<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ul&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;defeated<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ul&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;dejected&lt;/li&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;disheartened&lt;/li&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;depressed&lt;/li&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ul&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/li&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;annoyed&lt;/li&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;cross&lt;/li&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;angry&lt;/li&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ul&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/li&gt;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ul&gt;<br />
-&nbsp;&nbsp;&lt;/li&gt;<br />
-&lt;/ul&gt;
-</code>
-
-
-
-<h2><a name="meta"></a>meta()</h2>
-
-<p>Helps you generate meta tags. You can pass strings to the function, or simple arrays, or multidimensional ones. Examples:</p>
-
-<code>
-echo meta('description', 'My Great site');<br />
-// Generates: &lt;meta name="description" content="My Great Site" /><br />
-<br /><br />
-
-echo meta('Content-type', 'text/html; charset=utf-8', 'equiv'); // Note the third parameter. Can be "equiv" or "name"<br />
-// Generates: &lt;meta http-equiv="Content-type" content="text/html; charset=utf-8" /><br />
-
-<br /><br />
-
-echo meta(array('name' => 'robots', 'content' => 'no-cache'));<br />
-// Generates: &lt;meta name="robots" content="no-cache" /><br />
-
-<br /><br />
-
-$meta = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('name' => 'robots', 'content' => 'no-cache'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('name' => 'description', 'content' => 'My Great Site'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('name' => 'keywords', 'content' => 'love, passion, intrigue, deception'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('name' => 'robots', 'content' => 'no-cache'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('name' => 'Content-type', 'content' => 'text/html; charset=utf-8', 'type' => 'equiv')<br />
-&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-echo meta($meta);
-<br />
-// Generates: <br />
-// &lt;meta name="robots" content="no-cache" /><br />
-// &lt;meta name="description" content="My Great Site" /><br />
-// &lt;meta name="keywords" content="love, passion, intrigue, deception" /><br />
-// &lt;meta name="robots" content="no-cache" /><br />
-// &lt;meta http-equiv="Content-type" content="text/html; charset=utf-8" />
-</code>
-
-
-<h2><a name="doctype"></a>doctype()</h2>
-
-<p>Helps you generate document type declarations, or DTD's. XHTML 1.0 Strict is used by default, but many doctypes are available.</p>
-
-<code>
-echo doctype();<br />
-// &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;<br />
-<br />
-echo doctype('html4-trans');<br />
-// &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
-</code>
-
-<p>The following is a list of doctype choices. These are configurable, and pulled from <samp>application/config/doctypes.php</samp></p>
-
-<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
- <tr>
- <th>Doctype</th>
- <th>Option</th>
- <th>Result</th>
- </tr>
- <tr>
- <td class="td">XHTML 1.1</td>
- <td class="td">doctype('xhtml11')</td>
- <td class="td">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;</td>
- </tr>
- <tr>
- <td class="td">XHTML 1.0 Strict</td>
- <td class="td">doctype('xhtml1-strict')</td>
- <td class="td">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;</td>
- </tr>
- <tr>
- <td class="td">XHTML 1.0 Transitional</td>
- <td class="td">doctype('xhtml1-trans')</td>
- <td class="td">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;</td>
- </tr>
- <tr>
- <td class="td">XHTML 1.0 Frameset</td>
- <td class="td">doctype('xhtml1-frame')</td>
- <td class="td">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"&gt;</td>
- </tr>
- <tr>
- <td class="td">HTML 5</td>
- <td class="td">doctype('html5')</td>
- <td class="td">&lt;!DOCTYPE html&gt;</td>
- </tr>
- <tr>
- <td class="td">HTML 4 Strict</td>
- <td class="td">doctype('html4-strict')</td>
- <td class="td">&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;</td>
- </tr>
- <tr>
- <td class="td">HTML 4 Transitional</td>
- <td class="td">doctype('html4-trans')</td>
- <td class="td">&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;</td>
- </tr>
- <tr>
- <td class="td">HTML 4 Frameset</td>
- <td class="td">doctype('html4-frame')</td>
- <td class="td">&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"&gt;</td>
- </tr>
-</table>
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="form_helper.html">Form Helper</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="path_helper.html"> Path Helper</a></p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html
deleted file mode 100644
index 66982e8b3..000000000
--- a/user_guide/helpers/inflector_helper.html
+++ /dev/null
@@ -1,151 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Inflector Helper : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Inflector Helper
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Inflector Helper</h1>
-
-<p>The Inflector Helper file contains functions that permits you to change words to plural, singular, camel case, etc.</p>
-
-
-<h2>Loading this Helper</h2>
-
-<p>This helper is loaded using the following code:</p>
-<code>$this->load->helper('inflector');</code>
-
-<p>The following functions are available:</p>
-
-
-<h2>singular()</h2>
-
-<p>Changes a plural word to singular. Example:</p>
-
-<code>
-$word = "dogs";<br />
-echo singular($word); // Returns "dog"
-</code>
-
-
-<h2>plural()</h2>
-
-<p>Changes a singular word to plural. Example:</p>
-
-<code>
-$word = "dog";<br />
-echo plural($word); // Returns "dogs"
-</code>
-
-
-<p>To force a word to end with &quot;es&quot; use a second &quot;true&quot; argument. </p>
-<code> $word = &quot;pass&quot;;<br />
-echo plural($word, TRUE); // Returns &quot;passes&quot; </code>
-
-<h2>camelize()</h2>
-<p>Changes a string of words separated by spaces or underscores to camel case. Example:</p>
-
-<code>
-$word = "my_dog_spot";<br />
-echo camelize($word); // Returns "myDogSpot"
-</code>
-
-
-<h2>underscore()</h2>
-
-<p>Takes multiple words separated by spaces and underscores them. Example:</p>
-
-<code>
-$word = "my dog spot";<br />
-echo underscore($word); // Returns "my_dog_spot"
-</code>
-
-
-<h2>humanize()</h2>
-
-<p>Takes multiple words separated by underscores and adds spaces between them. Each word is capitalized. Example:</p>
-
-<code>
-$word = "my_dog_spot";<br />
-echo humanize($word); // Returns "My Dog Spot"
-</code>
-
-
-
-
-
-
-
-
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="html_helper.html"> HTML Helper</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="number_helper.html">Number Helper</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/helpers/language_helper.html b/user_guide/helpers/language_helper.html
deleted file mode 100644
index 073c368d8..000000000
--- a/user_guide/helpers/language_helper.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Language Helper : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Language Helper
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Language Helper</h1>
-
-<p>The Language Helper file contains functions that assist in working with language files.</p>
-
-
-<h2>Loading this Helper</h2>
-
-<p>This helper is loaded using the following code:</p>
-<code>$this->load->helper('language');</code>
-
-<p>The following functions are available:</p>
-
-<h2>lang('<var>language line</var>', '<var>element id</var>')</h2>
-
-<p>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 <kbd>$this-&gt;lang-&gt;line()</kbd>.
- The optional second parameter will also output a form label for you. Example:</p>
-
-<code>echo lang('<samp>language_key</samp>', '<samp>form_item_id</samp>');<br />
-// becomes &lt;label for="form_item_id"&gt;language_key&lt;/label&gt;</code>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="date_helper.html">Date Helper</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="download_helper.html">Download Helper</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/helpers/number_helper.html b/user_guide/helpers/number_helper.html
deleted file mode 100644
index c48987e6c..000000000
--- a/user_guide/helpers/number_helper.html
+++ /dev/null
@@ -1,113 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Number Helper : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Number Helper
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Number Helper</h1>
-
-<p>The Number Helper file contains functions that help you work with numeric data.</p>
-
-
-<h2>Loading this Helper</h2>
-
-<p>This helper is loaded using the following code:</p>
-<code>$this->load->helper('number');</code>
-
-<p>The following functions are available:</p>
-
-
-<h2>byte_format()</h2>
-
-<p>Formats a numbers as bytes, based on size, and adds the appropriate suffix. Examples:</p>
-
-<code>
-echo byte_format(456); // Returns 456 Bytes<br />
-echo byte_format(4567); // Returns 4.5 KB<br />
-echo byte_format(45678); // Returns 44.6 KB<br />
-echo byte_format(456789); // Returns 447.8 KB<br />
-echo byte_format(3456789); // Returns 3.3 MB<br />
-echo byte_format(12345678912345); // Returns 1.8 GB<br />
-echo byte_format(123456789123456789); // Returns 11,228.3 TB
-</code>
-
-<p>An optional second parameter allows you to set the precision of the result.</p>
-
-<code>
-echo byte_format(45678, 2); // Returns 44.61 KB
-</code>
-
-<p class="important">
-<strong>Note:</strong>
-The text generated by this function is found in the following language file: language/<your_lang>/number_lang.php
-</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="inflector_helper.html">Inflector Helper</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="path_helper.html">Path Helper</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/helpers/path_helper.html b/user_guide/helpers/path_helper.html
deleted file mode 100644
index 00f4aa2ec..000000000
--- a/user_guide/helpers/path_helper.html
+++ /dev/null
@@ -1,106 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Path Helper : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Path Helper
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Path Helper</h1>
-
-<p>The Path Helper file contains functions that permits you to work with file paths on the server.</p>
-
-
-<h2>Loading this Helper</h2>
-
-<p>This helper is loaded using the following code:</p>
-<code>$this->load->helper('path');</code>
-
-<p>The following functions are available:</p>
-
-
-<h2>set_realpath()</h2>
-
-<p>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.</p>
-
-<code>$directory = '/etc/passwd';<br />
-echo set_realpath($directory);<br />
-// returns &quot;/etc/passwd&quot;<br />
-<br />
-$non_existent_directory = '/path/to/nowhere';<br />
-echo set_realpath($non_existent_directory, TRUE);<br />
-// returns an <strong>error</strong>, as the path could not be resolved
-<br /><br />
-echo set_realpath($non_existent_directory, FALSE);<br />
-// returns &quot;/path/to/nowhere&quot;
-
-
-
-</code>
-<h2>&nbsp;</h2>
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="number_helper.html">Number Helper</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="security_helper.html">Security Helper</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html
deleted file mode 100644
index 16d5c51f2..000000000
--- a/user_guide/helpers/security_helper.html
+++ /dev/null
@@ -1,132 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Security Helper : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Security Helper
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Security Helper</h1>
-
-<p>The Security Helper file contains security related functions.</p>
-
-
-<h2>Loading this Helper</h2>
-
-<p>This helper is loaded using the following code:</p>
-<code>$this->load->helper('security');</code>
-
-<p>The following functions are available:</p>
-
-
-<h2>xss_clean()</h2>
-
-<p>Provides Cross Site Script Hack filtering. This function is an alias to the one in the
-<a href="../libraries/input.html">Input class</a>. More info can be found there.</p>
-
-
-<h2>sanitize_filename()</h2>
-
-<p>Provides protection against directory traversal. This function is an alias to the one in the
-<a href="../libraries/security.html">Security class</a>. More info can be found there.</p>
-
-
-<h2>do_hash()</h2>
-
-<p>Permits you to create SHA1 or MD5 one way hashes suitable for encrypting passwords. Will create SHA1 by default. Examples:</p>
-
-<code>
-$str = do_hash($str); // SHA1<br />
-<br />
-$str = do_hash($str, 'md5'); // MD5
-</code>
-
-<p class="important"><strong>Note:</strong> This function was formerly named <kbd>dohash()</kbd>, which has been deprecated in favour of <kbd>do_hash()</kbd>.</p>
-
-
-
-<h2>strip_image_tags()</h2>
-
-<p>This is a security function that will strip image tags from a string. It leaves the image URL as plain text.</p>
-
-<code>$string = strip_image_tags($string);</code>
-
-
-<h2>encode_php_tags()</h2>
-
-<p>This is a security function that converts PHP tags to entities. Note: If you use the XSS filtering function it does this automatically.</p>
-
-<code>$string = encode_php_tags($string);</code>
-
-
-
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="path_helper.html"> Path Helper</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="smiley_helper.html">Smiley Helper</a></p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html
deleted file mode 100644
index 8bdd1df2c..000000000
--- a/user_guide/helpers/smiley_helper.html
+++ /dev/null
@@ -1,215 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Smiley Helper : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Smiley Helper
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Smiley Helper</h1>
-
-<p>The Smiley Helper file contains functions that let you manage smileys (emoticons).</p>
-
-
-<h2>Loading this Helper</h2>
-
-<p>This helper is loaded using the following code:</p>
-<code>$this->load->helper('smiley');</code>
-
-<h2>Overview</h2>
-
-<p>The Smiley helper has a renderer that takes plain text simileys, like <dfn>:-)</dfn> and turns
-them into a image representation, like <img src="../images/smile.gif" width="19" height="19" border="0" alt="smile!" /></p>
-
-<p>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.</p>
-
-
-
-<h2>Clickable Smileys Tutorial</h2>
-
-<p>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.</p>
-
-<p class="important"><strong>Important:</strong> Before you begin, please <a href="http://codeigniter.com/download_files/smileys.zip">download the smiley images</a> and put them in
-a publicly accessible place on your server. This helper also assumes you have the smiley replacement array located at
-<dfn>application/config/smileys.php</dfn></p>
-
-
-<h3>The Controller</h3>
-
-<p>In your <dfn>application/controllers/</dfn> folder, create a file called <kbd>smileys.php</kbd> and place the code below in it.</p>
-
-<p><strong>Important:</strong> Change the URL in the <dfn>get_clickable_smileys()</dfn> function below so that it points to
-your <dfn>smiley</dfn> folder.</p>
-
-<p>You'll notice that in addition to the smiley helper we are using the <a href="../libraries/table.html">Table Class</a>.</p>
-
-<textarea class="textarea" style="width:100%" cols="50" rows="25">
-&lt;?php
-
-class Smileys extends CI_Controller {
-
- function __construct()
- {
- parent::__construct();
- }
-
- 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);
- }
-
-}
-?&gt;
-</textarea>
-
-<p>In your <dfn>application/views/</dfn> folder, create a file called <kbd>smiley_view.php</kbd> and place this code in it:</p>
-
-<textarea class="textarea" style="width:100%" cols="50" rows="20">
-&lt;html>
-&lt;head>
-&lt;title>Smileys&lt;/title>
-
-&lt;?php echo smiley_js(); ?>
-
-&lt;/head>
-&lt;body>
-
-&lt;form name="blog">
-&lt;textarea name="comments" id="comments" cols="40" rows="4">&lt;/textarea>
-&lt;/form>
-
-&lt;p>Click to insert a smiley!&lt;/p>
-
-&lt;?php echo $smiley_table; ?>
-
-&lt;/body>
-&lt;/html>
-</textarea>
-
-
-<p>When you have created the above controller and view, load it by visiting <dfn>http://www.example.com/index.php/smileys/</dfn></p>
-
-
-<h3>Field Aliases</h3>
-
-<p>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.</p>
-<code>$image_array = get_smiley_links("http://example.com/images/smileys/", "comment_textarea_alias");</code>
-
-<p>To map the alias to the field id, pass them both into the smiley_js function:</p>
-<code>$image_array = smiley_js("comment_textarea_alias", "comments");</code>
-
-
-<h1>Function Reference</h1>
-
-<h2>get_clickable_smileys()</h2>
-
-<p>Returns an array containing your smiley images wrapped in a clickable link. You must supply the URL to your smiley folder
-and a field id or field alias.</p>
-
-<code>$image_array = get_smiley_links("http://example.com/images/smileys/", "comment");</code>
-<p class="important">Note: Usage of this function without the second parameter, in combination with js_insert_smiley has been deprecated.</p>
-
-
-<h2>smiley_js()</h2>
-
-<p>Generates the JavaScript that allows the images to be clicked and inserted into a form field.
-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 &lt;head&gt; area of your web page.</p>
-
-<code>&lt;?php echo smiley_js(); ?&gt;</code>
-<p class="important">Note: This function replaces js_insert_smiley, which has been deprecated.</p>
-
-
-<h2>parse_smileys()</h2>
-
-<p>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:</p>
-
-<code>
-$str = 'Here are some simileys: :-) ;-)';
-
-$str = parse_smileys($str, "http://example.com/images/smileys/");
-
-echo $str;
-</code>
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="security_helper.html">Security Helper</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="string_helper.html">String Helper</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html
deleted file mode 100644
index 3d7ba1c51..000000000
--- a/user_guide/helpers/string_helper.html
+++ /dev/null
@@ -1,189 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>String Helper : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-String Helper
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>String Helper</h1>
-
-<p>The String Helper file contains functions that assist in working with strings.</p>
-
-
-<h2>Loading this Helper</h2>
-
-<p>This helper is loaded using the following code:</p>
-<code>$this->load->helper('string');</code>
-
-<p>The following functions are available:</p>
-
-<h2>random_string()</h2>
-
-<p>Generates a random string based on the type and length you specify. Useful for creating passwords or generating random hashes.</p>
-
-<p>The first parameter specifies the type of string, the second parameter specifies the length. The following choices are available:</p>
-
- alpha, alunum, numeric, nozero, unique, md5, encrypt and sha1
-<ul>
- <li><strong>alpha</strong>:&nbsp; A string with lower and uppercase letters only.</li>
- <li><strong>alnum</strong>:&nbsp; Alpha-numeric string with lower and uppercase characters.</li>
- <li><strong>numeric</strong>:&nbsp; Numeric string.</li>
- <li><strong>nozero</strong>:&nbsp; Numeric string with no zeros.</li>
- <li><strong>unique</strong>:&nbsp; Encrypted with MD5 and uniqid(). Note: The length parameter is not available for this type.
- Returns a fixed length 32 character string.</li>
- <li><strong>sha1</strong>:&nbsp; An encrypted random number based on <kbd>do_hash()</kbd> from the <a href="security_helper.html">security helper</a>.</li>
-</ul>
-
-<p>Usage example:</p>
-
-<code>echo random_string('alnum', 16);</code>
-
-
-<h2>increment_string()</h2>
-
-<p>Increments a string by appending a number to it or increasing the number. Useful for creating "copies" or a file or duplicating database content which has unique titles or slugs.</p>
-
-<p>Usage example:</p>
-
-<code>echo increment_string('file', '_'); // "file_1"<br/>
-echo increment_string('file', '-', 2); // "file-2"<br/>
-echo increment_string('file-4'); // "file-5"<br/></code>
-
-
-<h2>alternator()</h2>
-
-<p>Allows two or more items to be alternated between, when cycling through a loop. Example:</p>
-
-<code>for ($i = 0; $i < 10; $i++)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo alternator('string one', 'string two');<br />
-}<br />
-</code>
-
-<p>You can add as many parameters as you want, and with each iteration of your loop the next item will be returned.</p>
-
-<code>for ($i = 0; $i < 10; $i++)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo alternator('one', 'two', 'three', 'four', 'five');<br />
-}<br />
-</code>
-
-<p><strong>Note:</strong> To use multiple separate calls to this function simply call the function with no arguments to re-initialize.</p>
-
-
-
-<h2>repeater()</h2>
-<p>Generates repeating copies of the data you submit. Example:</p>
-<code>$string = "\n";<br />
-echo repeater($string, 30);</code>
-
-<p>The above would generate 30 newlines.</p>
-<h2>reduce_double_slashes()</h2>
-<p>Converts double slashes in a string to a single slash, except those found in http://. Example: </p>
-<code>$string = &quot;http://example.com//index.php&quot;;<br />
-echo reduce_double_slashes($string); // results in &quot;http://example.com/index.php&quot;</code>
-<h2>trim_slashes()</h2>
-<p>Removes any leading/trailing slashes from a string. Example:<br />
- <br />
- <code>$string = &quot;/this/that/theother/&quot;;<br />
-echo trim_slashes($string); // results in this/that/theother</code></p>
-
-
-<h2>reduce_multiples()</h2>
-<p>Reduces multiple instances of a particular character occuring directly after each other. Example:</p>
-<code>
-$string="Fred, Bill,, Joe, Jimmy";<br />
-$string=reduce_multiples($string,","); //results in "Fred, Bill, Joe, Jimmy"
-</code>
-<p>The function accepts the following parameters:
-<code>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)</code>
-
-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:
-
-<code>
-$string=",Fred, Bill,, Joe, Jimmy,";<br />
-$string=reduce_multiples($string, ", ", TRUE); //results in "Fred, Bill, Joe, Jimmy"
-</code>
-</p>
-
-<h2>quotes_to_entities()</h2>
-<p>Converts single and double quotes in a string to the corresponding HTML entities. Example:</p>
-<code>$string="Joe's \"dinner\"";<br />
-$string=quotes_to_entities($string); //results in "Joe&amp;#39;s &amp;quot;dinner&amp;quot;"
-</code>
-
-<h2>strip_quotes()</h2>
-<p>Removes single and double quotes from a string. Example:</p>
-<code>$string="Joe's \"dinner\"";<br />
-$string=strip_quotes($string); //results in "Joes dinner"
-</code>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="smiley_helper.html">Smiley Helper</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="text_helper.html">Text Helper</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html
deleted file mode 100644
index 9f0d22ffc..000000000
--- a/user_guide/helpers/text_helper.html
+++ /dev/null
@@ -1,211 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Text Helper : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Text Helper
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Text Helper</h1>
-
-<p>The Text Helper file contains functions that assist in working with text.</p>
-
-
-<h2>Loading this Helper</h2>
-
-<p>This helper is loaded using the following code:</p>
-<code>$this->load->helper('text');</code>
-
-<p>The following functions are available:</p>
-
-
-<h2>word_limiter()</h2>
-
-<p>Truncates a string to the number of <strong>words</strong> specified. Example:</p>
-
-<code>
-$string = "Here is a nice text string consisting of eleven words.";<br />
-<br />
-$string = word_limiter($string, 4);<br /><br />
-
-// Returns: Here is a nice&#8230;
-</code>
-
-<p>The third parameter is an optional suffix added to the string. By default it adds an ellipsis.</p>
-
-
-<h2>character_limiter()</h2>
-
-<p>Truncates a string to the number of <strong>characters</strong> specified. It maintains the integrity
-of words so the character count may be slightly more or less then what you specify. Example:</p>
-
-<code>
-$string = "Here is a nice text string consisting of eleven words.";<br />
-<br />
-$string = character_limiter($string, 20);<br /><br />
-
-// Returns: Here is a nice text string&#8230;
-</code>
-
-<p>The third parameter is an optional suffix added to the string, if undeclared this helper uses an ellipsis.</p>
-
-
-
-<h2>ascii_to_entities()</h2>
-
-<p>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:</p>
-
-<code>$string = ascii_to_entities($string);</code>
-
-
-<h2>entities_to_ascii()</h2>
-
-<p>This function does the opposite of the previous one; it turns character entities back into ASCII.</p>
-
-<h2>convert_accented_characters()</h2>
-
-<p>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.</p>
-
-<code>$string = convert_accented_characters($string);</code>
-
-<p>This function uses a companion config file <dfn>application/config/foreign_chars.php</dfn> to define the to and from array for transliteration.</p>
-
-<h2>word_censor()</h2>
-
-<p>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:</p>
-
-<code>
-$disallowed = array('darn', 'shucks', 'golly', 'phooey');<br />
-<br />
-$string = word_censor($string, $disallowed, 'Beep!');</code>
-
-
-<h2>highlight_code()</h2>
-
-<p>Colorizes a string of code (PHP, HTML, etc.). Example:</p>
-
-<code>$string = highlight_code($string);</code>
-
-<p>The function uses PHP's highlight_string() function, so the colors used are the ones specified in your php.ini file.</p>
-
-
-<h2>highlight_phrase()</h2>
-
-<p>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:</p>
-
-<code>
-$string = "Here is a nice text string about nothing in particular.";<br />
-<br />
-$string = highlight_phrase($string, "nice text", '&lt;span style="color:#990000">', '&lt;/span>');
-</code>
-
-<p>The above text returns:</p>
-
-<p>Here is a <span style="color:#990000">nice text</span> string about nothing in particular.</p>
-
-
-
-<h2>word_wrap()</h2>
-
-<p>Wraps text at the specified <strong>character</strong> count while maintaining complete words. Example:</p>
-
-<code>$string = "Here is a simple string of text that will help us demonstrate this function.";<br />
-<br />
-echo word_wrap($string, 25);<br />
-<br />
-// Would produce:<br />
-<br />
-Here is a simple string<br />
-of text that will help<br />
-us demonstrate this<br />
-function</code>
-
-<h2>ellipsize()</h2>
-
-<p>This function will strip tags from a string, split it at a defined maximum length, and insert an ellipsis.</p>
-<p>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.</p>
-<p>An optional forth parameter is the kind of ellipsis. By default, <samp>&amp;hellip;</samp> will be inserted.</p>
-
-<code>$str = 'this_string_is_entirely_too_long_and_might_break_my_design.jpg';<br />
-<br />
-echo ellipsize($str, 32, .5);</code>
-
-Produces:
-
-<code>this_string_is_e&hellip;ak_my_design.jpg</code>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="string_helper.html">String Helper</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="typography_helper.html">Typography Helper</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html
deleted file mode 100644
index a6bd809a5..000000000
--- a/user_guide/helpers/typography_helper.html
+++ /dev/null
@@ -1,112 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Typography Helper : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Typography Helper
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Typography Helper</h1>
-
-<p>The Typography Helper file contains functions that help your format text in semantically relevant ways.</p>
-
-
-<h2>Loading this Helper</h2>
-
-<p>This helper is loaded using the following code:</p>
-<code>$this->load->helper('typography');</code>
-
-<p>The following functions are available:</p>
-
-
-<h2>auto_typography()</h2>
-
-<p>Formats text so that it is semantically and typographically correct HTML. Please see the <a href="../libraries/typography.html">Typography Class</a> for more info.</p>
-
-<p>Usage example:</p>
-
-<code>$string = auto_typography($string);</code>
-
-<p><strong>Note:</strong> 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
-<a href="../general/caching.html">caching</a> your pages.</p>
-
-
-<h2>nl2br_except_pre()</h2>
-
-<p>Converts newlines to &lt;br /&gt; tags unless they appear within &lt;pre&gt; tags.
-This function is identical to the native PHP <dfn>nl2br()</dfn> function, except that it ignores &lt;pre&gt; tags.</p>
-
-<p>Usage example:</p>
-
-<code>$string = nl2br_except_pre($string);</code>
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="text_helper.html">Text Helper</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="url_helper.html">URL Helper</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html
deleted file mode 100644
index 76ec32ab2..000000000
--- a/user_guide/helpers/url_helper.html
+++ /dev/null
@@ -1,302 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>URL Helper : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-URL Helper
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>URL Helper</h1>
-
-<p>The URL Helper file contains functions that assist in working with URLs.</p>
-
-
-<h2>Loading this Helper</h2>
-
-<p>This helper is loaded using the following code:</p>
-<code>$this->load->helper('url');</code>
-
-<p>The following functions are available:</p>
-
-<h2>site_url()</h2>
-
-<p>Returns your site URL, as specified in your config file. The index.php file (or whatever you have set as your
-site <dfn>index_page</dfn> in your config file) will be added to the URL, as will any URI segments you pass to the function, and the <dfn>url_suffix</dfn> as set in your config file.</p>
-
-<p>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.</p>
-
-<p>Segments can be optionally passed to the function as a string or an array. Here is a string example:</p>
-
-<code>echo site_url("news/local/123");</code>
-
-<p>The above example would return something like: http://example.com/index.php/news/local/123</p>
-
-<p>Here is an example of segments passed as an array:</p>
-
-<code>
-$segments = array('news', 'local', '123');<br />
-<br />
-echo site_url($segments);</code>
-
-
-<h2>base_url()</h2>
-<p>Returns your site base URL, as specified in your config file. Example:</p>
-<code>echo base_url();</code>
-
-<p>This function returns the same thing as site_url, without the <dfn>index_page</dfn> or <dfn>url_suffix</dfn> being appended.</p>
-
-<p>Also like site_url, you can supply segments as a string or an array. Here is a string example:</p>
-
-<code>echo base_url("blog/post/123");</code>
-
-<p>The above example would return something like: http://example.com/blog/post/123</p>
-
-<p>This is useful because unlike site_url(), you can supply a string to a file, such as an image or stylesheet. For example:</p>
-
-<code>echo base_url("images/icons/edit.png");</code>
-
-<p>This would give you something like: http://example.com/images/icons/edit.png</p>
-
-
-<h2>current_url()</h2>
-<p>Returns the full URL (including segments) of the page being currently viewed.</p>
-
-
-<h2>uri_string()</h2>
-<p>Returns the URI segments of any page that contains this function. For example, if your URL was this:</p>
-<code>http://some-site.com/blog/comments/123</code>
-
-<p>The function would return:</p>
-<code>/blog/comments/123</code>
-
-
-<h2>index_page()</h2>
-<p>Returns your site "index" page, as specified in your config file. Example:</p>
-<code>echo index_page();</code>
-
-
-
-<h2>anchor()</h2>
-
-<p>Creates a standard HTML anchor link based on your local site URL:</p>
-
-<code>&lt;a href="http://example.com">Click Here&lt;/a></code>
-
-<p>The tag has three optional parameters:</p>
-
-<code>anchor(<var>uri segments</var>, <var>text</var>, <var>attributes</var>)</code>
-
-<p>The first parameter can contain any segments you wish appended to the URL. As with the <dfn>site_url()</dfn> function above,
-segments can be a string or an array.</p>
-
-<p><strong>Note:</strong>&nbsp; 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.</p>
-
-<p>The second segment is the text you would like the link to say. If you leave it blank, the URL will be used.</p>
-
-<p>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.</p>
-
-<p>Here are some examples:</p>
-
-<code>echo anchor('news/local/123', 'My News', 'title="News title"');</code>
-
-<p>Would produce: &lt;a href="http://example.com/index.php/news/local/123" title="News title">My News&lt;/a></p>
-
-<code>echo anchor('news/local/123', 'My News', array('title' => 'The best news!'));</code>
-
-<p>Would produce: &lt;a href="http://example.com/index.php/news/local/123" title="The best news!">My News&lt;/a></p>
-
-
-<h2>anchor_popup()</h2>
-
-<p>Nearly identical to the <dfn>anchor()</dfn> 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:</p>
-
-<code>
-
-$atts = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'width'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '800',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'height'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '600',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'scrollbars' => 'yes',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'status'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> 'yes',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'resizable'&nbsp;&nbsp;=> 'yes',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'screenx'&nbsp;&nbsp;&nbsp;&nbsp;=> '0',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'screeny'&nbsp;&nbsp;&nbsp;&nbsp;=> '0'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-echo anchor_popup('news/local/123', 'Click Me!', $atts);</code>
-
-<p>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:</p>
-
-<code>echo anchor_popup('news/local/123', 'Click Me!', array());</code>
-
-
-<h2>mailto()</h2>
-
-<p>Creates a standard HTML email link. Usage example:</p>
-
-<code>echo mailto('me@my-site.com', 'Click Here to Contact Me');</code>
-
-<p>As with the <dfn>anchor()</dfn> tab above, you can set attributes using the third parameter.</p>
-
-
-<h2>safe_mailto()</h2>
-
-<p>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.</p>
-
-
-<h2>auto_link()</h2>
-
-<p>Automatically turns URLs and email addresses contained in a string into links. Example:</p>
-
-<code>$string = auto_link($string);</code>
-
-<p>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.</p>
-
-<p>Converts only URLs:</p>
-<code>$string = auto_link($string, 'url');</code>
-
-<p>Converts only Email addresses:</p>
-<code>$string = auto_link($string, 'email');</code>
-
-<p>The third parameter determines whether links are shown in a new window. The value can be TRUE or FALSE (boolean):</p>
-<code>$string = auto_link($string, 'both', TRUE);</code>
-
-
-<h2>url_title()</h2>
-<p>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:</p>
-
-<code>$title = "What's wrong with CSS?";<br />
-<br />
-$url_title = url_title($title);<br />
-<br />
-// Produces: Whats-wrong-with-CSS
-</code>
-
-
-<p>The second parameter determines the word delimiter. By default dashes are used. Options are: <dfn>dash</dfn>, or <dfn>underscore</dfn>:</p>
-
-<code>$title = "What's wrong with CSS?";<br />
-<br />
-$url_title = url_title($title, 'underscore');<br />
-<br />
-// Produces: Whats_wrong_with_CSS
-</code>
-
-<p>The third parameter determines whether or not lowercase characters are forced. By default they are not. Options are boolean <dfn>TRUE</dfn>/<dfn>FALSE</dfn>:</p>
-
-<code>$title = "What's wrong with CSS?";<br />
-<br />
-$url_title = url_title($title, 'underscore', TRUE);<br />
-<br />
-// Produces: whats_wrong_with_css
-</code>
-
-<h3>prep_url()</h3>
-<p>This function will add <kbd>http://</kbd> in the event that a scheme is missing from a URL. Pass the URL string to the function like this:</p>
-<code>
-$url = "example.com";<br /><br />
-$url = prep_url($url);</code>
-
-
-
-
-<h2>redirect()</h2>
-
-<p>Does a "header redirect" to the URI specified. If you specify the full site URL that link will be build, but for local links simply providing the URI segments
-to the controller you want to direct to will create the link. The function will build the URL based on your config file values.</p>
-
-<p>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 <em>only</em> available with 'location' redirects, and not 'refresh'. Examples:</p>
-
-<code>if ($logged_in == FALSE)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;redirect('/login/form/', 'refresh');<br />
-}<br />
-<br />
-// with 301 redirect<br />
-redirect('/article/13', 'location', 301);</code>
-
-<p class="important"><strong>Note:</strong> In order for this function to work it must be used before anything is outputted
-to the browser since it utilizes server headers.<br />
-<strong>Note:</strong> For very fine grained control over headers, you should use the <a href="../libraries/output.html">Output Library</a>'s set_header() function.</p>
-
-
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="typography_helper.html">Typography Helper</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="xml_helper.html">XML Helper</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html
deleted file mode 100644
index f410b2114..000000000
--- a/user_guide/helpers/xml_helper.html
+++ /dev/null
@@ -1,105 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>XML Helper : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-XML Helper
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>XML Helper</h1>
-
-<p>The XML Helper file contains functions that assist in working with XML data.</p>
-
-
-<h2>Loading this Helper</h2>
-
-<p>This helper is loaded using the following code:</p>
-<code>$this->load->helper('xml');</code>
-
-<p>The following functions are available:</p>
-
-<h2>xml_convert('<var>string</var>')</h2>
-
-<p>Takes a string as input and converts the following reserved XML characters to entities:</p>
-
-<p>
-Ampersands: &amp;<br />
-Less then and greater than characters: &lt; &gt;<br />
-Single and double quotes: ' &nbsp;"<br />
-Dashes: -</p>
-
-<p>This function ignores ampersands if they are part of existing character entities. Example:</p>
-
-<code>$string = xml_convert($string);</code>
-
-
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="url_helper.html">URL Helper</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/images/appflowchart.gif b/user_guide/images/appflowchart.gif
deleted file mode 100644
index 4328e48fe..000000000
--- a/user_guide/images/appflowchart.gif
+++ /dev/null
Binary files differ
diff --git a/user_guide/images/codeigniter_1.7.1_helper_reference.pdf b/user_guide/images/codeigniter_1.7.1_helper_reference.pdf
deleted file mode 100644
index 85af7c83b..000000000
--- a/user_guide/images/codeigniter_1.7.1_helper_reference.pdf
+++ /dev/null
Binary files differ
diff --git a/user_guide/images/codeigniter_1.7.1_library_reference.png b/user_guide/images/codeigniter_1.7.1_library_reference.png
deleted file mode 100644
index 7f054f95f..000000000
--- a/user_guide/images/codeigniter_1.7.1_library_reference.png
+++ /dev/null
Binary files differ
diff --git a/user_guide/images/nav_bg_darker.jpg b/user_guide/images/nav_bg_darker.jpg
deleted file mode 100644
index 816efad6a..000000000
--- a/user_guide/images/nav_bg_darker.jpg
+++ /dev/null
Binary files differ
diff --git a/user_guide/images/nav_separator_darker.jpg b/user_guide/images/nav_separator_darker.jpg
deleted file mode 100644
index a09bd5a6a..000000000
--- a/user_guide/images/nav_separator_darker.jpg
+++ /dev/null
Binary files differ
diff --git a/user_guide/images/nav_toggle_darker.jpg b/user_guide/images/nav_toggle_darker.jpg
deleted file mode 100644
index eff33de4f..000000000
--- a/user_guide/images/nav_toggle_darker.jpg
+++ /dev/null
Binary files differ
diff --git a/user_guide/images/reactor-bullet.png b/user_guide/images/reactor-bullet.png
deleted file mode 100755
index 89c8129a4..000000000
--- a/user_guide/images/reactor-bullet.png
+++ /dev/null
Binary files differ
diff --git a/user_guide/images/transparent.gif b/user_guide/images/transparent.gif
deleted file mode 100644
index b7406476a..000000000
--- a/user_guide/images/transparent.gif
+++ /dev/null
Binary files differ
diff --git a/user_guide/index.html b/user_guide/index.html
deleted file mode 100644
index fa90983e1..000000000
--- a/user_guide/index.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Welcome to CodeIgniter : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='userguide.css' />
-
-<script type="text/javascript" src="nav/nav.js"></script>
-<script type="text/javascript" src="nav/prototype.lite.js"></script>
-<script type="text/javascript" src="nav/moo.fx.js"></script>
-<script type="text/javascript" src="nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('null');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp; CodeIgniter User Guide
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-
-
-
-<br clear="all" />
-
-<div class="center"><img src="images/ci_logo_flame.jpg" width="150" height="164" border="0" alt="CodeIgniter" /></div>
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-
-<h2>Welcome to CodeIgniter</h2>
-
-<p>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.</p>
-
-
-<h2>Who is CodeIgniter For?</h2>
-
-<p>CodeIgniter is right for you if:</p>
-
-<ul>
-<li>You want a framework with a small footprint.</li>
-<li>You need exceptional performance.</li>
-<li>You need broad compatibility with standard hosting accounts that run a variety of PHP versions and configurations.</li>
-<li>You want a framework that requires nearly zero configuration.</li>
-<li>You want a framework that does not require you to use the command line.</li>
-<li>You want a framework that does not require you to adhere to restrictive coding rules.</li>
-<li>You do not want to be forced to learn a templating language (although a template parser is optionally available if you desire one).</li>
-<li>You eschew complexity, favoring simple solutions.</li>
-<li>You need clear, thorough documentation.</li>
-</ul>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p><a href="#top">Top of Page</a></p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html
deleted file mode 100644
index 14c65edd0..000000000
--- a/user_guide/installation/downloads.html
+++ /dev/null
@@ -1,115 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Downloading CodeIgniter : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Downloading CodeIgniter
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Downloading CodeIgniter</h1>
-
-<ul>
- <li><a href="http://codeigniter.com/downloads/">CodeIgniter V 2.1.0 (Current version)</a></li>
- <li><a href="http://codeigniter.com/download_files/reactor/CodeIgniter_2.0.3.zip">CodeIgniter V 2.0.3</a></li>
- <li><a href="http://codeigniter.com/download_files/reactor/CodeIgniter_2.0.2.zip">CodeIgniter V 2.0.2</a></li>
- <li><a href="http://codeigniter.com/download_files/reactor/CodeIgniter_2.0.1.zip">CodeIgniter V 2.0.1</a></li>
- <li><a href="http://codeigniter.com/download_files/reactor/CodeIgniter_2.0.0.zip">CodeIgniter V 2.0.0</a></li>
- <li><a href="http://codeigniter.com/download_files/CodeIgniter_1.7.3.zip">CodeIgniter V 1.7.3</a></li>
- <li><a href="http://codeigniter.com/download_files/CodeIgniter_1.7.2.zip">CodeIgniter V 1.7.2</a></li>
- <li><a href="http://codeigniter.com/download_files/CodeIgniter_1.7.1.zip">CodeIgniter V 1.7.1</a></li>
- <li><a href="http://codeigniter.com/download_files/CodeIgniter_1.7.0.zip">CodeIgniter V 1.7.0</a></li>
- <li><a href="http://codeigniter.com/download_files/CodeIgniter_1.6.3.zip">CodeIgniter V 1.6.3</a></li>
- <li><a href="http://codeigniter.com/download_files/CodeIgniter_1.6.2.zip">CodeIgniter V 1.6.2</a></li>
- <li><a href="http://codeigniter.com/download_files/CodeIgniter_1.6.1.zip">CodeIgniter V 1.6.1</a></li>
- <li><a href="http://codeigniter.com/download_files/CodeIgniter_1.6.0.zip">CodeIgniter V 1.6.0</a></li>
- <li><a href="http://codeigniter.com/download_files/CodeIgniter_1.5.4.zip">CodeIgniter V 1.5.4</a></li>
- <li><a href="http://codeigniter.com/download_files/CodeIgniter_1.5.3.zip">CodeIgniter V 1.5.3</a></li>
- <li><a href="http://codeigniter.com/download_files/CodeIgniter_1.5.2.zip">CodeIgniter V 1.5.2</a></li>
- <li><a href="http://codeigniter.com/download_files/CodeIgniter_1.5.1.zip">CodeIgniter V 1.5.1</a></li>
- <li><a href="http://codeigniter.com/download_files/CodeIgniter_1.4.1.zip">CodeIgniter V 1.4.1</a></li>
- <li><a href="http://codeigniter.com/download_files/CodeIgniter_1.3.3.zip">CodeIgniter V 1.3.3</a></li>
- <li><a href="http://codeigniter.com/download_files/CodeIgniter_1.3.2.zip">CodeIgniter V 1.3.2</a></li>
- <li><a href="http://codeigniter.com/download_files/CodeIgniter_1.3.1.zip">CodeIgniter V 1.3.1</a></li>
- <li><a href="http://codeigniter.com/download_files/CodeIgniter_1.3.zip">CodeIgniter V 1.3</a></li>
- <li><a href="http://codeigniter.com/download_files/CodeIgniter_1.2.zip">CodeIgniter V 1.2</a></li>
- <li><a href="http://codeigniter.com/download_files/CodeIgniter_1.1b.zip">CodeIgniter V 1.1</a></li>
- <li><a href="http://codeigniter.com/download_files/CodeIgniter_1.0b.zip">CodeIgniter V 1.0</a></li>
-</ul>
-
-
-
-
-<h1 id="git">Git Server</h1>
-<p><a href="http://git-scm.com/about">Git</a> is a distributed version control system.</p>
-
- <p>Public Git access is available at <a href="https://github.com/EllisLab/CodeIgniter">GitHub</a>.
- 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.</p>
-
- <p>Beginning with version 2.0.3, stable tags are also available via GitHub, simply select the version from the Tags dropdown.</p>
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="../general/credits.html">Credits</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="../installation/index.html">Installation Instructions</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html
deleted file mode 100644
index f01c8b8d5..000000000
--- a/user_guide/installation/index.html
+++ /dev/null
@@ -1,108 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Installation Instructions : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Installation Instructions
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Installation Instructions</h1>
-
-<p>CodeIgniter is installed in four steps:</p>
-
-<ol>
-<li>Unzip the package.</li>
-<li>Upload the CodeIgniter folders and files to your server. Normally the index.php file will be at your root.</li>
-<li>Open the <dfn>application/config/config.php</dfn> file with a text editor and set your base URL. If you intend to use encryption or sessions, set your encryption key.</li>
-<li>If you intend to use a database, open the <dfn>application/config/database.php</dfn> file with a text editor and set your database settings.</li>
-</ol>
-
-<p>If you wish to increase security by hiding the location of your CodeIgniter files you can rename the <dfn>system</dfn> and <dfn>application</dfn> folders
-to something more private. If you do rename them, you must open your main <kbd>index.php</kbd> file and set the <samp>$system_folder</samp> and <samp>$application_folder</samp>
-variables at the top of the file with the new name you've chosen.</p>
-
-<p>For the best security, both the <dfn>system</dfn> and any <dfn>application</dfn> 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.</p>
-
-<p>After moving them, open your main <kdb>index.php</kbd> file and set the <samp>$system_folder</samp> and <samp>$application_folder</samp> variables, preferably with a full path, e.g. '<dfn>/www/MyUser/system</dfn>'.</p>
-
-<p>
- One additional measure to take in production environments is to disable
- PHP error reporting and any other development-only functionality. In CodeIgniter,
- this can be done by setting the <kbd>ENVIRONMENT</kbd> constant, which is
- more fully described on the <a href="../general/security.html">security page</a>.
-</p>
-
-<p>That's it!</p>
-
-<p>If you're new to CodeIgniter, please read the <a href="../overview/getting_started.html">Getting Started</a> section of the User Guide to begin learning how
-to build dynamic PHP applications. Enjoy!</p>
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="../general/credits.html">Credits</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="upgrading.html">Upgrading from a Previous Version</a>
-</p>
-
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html
deleted file mode 100644
index e79eb6a9f..000000000
--- a/user_guide/installation/troubleshooting.html
+++ /dev/null
@@ -1,90 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Troubleshooting : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Trouble Shooting
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Troubleshooting</h1>
-
-<p>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 <dfn>application/config/config.php</dfn> file and look for the <kbd>URI Protocol</kbd>
-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 <kbd>application/config/config.php</kbd> file and change this:</p>
-
-<code>$config['index_page'] = "index.php";</code>
-
-<p>To this:</p>
-
-<code>$config['index_page'] = "index.php?";</code>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="upgrading.html">Upgrading from a Previous Version</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="../overview/at_a_glance.html">CodeIgniter at a Glance</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html
deleted file mode 100644
index 2b3d066cd..000000000
--- a/user_guide/installation/upgrade_120.html
+++ /dev/null
@@ -1,92 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from Beta 1.1 to Final 1.2
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading From Beta 1.0 to Final 1.2</h1>
-
-<p>To upgrade to Version 1.2 please replace the following directories with the new versions:</p>
-
-<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
-
-<ul>
-<li>drivers</li>
-<li>helpers</li>
-<li>init</li>
-<li>language</li>
-<li>libraries</li>
-<li>plugins</li>
-<li>scaffolding</li>
-</ul>
-
-<p>Please also replace your local copy of the user guide with the new version.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html
deleted file mode 100644
index dd1465617..000000000
--- a/user_guide/installation/upgrade_130.html
+++ /dev/null
@@ -1,203 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from 1.2 to 1.3
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading from 1.2 to 1.3</h1>
-
-<p class="important"><strong>Note:</strong> The instructions on this page assume you are running version 1.2. If you
-have not upgraded to that version please do so first.</p>
-
-
-<p>Before performing an update you should take your site offline by replacing the index.php file
-with a static one.</p>
-
-
-<h2>Step 1: Update your CodeIgniter files</h2>
-
-<p>Replace the following directories in your "system" folder with the new versions:</p>
-
-<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
-
-<ul>
-<li>application/<strong>models</strong>/&nbsp;&nbsp; (new for 1.3)</li>
-<li>codeigniter&nbsp;&nbsp; (new for 1.3)</li>
-<li>drivers</li>
-<li>helpers</li>
-<li>init</li>
-<li>language</li>
-<li>libraries</li>
-<li>plugins</li>
-<li>scaffolding</li>
-</ul>
-
-
-<h2>Step 2: Update your error files</h2>
-
-<p>Version 1.3 contains two new error templates located in <dfn>application/errors</dfn>, and for naming consistency the other error templates have
-been renamed.</p>
-
-<p>If you <strong>have not</strong> customized any of the error templates simply
-replace this folder:</p>
-
-<ul>
-<li>application/errors/</li>
-</ul>
-
-<p>If you <strong>have</strong> customized your error templates, rename them as follows:</p>
-
-
-<ul>
-<li>404.php&nbsp;&nbsp; =&nbsp; error_404.php</li>
-<li>error.php&nbsp;&nbsp; =&nbsp; error_general.php</li>
-<li>error_db.php&nbsp;&nbsp; (new)</li>
-<li>error_php.php&nbsp;&nbsp; (new)</li>
-</ul>
-
-
-<h2>Step 3: Update your index.php file</h2>
-
-<p>Please open your main <dfn>index.php</dfn> file (located at your root). At the very bottom of the file, change this:</p>
-
-<code>require_once BASEPATH.'libraries/Front_controller'.EXT;</code>
-
-<p>To this:</p>
-
-<code>require_once BASEPATH.'codeigniter/CodeIgniter'.EXT;</code>
-
-
-<h2>Step 4: Update your config.php file</h2>
-
-<p>Open your <dfn>application/config/config.php</dfn> file and add these new items:</p>
-
-<pre>
-/*
-|------------------------------------------------
-| 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';
-</pre>
-
-
-<h2>Step 5: Update your database.php file</h2>
-
-<p>Open your <dfn>application/config/database.php</dfn> file and add these new items:</p>
-
-<pre>
-$db['default']['dbprefix'] = "";
-$db['default']['active_r'] = TRUE;
-</pre>
-
-
-<h2>Step 6: Update your user guide</h2>
-
-<p>Please also replace your local copy of the user guide with the new version.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html
deleted file mode 100644
index 202468dac..000000000
--- a/user_guide/installation/upgrade_131.html
+++ /dev/null
@@ -1,102 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from 1.3 to 1.3.1
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading from 1.3 to 1.3.1</h1>
-
-<p class="important"><strong>Note:</strong> The instructions on this page assume you are running version 1.3. If you
-have not upgraded to that version please do so first.</p>
-
-<p>Before performing an update you should take your site offline by replacing the index.php file with a static one.</p>
-
-
-
-<h2>Step 1: Update your CodeIgniter files</h2>
-
-<p>Replace the following directories in your "system" folder with the new versions:</p>
-
-<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
-
-<ul>
-<li>drivers</li>
-<li>init/init_unit_test.php (new for 1.3.1)</li>
-<li>language/</li>
-<li>libraries</li>
-<li>scaffolding</li>
-</ul>
-
-
-<h2>Step 2: Update your user guide</h2>
-
-<p>Please also replace your local copy of the user guide with the new version.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html
deleted file mode 100644
index 99f8fd3ab..000000000
--- a/user_guide/installation/upgrade_132.html
+++ /dev/null
@@ -1,100 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from 1.3.1 to 1.3.2
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading from 1.3.1 to 1.3.2</h1>
-
-<p class="important"><strong>Note:</strong> 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.</p>
-
-<p>Before performing an update you should take your site offline by replacing the index.php file with a static one.</p>
-
-
-
-<h2>Step 1: Update your CodeIgniter files</h2>
-
-<p>Replace the following directories in your "system" folder with the new versions:</p>
-
-<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
-
-<ul>
-<li>drivers</li>
-<li>init</li>
-<li>libraries</li>
-</ul>
-
-
-<h2>Step 2: Update your user guide</h2>
-
-<p>Please also replace your local copy of the user guide with the new version.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html
deleted file mode 100644
index b9b7a7fd3..000000000
--- a/user_guide/installation/upgrade_133.html
+++ /dev/null
@@ -1,112 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from 1.3.2 to 1.3.3
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading from 1.3.2 to 1.3.3</h1>
-
-<p class="important"><strong>Note:</strong> 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.</p>
-
-<p>Before performing an update you should take your site offline by replacing the index.php file with a static one.</p>
-
-
-
-<h2>Step 1: Update your CodeIgniter files</h2>
-
-<p>Replace the following directories in your "system" folder with the new versions:</p>
-
-<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
-
-<ul>
-<li>codeigniter</li>
-<li>drivers</li>
-<li>helpers</li>
-<li>init</li>
-<li>libraries</li>
-</ul>
-
-
-<h2>Step 2: Update your Models</h2>
-
-<p>If you are <strong>NOT</strong> using CodeIgniter's <a href="../general/models.html">Models</a> feature disregard this step.</p>
-
-<p>As of version 1.3.3, CodeIgniter does <strong>not</strong> 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,
-<a href="../general/models.html">as described here</a>.</p>
-
-
-<h2>Step 3: Update your user guide</h2>
-
-<p>Please also replace your local copy of the user guide with the new version.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html
deleted file mode 100644
index 50891b912..000000000
--- a/user_guide/installation/upgrade_140.html
+++ /dev/null
@@ -1,145 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from 1.3.3 to 1.4.0
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading from 1.3.3 to 1.4.0</h1>
-
-<p class="important"><strong>Note:</strong> 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.</p>
-
-<p>Before performing an update you should take your site offline by replacing the index.php file with a static one.</p>
-
-
-
-<h2>Step 1: Update your CodeIgniter files</h2>
-
-<p>Replace the following directories in your "system" folder with the new versions:</p>
-
-<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
-
-<ul>
-<li>application/config/<strong>hooks.php</strong></li>
-<li>application/config/<strong>mimes.php</strong></li>
-<li>codeigniter</li>
-<li>drivers</li>
-<li>helpers</li>
-<li>init</li>
-<li>language</li>
-<li>libraries</li>
-<li>scaffolding</li>
-</ul>
-
-
-<h2>Step 2: Update your config.php file</h2>
-
-<p>Open your <dfn>application/config/config.php</dfn> file and add these new items:</p>
-
-<pre>
-
-/*
-|--------------------------------------------------------------------------
-| 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~%.:_-';
-</pre>
-
-
-<h2>Step 3: Update your user guide</h2>
-
-<p>Please also replace your local copy of the user guide with the new version.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html
deleted file mode 100644
index afa8018b8..000000000
--- a/user_guide/installation/upgrade_141.html
+++ /dev/null
@@ -1,148 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from 1.4.0 to 1.4.1 </td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading from 1.4.0 to 1.4.1</h1>
-
-<p class="important"><strong>Note:</strong> 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.</p>
-
-<p>Before performing an update you should take your site offline by replacing the index.php file with a static one.</p>
-
-
-
-<h2>Step 1: Update your CodeIgniter files</h2>
-
-<p>Replace the following directories in your "system" folder with the new versions:</p>
-
-<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
-
-<ul>
-<li>codeigniter</li>
-<li>drivers</li>
-<li>helpers</li>
-<li>libraries</li>
-</ul>
-
-
-<h2>Step 2: Update your config.php file</h2>
-
-<p>Open your <dfn>application/config/config.php</dfn> file and add this new item:</p>
-
-<pre>
-
-/*
-|--------------------------------------------------------------------------
-| 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;
-
-</pre>
-
-
-
-<h2>Step 3: Rename an Autoload Item</h2>
-
-<p>Open the following file: <dfn>application/config/autoload.php</dfn></p>
-
-<p>Find this array item:</p>
-
-<code>$autoload['core'] = array();</code>
-
-<p>And rename it to this:</p>
-
-<code>$autoload['libraries'] = array();</code>
-
-<p>This change was made to improve clarity since some users were not sure that their own libraries could be auto-loaded.</p>
-
-
-
-
-
-
-<h2>Step 4: Update your user guide</h2>
-
-<p>Please also replace your local copy of the user guide with the new version.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html
deleted file mode 100644
index f910aa039..000000000
--- a/user_guide/installation/upgrade_150.html
+++ /dev/null
@@ -1,178 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from 1.4.1 to 1.5.0
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading from 1.4.1 to 1.5.0</h1>
-
-<p class="important"><strong>Note:</strong> 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.</p>
-
-<p>Before performing an update you should take your site offline by replacing the index.php file with a static one.</p>
-
-
-
-<h2>Step 1: Update your CodeIgniter files</h2>
-
-<p>Replace these files and directories in your "system" folder with the new versions:</p>
-
-<ul>
-
-<li><dfn>application/config/user_agents.php</dfn> (new file for 1.5)</li>
-<li><dfn>application/config/smileys.php</dfn> (new file for 1.5)</li>
-<li><dfn>codeigniter/</dfn></li>
-<li><dfn>database/</dfn> (new folder for 1.5. Replaces the "drivers" folder)</li>
-<li><dfn>helpers/</dfn></li>
-<li><dfn>language/</dfn></li>
-<li><dfn>libraries/</dfn></li>
-<li><dfn>scaffolding/</dfn></li>
-</ul>
-
-<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
-
-
-<h2>Step 2: Update your database.php file</h2>
-
-<p>Open your <dfn>application/config/database.php</dfn> file and add these new items:</p>
-
-<pre>
-$db['default']['cache_on'] = FALSE;
-$db['default']['cachedir'] = '';
-</pre>
-
-
-
-<h2>Step 3: Update your config.php file</h2>
-
-<p>Open your <dfn>application/config/config.php</dfn> file and <kbd>ADD</kbd> these new items:</p>
-
-<pre>
-/*
-|--------------------------------------------------------------------------
-| 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;
-</pre>
-
-<p>In that same file <kbd>REMOVE</kbd> this item:</p>
-
-
-<pre>
-/*
-|--------------------------------------------------------------------------
-| 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;
-</pre>
-
-<p>Error logging is now disabled simply by setting the threshold to zero.</p>
-
-
-
-<h2>Step 4: Update your main index.php file</h2>
-
-<p>If you are running a stock <dfn>index.php</dfn> file simply replace your version with the new one.</p>
-
-<p>If your <dfn>index.php</dfn> file has internal modifications, please add your modifications to the new file and use it.</p>
-
-
-
-<h2>Step 5: Update your user guide</h2>
-
-<p>Please also replace your local copy of the user guide with the new version.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_152.html b/user_guide/installation/upgrade_152.html
deleted file mode 100644
index 55e43f728..000000000
--- a/user_guide/installation/upgrade_152.html
+++ /dev/null
@@ -1,111 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from 1.5.0 to 1.5.2
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading from 1.5.0 to 1.5.2</h1>
-
-<p class="important"><strong>Note:</strong> 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.</p>
-
-<p>Before performing an update you should take your site offline by replacing the index.php file with a static one.</p>
-
-
-
-<h2>Step 1: Update your CodeIgniter files</h2>
-
-<p>Replace these files and directories in your "system" folder with the new versions:</p>
-
-<ul>
-
-<li><dfn>system/helpers/download_helper.php</dfn></li>
-<li><dfn>system/helpers/form_helper.php</dfn></li>
-<li><dfn>system/libraries/Table.php</dfn></li>
-<li><dfn>system/libraries/User_agent.php</dfn></li>
-<li><dfn>system/libraries/Exceptions.php</dfn></li>
-<li><dfn>system/libraries/Input.php</dfn></li>
-<li><dfn>system/libraries/Router.php</dfn></li>
-<li><dfn>system/libraries/Loader.php</dfn></li>
-<li><dfn>system/libraries/Image_lib.php</dfn></li>
-<li><dfn>system/language/english/unit_test_lang.php</dfn></li>
-<li><dfn>system/database/DB_active_rec.php</dfn></li>
-<li><dfn> system/database/drivers/mysqli/mysqli_driver.php</dfn></li>
-<li><dfn>codeigniter/</dfn></li>
-</ul>
-
-<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
-
-
-<h2>Step 2: Update your user guide</h2>
-
-<p>Please also replace your local copy of the user guide with the new version.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_153.html b/user_guide/installation/upgrade_153.html
deleted file mode 100644
index 3e6af7a38..000000000
--- a/user_guide/installation/upgrade_153.html
+++ /dev/null
@@ -1,100 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;Upgrading from 1.5.2 to 1.5.3
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading from 1.5.2 to 1.5.3</h1>
-
-<p>Before performing an update you should take your site offline by replacing the index.php file with a static one.</p>
-
-
-
-<h2>Step 1: Update your CodeIgniter files</h2>
-
-<p>Replace these files and directories in your "system" folder with the new versions:</p>
-
-<ul>
-
-<li><dfn>system/database/drivers</dfn></li>
-<li><dfn>system/helpers</dfn></li>
-<li><dfn>system/libraries/Input.php</dfn></li>
-<li><dfn>system/libraries/Loader.php</dfn></li>
-<li><dfn>system/libraries/Profiler.php</dfn></li>
-<li><dfn>system/libraries/Table.php</dfn></li>
-</ul>
-
-<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
-
-
-<h2>Step 2: Update your user guide</h2>
-
-<p>Please also replace your local copy of the user guide with the new version.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_154.html b/user_guide/installation/upgrade_154.html
deleted file mode 100644
index 627fa0896..000000000
--- a/user_guide/installation/upgrade_154.html
+++ /dev/null
@@ -1,116 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Upgrading from 1.5.3 to 1.5.4 : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from 1.5.3 to 1.5.4
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading from 1.5.3 to 1.5.4</h1>
-
-<p>Before performing an update you should take your site offline by replacing the index.php file with a static one.</p>
-
-
-
-<h2>Step 1: Update your CodeIgniter files</h2>
-
-<p>Replace these files and directories in your "system" folder with the new versions:</p>
-
-<ul>
-
-<li><dfn>application/config/mimes.php</dfn></li>
-<li><dfn>system/codeigniter</dfn></li>
-<li><dfn>system/database</dfn></li>
-<li><dfn>system/helpers</dfn></li>
-<li><dfn>system/libraries</dfn></li>
-<li><dfn>system/plugins</dfn></li>
-</ul>
-
-<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
-
-<h2>Step 2: Add charset to your config.php </h2>
-<p>Add the following to application/config/config.php</p>
-<code>/*<br />
- |--------------------------------------------------------------------------<br />
- | Default Character Set<br />
- |--------------------------------------------------------------------------<br />
- |<br />
- | This determines which character set is used by default in various methods<br />
- | that require a character set to be provided.<br />
- |<br />
- */<br />
- $config['charset'] = &quot;UTF-8&quot;;</code>
-
-<h2>Step 3: Autoloading language files </h2>
-<p>If you want to autoload any language files, add this line to application/config/autoload.php</p>
-<code>$autoload['language'] = array();</code>
-
-<h2>Step 4: Update your user guide</h2>
-<p>Please also replace your local copy of the user guide with the new version.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_160.html b/user_guide/installation/upgrade_160.html
deleted file mode 100644
index 70e589ccf..000000000
--- a/user_guide/installation/upgrade_160.html
+++ /dev/null
@@ -1,125 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Upgrading from 1.5.4 to 1.6.0 : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from 1.5.4 to 1.6.0
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading from 1.5.4 to 1.6.0</h1>
-
-<p>Before performing an update you should take your site offline by replacing the index.php file with a static one.</p>
-
-
-
-<h2>Step 1: Update your CodeIgniter files</h2>
-
-<p>Replace these files and directories in your "system" folder with the new versions:</p>
-
-<ul>
-
-<li><dfn>system/codeigniter</dfn></li>
-<li><dfn>system/database</dfn></li>
-<li><dfn>system/helpers</dfn></li>
-<li><dfn>system/libraries</dfn></li>
-<li><dfn>system/plugins</dfn></li>
-<li><dfn>system/language</dfn></li>
-</ul>
-
-<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
-
-<h2>Step 2: Add time_to_update to your config.php </h2>
-<p>Add the following to application/config/config.php with the other session configuration options</p>
-<p><code>$config['sess_time_to_update'] = 300;</code></p>
-<h2>Step 3: Add $autoload['model']</h2>
-<p>Add the following to application/config/autoload.php</p>
-<p><code> /*<br />
- | -------------------------------------------------------------------<br />
- | Auto-load Model files<br />
- | -------------------------------------------------------------------<br />
- | Prototype:<br />
- |<br />
- | $autoload['model'] = array('my_model');<br />
- |<br />
- */<br />
- <br />
- $autoload['model'] = array();</code></p>
-<h2>Step 4: Add to your database.php </h2>
-<p>Make the following changes to your application/config/database.php file:</p>
-<p>Add the following variable above the database configuration options, with <dfn>$active_group</dfn></p>
-<p><code>$active_record = TRUE;</code></p>
-<p>Remove the following from your database configuration options</p>
-<p><code>$db['default']['active_r'] = TRUE;</code></p>
-<p>Add the following to your database configuration options</p>
-<p><code>$db['default']['char_set'] = &quot;utf8&quot;;<br />
-$db['default']['dbcollat'] = &quot;utf8_general_ci&quot;;</code></p>
-
-<h2>Step 5: Update your user guide</h2>
-<p>Please also replace your local copy of the user guide with the new version.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_161.html b/user_guide/installation/upgrade_161.html
deleted file mode 100644
index 40877369d..000000000
--- a/user_guide/installation/upgrade_161.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Upgrading from 1.6.0 to 1.6.1 : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from 1.6.0 to 1.6.1
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading from 1.6.0 to 1.6.1</h1>
-
-<p>Before performing an update you should take your site offline by replacing the index.php file with a static one.</p>
-
-
-
-<h2>Step 1: Update your CodeIgniter files</h2>
-
-<p>Replace these files and directories in your "system" folder with the new versions:</p>
-
-<ul>
-
-<li><dfn>system/codeigniter</dfn></li>
-<li><dfn>system/database</dfn></li>
-<li><dfn>system/helpers</dfn></li>
-<li><dfn>system/language</dfn></li>
-<li><dfn>system/libraries</dfn></li>
-</ul>
-
-<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
-
-<h2>Step 2: Update your user guide</h2>
-<p>Please also replace your local copy of the user guide with the new version.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_162.html b/user_guide/installation/upgrade_162.html
deleted file mode 100644
index d67190842..000000000
--- a/user_guide/installation/upgrade_162.html
+++ /dev/null
@@ -1,106 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Upgrading from 1.6.1 to 1.6.2 : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from 1.6.1 to 1.6.2
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading from 1.6.1 to 1.6.2</h1>
-
-<p>Before performing an update you should take your site offline by replacing the index.php file with a static one.</p>
-
-
-
-<h2>Step 1: Update your CodeIgniter files</h2>
-
-<p>Replace these files and directories in your "system" folder with the new versions:</p>
-
-<ul>
-
-<li><dfn>system/codeigniter</dfn></li>
-<li><dfn>system/database</dfn></li>
-<li><dfn>system/helpers</dfn></li>
-<li><dfn>system/language</dfn></li>
-<li><dfn>system/libraries</dfn></li>
-</ul>
-
-<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
-
-
-<h2>Step 2: Encryption Key</h2>
-<p>If you are using sessions, open up application/config/config.php and verify you've set an encryption key.</p>
-
-<h2>Step 3: Constants File</h2>
-<p>Copy /application/config/constants.php to your installation, and modify if necessary.</p>
-<h2>Step 4: Mimes File</h2>
-<p>Replace /application/config/mimes.php with the dowloaded version. If you've added custom mime types, you'll need to re-add them.</p>
-<h2>Step 5: Update your user guide</h2>
-<p>Please also replace your local copy of the user guide with the new version.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_163.html b/user_guide/installation/upgrade_163.html
deleted file mode 100644
index cdf6bdf6f..000000000
--- a/user_guide/installation/upgrade_163.html
+++ /dev/null
@@ -1,99 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Upgrading from 1.6.2 to 1.6.3 : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from 1.6.2 to 1.6.3
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading from 1.6.2 to 1.6.3</h1>
-
-<p>Before performing an update you should take your site offline by replacing the index.php file with a static one.</p>
-
-
-
-<h2>Step 1: Update your CodeIgniter files</h2>
-
-<p>Replace these files and directories in your "system" folder with the new versions:</p>
-
-<ul>
-
-<li><dfn>system/codeigniter</dfn></li>
-<li><dfn>system/database</dfn></li>
-<li><dfn>system/helpers</dfn></li>
-<li><dfn>system/language</dfn></li>
-<li><dfn>system/libraries</dfn></li>
-</ul>
-
-<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
-
-
-<h2>Step 2: Update your user guide</h2>
-<p>Please also replace your local copy of the user guide with the new version.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_170.html b/user_guide/installation/upgrade_170.html
deleted file mode 100644
index 7c67f9125..000000000
--- a/user_guide/installation/upgrade_170.html
+++ /dev/null
@@ -1,121 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Upgrading from 1.6.3 to 1.7.0 : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from 1.6.3 to 1.7.0
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading from 1.6.3 to 1.7.0</h1>
-
-<p>Before performing an update you should take your site offline by replacing the index.php file with a static one.</p>
-
-
-
-<h2>Step 1: Update your CodeIgniter files</h2>
-
-<p>Replace these files and directories in your "system" folder with the new versions:</p>
-
-<ul>
-
-<li><dfn>system/codeigniter</dfn></li>
-<li><dfn>system/database</dfn></li>
-<li><dfn>system/helpers</dfn></li>
-<li><dfn>system/language</dfn></li>
-<li><dfn>system/libraries</dfn></li>
-</ul>
-
-<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
-
-
-<h2>Step 2: Update your Session Table</h2>
-
-<p>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 <dfn>user_data</dfn> to your session table.
-Here is an example of what this column might look like for MySQL:</p>
-
-<code>user_data text NOT NULL</code>
-
-<p>To add this column you will run a query similar to this:</p>
-
-<code>ALTER TABLE `ci_sessions` ADD `user_data` text NOT NULL</code>
-
-<p>You'll find more information regarding the new Session functionality in the <a href="../libraries/sessions.html">Session class</a> page.</p>
-
-
-<h2>Step 3: Update your Validation Syntax</h2>
-
-<p>This is an <strong>optional</strong>, but recommended step, for people currently using the Validation class. CI 1.7 introduces a new <a href="../libraries/form_validation.html">Form Validation class</a>, 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.</p>
-
-
-
-<h2>Step 4: Update your user guide</h2>
-<p>Please replace your local copy of the user guide with the new version, including the image files.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_171.html b/user_guide/installation/upgrade_171.html
deleted file mode 100644
index 014b2c589..000000000
--- a/user_guide/installation/upgrade_171.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Upgrading from 1.7.0 to 1.7.1 : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from 1.7.0 to 1.7.1
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading from 1.7.0 to 1.7.1</h1>
-
-<p>Before performing an update you should take your site offline by replacing the index.php file with a static one.</p>
-
-
-
-<h2>Step 1: Update your CodeIgniter files</h2>
-
-<p>Replace these files and directories in your "system" folder with the new versions:</p>
-
-<ul>
-
-<li><dfn>system/codeigniter</dfn></li>
-<li><dfn>system/database</dfn></li>
-<li><dfn>system/helpers</dfn></li>
-<li><dfn>system/language</dfn></li>
-<li><dfn>system/libraries</dfn></li>
-</ul>
-
-<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
-
-<h2>Step 2: Update your user guide</h2>
-<p>Please replace your local copy of the user guide with the new version, including the image files.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_172.html b/user_guide/installation/upgrade_172.html
deleted file mode 100644
index 961f3cae1..000000000
--- a/user_guide/installation/upgrade_172.html
+++ /dev/null
@@ -1,109 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Upgrading from 1.7.1 to 1.7.2 : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from 1.7.1 to 1.7.2
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading from 1.7.1 to 1.7.2</h1>
-
-<p>Before performing an update you should take your site offline by replacing the index.php file with a static one.</p>
-
-
-
-<h2>Step 1: Update your CodeIgniter files</h2>
-
-<p>Replace these files and directories in your "system" folder with the new versions:</p>
-
-<ul>
-
-<li><dfn>system/codeigniter</dfn></li>
-<li><dfn>system/database</dfn></li>
-<li><dfn>system/helpers</dfn></li>
-<li><dfn>system/language</dfn></li>
-<li><dfn>system/libraries</dfn></li>
-<li><dfn>index.php</dfn></li>
-</ul>
-
-<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
-
-<h2>Step 2: Remove header() from 404 error template</h2>
-<p>If you are using header() in your 404 error template, such as the case with the default <samp>error_404.php</samp> template shown below, remove that line of code.</p>
-
-<code>&lt;?php header(&quot;HTTP/1.1 404 Not Found&quot;); ?&gt;</code>
-
-<p>404 status headers are now properly handled in the show_404() method itself.</p>
-
-<h2>Step 3: Confirm your system_path</h2>
-<p>In your updated index.php file, confirm that the <dfn>$system_path</dfn> variable is set to your application's system folder.</p>
-
-<h2>Step 4: Update your user guide</h2>
-<p>Please replace your local copy of the user guide with the new version, including the image files.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_200.html b/user_guide/installation/upgrade_200.html
deleted file mode 100644
index b5d6e75ec..000000000
--- a/user_guide/installation/upgrade_200.html
+++ /dev/null
@@ -1,131 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Upgrading from 1.7.2 to 2.0.0 : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from 1.7.2 to 2.0.0
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading from 1.7.2 to 2.0.0</h1>
-
-<p>Before performing an update you should take your site offline by replacing the index.php file with a static one.</p>
-
-
-
-<h2>Step 1: Update your CodeIgniter files</h2>
-
-<p>Replace all files and directories in your "system" folder <strong>except</strong> your <kbd>application</kbd> folder.</p>
-
-<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
-
-<h2>Step 2: Adjust get_dir_file_info() where necessary</h2>
-
-<p>Version 2.0.0 brings a non-backwards compatible change to <kbd>get_dir_file_info()</kbd> in the <a href="../helpers/file_helper.html">File Helper</a>. 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 <em>need</em>
- recursiveness where you are using this helper function, change such instances, setting the second parameter, <kbd>$top_level_only</kbd> to FALSE:</p>
-
-<code>get_dir_file_info('/path/to/directory', <kbd>FALSE</kbd>);</code>
-
-</p>
-
-<h2>Step 3: Convert your Plugins to Helpers</h2>
-
-<p>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 <var>filename_pi.php</var> to <var>filename_helper.php</var>, move them to your <kbd>helpers</kbd> folder, and change all instances of:
-
- <code>$this->load->plugin('foo');</code>
-
-to
-
- <code>$this->load->helper('foo');</code>
-
-</p>
-
-<h2>Step 4: Update stored encrypted data</h2>
-
-<p class="important"><strong>Note:</strong> 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.</p>
-
-<p>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, <kbd>encode_from_legacy()</kbd> 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.</p>
-
-<p>Please read <a href="../libraries/encryption.html#legacy">how to use this method</a> in the Encryption library documentation.</p>
-
-<h2>Step 5: Remove loading calls for the compatibility helper.</h2>
-<p>The compatibility helper has been removed from the CodeIgniter core. All methods in it should be natively available in supported PHP versions.</p>
-
-<h2>Step 6: Update Class extension</h2>
-<p>All core classes are now prefixed with <kbd>CI_</kbd>. Update Models and Controllers to extend CI_Model and CI_Controller, respectively.</p>
-
-<h2>Step 7: Update Parent Constructor calls</h2>
-<p>All native CodeIgniter classes now use the PHP 5 <kbd>__construct()</kbd> convention. Please update extended libraries to call <kbd>parent::__construct()</kbd>.</p>
-
-<h2>Step 8: Update your user guide</h2>
-<p>Please replace your local copy of the user guide with the new version, including the image files.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_201.html b/user_guide/installation/upgrade_201.html
deleted file mode 100644
index 7edd0ba6a..000000000
--- a/user_guide/installation/upgrade_201.html
+++ /dev/null
@@ -1,105 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Upgrading from 2.0.0 to 2.0.1 : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from 2.0.0 to 2.0.1
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading from 2.0.0 to 2.0.1</h1>
-
-<p>Before performing an update you should take your site offline by replacing the index.php file with a static one.</p>
-
-
-<h2>Step 1: Update your CodeIgniter files</h2>
-
-<p>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.</p>
-
-<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
-
-
-<h2>Step 2: Replace config/mimes.php</h2>
-
-<p>This config file has been updated to contain more mime types, please copy it to <kbd>application/config/mimes.php</kbd>.</p>
-
-
-<h2>Step 3: Check for forms posting to default controller</h2>
-
-<p>
- The default behavior for <kbd>form_open()</kbd> 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.
- If submitting to the default controller was the expected behavior it will need to be changed from:
-</p>
-
-<code>echo form_open(); //&lt;form action="" method="post" accept-charset="utf-8"></code>
-
-<p>to use either a / or <kbd>base_url()</kbd>:</p>
-
-<code>echo form_open('/'); //&lt;form action="http://example.com/index.php/" method="post" accept-charset="utf-8"><br/>
-echo form_open(base_url()); //&lt;form action="http://example.com/" method="post" accept-charset="utf-8"></code>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_202.html b/user_guide/installation/upgrade_202.html
deleted file mode 100644
index 9aaa561eb..000000000
--- a/user_guide/installation/upgrade_202.html
+++ /dev/null
@@ -1,97 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Upgrading from 2.0.1 to 2.0.2 : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from 2.0.1 to 2.0.2
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading from 2.0.1 to 2.0.2</h1>
-
-<p>Before performing an update you should take your site offline by replacing the index.php file with a static one.</p>
-
-
-<h2>Step 1: Update your CodeIgniter files</h2>
-
-<p>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.</p>
-
-<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
-
-
-<h2>Step 2: Remove loading calls for the Security Library</h2>
-
-<p>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.</p>
-
-
-<h2>Step 3: Move MY_Security</h2>
-
-<p>If you are overriding or extending the Security library, you will need to move it to <kbd>application/core</kbd>.</p>
-
-<p><samp>csrf_token_name</samp> and <samp>csrf_hash</samp> have changed to protected class properties. Please use <samp>security->get_csrf_hash()</samp> and <samp>security->get_csrf_token_name()</samp> to access those values.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_203.html b/user_guide/installation/upgrade_203.html
deleted file mode 100644
index d4b703af0..000000000
--- a/user_guide/installation/upgrade_203.html
+++ /dev/null
@@ -1,121 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Upgrading from 2.0.2 to 2.0.3 : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from 2.0.2 to 2.0.3
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading from 2.0.2 to 2.0.3</h1>
-
-<p>Before performing an update you should take your site offline by replacing the index.php file with a static one.</p>
-
-
-<h2>Step 1: Update your CodeIgniter files</h2>
-
-<p>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.</p>
-
-<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
-
-<h2>Step 2: Update your main index.php file</h2>
-
-<p>If you are running a stock <dfn>index.php</dfn> file simply replace your version with the new one.</p>
-
-<p>If your <dfn>index.php</dfn> file has internal modifications, please add your modifications to the new file and use it.</p>
-
-<h2>Step 3: Replace config/user_agents.php</h2>
-
-<p>This config file has been updated to contain more user agent types, please copy it to <kbd>application/config/user_agents.php</kbd>.</p>
-
-<h2>Step 4: Change references of the EXT constant to ".php"</h2>
-<p class="important"><strong>Note:</strong> 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.</p>
-
-<h2>Step 5: Remove APPPATH.'third_party' from autoload.php</h2>
-
-<p>Open application/autoload.php, and look for the following:</p>
-
-<code>$autoload['packages'] = array(APPPATH.'third_party');</code>
-
-<p>If you have not chosen to load any additional packages, that line can be changed to:</p>
-<code>$autoload['packages'] = array();</code>
-
-<p>Which should provide for nominal performance gains if not autoloading packages.</p>
-
-<h2>Update Sessions Database Tables</h2>
-
-<p>If you are using database sessions with the CI Session Library, please update your <samp>ci_sessions</samp> database table as follows:</p>
-
-<code>
- CREATE INDEX last_activity_idx ON ci_sessions(last_activity);
- ALTER TABLE ci_sessions MODIFY user_agent VARCHAR(120);
-</code>
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_210.html b/user_guide/installation/upgrade_210.html
deleted file mode 100644
index d9a7213a9..000000000
--- a/user_guide/installation/upgrade_210.html
+++ /dev/null
@@ -1,89 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Upgrading from 2.0.3 to 2.1.0 : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from 2.0.3 to 2.1.0
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading from 2.0.3 to 2.1.0</h1>
-
-<p>Before performing an update you should take your site offline by replacing the index.php file with a static one.</p>
-
-<h2>Step 1: Update your CodeIgniter files</h2>
-
-<p>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.</p>
-
-<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
-
-<h2>Step 2: Replace config/user_agents.php</h2>
-
-<p>This config file has been updated to contain more user agent types, please copy it to <kbd>application/config/user_agents.php</kbd>.</p>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html
deleted file mode 100644
index dc3c1f07c..000000000
--- a/user_guide/installation/upgrade_b11.html
+++ /dev/null
@@ -1,144 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from Beta 1.0 to Beta 1.1
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading From Beta 1.0 to Beta 1.1</h1>
-
-<p>To upgrade to Beta 1.1 please perform the following steps:</p>
-
-<h2>Step 1: Replace your index file</h2>
-
-<p>Replace your main <kbd>index.php</kbd> 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.</p>
-
-<h2>Step 2: Relocate your config folder</h2>
-
-<p>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 <kbd>config</kbd> directory must now reside
-inside of your <dfn>application</dfn> folder, so please move it there.</p>
-
-
-<h2>Step 3: Replace directories</h2>
-
-<p>Replace the following directories with the new versions:</p>
-
-<ul>
-<li>drivers</li>
-<li>helpers</li>
-<li>init</li>
-<li>libraries</li>
-<li>scaffolding</li>
-</ul>
-
-
-<h2>Step 4: Add the calendar language file</h2>
-
-<p>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: <dfn>language/english/calendar_lang.php</dfn></p>
-
-
-<h2>Step 5: Edit your config file</h2>
-
-<p>The original <kbd>application/config/config.php</kbd> file has a typo in it Open the file and look for the items related to cookies:</p>
-
-<code>$conf['cookie_prefix'] = "";<br />
-$conf['cookie_domain'] = "";<br />
-$conf['cookie_path'] = "/";</code>
-
-<p>Change the array name from <kbd>$conf</kbd> to <kbd>$config</kbd>, like this:</p>
-
-<code>$config['cookie_prefix'] = "";<br />
-$config['cookie_domain'] = "";<br />
-$config['cookie_path'] = "/";</code>
-
-<p>Lastly, add the following new item to the config file (and edit the option if needed):</p>
-
-<code><br />
-/*<br />
-|------------------------------------------------<br />
-| URI PROTOCOL<br />
-|------------------------------------------------<br />
-|<br />
-| This item determines which server global <br />
-| should be used to retrieve the URI string. The <br />
-| default setting of "auto" works for most servers.<br />
-| If your links do not seem to work, try one of <br />
-| the other delicious flavors:<br />
-| <br />
-| 'auto' Default - auto detects<br />
-| 'path_info' Uses the PATH_INFO <br />
-| 'query_string' Uses the QUERY_STRING<br />
-*/<br />
-<br />
-$config['uri_protocol'] = "auto";</code>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html
deleted file mode 100644
index c3f5ae6dd..000000000
--- a/user_guide/installation/upgrading.html
+++ /dev/null
@@ -1,106 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Upgrading From a Previous Version : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Upgrading from a Previous Version
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Upgrading From a Previous Version</h1>
-
-<p>Please read the upgrade notes corresponding to the version you are upgrading from.</p>
-
-<ul>
- <li><a href="upgrade_210.html">Upgrading from 2.0.3 to 2.1.0</a></li>
- <li><a href="upgrade_203.html">Upgrading from 2.0.2 to 2.0.3</a></li>
- <li><a href="upgrade_202.html">Upgrading from 2.0.1 to 2.0.2</a></li>
- <li><a href="upgrade_201.html">Upgrading from 2.0 to 2.0.1</a></li>
- <li><a href="upgrade_200.html">Upgrading from 1.7.2 to 2.0</a></li>
- <li><a href="upgrade_172.html">Upgrading from 1.7.1 to 1.7.2</a></li>
- <li><a href="upgrade_171.html">Upgrading from 1.7.0 to 1.7.1</a></li>
- <li><a href="upgrade_170.html">Upgrading from 1.6.3 to 1.7.0</a></li>
- <li><a href="upgrade_163.html">Upgrading from 1.6.2 to 1.6.3</a></li>
- <li><a href="upgrade_162.html">Upgrading from 1.6.1 to 1.6.2</a></li>
- <li><a href="upgrade_161.html">Upgrading from 1.6.0 to 1.6.1</a></li>
- <li><a href="upgrade_160.html">Upgrading from 1.5.4 to 1.6.0</a></li>
- <li><a href="upgrade_154.html">Upgrading from 1.5.3 to 1.5.4</a></li>
- <li><a href="upgrade_153.html">Upgrading from 1.5.2 to 1.5.3</a></li>
- <li><a href="upgrade_152.html">Upgrading from 1.5.0 or 1.5.1 to 1.5.2</a></li>
- <li><a href="upgrade_150.html">Upgrading from 1.4.1 to 1.5.0</a></li>
- <li><a href="upgrade_141.html">Upgrading from 1.4.0 to 1.4.1</a></li>
- <li><a href="upgrade_140.html">Upgrading from 1.3.3 to 1.4.0</a></li>
- <li><a href="upgrade_133.html">Upgrading from 1.3.2 to 1.3.3</a></li>
- <li><a href="upgrade_132.html">Upgrading from 1.3.1 to 1.3.2</a></li>
- <li><a href="upgrade_131.html">Upgrading from 1.3 to 1.3.1</a></li>
- <li><a href="upgrade_130.html">Upgrading from 1.2 to 1.3</a></li>
- <li><a href="upgrade_120.html">Upgrading from 1.1 to 1.2</a></li>
- <li><a href="upgrade_b11.html">Upgrading from Beta 1.0 to Beta 1.1</a></li>
-</ul>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Installation Instructions</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="troubleshooting.html">Troubleshooting</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html
deleted file mode 100644
index 602e6fac0..000000000
--- a/user_guide/libraries/benchmark.html
+++ /dev/null
@@ -1,198 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Benchmarking Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Benchmarking Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Benchmarking Class</h1>
-
-<p>CodeIgniter has a Benchmarking class that is always active, enabling the time difference between any
-two marked points to be calculated.</p>
-
-<p class="important"><strong>Note:</strong> This class is initialized automatically by the system so there is no need to do it manually.</p>
-
-
-<p>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.</p>
-
-
-<h3>Table of Contents</h3>
-
-<ul>
-<li><a href="#using">Using the Benchmark Class</a></li>
-<li><a href="#profiler">Profiling Your Benchmark Points</a></li>
-<li><a href="#execution">Displaying Total Execution Time</a></li>
-<li><a href="#memory">Displaying Memory Consumption</a></li>
-</ul>
-
-
-
-<a name="using"></a>
-<h2>Using the Benchmark Class</h2>
-
-<p>The Benchmark class can be used within your <a href="../general/controllers.html">controllers</a>, <a href="../general/views.html">views</a>, or your <a href="../general/models.html">models</a>. The process for usage is this:</p>
-
-<ol>
-<li>Mark a start point</li>
-<li>Mark an end point</li>
-<li>Run the "elapsed time" function to view the results</li>
-</ol>
-
-<p>Here's an example using real code:</p>
-
-<code>$this->benchmark->mark('code_start');<br />
-<br />
-// Some code happens here<br />
-<br />
-$this->benchmark->mark('code_end');<br />
-<br />
-echo $this->benchmark->elapsed_time('code_start', 'code_end');</code>
-
-<p class="important"><strong>Note:</strong> 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:</p>
-
-<code>$this->benchmark->mark('dog');<br />
-<br />
-// Some code happens here<br />
-<br />
-$this->benchmark->mark('cat');<br />
-<br />
-// More code happens here<br />
-<br />
-$this->benchmark->mark('bird');<br />
-<br />
-echo $this->benchmark->elapsed_time('dog', 'cat');<br />
-echo $this->benchmark->elapsed_time('cat', 'bird');<br />
-echo $this->benchmark->elapsed_time('dog', 'bird');</code>
-
-
-<a name="profiler"></a>
-<h2>Profiling Your Benchmark Points</h2>
-
-<p>If you want your benchmark data to be available to the
-<a href="../general/profiling.html">Profiler</a> all of your marked points must be set up in pairs, and
-each mark point name must end with <kbd>_start</kbd> and <kbd>_end</kbd>.
-Each pair of points must otherwise be named identically. Example:</p>
-
-<code>
-$this->benchmark->mark('my_mark<kbd>_start</kbd>');<br />
-<br />
-// Some code happens here...<br />
-<br />
-$this->benchmark->mark('my_mark<kbd>_end</kbd>');
-<br /><br />
-
-$this->benchmark->mark('another_mark<kbd>_start</kbd>');<br />
-<br />
-// Some more code happens here...<br />
-<br />
-$this->benchmark->mark('another_mark<kbd>_end</kbd>');
-</code>
-
-<p>Please read the <a href="../general/profiling.html">Profiler page</a> for more information.</p>
-
-
-<a name="execution"></a>
-<h2>Displaying Total Execution Time</h2>
-
-<p>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:</p>
-
-<code>&lt;?php echo $this->benchmark->elapsed_time();?&gt;</code>
-
-<p>You'll notice that it's the same function used in the examples above to calculate the time between two point, except you are
-<strong>not</strong> 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.</p>
-
-<p>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:</p>
-<code>{elapsed_time}</code>
-
-<p class="important"><strong>Note:</strong> If you want to benchmark anything within your controller
-functions you must set your own start/end points.</p>
-
-<a name="memory"></a>
-<h2>Displaying Memory Consumption</h2>
-
-<p>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:</p>
-
-<code>&lt;?php echo $this->benchmark->memory_usage();?&gt;</code>
-<p>Note: This function can only be used in your view files. The consumption will reflect the total memory used by the entire app.</p>
-
-<p>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:</p>
-<code>{memory_usage}</code>
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="../doc_style/index.html">Writing Documentaion</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="calendar.html">Calendar Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/caching.html b/user_guide/libraries/caching.html
deleted file mode 100644
index 9808aaa51..000000000
--- a/user_guide/libraries/caching.html
+++ /dev/null
@@ -1,193 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Caching Driver : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-<a href="../general/drivers.html">Drivers</a> &nbsp;&#8250;&nbsp;
-Caching Driver
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Caching Driver</h1>
-
-<p>CodeIgniter features wrappers around some of the most popular forms of fast and dynamic caching. All but file-based caching require specific server requirements, and a Fatal Exception will be thrown if server requirements are not met.</p>
-
-<h2>Table of Contents</h2>
-<ul>
- <li><a href="#example_usage" title="Example Usage">Example Usage</a></li>
- <li><a href="#function_reference" title="Function Reference">Function Reference</a></li>
-</ul>
-
-<h3>Available Drivers</h3>
-<ul>
- <li><a href="#apc" title="APC Cache">Alternative PHP Cache (APC) Caching</a></li>
- <li><a href="#file" title="File Caching">File-based Caching</a></li>
- <li><a href="#memcached" title="Memcached">Memcached Caching</a></li>
- <li><a href="#dummy" title="Dummy Caching">Dummy Cache</a></li>
-</ul>
-
-<h2 id="example_usage">Example Usage</h2>
-
-<p>The following example will load the cache driver, specify <a href="#apc" title="APC">APC</a> as the driver to use, and fall back to file-based caching if APC is not available in the hosting environment.</p>
-
-<code>
-$this->load->driver('cache', array('adapter' => 'apc', 'backup' => 'file'));<br />
-<br />
-if ( ! $foo = $this->cache->get('foo'))<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo 'Saving to the cache!&lt;br />';<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$foo = 'foobarbaz!';<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Save into the cache for 5 minutes<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this->cache->save('foo', $foo, 300);<br />
-}<br />
-<br />
-echo $foo;
-</code>
-
-<h1 id="function_reference">Function Reference</h1>
-
-<h2>is_supported(<var>driver</var>['string'])</h2>
-
-<p>This function is automatically called when accessing drivers via <samp>$this->cache->get()</samp>. However, if the individual drivers are used, make sure to call this function to ensure the driver is supported in the hosting environment.</p>
-
-<code>
-if ($this->cache->apc->is_supported())<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($data = $this->cache->apc->get('my_cache'))<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// do things.<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-}
-</code>
-
-<h2>get(<var>id</var>['string'])</h2>
-
-<p>This function will attempt to fetch an item from the cache store. If the item does not exist, the function will return <samp>FALSE</samp>.</p>
-<code>$foo = $this->cache->get('my_cached_item');</code>
-
-<h2>save(<var>id</var>['string'], <var>data</var>['mixed'], <var>ttl</var>['int'])</h2>
-
-<p>This function will save an item to the cache store. If saving fails, the function will return <samp>FALSE</samp>.</p>
-<p>The optional third parameter (Time To Live) defaults to 60 seconds.</p>
-<code>$this->cache->save('cache_item_id', 'data_to_cache');</code>
-
-<h2>delete(<var>id</var>['string'])</h2>
-
-<p>This function will delete a specific item from the cache store. If item deletion fails, the function will return <samp>FALSE</samp>.</p>
-<code>$this->cache->delete('cache_item_id');</code>
-
-<h2>clean()</h2>
-
-<p>This function will 'clean' the entire cache. If the deletion of the cache files fails, the function will return <samp>FALSE</samp>.</p>
-
-<code>$this->cache->clean();</code>
-
-<h2>cache_info()</h2>
-
-<p>This function will return information on the entire cache.</p>
-
-<code>var_dump($this->cache->cache_info());</code>
-
-<h2>get_metadata(<var>id</var>['string'])</h2>
-
-<p>This function will return detailed information on a specific item in the cache.</p>
-
-<code>var_dump($this->cache->get_metadata('my_cached_item'));</code>
-
-<h1>Drivers</h1>
-
-<h2 id="apc">Alternative PHP Cache (APC) Caching</h2>
-
-<p>All of the functions listed above can be accessed without passing a specific adapter to the driver loader as follows:</p>
-<code>$this->load->driver('cache');<br />
- $this->cache->apc->save('foo', 'bar', 10);</code>
-<p>For more information on APC, please see <a href="http://php.net/apc">http://php.net/apc</a></p>
-
-<h2 id="file">File-based Caching</h2>
-
-<p>Unlike caching from the Output Class, the driver file-based caching allows for pieces of view files to be cached. Use this with care, and make sure to benchmark your application, as a point can come where disk I/O will negate positive gains by caching.</p>
-
-<p>All of the functions listed above can be accessed without passing a specific adapter to the driver loader as follows:</p>
-<code>$this->load->driver('cache');<br />
- $this->cache->file->save('foo', 'bar', 10);</code>
-
-<h2 id="memcached">Memcached Caching</h2>
-
-<p>Multiple Memcached servers can be specified in the memcached.php configuration file, located in the <samp>application/config/</samp> directory.
-
-<p>All of the functions listed above can be accessed without passing a specific adapter to the driver loader as follows:</p>
-<code>$this->load->driver('cache');<br />
- $this->cache->memcached->save('foo', 'bar', 10);</code>
-
-<p>For more information on Memcached, please see <a href="http://php.net/memcached">http://php.net/memcached</a></p>
-
-<h2 id="dummy">Dummy Cache</h2>
-
-<p>This is a caching backend that will always 'miss.' It stores no data, but lets you keep your caching code in place in environments that don't support your chosen cache.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="zip.html">Zip Encoding Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="../database/index.html">Database Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html
deleted file mode 100644
index 2abc43975..000000000
--- a/user_guide/libraries/calendar.html
+++ /dev/null
@@ -1,249 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Calendaring Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Calendaring Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-
-
-<h1>Calendaring Class</h1>
-
-<p>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.</p>
-
-<h2>Initializing the Class</h2>
-
-<p>Like most other classes in CodeIgniter, the Calendar class is initialized in your controller using the <dfn>$this->load->library</dfn> function:</p>
-
-<code>$this->load->library('calendar');</code>
-<p>Once loaded, the Calendar object will be available using: <dfn>$this->calendar</dfn></p>
-
-
-<h2>Displaying a Calendar</h2>
-
-<p>Here is a very simple example showing how you can display a calendar:</p>
-
-<code>$this->load->library('calendar');<br />
-<br />
-echo $this->calendar->generate();</code>
-
-<p>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:</p>
-
-<code>$this->load->library('calendar');<br />
-<br />
-echo $this->calendar->generate(<kbd>2006</kbd>, <kbd>6</kbd>);</code>
-
-<p>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.</p>
-
-<h2>Passing Data to your Calendar Cells</h2>
-
-<p>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:</p>
-
-<code>$this->load->library('calendar');<br />
-<br />
-$data = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3&nbsp; => 'http://example.com/news/article/2006/03/',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;7&nbsp; => 'http://example.com/news/article/2006/07/',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;13 => 'http://example.com/news/article/2006/13/',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;26 => 'http://example.com/news/article/2006/26/'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-echo $this->calendar->generate(<kbd>2006</kbd>, <kbd>6</kbd>, <var>$data</var>);</code>
-
-<p>Using the above example, day numbers 3, 7, 13, and 26 will become links pointing to the URLs you've provided.</p>
-
-<p class="important"><strong>Note:</strong> 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.</p>
-
-
-<h2>Setting Display Preferences</h2>
-
-<p>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:</p>
-
-
-<code>
-$prefs = array (<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'start_day'&nbsp;&nbsp;&nbsp; => 'saturday',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'month_type'&nbsp;&nbsp; => 'long',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'day_type'&nbsp;&nbsp;&nbsp;&nbsp; => 'short'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-$this->load->library('calendar', $prefs);<br />
-<br />
-echo $this->calendar->generate();</code>
-
-<p>The above code would start the calendar on saturday, use the "long" month heading, and the "short" day names. More information
-regarding preferences below.</p>
-
-
-
-
-<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
-<tr>
-<th>Preference</th>
-<th>Default&nbsp;Value</th>
-<th>Options</th>
-<th>Description</th>
-</tr><tr>
-<td class="td"><strong>template</strong></td><td class="td">None</td><td class="td">None</td><td class="td">A string containing your calendar template. See the template section below.</td>
-</tr><tr>
-<td class="td"><strong>local_time</strong></td><td class="td">time()</td><td class="td">None</td><td class="td">A Unix timestamp corresponding to the current time.</td>
-</tr><tr>
-<td class="td"><strong>start_day</strong></td><td class="td">sunday</td><td class="td">Any week day (sunday, monday, tuesday, etc.)</td><td class="td">Sets the day of the week the calendar should start on.</td>
-</tr><tr>
-<td class="td"><strong>month_type</strong></td><td class="td">long</td><td class="td">long, short</td><td class="td">Determines what version of the month name to use in the header. long = January, short = Jan.</td>
-</tr><tr>
-<td class="td"><strong>day_type</strong></td><td class="td">abr</td><td class="td">long, short, abr</td><td class="td">Determines what version of the weekday names to use in the column headers. long = Sunday, short = Sun, abr = Su.</td>
-</tr><tr>
-<td class="td"><strong>show_next_prev</strong></td><td class="td">FALSE</td><td class="td">TRUE/FALSE (boolean)</td><td class="td">Determines whether to display links allowing you to toggle to next/previous months. See information on this feature below.</td>
-</tr><tr>
-<td class="td"><strong>next_prev_url</strong></td><td class="td">None</td><td class="td">A URL</td><td class="td">Sets the basepath used in the next/previous calendar links.</td>
-</tr>
-</table>
-
-
-
-<h2>Showing Next/Previous Month Links</h2>
-
-<p>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:</p>
-
-
-<code>$prefs = array (<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'show_next_prev'&nbsp;&nbsp;=> TRUE,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'next_prev_url'&nbsp;&nbsp; => 'http://example.com/index.php/calendar/show/'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-$this-&gt;load-&gt;library('calendar', $prefs);<br />
-<br />
-echo $this->calendar->generate(<var>$this->uri->segment(3)</var>, <var>$this->uri->segment(4)</var>);</code>
-
-<p>You'll notice a few things about the above example:</p>
-
-<ul>
-<li>You must set the "show_next_prev" to TRUE.</li>
-<li>You must supply the URL to the controller containing your calendar in the "next_prev_url" preference.</li>
-<li>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.).</li>
-</ul>
-
-
-
-<h2>Creating a Calendar Template</h2>
-
-<p>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:</p>
-
-
-<code>
-$prefs['template'] = '<br /><br />
-&nbsp;&nbsp;&nbsp;<dfn>{table_open}</dfn><var>&lt;table border="0" cellpadding="0" cellspacing="0"></var><dfn>{/table_open}</dfn><br />
-<br />
-&nbsp;&nbsp;&nbsp;<dfn>{heading_row_start}</dfn><var>&lt;tr></var><dfn>{/heading_row_start}</dfn><br />
-<br />
-&nbsp;&nbsp;&nbsp;<dfn>{heading_previous_cell}</dfn><var>&lt;th>&lt;a href="</var><kbd>{previous_url}</kbd><var>">&amp;lt;&amp;lt;&lt;/a>&lt;/th></var><dfn>{/heading_previous_cell}</dfn><br />
-&nbsp;&nbsp;&nbsp;<dfn>{heading_title_cell}</dfn><var>&lt;th colspan="</var><kbd>{colspan}</kbd><var>"></var><kbd>{heading}</kbd><var>&lt;/th></var><dfn>{/heading_title_cell}</dfn><br />
-&nbsp;&nbsp;&nbsp;<dfn>{heading_next_cell}</dfn><var>&lt;th>&lt;a href="</var><kbd>{next_url}</kbd><var>">&amp;gt;&amp;gt;&lt;/a>&lt;/th></var><dfn>{/heading_next_cell}</dfn><br />
-<br />
-&nbsp;&nbsp;&nbsp;<dfn>{heading_row_end}</dfn><var>&lt;/tr></var><dfn>{/heading_row_end}</dfn><br />
-<br />
-&nbsp;&nbsp;&nbsp;<dfn>{week_row_start}</dfn><var>&lt;tr></var><dfn>{/week_row_start}</dfn><br />
-&nbsp;&nbsp;&nbsp;<dfn>{week_day_cell}</dfn><var>&lt;td></var><dfn>{week_day}</dfn><var>&lt;/td></var><dfn>{/week_day_cell}</dfn><br />
-&nbsp;&nbsp;&nbsp;<dfn>{week_row_end}</dfn><var>&lt;/tr></var><dfn>{/week_row_end}</dfn><br />
-<br />
-&nbsp;&nbsp;&nbsp;<dfn>{cal_row_start}</dfn><var>&lt;tr></var><dfn>{/cal_row_start}</dfn><br />
-&nbsp;&nbsp;&nbsp;<dfn>{cal_cell_start}</dfn><var>&lt;td></var><dfn>{/cal_cell_start}</dfn><br />
-<br />
-&nbsp;&nbsp;&nbsp;<dfn>{cal_cell_content}</dfn><var>&lt;a href="</var><kbd>{content}</kbd><var>"></var><kbd>{day}</kbd><var>&lt;/a></var><dfn>{/cal_cell_content}</dfn><br />
-&nbsp;&nbsp;&nbsp;<dfn>{cal_cell_content_today}</dfn><var>&lt;div class="highlight">&lt;a href="</var><kbd>{content}</kbd><var>"></var><kbd>{day}</kbd><var>&lt;/a>&lt;/div></var><dfn>{/cal_cell_content_today}</dfn><br />
-<br />
-&nbsp;&nbsp;&nbsp;<dfn>{cal_cell_no_content}</dfn><var></var><kbd>{day}</kbd><var></var><dfn>{/cal_cell_no_content}</dfn><br />
-&nbsp;&nbsp;&nbsp;<dfn>{cal_cell_no_content_today}</dfn><var>&lt;div class="highlight"></var><kbd>{day}</kbd><var>&lt;/div></var><dfn>{/cal_cell_no_content_today}</dfn><br />
-<br />
-&nbsp;&nbsp;&nbsp;<dfn>{cal_cell_blank}</dfn><var>&amp;nbsp;</var><dfn>{/cal_cell_blank}</dfn><br />
-<br />
-&nbsp;&nbsp;&nbsp;<dfn>{cal_cell_end}</dfn><var>&lt;/td></var><dfn>{/cal_cell_end}</dfn><br />
-&nbsp;&nbsp;&nbsp;<dfn>{cal_row_end}</dfn><var>&lt;/tr></var><dfn>{/cal_row_end}</dfn><br />
-<br />
-&nbsp;&nbsp;&nbsp;<dfn>{table_close}</dfn><var>&lt;/table></var><dfn>{/table_close}</dfn><br />
-';<br />
-<br />
-$this->load->library('calendar', $prefs);<br />
-<br />
-echo $this->calendar->generate();</code>
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="benchmark.html">Benchmark Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="cart.html">Cart Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/cart.html b/user_guide/libraries/cart.html
deleted file mode 100644
index b867b709c..000000000
--- a/user_guide/libraries/cart.html
+++ /dev/null
@@ -1,346 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Shopping Cart Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Shopping Cart Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Shopping Cart Class</h1>
-
-<p>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.</p>
-
-<p>Please note that the Cart Class ONLY provides the core "cart" functionality. It does not provide shipping, credit card authorization, or other processing components.</p>
-
-
-<h2>Initializing the Shopping Cart Class</h2>
-
-<p><strong>Important:</strong> The Cart class utilizes CodeIgniter's
-<a href="sessions.html">Session Class</a> 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 <a href="sessions.html">Session Documentation</a> , and set the session preferences in your <kbd>application/config/config.php</kbd> file to utilize a database.</p>
-
-<p>To initialize the Shopping Cart Class in your controller constructor, use the <dfn>$this->load->library</dfn> function:</p>
-
-<code>$this->load->library('cart');</code>
-<p>Once loaded, the Cart object will be available using: <dfn>$this->cart</dfn></p>
-
-<p class="important"><strong>Note:</strong> The Cart Class will load and initialize the Session Class automatically, so unless you are using sessions elsewhere in your application, you do not need to load the Session class.</p>
-
-<h2>Adding an Item to The Cart</h2>
-
-<p>To add an item to the shopping cart, simply pass an array with the product information to the <dfn>$this->cart->insert()</dfn> function, as shown below:</p>
-
-<code>
-$data = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'id'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; => 'sku_123ABC',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'qty'&nbsp;&nbsp;&nbsp;&nbsp; => 1,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'price'&nbsp;&nbsp; => 39.95,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name'&nbsp;&nbsp;&nbsp; => 'T-Shirt',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'options' => array('Size' => 'L', 'Color' => 'Red')<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-
-$this->cart->insert($data);
-
-</code>
-
-<p class="important"><strong>Important:</strong> The first four array indexes above (<dfn>id</dfn>, <dfn>qty</dfn>, <dfn>price</dfn>, and <dfn>name</dfn>) are <strong>required</strong>.
-If you omit any of them the data will not be saved to the cart. The fifth index (<dfn>options</dfn>) is optional.
-It is intended to be used in cases where your product has options associated with it. Use an array for options, as shown above.</p>
-
-<p>The five reserved indexes are:</p>
-
-<ul>
-<li><strong>id</strong> - Each product in your store must have a unique identifier. Typically this will be an "sku" or other such identifier.</li>
-<li><strong>qty</strong> - The quantity being purchased.
-<li><strong>price</strong> - The price of the item.
-<li><strong>name</strong> - The name of the item.
-<li><strong>options</strong> - Any additional attributes that are needed to identify the product. These must be passed via an array.
-</ul>
-
-<p>In addition to the five indexes above, there are two reserved words: <dfn>rowid</dfn> and <dfn>subtotal</dfn>. These are used internally by the Cart class, so
-please do NOT use those words as index names when inserting data into the cart.</p>
-
-<p>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.</p>
-
-<p>The insert() method will return the $rowid if you successfully insert a single item.</p>
-
-
-<h2>Adding Multiple Items to The Cart</h2>
-
-<p>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.</p>
-
-
-<code>
-$data = array(<br />
-
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'id'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; => 'sku_123ABC',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'qty'&nbsp;&nbsp;&nbsp;&nbsp; => 1,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'price'&nbsp;&nbsp; => 39.95,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name'&nbsp;&nbsp;&nbsp; => 'T-Shirt',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'options' => array('Size' => 'L', 'Color' => 'Red')<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'id'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; => 'sku_567ZYX',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'qty'&nbsp;&nbsp;&nbsp;&nbsp; => 1,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'price'&nbsp;&nbsp; => 9.95,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name'&nbsp;&nbsp;&nbsp; => 'Coffee Mug'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'id'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; => 'sku_965QRS',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'qty'&nbsp;&nbsp;&nbsp;&nbsp; => 1,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'price'&nbsp;&nbsp; => 29.95,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name'&nbsp;&nbsp;&nbsp; => 'Shot Glass'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br />
-
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-
-$this->cart->insert($data);
-
-</code>
-
-
-
-
-<h2>Displaying the Cart</h2>
-
-<p>To display the cart you will create a <a href="../general/views.html">view file</a> with code similar to the one shown below.</p>
-
-<p>Please note that this example uses the <a href="../helpers/form_helper.html">form helper</a>.</p>
-
-
-<textarea class="textarea" style="width:100%" cols="50" rows="55">
-&lt;?php echo form_open('path/to/controller/update/function'); ?>
-
-&lt;table cellpadding="6" cellspacing="1" style="width:100%" border="0">
-
-&lt;tr>
- &lt;th>QTY&lt;/th>
- &lt;th>Item Description&lt;/th>
- &lt;th style="text-align:right">Item Price&lt;/th>
- &lt;th style="text-align:right">Sub-Total&lt;/th>
-&lt;/tr>
-
-&lt;?php $i = 1; ?>
-
-&lt;?php foreach ($this->cart->contents() as $items): ?>
-
- &lt;?php echo form_hidden($i.'[rowid]', $items['rowid']); ?>
-
- &lt;tr>
- &lt;td>&lt;?php echo form_input(array('name' => $i.'[qty]', 'value' => $items['qty'], 'maxlength' => '3', 'size' => '5')); ?>&lt;/td>
- &lt;td>
- &lt;?php echo $items['name']; ?>
-
- &lt;?php if ($this->cart->has_options($items['rowid']) == TRUE): ?>
-
- &lt;p>
- &lt;?php foreach ($this->cart->product_options($items['rowid']) as $option_name => $option_value): ?>
-
- &lt;strong>&lt;?php echo $option_name; ?>:&lt;/strong> &lt;?php echo $option_value; ?>&lt;br />
-
- &lt;?php endforeach; ?>
- &lt;/p>
-
- &lt;?php endif; ?>
-
- &lt;/td>
- &lt;td style="text-align:right">&lt;?php echo $this->cart->format_number($items['price']); ?>&lt;/td>
- &lt;td style="text-align:right">$&lt;?php echo $this->cart->format_number($items['subtotal']); ?>&lt;/td>
- &lt;/tr>
-
-&lt;?php $i++; ?>
-
-&lt;?php endforeach; ?>
-
-&lt;tr>
- &lt;td colspan="2">&nbsp;&lt;/td>
- &lt;td class="right">&lt;strong>Total&lt;/strong>&lt;/td>
- &lt;td class="right">$&lt;?php echo $this->cart->format_number($this->cart->total()); ?>&lt;/td>
-&lt;/tr>
-
-&lt;/table>
-
-&lt;p>&lt;?php echo form_submit('', 'Update your Cart'); ?>&lt;/p>
-</textarea>
-
-
-
-
-<h2>Updating The Cart</h2>
-
-<p>To update the information in your cart, you must pass an array containing the <kbd>Row ID</kbd> and quantity to the <dfn>$this->cart->update()</dfn> function:</p>
-
-<p class="important"><strong>Note:</strong> If the quantity is set to zero, the item will be removed from the cart.</p>
-
-<code>
-$data = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rowid' => 'b99ccdf16028f015540f341130b6d8ec',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'qty'&nbsp;&nbsp; => 3<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-
-$this->cart->update($data);
-<br /><br />
-// Or a multi-dimensional array<br /><br />
-$data = array(<br />
-
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rowid'&nbsp;&nbsp; => 'b99ccdf16028f015540f341130b6d8ec',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'qty'&nbsp;&nbsp;&nbsp;&nbsp; => 3<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rowid'&nbsp;&nbsp; => 'xw82g9q3r495893iajdh473990rikw23',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'qty'&nbsp;&nbsp;&nbsp;&nbsp; => 4<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rowid'&nbsp;&nbsp; => 'fh4kdkkkaoe30njgoe92rkdkkobec333',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'qty'&nbsp;&nbsp;&nbsp;&nbsp; => 2<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br />
-
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-
-$this->cart->update($data);
-
-
-
-
-</code>
-
-<p><strong>What is a Row ID?</strong>&nbsp; The <kbd>row ID</kbd> 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.</p>
-
-<p>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.</p>
-
-<p>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.</p>
-
-
-
-<p>&nbsp;<br /></p>
-
-
-<h1>Function Reference</h1>
-
-<h2>$this->cart->insert();</h2>
-
-<p>Permits you to add items to the shopping cart, as outlined above.</p>
-
-
-<h2>$this->cart->update();</h2>
-
-<p>Permits you to update items in the shopping cart, as outlined above.</p>
-
-
-<h2>$this->cart->total();</h2>
-
-<p>Displays the total amount in the cart.</p>
-
-
-<h2>$this->cart->total_items();</h2>
-
-<p>Displays the total number of items in the cart.</p>
-
-
-<h2>$this->cart->contents();</h2>
-
-<p>Returns an array containing everything in the cart.</p>
-
-
-
-<h2>$this->cart->has_options(rowid);</h2>
-
-<p>Returns TRUE (boolean) if a particular row in the cart contains options. This function is designed to be used in a loop with <dfn>$this->cart->contents()</dfn>, since you must pass the <kbd>rowid</kbd> to this function, as shown in the <dfn>Displaying the Cart</dfn> example above.</p>
-
-
-<h2>$this->cart->product_options(rowid);</h2>
-
-<p>Returns an array of options for a particular product. This function is designed to be used in a loop with <dfn>$this->cart->contents()</dfn>, since you must pass the <kbd>rowid</kbd> to this function, as shown in the <dfn>Displaying the Cart</dfn> example above.</p>
-
-
-
-<h2>$this->cart->destroy();</h2>
-
-<p>Permits you to destroy the cart. This function will likely be called when you are finished processing the customer's order.</p>
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="calendar.html">Calendar Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="config.html">Config Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html
deleted file mode 100644
index 08b612e77..000000000
--- a/user_guide/libraries/config.html
+++ /dev/null
@@ -1,222 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Config Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Config Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Config Class</h1>
-
-<p>The Config class provides a means to retrieve configuration preferences. These preferences can
-come from the default config file (<samp>application/config/config.php</samp>) or from your own custom config files.</p>
-
-<p class="important"><strong>Note:</strong> This class is initialized automatically by the system so there is no need to do it manually.</p>
-
-
-<h2>Anatomy of a Config File</h2>
-
-<p>By default, CodeIgniter has one primary config file, located at <samp>application/config/config.php</samp>. If you open the file using
-your text editor you'll see that config items are stored in an array called <var>$config</var>.</p>
-
-<p>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 <dfn>config</dfn> folder.</p>
-
-<p><strong>Note:</strong> If you do create your own config files use the same format as the primary one, storing your items in
-an array called <var>$config</var>. 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).</p>
-
-<h2>Loading a Config File</h2>
-
-<p><strong>Note:</strong> CodeIgniter automatically loads the primary config file (<samp>application/config/config.php</samp>),
-so you will only need to load a config file if you have created your own.</p>
-
-<p>There are two ways to load a config file:</p>
-
-<ol><li><strong>Manual Loading</strong>
-
-<p>To load one of your custom config files you will use the following function within the <a href="../general/controllers.html">controller</a> that needs it:</p>
-
-<code>$this->config->load('<var>filename</var>');</code>
-
-<p>Where <var>filename</var> is the name of your config file, without the .php file extension.</p>
-
-<p>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 <kbd>TRUE</kbd>
-and each config file will be stored in an array index corresponding to the name of the config file. Example:</p>
-
-<code>
-// Stored in an array with this prototype: $this->config['blog_settings'] = $config<br />
-$this->config->load('<var>blog_settings</var>', <kbd>TRUE</kbd>);</code>
-
-<p>Please see the section entitled <dfn>Fetching Config Items</dfn> below to learn how to retrieve config items set this way.</p>
-
-<p>The third parameter allows you to suppress errors in the event that a config file does not exist:</p>
-
-<code>$this->config->load('<var>blog_settings</var>', <dfn>FALSE</dfn>, <kbd>TRUE</kbd>);</code>
-
-</li>
-<li><strong>Auto-loading</strong>
-
-<p>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 <strong>autoload.php</strong> file, located at <samp>application/config/autoload.php</samp>, and add your config file as
-indicated in the file.</p>
-</li>
-</ol>
-
-
-<h2>Fetching Config Items</h2>
-
-<p>To retrieve an item from your config file, use the following function:</p>
-
-<code>$this->config->item('<var>item name</var>');</code>
-
-<p>Where <var>item name</var> is the $config array index you want to retrieve. For example, to fetch your language choice you'll do this:</p>
-
-<code>$lang = $this->config->item('language');</code>
-
-<p>The function returns FALSE (boolean) if the item you are trying to fetch does not exist.</p>
-
-<p>If you are using the second parameter of the <kbd>$this->config->load</kbd> 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 <kbd>$this->config->item()</kbd> function. Example:</p>
-
-<code>
-// Loads a config file named blog_settings.php and assigns it to an index named "blog_settings"<br />
-$this->config->load('<var>blog_settings</var>', <kbd>TRUE</kbd>);<br /><br />
-
-// Retrieve a config item named site_name contained within the blog_settings array<br />
-$site_name = $this->config->item('<dfn>site_name</dfn>', '<var>blog_settings</var>');<br /><br />
-
-// An alternate way to specify the same item:<br />
-$blog_config = $this->config->item('<var>blog_settings</var>');<br />
-$site_name = $blog_config['site_name'];</code>
-
-<h2>Setting a Config Item</h2>
-
-<p>If you would like to dynamically set a config item or change an existing one, you can do so using:</p>
-
-<code>$this->config->set_item('<var>item_name</var>', '<var>item_value</var>');</code>
-
-<p>Where <var>item_name</var> is the $config array index you want to change, and <var>item_value</var> is its value.</p>
-
-<a name="environments"></a>
-<h2>Environments</h2>
-
-<p>
- You may load different configuration files depending on the current environment.
- The <kbd>ENVIRONMENT</kbd> constant is defined in index.php, and is described
- in detail in the <a href="../general/environments.html">Handling Environments</a>
- section.
-</p>
-
-<p>
- To create an environment-specific configuration file,
- create or copy a configuration file in application/config/{ENVIRONMENT}/{FILENAME}.php
-</p>
-
-<p>For example, to create a production-only config.php, you would:</p>
-
-<ol>
- <li>Create the directory application/config/production/</li>
- <li>Copy your existing config.php into the above directory</li>
- <li>Edit application/config/production/config.php so it contains your production settings</li>
-</ol>
-
-<p>
- When you set the <kbd>ENVIRONMENT</kbd> constant to 'production', the settings
- for your new production-only config.php will be loaded.
-</p>
-
-<p>You can place the following configuration files in environment-specific folders:</p>
-
-<ul>
-<li>Default CodeIgniter configuration files</li>
-<li>Your own custom configuration files</li>
-</ul>
-
-<p><strong>Note:</strong> CodeIgniter always tries to load the configuration files for the current environment first. If the file does not exist, the global config file (i.e., the one in <samp>application/config/</samp>) is loaded. This means you are not obligated to place <strong>all</strong> of your configuration files in an environment folder &minus; only the files that change per environment.</p>
-
-<h2>Helper Functions</h2>
-
-<p>The config class has the following helper functions:</p>
-
-<h2>$this->config->site_url();</h2>
-<p>This function retrieves the URL to your site, along with the "index" value you've specified in the config file.</p>
-
-<h2>$this->config->base_url();</h2>
-<p>This function retrieves the URL to your site, plus an optional path such as to a stylesheet or image.</p>
-
-<p>The two functions above are normally accessed via the corresponding functions in the <a href="../helpers/url_helper.html">URL Helper.</a></p>
-
-<h2>$this->config->system_url();</h2>
-<p>This function retrieves the URL to your <dfn>system folder</dfn>.</p>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="calendar.html">Calendaring Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="../database/index.html">Database Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html>
diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html
deleted file mode 100644
index 7fc56d55b..000000000
--- a/user_guide/libraries/email.html
+++ /dev/null
@@ -1,307 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Email Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Email Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Email Class</h1>
-
-<p>CodeIgniter's robust Email Class supports the following features:</p>
-
-
-<ul>
-<li>Multiple Protocols: Mail, Sendmail, and SMTP</li>
-<li>Multiple recipients</li>
-<li>CC and BCCs</li>
-<li>HTML or Plaintext email</li>
-<li>Attachments</li>
-<li>Word wrapping</li>
-<li>Priorities</li>
-<li>BCC Batch Mode, enabling large email lists to be broken into small BCC batches.</li>
-<li>Email Debugging tools</li>
-</ul>
-
-
-<h2>Sending Email</h2>
-
-<p>Sending email is not only simple, but you can configure it on the fly or set your preferences in a config file.</p>
-
-<p>Here is a basic example demonstrating how you might send email. Note: This example assumes you are sending the email from one of your
-<a href="../general/controllers.html">controllers</a>.</p>
-
-<code>$this->load->library('email');<br />
-<br />
-$this->email->from('your@example.com', 'Your Name');<br />
-$this->email->to('someone@example.com'); <br />
-$this->email->cc('another@another-example.com'); <br />
-$this->email->bcc('them@their-example.com'); <br />
-<br />
-$this->email->subject('Email Test');<br />
-$this->email->message('Testing the email class.'); <br />
-<br />
-$this->email->send();<br />
-<br />
-echo $this->email->print_debugger();</code>
-
-
-
-
-<h2>Setting Email Preferences</h2>
-
-<p>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:</p>
-
-<p>Preferences are set by passing an array of preference values to the email <dfn>initialize</dfn> function. Here is an example of how you might set some preferences:</p>
-
-<code>$config['protocol'] = 'sendmail';<br />
-$config['mailpath'] = '/usr/sbin/sendmail';<br />
-$config['charset'] = 'iso-8859-1';<br />
-$config['wordwrap'] = TRUE;<br />
-<br />
-$this->email->initialize($config);</code>
-
-<p><strong>Note:</strong> Most of the preferences have default values that will be used if you do not set them.</p
-
-><h3>Setting Email Preferences in a Config File</h3>
-
-<p>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 <var>email.php</var>, add the <var>$config</var>
-array in that file. Then save the file at <var>config/email.php</var> and it will be used automatically. You
-will NOT need to use the <dfn>$this->email->initialize()</dfn> function if you save your preferences in a config file.</p>
-
-
-
-
-<h2>Email Preferences</h2>
-
-<p>The following is a list of all the preferences that can be set when sending email.</p>
-
-
-<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
-<tr>
-<th>Preference</th>
-<th>Default&nbsp;Value</th>
-<th>Options</th>
-<th>Description</th>
-</tr><tr>
-<td class="td"><strong>useragent</strong></td><td class="td">CodeIgniter</td><td class="td">None</td><td class="td">The "user agent".</td>
-</tr><tr>
-<td class="td"><strong>protocol</strong></td><td class="td">mail</td><td class="td">mail, sendmail, or smtp</td><td class="td">The mail sending protocol.</td>
-</tr><tr>
-<td class="td"><strong>mailpath</strong></td><td class="td">/usr/sbin/sendmail</td><td class="td">None</td><td class="td">The server path to Sendmail.</td>
-</tr><tr>
-<td class="td"><strong>smtp_host</strong></td><td class="td">No Default</td><td class="td">None</td><td class="td">SMTP Server Address.</td>
-</tr><tr>
-<td class="td"><strong>smtp_user</strong></td><td class="td">No Default</td><td class="td">None</td><td class="td">SMTP Username.</td>
-</tr><tr>
-<td class="td"><strong>smtp_pass</strong></td><td class="td">No Default</td><td class="td">None</td><td class="td">SMTP Password.</td>
-</tr><tr>
-<td class="td"><strong>smtp_port</strong></td><td class="td">25</td><td class="td">None</td><td class="td">SMTP Port.</td>
-</tr><tr>
-<td class="td"><strong>smtp_timeout</strong></td><td class="td">5</td><td class="td">None</td><td class="td">SMTP Timeout (in seconds).</td>
-</tr><tr>
-<td class="td"><strong>wordwrap</strong></td><td class="td">TRUE</td><td class="td">TRUE or FALSE (boolean)</td><td class="td">Enable word-wrap.</td>
-</tr><tr>
-<td class="td"><strong>wrapchars</strong></td><td class="td">76</td><td class="td"> </td><td class="td">Character count to wrap at.</td>
-</tr><tr>
-<td class="td"><strong>mailtype</strong></td><td class="td">text</td><td class="td">text or html</td><td class="td">Type 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.</td>
-</tr><tr>
-<td class="td"><strong>charset</strong></td><td class="td">utf-8</td><td class="td"></td><td class="td">Character set (utf-8, iso-8859-1, etc.).</td>
-</tr><tr>
-<td class="td"><strong>validate</strong></td><td class="td">FALSE</td><td class="td">TRUE or FALSE (boolean)</td><td class="td">Whether to validate the email address.</td>
-</tr><tr>
-<td class="td"><strong>priority</strong></td><td class="td">3</td><td class="td">1, 2, 3, 4, 5</td><td class="td">Email Priority. 1 = highest. 5 = lowest. 3 = normal.</td>
-</tr>
-<tr>
- <td class="td"><strong>crlf</strong></td>
- <td class="td">\n</td>
- <td class="td">&quot;\r\n&quot; or &quot;\n&quot; or &quot;\r&quot;</td>
- <td class="td">Newline character. (Use &quot;\r\n&quot; to comply with RFC 822).</td>
-</tr>
-<tr>
-<td class="td"><strong>newline</strong></td><td class="td">\n</td>
-<td class="td">"\r\n" or "\n" or &quot;\r&quot;</td><td class="td">Newline character. (Use "\r\n" to comply with RFC 822).</td>
-</tr><tr>
-<td class="td"><strong>bcc_batch_mode</strong></td><td class="td">FALSE</td><td class="td">TRUE or FALSE (boolean)</td><td class="td">Enable BCC Batch Mode.</td>
-</tr><tr>
-<td class="td"><strong>bcc_batch_size</strong></td><td class="td">200</td><td class="td">None</td><td class="td">Number of emails in each BCC batch.</td>
-</tr>
-</table>
-
-
-<h2>Email Function Reference</h2>
-
-<h3>$this->email->from()</h3>
-<p>Sets the email address and name of the person sending the email:</p>
-<code>$this->email->from('<var>you@example.com</var>', '<var>Your Name</var>');</code>
-
-<h3>$this->email->reply_to()</h3>
-<p>Sets the reply-to address. If the information is not provided the information in the "from" function is used. Example:</p>
-<code>$this->email->reply_to('<var>you@example.com</var>', '<var>Your Name</var>');</code>
-
-
-<h3>$this->email->to()</h3>
-<p>Sets the email address(s) of the recipient(s). Can be a single email, a comma-delimited list or an array:</p>
-
-<code>$this->email->to('<var>someone@example.com</var>');</code>
-<code>$this->email->to('<var>one@example.com</var>, <var>two@example.com</var>, <var>three@example.com</var>');</code>
-
-<code>$list = array('<var>one@example.com</var>', '<var>two@example.com</var>', '<var>three@example.com</var>');<br />
-<br />
-$this->email->to(<var>$list</var>);</code>
-
-<h3>$this->email->cc()</h3>
-<p>Sets the CC email address(s). Just like the "to", can be a single email, a comma-delimited list or an array.</p>
-
-<h3>$this->email->bcc()</h3>
-<p>Sets the BCC email address(s). Just like the "to", can be a single email, a comma-delimited list or an array.</p>
-
-
-<h3>$this->email->subject()</h3>
-<p>Sets the email subject:</p>
-<code>$this->email->subject('<var>This is my subject</var>');</code>
-
-<h3>$this->email->message()</h3>
-<p>Sets the email message body:</p>
-<code>$this->email->message('<var>This is my message</var>');</code>
-
-<h3>$this->email->set_alt_message()</h3>
-<p>Sets the alternative email message body:</p>
-<code>$this->email->set_alt_message('<var>This is the alternative message</var>');</code>
-
-<p>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.</p>
-
-
-
-<h3>$this->email->clear()</h3>
-<p>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.</p>
-<code>foreach ($list as $name => $address)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$this->email->clear();<br /><br />
-
-&nbsp;&nbsp;&nbsp;&nbsp;$this->email->to($address);<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$this->email->from('your@example.com');<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$this->email->subject('Here is your info '.$name);<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$this->email->message('Hi '.$name.' Here is the info you requested.');<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$this->email->send();<br />
-}</code>
-
-<p>If you set the parameter to TRUE any attachments will be cleared as well:</p>
-
-<code>$this->email->clear(TRUE);</code>
-
-
-<h3>$this->email->send()</h3>
-<p>The Email sending function. Returns boolean TRUE or FALSE based on success or failure, enabling it to be used
-conditionally:</p>
-
-<code>if ( ! $this->email->send())<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;// Generate error<br />
-}</code>
-
-
-<h3>$this->email->attach()</h3>
-<p>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:</p>
-
-<code>$this->email->attach('/path/to/photo1.jpg');<br />
-$this->email->attach('/path/to/photo2.jpg');<br />
-$this->email->attach('/path/to/photo3.jpg');<br />
-<br />
-$this->email->send();</code>
-
-
-<h3>$this->email->print_debugger()</h3>
-<p>Returns a string containing any server messages, the email headers, and the email messsage. Useful for debugging.</p>
-
-
-<h2>Overriding Word Wrapping</h2>
-
-<p>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:</p>
-
-<code>The text of your email that<br />
-gets wrapped normally.<br />
-<br />
-<var>{unwrap}</var>http://example.com/a_long_link_that_should_not_be_wrapped.html<var>{/unwrap}</var><br />
-<br />
-More text that will be<br />
-wrapped normally.</code>
-
-<p>Place the item you do not want word-wrapped between: <var>{unwrap}</var> <var>{/unwrap}</var></p>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="../database/index.html">Database Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="encryption.html">Encryption Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html
deleted file mode 100644
index 6ec629f96..000000000
--- a/user_guide/libraries/encryption.html
+++ /dev/null
@@ -1,224 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Encryption Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Encryption Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Encryption Class</h1>
-
-<p>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 be provided with a high degree of security appropriate for storage.</p>
-
-
-<h2>Setting your Key</h2>
-
-<p>A <em>key</em> 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 <strong>only</strong> 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.</p>
-
-<p>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.</p>
-
-<p>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 <strong>not</strong> be a simple text string. In order to be cryptographically secure it
-needs to be as random as possible.</p>
-
-<p>Your key can be either stored in your <dfn>application/config/config.php</dfn>, or you can design your own
-storage mechanism and pass the key dynamically when encoding/decoding.</p>
-
-<p>To save your key to your <dfn>application/config/config.php</dfn>, open the file and set:</p>
-<code>$config['encryption_key'] = "YOUR KEY";</code>
-
-
-<h2>Message Length</h2>
-
-<p>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.</p>
-
-
-<h2>Initializing the Class</h2>
-
-<p>Like most other classes in CodeIgniter, the Encryption class is initialized in your controller using the <dfn>$this->load->library</dfn> function:</p>
-
-<code>$this->load->library('encrypt');</code>
-<p>Once loaded, the Encrypt library object will be available using: <dfn>$this->encrypt</dfn></p>
-
-
-<h2>$this->encrypt->encode()</h2>
-
-<p>Performs the data encryption and returns it as a string. Example:</p>
-<code>
-$msg = 'My secret message';<br />
-<br />
-$encrypted_string = $this->encrypt->encode($msg);</code>
-
-<p>You can optionally pass your encryption key via the second parameter if you don't want to use the one in your config file:</p>
-
-<code>
-$msg = 'My secret message';<br />
-$key = 'super-secret-key';<br />
-<br />
-$encrypted_string = $this->encrypt->encode($msg, $key);</code>
-
-
-<h2>$this->encrypt->decode()</h2>
-
-<p>Decrypts an encoded string. Example:</p>
-
-<code>
-$encrypted_string = 'APANtByIGI1BpVXZTJgcsAG8GZl8pdwwa84';<br />
-<br />
-$plaintext_string = $this->encrypt->decode($encrypted_string);</code>
-
-<p>You can optionally pass your encryption key via the second parameter if you don't want to use the one in your config file:</p>
-
-<code>
-$msg = 'My secret message';<br />
-$key = 'super-secret-key';<br />
-<br />
-$encrypted_string = $this->encrypt->decode($msg, $key);</code>
-
-
-<h2>$this->encrypt->set_cipher();</h2>
-
-<p>Permits you to set an Mcrypt cipher. By default it uses <samp>MCRYPT_RIJNDAEL_256</samp>. Example:</p>
-<code>$this->encrypt->set_cipher(MCRYPT_BLOWFISH);</code>
-<p>Please visit php.net for a list of <a href="http://php.net/mcrypt">available ciphers</a>.</p>
-
-<p>If you'd like to manually test whether your server supports Mcrypt you can use:</p>
-<code>echo ( ! function_exists('mcrypt_encrypt')) ? 'Nope' : 'Yup';</code>
-
-
-<h2>$this->encrypt->set_mode();</h2>
-
-<p>Permits you to set an Mcrypt mode. By default it uses <samp>MCRYPT_MODE_CBC</samp>. Example:</p>
-<code>$this->encrypt->set_mode(MCRYPT_MODE_CFB);</code>
-<p>Please visit php.net for a list of <a href="http://php.net/mcrypt">available modes</a>.</p>
-
-
-<h2>$this->encrypt->sha1();</h2>
-<p>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:</p>
-<code>$hash = $this->encrypt->sha1('Some string');</code>
-
-<p>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:</p>
-
-<code>$hash = sha1('Some string');</code>
-
-<p>If your server does not support SHA1 you can use the provided function.</p>
-
-<h2 id="legacy">$this->encrypt->encode_from_legacy(<kbd>$orig_data</kbd>, <kbd>$legacy_mode</kbd> = MCRYPT_MODE_ECB, <kbd>$key</kbd> = '');</h2>
-<p>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.</p>
-
-<p class="important"><strong>Why only a method to re-encode the data instead of maintaining legacy methods for both encoding and decoding?</strong> 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.</p>
-
-<code>$new_data = $this->encrypt->encode_from_legacy(<kbd>$old_encrypted_string</kbd>);</code>
-
-<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
-<tr>
- <th>Parameter</th>
- <th>Default</th>
- <th>Description</th>
-</tr>
-<tr>
- <td class="td"><strong>$orig_data</strong></td>
- <td class="td">n/a</td>
- <td class="td">The original encrypted data from CodeIgniter 1.x's Encryption library</td>
-</tr>
-<tr>
- <td class="td"><strong>$legacy_mode</strong></td>
- <td class="td">MCRYPT_MODE_ECB</td>
- <td class="td">The 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.</td>
-</tr>
-<tr>
- <td class="td"><strong>$key</strong></td>
- <td class="td">n/a</td>
- <td class="td">The encryption key. This it typically specified in your config file as outlined above.</td>
-</tr>
-</table>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="email.html">Email Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="file_uploading.html">File Uploading Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html
deleted file mode 100644
index 2cb1ef5ea..000000000
--- a/user_guide/libraries/file_uploading.html
+++ /dev/null
@@ -1,451 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>File Uploading Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-File Uploading Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>File Uploading Class</h1>
-
-<p>CodeIgniter's File Uploading Class permits files to be uploaded. You can set various
-preferences, restricting the type and size of the files.</p>
-
-
-<h2>The Process</h2>
-
-<p>Uploading a file involves the following general process:</p>
-
-
-<ul>
-<li>An upload form is displayed, allowing a user to select a file and upload it.</li>
-<li>When the form is submitted, the file is uploaded to the destination you specify.</li>
-<li>Along the way, the file is validated to make sure it is allowed to be uploaded based on the preferences you set.</li>
-<li>Once uploaded, the user will be shown a success message.</li>
-</ul>
-
-<p>To demonstrate this process here is brief tutorial. Afterward you'll find reference information.</p>
-
-<h2>Creating the Upload Form</h2>
-
-
-
-<p>Using a text editor, create a form called <dfn>upload_form.php</dfn>. In it, place this code and save it to your <samp>applications/views/</samp>
-folder:</p>
-
-
-<textarea class="textarea" style="width:100%" cols="50" rows="23">
-&lt;html>
-&lt;head>
-&lt;title>Upload Form&lt;/title>
-&lt;/head>
-&lt;body>
-
-&lt;?php echo $error;?>
-
-&lt;?php echo form_open_multipart('upload/do_upload');?>
-
-&lt;input type="file" name="userfile" size="20" />
-
-&lt;br />&lt;br />
-
-&lt;input type="submit" value="upload" />
-
-&lt;/form>
-
-&lt;/body>
-&lt;/html></textarea>
-
-<p>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.</p>
-
-
-<h2>The Success Page</h2>
-
-<p>Using a text editor, create a form called <dfn>upload_success.php</dfn>.
-In it, place this code and save it to your <samp>applications/views/</samp> folder:</p>
-
-<textarea class="textarea" style="width:100%" cols="50" rows="20">&lt;html>
-&lt;head>
-&lt;title>Upload Form&lt;/title>
-&lt;/head>
-&lt;body>
-
-&lt;h3>Your file was successfully uploaded!&lt;/h3>
-
-&lt;ul>
-&lt;?php foreach ($upload_data as $item => $value):?>
-&lt;li>&lt;?php echo $item;?>: &lt;?php echo $value;?>&lt;/li>
-&lt;?php endforeach; ?>
-&lt;/ul>
-
-&lt;p>&lt;?php echo anchor('upload', 'Upload Another File!'); ?>&lt;/p>
-
-&lt;/body>
-&lt;/html></textarea>
-
-
-<h2>The Controller</h2>
-
-<p>Using a text editor, create a controller called <dfn>upload.php</dfn>. In it, place this code and save it to your <samp>applications/controllers/</samp>
-folder:</p>
-
-
-<textarea class="textarea" style="width:100%" cols="50" rows="43">&lt;?php
-
-class Upload extends CI_Controller {
-
- function __construct()
- {
- parent::__construct();
- $this->load->helper(array('form', 'url'));
- }
-
- function index()
- {
- $this->load->view('upload_form', array('error' => ' ' ));
- }
-
- function do_upload()
- {
- $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);
-
- if ( ! $this->upload->do_upload())
- {
- $error = array('error' => $this->upload->display_errors());
-
- $this->load->view('upload_form', $error);
- }
- else
- {
- $data = array('upload_data' => $this->upload->data());
-
- $this->load->view('upload_success', $data);
- }
- }
-}
-?&gt;</textarea>
-
-
-<h2>The Upload Folder</h2>
-
-<p>You'll need a destination folder for your uploaded images. Create a folder at the root of your CodeIgniter installation called
-<dfn>uploads</dfn> and set its file permissions to 777.</p>
-
-
-<h2>Try it!</h2>
-
-<p>To try your form, visit your site using a URL similar to this one:</p>
-
-<code>example.com/index.php/<var>upload</var>/</code>
-
-<p>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.</p>
-
-
-<p>&nbsp;</p>
-
-<h1>Reference Guide</h1>
-
-
-<h2>Initializing the Upload Class</h2>
-
-<p>Like most other classes in CodeIgniter, the Upload class is initialized in your controller using the <dfn>$this->load->library</dfn> function:</p>
-
-<code>$this->load->library('upload');</code>
-<p>Once the Upload class is loaded, the object will be available using: <dfn>$this->upload</dfn></p>
-
-
-<h2>Setting Preferences</h2>
-
-<p>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:</p>
-
-<code>$config['upload_path'] = './uploads/';<br />
-$config['allowed_types'] = 'gif|jpg|png';<br />
-$config['max_size'] = '100';<br />
-$config['max_width'] = '1024';<br />
-$config['max_height'] = '768';<br />
-<br />
-$this->load->library('upload', $config);<br /><br />
-
-// Alternately you can set preferences by calling the initialize function. Useful if you auto-load the class:<br />
-$this->upload->initialize($config);</code>
-
-<p>The above preferences should be fairly self-explanatory. Below is a table describing all available preferences.</p>
-
-
-<h2>Preferences</h2>
-
-<p>The following preferences are available. The default value indicates what will be used if you do not specify that preference.</p>
-
-<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
-<tr>
-<th>Preference</th>
-<th>Default&nbsp;Value</th>
-<th>Options</th>
-<th>Description</th>
-</tr>
-
-<tr>
-<td class="td"><strong>upload_path</strong></td>
-<td class="td">None</td>
-<td class="td">None</td>
-<td class="td">The path to the folder where the upload should be placed. The folder must be writable and the path can be absolute or relative.</td>
-</tr>
-
-<tr>
-<td class="td"><strong>allowed_types</strong></td>
-<td class="td">None</td>
-<td class="td">None</td>
-<td class="td">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.</td>
-</tr>
-
-
-<tr>
-<td class="td"><strong>file_name</strong></td>
-<td class="td">None</td>
-<td class="td">Desired file name</td>
-<td class="td">
- <p>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.</p>
-</td>
-</tr>
-
-<tr>
-<td class="td"><strong>overwrite</strong></td>
-<td class="td">FALSE</td>
-<td class="td">TRUE/FALSE (boolean)</td>
-<td class="td">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.</td>
-</tr>
-
-
-<tr>
-<td class="td"><strong>max_size</strong></td>
-<td class="td">0</td>
-<td class="td">None</td>
-<td class="td">The 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.</td>
-</tr>
-
-<tr>
-<td class="td"><strong>max_width</strong></td>
-<td class="td">0</td>
-<td class="td">None</td>
-<td class="td">The maximum width (in pixels) that the file can be. Set to zero for no limit.</td>
-</tr>
-
-<tr>
-<td class="td"><strong>max_height</strong></td>
-<td class="td">0</td>
-<td class="td">None</td>
-<td class="td">The maximum height (in pixels) that the file can be. Set to zero for no limit.</td>
-</tr>
-
-<tr>
-<td class="td"><strong>max_filename</strong></td>
-<td class="td">0</td>
-<td class="td">None</td>
-<td class="td">The maximum length that a file name can be. Set to zero for no limit.</td>
-</tr>
-
-<tr>
-<td class="td"><strong>encrypt_name</strong></td>
-<td class="td">FALSE</td>
-<td class="td">TRUE/FALSE (boolean)</td>
-<td class="td">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.</td>
-</tr>
-
-<tr>
-<td class="td"><strong>remove_spaces</strong></td>
-<td class="td">TRUE</td>
-<td class="td">TRUE/FALSE (boolean)</td>
-<td class="td">If set to TRUE, any spaces in the file name will be converted to underscores. This is recommended.</td>
-</tr>
-</table>
-
-
-<h2>Setting preferences in a config file</h2>
-
-<p>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 <var>upload.php</var>, add the <var>$config</var>
-array in that file. Then save the file in: <var>config/upload.php</var> and it will be used automatically. You
-will NOT need to use the <dfn>$this->upload->initialize</dfn> function if you save your preferences in a config file.</p>
-
-
-<h2>Function Reference</h2>
-
-<p>The following functions are available</p>
-
-
-<h2>$this->upload->do_upload()</h2>
-
-<p>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 <dfn>userfile</dfn>, and the form must be a "multipart type:</p>
-
-<code>&lt;form method="post" action="some_action" enctype="multipart/form-data" /></code>
-
-<p>If you would like to set your own field name simply pass its value to the <dfn>do_upload</dfn> function:</p>
-
-<code>
-$field_name = "some_field_name";<br />
-$this->upload->do_upload($field_name)</code>
-
-
-<h2>$this->upload->display_errors()</h2>
-
-<p>Retrieves any error messages if the <dfn>do_upload()</dfn> function returned false. The function does not echo automatically, it
-returns the data so you can assign it however you need.</p>
-
-<h3>Formatting Errors</h3>
-<p>By default the above function wraps any errors within &lt;p> tags. You can set your own delimiters like this:</p>
-
-<code>$this->upload->display_errors('<var>&lt;p></var>', '<var>&lt;/p></var>');</code>
-
-<h2>$this->upload->data()</h2>
-
-<p>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:</p>
-
-<code>Array<br />
-(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;[file_name]&nbsp;&nbsp;&nbsp;&nbsp;=> mypic.jpg<br />
-&nbsp;&nbsp;&nbsp;&nbsp;[file_type]&nbsp;&nbsp;&nbsp;&nbsp;=> image/jpeg<br />
-&nbsp;&nbsp;&nbsp;&nbsp;[file_path]&nbsp;&nbsp;&nbsp;&nbsp;=> /path/to/your/upload/<br />
-&nbsp;&nbsp;&nbsp;&nbsp;[full_path]&nbsp;&nbsp;&nbsp;&nbsp;=> /path/to/your/upload/jpg.jpg<br />
-&nbsp;&nbsp;&nbsp;&nbsp;[raw_name]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> mypic<br />
-&nbsp;&nbsp;&nbsp;&nbsp;[orig_name]&nbsp;&nbsp;&nbsp;&nbsp;=> mypic.jpg<br />
-&nbsp;&nbsp;&nbsp;&nbsp;[client_name]&nbsp;&nbsp;=> mypic.jpg<br />
-&nbsp;&nbsp;&nbsp;&nbsp;[file_ext]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> .jpg<br />
-&nbsp;&nbsp;&nbsp;&nbsp;[file_size]&nbsp;&nbsp;&nbsp;&nbsp;=> 22.2<br />
-&nbsp;&nbsp;&nbsp;&nbsp;[is_image]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> 1<br />
-&nbsp;&nbsp;&nbsp;&nbsp;[image_width]&nbsp;&nbsp;=> 800<br />
-&nbsp;&nbsp;&nbsp;&nbsp;[image_height] => 600<br />
-&nbsp;&nbsp;&nbsp;&nbsp;[image_type]&nbsp;&nbsp;&nbsp;=> jpeg<br />
-&nbsp;&nbsp;&nbsp;&nbsp;[image_size_str] => width="800" height="200"<br />
-)</code>
-
-<h3>Explanation</h3>
-
-<p>Here is an explanation of the above array items.</p>
-
-<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
-<tr><th>Item</th><th>Description</th></tr>
-
-<tr><td class="td"><strong>file_name</strong></td>
-<td class="td">The name of the file that was uploaded including the file extension.</td></tr>
-
-<tr><td class="td"><strong>file_type</strong></td>
-<td class="td">The file's Mime type</td></tr>
-
-<tr><td class="td"><strong>file_path</strong></td>
-<td class="td">The absolute server path to the file</td></tr>
-
-<tr><td class="td"><strong>full_path</strong></td>
-<td class="td">The absolute server path including the file name</td></tr>
-
-<tr><td class="td"><strong>raw_name</strong></td>
-<td class="td">The file name without the extension</td></tr>
-
-<tr><td class="td"><strong>orig_name</strong></td>
-<td class="td">The original file name. This is only useful if you use the encrypted name option.</td></tr>
-
-<tr><td class="td"><strong>client_name</strong></td>
-<td class="td">The file name as supplied by the client user agent, prior to any file name preparation or incrementing.</td></tr>
-
-<tr><td class="td"><strong>file_ext</strong></td>
-<td class="td">The file extension with period</td></tr>
-
-<tr><td class="td"><strong>file_size</strong></td>
-<td class="td">The file size in kilobytes</td></tr>
-
-<tr><td class="td"><strong>is_image</strong></td>
-<td class="td">Whether the file is an image or not. 1 = image. 0 = not.</td></tr>
-
-<tr><td class="td"><strong>image_width</strong></td>
-<td class="td">Image width.</td></tr>
-
-<tr><td class="td"><strong>image_height</strong></td>
-<td class="td">Image height</td></tr>
-
-<tr><td class="td"><strong>image_type</strong></td>
-<td class="td">Image type. Typically the file extension without the period.</td></tr>
-
-<tr><td class="td"><strong>image_size_str</strong></td>
-<td class="td">A string containing the width and height. Useful to put into an image tag.</td></tr>
-
-
-</table>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="encryption.html">Encryption Helper</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="form_validation.html">Form Validation Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">Ellislab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html
deleted file mode 100644
index 2028bcd2c..000000000
--- a/user_guide/libraries/form_validation.html
+++ /dev/null
@@ -1,1250 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Form Validation : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Form Validation
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Form Validation</h1>
-
-<p>CodeIgniter provides a comprehensive form validation and data prepping class that helps minimize the amount of code you'll write.</p>
-
-<ul>
-<li><a href="#overview">Overview</a></li>
-<li><a href="#tutorial">Form Validation Tutorial</a>
-
- <ul>
- <li><a href="#theform">The Form</a></li>
- <li><a href="#thesuccesspage">The Success Page</a></li>
- <li><a href="#thecontroller">The Controller</a></li>
- <li><a href="#validationrules">Setting Validation Rules</a></li>
- <li><a href="#validationrulesasarray">Setting Validation Rules Using an Array</a></li>
- <li><a href="#cascadingrules">Cascading Rules</a></li>
- <li><a href="#preppingdata">Prepping Data</a></li>
- <li><a href="#repopulatingform">Re-populating the Form</a></li>
- <li><a href="#callbacks">Callbacks</a></li>
- <li><a href="#settingerrors">Setting Error Messages</a></li>
- <li><a href="#errordelimiters">Changing the Error Delimiters</a></li>
- <li><a href="#translatingfn">Translating Field Names</a></li>
- <li><a href="#individualerrors">Showing Errors Individually</a></li>
- <li><a href="#savingtoconfig">Saving Sets of Validation Rules to a Config File</a></li>
- <li><a href="#arraysasfields">Using Arrays as Field Names</a></li>
- </ul>
-</li>
-<li><a href="#rulereference">Rule Reference</a></li>
-<li><a href="#preppingreference">Prepping Reference</a></li>
-<li><a href="#functionreference">Function Reference</a></li>
-<li><a href="#helperreference">Helper Reference</a></li>
-
-</ul>
-
-
-
-
-
-
-<p>&nbsp;</p>
-
-<a name="overview"></a>
-<h1>Overview</h1>
-
-
-<p>Before explaining CodeIgniter's approach to data validation, let's describe the ideal scenario:</p>
-
-<ol>
-<li>A form is displayed.</li>
-<li>You fill it in and submit it.</li>
-<li>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.</li>
-<li>This process continues until you have submitted a valid form.</li>
-</ol>
-
-<p>On the receiving end, the script must:</p>
-
-<ol>
-<li>Check for required data.</li>
-<li>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.</li>
-<li>Sanitize the data for security.</li>
-<li>Pre-format the data if needed (Does the data need to be trimmed? HTML encoded? Etc.)</li>
-<li>Prep the data for insertion in the database.</li>
-</ol>
-
-
-<p>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.</p>
-
-<p>&nbsp;</p>
-
-
-<a name="tutorial"></a>
-<h1>Form Validation Tutorial</h1>
-
-<p>What follows is a "hands on" tutorial for implementing CodeIgniters Form Validation.</p>
-
-
-<p>In order to implement form validation you'll need three things:</p>
-
-<ol>
-<li>A <a href="../general/views.html">View</a> file containing a form.</li>
-<li>A View file containing a "success" message to be displayed upon successful submission.</li>
-<li>A <a href="../general/controllers.html">controller</a> function to receive and process the submitted data.</li>
-</ol>
-
-<p>Let's create those three things, using a member sign-up form as the example.</p>
-
-
-
-<a name="theform"></a>
-
-<h2>The Form</h2>
-
-<p>Using a text editor, create a form called <dfn>myform.php</dfn>. In it, place this code and save it to your <samp>applications/views/</samp>
-folder:</p>
-
-
-<textarea class="textarea" style="width:100%" cols="50" rows="30">&lt;html>
-&lt;head>
-&lt;title>My Form&lt;/title>
-&lt;/head>
-&lt;body>
-
-&lt;?php echo validation_errors(); ?>
-
-&lt;?php echo form_open('form'); ?>
-
-&lt;h5>Username&lt;/h5>
-&lt;input type="text" name="username" value="" size="50" />
-
-&lt;h5>Password&lt;/h5>
-&lt;input type="text" name="password" value="" size="50" />
-
-&lt;h5>Password Confirm&lt;/h5>
-&lt;input type="text" name="passconf" value="" size="50" />
-
-&lt;h5>Email Address&lt;/h5>
-&lt;input type="text" name="email" value="" size="50" />
-
-&lt;div>&lt;input type="submit" value="Submit" />&lt;/div>
-
-&lt;/form>
-
-&lt;/body>
-&lt;/html>
-</textarea>
-
-
-
-
-<a name="thesuccesspage"></a>
-<h2>The Success Page</h2>
-
-
-<p>Using a text editor, create a form called <dfn>formsuccess.php</dfn>. In it, place this code and save it to your <samp>applications/views/</samp>
-folder:</p>
-
-
-<textarea class="textarea" style="width:100%" cols="50" rows="14">
-&lt;html>
-&lt;head>
-&lt;title>My Form&lt;/title>
-&lt;/head>
-&lt;body>
-
-&lt;h3>Your form was successfully submitted!&lt;/h3>
-
-&lt;p>&lt;?php echo anchor('form', 'Try it again!'); ?>&lt;/p>
-
-&lt;/body>
-&lt;/html>
-</textarea>
-
-
-
-<a name="thecontroller"></a>
-<h2>The Controller</h2>
-
-<p>Using a text editor, create a controller called <dfn>form.php</dfn>. In it, place this code and save it to your <samp>applications/controllers/</samp>
-folder:</p>
-
-
-<textarea class="textarea" style="width:100%" cols="50" rows="21">&lt;?php
-
-class Form extends CI_Controller {
-
- function index()
- {
- $this->load->helper(array('form', 'url'));
-
- $this->load->library('form_validation');
-
- if ($this->form_validation->run() == FALSE)
- {
- $this->load->view('myform');
- }
- else
- {
- $this->load->view('formsuccess');
- }
- }
-}
-?></textarea>
-
-
-<h2>Try it!</h2>
-
-<p>To try your form, visit your site using a URL similar to this one:</p>
-
-<code>example.com/index.php/<var>form</var>/</code>
-
-<p><dfn>If you submit the form you should simply see the form reload. That's because you haven't set up any validation
-rules yet.</dfn></p>
-
-<p><strong>Since you haven't told the Form Validation class to validate anything yet, it returns <kbd>FALSE</kbd> (boolean false) by default. The <samp>run()</samp>
-function only returns <kbd>TRUE</kbd> if it has successfully applied your rules without any of them failing.</strong></p>
-
-
-<h2>Explanation</h2>
-
-<p>You'll notice several things about the above pages:</p>
-
-<p>The <dfn>form</dfn> (myform.php) is a standard web form with a couple exceptions:</p>
-
-<ol>
-<li>It uses a <dfn>form helper</dfn> 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.</li>
-
-<li>At the top of the form you'll notice the following function call:
-<code>&lt;?php echo validation_errors(); ?&gt;</code>
-
-<p>This function will return any error messages sent back by the validator. If there are no messages it returns an empty string.</p>
-</li>
-</ol>
-
-<p>The <dfn>controller</dfn> (form.php) has one function: <dfn>index()</dfn>. This function initializes the validation class and
-loads the <var>form helper</var> and <var>URL helper</var> used by your view files. It also <samp>runs</samp>
-the validation routine. Based on
-whether the validation was successful it either presents the form or the success page.</p>
-
-
-
-
-<a name="validationrules"></a>
-
-<h2>Setting Validation Rules</h2>
-
-<p>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 <dfn>set_rules()</dfn> function:</p>
-
-<code>$this->form_validation->set_rules();</code>
-
-<p>The above function takes <strong>three</strong> parameters as input:</p>
-
-<ol>
- <li>The field name - the exact name you've given the form field.</li>
- <li>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". <strong>Note:</strong> If you would like the field name to be stored in a language file, please see <a href="#translatingfn">Translating Field Names</a>.</li>
- <li>The validation rules for this form field.</li>
-</ol>
-
-
-<p><br />Here is an example. In your <dfn>controller</dfn> (form.php), add this code just below the validation initialization function:</p>
-
-<code>
-$this->form_validation->set_rules('username', 'Username', 'required');<br />
-$this->form_validation->set_rules('password', 'Password', 'required');<br />
-$this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');<br />
-$this->form_validation->set_rules('email', 'Email', 'required');<br />
-</code>
-
-<p>Your controller should now look like this:</p>
-
-<textarea class="textarea" style="width:100%" cols="50" rows="28">&lt;?php
-
-class Form extends CI_Controller {
-
- function index()
- {
- $this->load->helper(array('form', 'url'));
-
- $this->load->library('form_validation');
-
- $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');
-
- if ($this->form_validation->run() == FALSE)
- {
- $this->load->view('myform');
- }
- else
- {
- $this->load->view('formsuccess');
- }
- }
-}
-?></textarea>
-
-<p><dfn>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.</dfn></p>
-
-<p class="important"><strong>Note:</strong> The form fields are not yet being re-populated with the data when
-there is an error. We'll get to that shortly.</p>
-
-
-
-
-<a name="validationrulesasarray"></a>
-<h2>Setting Rules Using an Array</h2>
-
-<p>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:</p>
-
-<code>
-$config = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'field'&nbsp;&nbsp;&nbsp;=> 'username', <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'label'&nbsp;&nbsp;&nbsp;=> 'Username', <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rules'&nbsp;&nbsp;&nbsp;=> 'required'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'field'&nbsp;&nbsp;&nbsp;=> 'password', <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'label'&nbsp;&nbsp;&nbsp;=> 'Password', <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rules'&nbsp;&nbsp;&nbsp;=> 'required'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'field'&nbsp;&nbsp;&nbsp;=> 'passconf', <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'label'&nbsp;&nbsp;&nbsp;=> 'Password Confirmation', <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rules'&nbsp;&nbsp;&nbsp;=> 'required'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),&nbsp;&nbsp;&nbsp;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'field'&nbsp;&nbsp;&nbsp;=> 'email', <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'label'&nbsp;&nbsp;&nbsp;=> 'Email', <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rules'&nbsp;&nbsp;&nbsp;=> 'required'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-$this->form_validation->set_rules($config);
-</code>
-
-
-
-
-
-
-<a name="cascadingrules"></a>
-<h2>Cascading Rules</h2>
-
-<p>CodeIgniter lets you pipe multiple rules together. Let's try it. Change your rules in the third parameter of rule setting function, like this:</p>
-
-<code>
-$this->form_validation->set_rules('username', 'Username', 'required|min_length[5]|max_length[12]|is_unique[users.username]');<br />
-$this->form_validation->set_rules('password', 'Password', 'required|matches[passconf]');<br />
-$this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');<br />
-$this->form_validation->set_rules('email', 'Email', 'required|valid_email|is_unique[users.email]');<br />
-</code>
-
-<p>The above code sets the following rules:</p>
-
-<ol>
-<li>The username field be no shorter than 5 characters and no longer than 12.</li>
-<li>The password field must match the password confirmation field.</li>
-<li>The email field must contain a valid email address.</li>
-</ol>
-
-<p>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.</p>
-
-
-
-<a name="preppingdata"></a>
-<h2>Prepping Data</h2>
-
-<p>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:</p>
-
-<code>
-$this->form_validation->set_rules('username', 'Username', '<kbd>trim</kbd>|required|min_length[5]|max_length[12]|<kbd>xss_clean</kbd>');<br />
-$this->form_validation->set_rules('password', 'Password', '<kbd>trim</kbd>|required|matches[passconf]|<kbd>md5</kbd>');<br />
-$this->form_validation->set_rules('passconf', 'Password Confirmation', '<kbd>trim</kbd>|required');<br />
-$this->form_validation->set_rules('email', 'Email', '<kbd>trim</kbd>|required|valid_email');<br />
-</code>
-
-
-<p>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.</p>
-
-<p><strong>Any native PHP function that accepts one parameter can be used as a rule, like <dfn>htmlspecialchars</dfn>,
-<dfn>trim</dfn>, <dfn>MD5</dfn>, etc.</strong></p>
-
-<p><strong>Note:</strong> You will generally want to use the prepping functions <strong>after</strong>
-the validation rules so if there is an error, the original data will be shown in the form.</p>
-
-
-
-
-<a name="repopulatingform"></a>
-<h2>Re-populating the form</h2>
-
-<p>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:</p>
-
-<code>set_value('field name')</code>
-
-
-<p>Open your <dfn>myform.php</dfn> view file and update the <strong>value</strong> in each field using the <dfn>set_value()</dfn> function:</p>
-
-<p><strong>Don't forget to include each field name in the <dfn>set_value()</dfn> functions!</strong></p>
-
-
-<textarea class="textarea" style="width:100%" cols="50" rows="30">
-&lt;html>
-&lt;head>
-&lt;title>My Form&lt;/title>
-&lt;/head>
-&lt;body>
-
-&lt;?php echo validation_errors(); ?>
-
-&lt;?php echo form_open('form'); ?>
-
-&lt;h5>Username&lt;/h5>
-&lt;input type="text" name="username" value="&lt;?php echo set_value('username'); ?>" size="50" />
-
-&lt;h5>Password&lt;/h5>
-&lt;input type="text" name="password" value="&lt;?php echo set_value('password'); ?>" size="50" />
-
-&lt;h5>Password Confirm&lt;/h5>
-&lt;input type="text" name="passconf" value="&lt;?php echo set_value('passconf'); ?>" size="50" />
-
-&lt;h5>Email Address&lt;/h5>
-&lt;input type="text" name="email" value="&lt;?php echo set_value('email'); ?>" size="50" />
-
-&lt;div>&lt;input type="submit" value="Submit" />&lt;/div>
-
-&lt;/form>
-
-&lt;/body>
-&lt;/html>
-</textarea>
-
-
-<p><dfn>Now reload your page and submit the form so that it triggers an error. Your form fields should now be re-populated</dfn></p>
-
-<p class="important"><strong>Note:</strong> The <a href="#functionreference">Function Reference</a> section below contains functions that
-permit you to re-populate &lt;select> menus, radio buttons, and checkboxes.</p>
-
-
-<p><strong>Important Note:</strong> If you use an array as the name of a form field, you must supply it as an array to the function. Example:</p>
-
-<code>&lt;input type="text" name="<kbd>colors[]</kbd>" value="&lt;?php echo set_value('<kbd>colors[]</kbd>'); ?>" size="50" /></code>
-
-<p>For more info please see the <a href="#arraysasfields">Using Arrays as Field Names</a> section below.</p>
-
-
-
-
-
-<a name="callbacks"></a>
-<h2>Callbacks: Your own Validation Functions</h2>
-
-<p>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.</p>
-
-<p>In your controller, change the "username" rule to this:</p>
-
-<code>$this->form_validation->set_rules('username', 'Username', '<kbd>callback_username_check</kbd>');</code>
-
-<p>Then add a new function called <dfn>username_check</dfn> to your controller. Here's how your controller should now look:</p>
-
-<textarea class="textarea" style="width:100%" cols="50" rows="40">&lt;?php
-
-class Form extends CI_Controller {
-
- public function index()
- {
- $this->load->helper(array('form', 'url'));
-
- $this->load->library('form_validation');
-
- $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|is_unique[users.email]');
-
- if ($this->form_validation->run() == FALSE)
- {
- $this->load->view('myform');
- }
- else
- {
- $this->load->view('formsuccess');
- }
- }
-
- public function username_check($str)
- {
- if ($str == 'test')
- {
- $this->form_validation->set_message('username_check', 'The %s field can not be the word "test"');
- return FALSE;
- }
- else
- {
- return TRUE;
- }
- }
-
-}
-?></textarea>
-
-<p><dfn>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.</dfn></p>
-
-<p>To invoke a callback just put the function name in a rule, with "callback_" as the rule <strong>prefix</strong>. If you need
-to receive an extra parameter in your callback function, just add it normally after the function name between square brackets,
-as in: "callback_foo<strong>[bar]</strong>", then it will be passed as the second argument of your callback function.</p>
-
-<p><strong>Note:</strong> 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.</p>
-
-<a name="settingerrors"></a>
-<h2>Setting Error Messages</h2>
-
-
-<p>All of the native error messages are located in the following language file: <dfn>language/english/form_validation_lang.php</dfn></p>
-
-<p>To set your own custom message you can either edit that file, or use the following function:</p>
-
-<code>$this->form_validation->set_message('<var>rule</var>', '<var>Error Message</var>');</code>
-
-<p>Where <var>rule</var> corresponds to the name of a particular rule, and <var>Error Message</var> is the text you would like displayed.</p>
-
-<p>If you include <dfn>%s</dfn> in your error string, it will be replaced with the "human" name you used for your field when you set your rules.</p>
-
-<p>In the "callback" example above, the error message was set by passing the name of the function:</p>
-
-<code>$this->form_validation->set_message('username_check')</code>
-
-<p>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:</p>
-
-<code>$this->form_validation->set_message('required', 'Your custom message here');</code>
-
-
-
-<a name="translatingfn"></a>
-<h2>Translating Field Names</h2>
-
-<p>If you would like to store the "human" name you passed to the <dfn>set_rules()</dfn> function in a language file, and therefore make the name able to be translated, here's how:</p>
-
-<p>First, prefix your "human" name with <dfn>lang:</dfn>, as in this example:</p>
-
-<code>
-$this->form_validation->set_rules('first_name', '<kbd>lang:</kbd>first_name', 'required');<br />
-</code>
-
-<p>Then, store the name in one of your language file arrays (without the prefix):</p>
-
-<code>$lang['first_name'] = 'First Name';</code>
-
-<p><strong>Note:</strong> 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:</p>
-
-<code>$this->lang->load('file_name');</code>
-
-<p>See the <a href="language.html">Language Class</a> page for more info regarding language files.</p>
-
-
-<a name="errordelimiters"></a>
-<h2>Changing the Error Delimiters</h2>
-
-<p>By default, the Form Validation class adds a paragraph tag (&lt;p&gt;) around each error message shown. You can either change these delimiters globally or
-individually.</p>
-
-<ol>
-
-<li><strong>Changing delimiters Globally</strong>
-
-<p>To globally change the error delimiters, in your controller function, just after loading the Form Validation class, add this:</p>
-
-<code>$this->form_validation->set_error_delimiters('<kbd>&lt;div class="error"></kbd>', '<kbd>&lt;/div></kbd>');</code>
-
-<p>In this example, we've switched to using div tags.</p>
-
-</li>
-
-<li><strong>Changing delimiters Individually</strong>
-
-<p>Each of the two error generating functions shown in this tutorial can be supplied their own delimiters as follows:</p>
-
-<code>&lt;?php echo form_error('field name', '<kbd>&lt;div class="error"></kbd>', '<kbd>&lt;/div></kbd>'); ?></code>
-
-<p>Or:</p>
-
-<code>&lt;?php echo validation_errors('<kbd>&lt;div class="error"></kbd>', '<kbd>&lt;/div></kbd>'); ?></code>
-
-</li>
-</ol>
-
-
-
-
-<a name="individualerrors"></a>
-<h2>Showing Errors Individually</h2>
-
-<p>If you prefer to show an error message next to each form field, rather than as a list, you can use the <dfn>form_error()</dfn> function.</p>
-
-<p>Try it! Change your form so that it looks like this:</p>
-
-<textarea class="textarea" style="width:100%" cols="50" rows="18">
-&lt;h5>Username&lt;/h5>
-&lt;?php echo form_error('username'); ?>
-&lt;input type="text" name="username" value="&lt;?php echo set_value('username'); ?>" size="50" />
-
-&lt;h5>Password&lt;/h5>
-&lt;?php echo form_error('password'); ?>
-&lt;input type="text" name="password" value="&lt;?php echo set_value('password'); ?>" size="50" />
-
-&lt;h5>Password Confirm&lt;/h5>
-&lt;?php echo form_error('passconf'); ?>
-&lt;input type="text" name="passconf" value="&lt;?php echo set_value('passconf'); ?>" size="50" />
-
-&lt;h5>Email Address&lt;/h5>
-&lt;?php echo form_error('email'); ?>
-&lt;input type="text" name="email" value="&lt;?php echo set_value('email'); ?>" size="50" />
-</textarea>
-
-<p>If there are no errors, nothing will be shown. If there is an error, the message will appear.</p>
-
-<p><strong>Important Note:</strong> If you use an array as the name of a form field, you must supply it as an array to the function. Example:</p>
-
-<code>&lt;?php echo form_error('<kbd>options[size]</kbd>'); ?><br />
-&lt;input type="text" name="<kbd>options[size]</kbd>" value="&lt;?php echo set_value("<kbd>options[size]</kbd>"); ?>" size="50" />
-</code>
-
-<p>For more info please see the <a href="#arraysasfields">Using Arrays as Field Names</a> section below.</p>
-
-
-
-
-<p>&nbsp;</p>
-
-
-<a name="savingtoconfig"></a>
-<h1>Saving Sets of Validation Rules to a Config File</h1>
-
-<p>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.</p>
-
-<h3>How to save your rules</h3>
-
-<p>To store your validation rules, simply create a file named <kbd>form_validation.php</kbd> in your <dfn>application/config/</dfn> folder.
-In that file you will place an array named <kbd>$config</kbd> with your rules. As shown earlier, the validation array will have this prototype:</p>
-
-<code>
-$config = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'field'&nbsp;&nbsp;&nbsp;=> 'username', <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'label'&nbsp;&nbsp;&nbsp;=> 'Username', <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rules'&nbsp;&nbsp;&nbsp;=> 'required'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'field'&nbsp;&nbsp;&nbsp;=> 'password', <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'label'&nbsp;&nbsp;&nbsp;=> 'Password', <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rules'&nbsp;&nbsp;&nbsp;=> 'required'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'field'&nbsp;&nbsp;&nbsp;=> 'passconf', <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'label'&nbsp;&nbsp;&nbsp;=> 'Password Confirmation', <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rules'&nbsp;&nbsp;&nbsp;=> 'required'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),&nbsp;&nbsp;&nbsp;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'field'&nbsp;&nbsp;&nbsp;=> 'email', <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'label'&nbsp;&nbsp;&nbsp;=> 'Email', <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rules'&nbsp;&nbsp;&nbsp;=> 'required'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-</code>
-
-<p><dfn>Your validation rule file will be loaded automatically and used when you call the run() function.</dfn></p>
-
-<p class="important">Please note that you MUST name your array $config.</p>
-
-<h3>Creating Sets of Rules</h3>
-
-<p>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:</p>
-
-
-<code>$config = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'<kbd>signup</kbd>' => array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'field' => 'username',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'label' => 'Username',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rules' => 'required'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'field' => 'password',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'label' => 'Password',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rules' => 'required'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'field' => 'passconf',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'label' => 'PasswordConfirmation',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rules' => 'required'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'field' => 'email',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'label' => 'Email',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rules' => 'required'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'<kbd>email</kbd>' => array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'field' => 'emailaddress',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'label' => 'EmailAddress',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rules' => 'required|valid_email'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'field' => 'name',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'label' => 'Name',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rules' => 'required|alpha'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'field' => 'title',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'label' => 'Title',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rules' => 'required'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'field' => 'message',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'label' => 'MessageBody',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rules' => 'required'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-</code>
-
-
-<h3>Calling a Specific Rule Group</h3>
-
-<p>In order to call a specific group you will pass its name to the <kbd>run()</kbd> function. For example, to call the <kbd>signup</kbd> rule you will do this:</p>
-
-<code>
-if ($this->form_validation->run('<kbd>signup</kbd>') == FALSE)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;$this->load->view('myform');<br />
-}<br />
-else<br />
-{<br />
-&nbsp;&nbsp;&nbsp;$this->load->view('formsuccess');<br />
-}<br />
-</code>
-
-
-
-<h3>Associating a Controller Function with a Rule Group</h3>
-
-<p>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 <kbd>Member</kbd> and a function named <kbd>signup</kbd>. Here's what your class might look like:</p>
-
-<code>
-&lt;?php<br /><br />
-class <kbd>Member</kbd> extends CI_Controller {<br />
-<br />
-&nbsp;&nbsp;&nbsp;function <kbd>signup</kbd>()<br />
-&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this->load->library('form_validation');<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($this->form_validation->run() == FALSE)<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this->load->view('myform');<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this->load->view('formsuccess');<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-&nbsp;&nbsp;&nbsp;}<br />
-}<br />
-?></code>
-
-<p>In your validation config file, you will name your rule group <kbd>member/signup</kbd>:</p>
-
-
-<code>$config = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'<kbd>member/signup</kbd>' => array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'field' => 'username',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'label' => 'Username',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rules' => 'required'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'field' => 'password',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'label' => 'Password',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rules' => 'required'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'field' => 'passconf',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'label' => 'PasswordConfirmation',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rules' => 'required'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'field' => 'email',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'label' => 'Email',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rules' => 'required'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-</code>
-
-<p><dfn>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.</dfn></p>
-
-<p>&nbsp;</p>
-
-
-<a name="arraysasfields"></a>
-<h1>Using Arrays as Field Names</h1>
-
-<p>The Form Validation class supports the use of arrays as field names. Consider this example:</p>
-
-<code>&lt;input type="text" name="<kbd>options[]</kbd>" value="" size="50" /></code>
-
-<p>If you do use an array as a field name, you must use the EXACT array name in the <a href="#helperreference">Helper Functions</a> that require the field name,
-and as your Validation Rule field name.</p>
-
-<p>For example, to set a rule for the above field you would use:</p>
-
-<code>$this->form_validation->set_rules('<kbd>options[]</kbd>', 'Options', 'required');</code>
-
-<p>Or, to show an error for the above field you would use:</p>
-
-<code>&lt;?php echo form_error('<kbd>options[]</kbd>'); ?></code>
-
-<p>Or to re-populate the field you would use:</p>
-
-<code>&lt;input type="text" name="<kbd>options[]</kbd>" value="<kbd>&lt;?php echo set_value('<kbd>options[]</kbd>'); ?></kbd>" size="50" /></code>
-
-<p>You can use multidimensional arrays as field names as well. For example:</p>
-
-<code>&lt;input type="text" name="<kbd>options[size]</kbd>" value="" size="50" /></code>
-
-<p>Or even:</p>
-
-<code>&lt;input type="text" name="<kbd>sports[nba][basketball]</kbd>" value="" size="50" /></code>
-
-<p>As with our first example, you must use the exact array name in the helper functions:</p>
-
-<code>&lt;?php echo form_error('<kbd>sports[nba][basketball]</kbd>'); ?></code>
-
-<p>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:</p>
-
-<code>
-&lt;input type="checkbox" name="<kbd>options[]</kbd>" value="red" /><br />
-&lt;input type="checkbox" name="<kbd>options[]</kbd>" value="blue" /><br />
-&lt;input type="checkbox" name="<kbd>options[]</kbd>" value="green" />
-</code>
-
-<p>Or if you use a multidimensional array:</p>
-
-<code>
-&lt;input type="checkbox" name="<kbd>options[color][]</kbd>" value="red" /><br />
-&lt;input type="checkbox" name="<kbd>options[color][]</kbd>" value="blue" /><br />
-&lt;input type="checkbox" name="<kbd>options[color][]</kbd>" value="green" />
-</code>
-
-<p>When you use a helper function you'll include the bracket as well:</p>
-
-<code>&lt;?php echo form_error('<kbd>options[color][]</kbd>'); ?></code>
-
-
-
-
-<p>&nbsp;</p>
-
-
-<a name="rulereference"></a>
-<h1>Rule Reference</h1>
-
-<p>The following is a list of all the native rules that are available to use:</p>
-
-
-<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
- <tr>
- <th>Rule</th>
- <th>Parameter</th>
- <th>Description</th>
- <th>Example</th>
- </tr>
-
- <tr>
- <td class="td"><strong>required</strong></td>
- <td class="td">No</td>
- <td class="td">Returns FALSE if the form element is empty.</td>
- <td class="td">&nbsp;</td>
- </tr>
-
- <tr>
- <td class="td"><strong>matches</strong></td>
- <td class="td">Yes</td>
- <td class="td">Returns FALSE if the form element does not match the one in the parameter.</td>
- <td class="td">matches[form_item]</td>
- </tr>
-
- <tr>
- <td class="td"><strong>is_unique</strong></td>
- <td class="td">Yes</td>
- <td class="td">Returns FALSE if the form element is not unique to the table and field name in the parameter.</td>
- <td class="td">is_unique[table.field]</td>
- </tr>
-
- <tr>
- <td class="td"><strong>min_length</strong></td>
- <td class="td">Yes</td>
- <td class="td">Returns FALSE if the form element is shorter then the parameter value.</td>
- <td class="td">min_length[6]</td>
- </tr>
-
- <tr>
- <td class="td"><strong>max_length</strong></td>
- <td class="td">Yes</td>
- <td class="td">Returns FALSE if the form element is longer then the parameter value.</td>
- <td class="td">max_length[12]</td>
- </tr>
-
- <tr>
- <td class="td"><strong>exact_length</strong></td>
- <td class="td">Yes</td>
- <td class="td">Returns FALSE if the form element is not exactly the parameter value.</td>
- <td class="td">exact_length[8]</td>
- </tr>
-
- <tr>
- <td class="td"><strong>greater_than</strong></td>
- <td class="td">Yes</td>
- <td class="td">Returns FALSE if the form element is less than the parameter value or not numeric.</td>
- <td class="td">greater_than[8]</td>
- </tr>
-
- <tr>
- <td class="td"><strong>less_than</strong></td>
- <td class="td">Yes</td>
- <td class="td">Returns FALSE if the form element is greater than the parameter value or not numeric.</td>
- <td class="td">less_than[8]</td>
- </tr>
-
- <tr>
- <td class="td"><strong>alpha</strong></td>
- <td class="td">No</td>
- <td class="td">Returns FALSE if the form element contains anything other than alphabetical characters.</td>
- <td class="td">&nbsp;</td>
- </tr>
-
- <tr>
- <td class="td"><strong>alpha_numeric</strong></td>
- <td class="td">No</td>
- <td class="td">Returns FALSE if the form element contains anything other than alpha-numeric characters.</td>
- <td class="td">&nbsp;</td>
- </tr>
-
- <tr>
- <td class="td"><strong>alpha_dash</strong></td>
- <td class="td">No</td>
- <td class="td">Returns FALSE if the form element contains anything other than alpha-numeric characters, underscores or dashes.</td>
- <td class="td">&nbsp;</td>
- </tr>
-
- <tr>
- <td class="td"><strong>numeric</strong></td>
- <td class="td">No</td>
- <td class="td">Returns FALSE if the form element contains anything other than numeric characters.</td>
- <td class="td">&nbsp;</td>
- </tr>
-
- <tr>
- <td class="td"><strong>integer</strong></td>
- <td class="td">No</td>
- <td class="td">Returns FALSE if the form element contains anything other than an integer.</td>
- <td class="td">&nbsp;</td>
- </tr>
-
- <tr>
- <td class="td"><strong>decimal</strong></td>
- <td class="td">Yes</td>
- <td class="td">Returns FALSE if the form element is not exactly the parameter value.</td>
- <td class="td">&nbsp;</td>
- </tr>
-
- <tr>
- <td class="td"><strong>is_natural</strong></td>
- <td class="td">No</td>
- <td class="td">Returns FALSE if the form element contains anything other than a natural number: 0, 1, 2, 3, etc.</td>
- <td class="td">&nbsp;</td>
- </tr>
-
- <tr>
- <td class="td"><strong>is_natural_no_zero</strong></td>
- <td class="td">No</td>
- <td class="td">Returns FALSE if the form element contains anything other than a natural number, but not zero: 1, 2, 3, etc.</td>
- <td class="td">&nbsp;</td>
- </tr>
-
- <tr>
- <td class="td"><strong>valid_email</strong></td>
- <td class="td">No</td>
- <td class="td">Returns FALSE if the form element does not contain a valid email address.</td>
- <td class="td">&nbsp;</td>
- </tr>
-
- <tr>
- <td class="td"><strong>valid_emails</strong></td>
- <td class="td">No</td>
- <td class="td">Returns FALSE if any value provided in a comma separated list is not a valid email.</td>
- <td class="td">&nbsp;</td>
- </tr>
-
- <tr>
- <td class="td"><strong>valid_ip</strong></td>
- <td class="td">No</td>
- <td class="td">Returns FALSE if the supplied IP is not valid.</td>
- <td class="td">&nbsp;</td>
- </tr>
-
- <tr>
- <td class="td"><strong>valid_base64</strong></td>
- <td class="td">No</td>
- <td class="td">Returns FALSE if the supplied string contains anything other than valid Base64 characters.</td>
- <td class="td">&nbsp;</td>
- </tr>
-
-
-</table>
-
-<p><strong>Note:</strong> These rules can also be called as discrete functions. For example:</p>
-
-<code>$this->form_validation->required($string);</code>
-
-<p class="important"><strong>Note:</strong> You can also use any native PHP functions that permit one parameter.</p>
-
-
-
-<p>&nbsp;</p>
-
-<a name="preppingreference"></a>
-<h1>Prepping Reference</h1>
-
-<p>The following is a list of all the prepping functions that are available to use:</p>
-
-
-
-<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
- <tr>
- <th>Name</th>
- <th>Parameter</th>
- <th>Description</th>
- </tr><tr>
-
- <td class="td"><strong>xss_clean</strong></td>
- <td class="td">No</td>
- <td class="td">Runs the data through the XSS filtering function, described in the <a href="input.html">Input Class</a> page.</td>
- </tr><tr>
-
- <td class="td"><strong>prep_for_form</strong></td>
- <td class="td">No</td>
- <td class="td">Converts special characters so that HTML data can be shown in a form field without breaking it.</td>
- </tr><tr>
-
- <td class="td"><strong>prep_url</strong></td>
- <td class="td">No</td>
- <td class="td">Adds "http://" to URLs if missing.</td>
- </tr><tr>
-
- <td class="td"><strong>strip_image_tags</strong></td>
- <td class="td">No</td>
- <td class="td">Strips the HTML from image tags leaving the raw URL.</td>
- </tr><tr>
-
- <td class="td"><strong>encode_php_tags</strong></td>
- <td class="td">No</td>
- <td class="td">Converts PHP tags to entities.</td>
- </tr>
-
-</table>
-
-<p class="important"><strong>Note:</strong> You can also use any native PHP functions that permit one parameter,
-like <kbd>trim</kbd>, <kbd>htmlspecialchars</kbd>, <kbd>urldecode</kbd>, etc.</p>
-
-
-
-
-
-
-
-<p>&nbsp;</p>
-
-<a name="functionreference"></a>
-<h1>Function Reference</h1>
-
-<p>The following functions are intended for use in your controller functions.</p>
-
-<h2>$this->form_validation->set_rules();</h2>
-
-<p>Permits you to set validation rules, as described in the tutorial sections above:</p>
-
-<ul>
-<li><a href="#validationrules">Setting Validation Rules</a></li>
-<li><a href="#savingtoconfig">Saving Groups of Validation Rules to a Config File</a></li>
-</ul>
-
-
-<h2>$this->form_validation->run();</h2>
-
-<p>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: <a href="#savingtoconfig">Saving Groups of Validation Rules to a Config File</a>.</p>
-
-
-<h2>$this->form_validation->set_message();</h2>
-
-<p>Permits you to set custom error messages. See <a href="#settingerrors">Setting Error Messages</a> above.</p>
-
-
-<p>&nbsp;</p>
-
-<a name="helperreference"></a>
-<h1>Helper Reference</h1>
-
-<p>The following helper functions are available for use in the view files containing your forms. Note that these are procedural functions, so they
-<strong>do not</strong> require you to prepend them with $this->form_validation.</p>
-
-<h2>form_error()</h2>
-
-<p>Shows an individual error message associated with the field name supplied to the function. Example:</p>
-
-<code>&lt;?php echo form_error('username'); ?></code>
-
-<p>The error delimiters can be optionally specified. See the <a href="#errordelimiters">Changing the Error Delimiters</a> section above.</p>
-
-
-
-<h2>validation_errors()</h2>
-<p>Shows all error messages as a string: Example:</p>
-
-<code>&lt;?php echo validation_errors(); ?></code>
-
-<p>The error delimiters can be optionally specified. See the <a href="#errordelimiters">Changing the Error Delimiters</a> section above.</p>
-
-
-
-<h2>set_value()</h2>
-
-<p>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:</p>
-
-<code>&lt;input type="text" name="quantity" value="<dfn>&lt;?php echo set_value('quantity', '0'); ?></dfn>" size="50" /></code>
-
-<p>The above form will show "0" when loaded for the first time.</p>
-
-<h2>set_select()</h2>
-
-<p>If you use a <dfn>&lt;select></dfn> 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).</p>
-
-<p>Example:</p>
-
-<code>
-&lt;select name="myselect"><br />
-&lt;option value="one" <dfn>&lt;?php echo set_select('myselect', 'one', TRUE); ?></dfn> >One&lt;/option><br />
-&lt;option value="two" <dfn>&lt;?php echo set_select('myselect', 'two'); ?></dfn> >Two&lt;/option><br />
-&lt;option value="three" <dfn>&lt;?php echo set_select('myselect', 'three'); ?></dfn> >Three&lt;/option><br />
-&lt;/select>
-</code>
-
-
-<h2>set_checkbox()</h2>
-
-<p>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:</p>
-
-<code>&lt;input type="checkbox" name="mycheck[]" value="1" <dfn>&lt;?php echo set_checkbox('mycheck[]', '1'); ?></dfn> /><br />
-&lt;input type="checkbox" name="mycheck[]" value="2" <dfn>&lt;?php echo set_checkbox('mycheck[]', '2'); ?></dfn> /></code>
-
-
-<h2>set_radio()</h2>
-
-<p>Permits you to display radio buttons in the state they were submitted. This function is identical to the <strong>set_checkbox()</strong> function above.</p>
-
-<code>&lt;input type="radio" name="myradio" value="1" <dfn>&lt;?php echo set_radio('myradio', '1', TRUE); ?></dfn> /><br />
-&lt;input type="radio" name="myradio" value="2" <dfn>&lt;?php echo set_radio('myradio', '2'); ?></dfn> /></code>
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="file_uploading.html">File Uploading Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="ftp.html">FTP Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html
deleted file mode 100644
index 175efe19b..000000000
--- a/user_guide/libraries/ftp.html
+++ /dev/null
@@ -1,315 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>FTP Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-FTP Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>FTP Class</h1>
-
-<p>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.</p>
-
-<p class="important"><strong>Note:</strong>&nbsp; SFTP and SSL FTP protocols are not supported, only standard FTP.</p>
-
-<h2>Initializing the Class</h2>
-
-<p>Like most other classes in CodeIgniter, the FTP class is initialized in your controller using the <dfn>$this->load->library</dfn> function:</p>
-
-<code>$this->load->library('ftp');</code>
-<p>Once loaded, the FTP object will be available using: <dfn>$this->ftp</dfn></p>
-
-
-<h2>Usage Examples</h2>
-
-<p>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.</p>
-
-<code>
-$this->load->library('ftp');<br />
-<br />
-$config['hostname'] = 'ftp.example.com';<br />
-$config['username'] = 'your-username';<br />
-$config['password'] = 'your-password';<br />
-$config['debug'] = TRUE;<br />
-<br />
-$this->ftp->connect($config);<br />
-<br />
-$this->ftp->upload('/local/path/to/myfile.html', '/public_html/myfile.html', 'ascii', 0775);<br />
-<br />
-$this->ftp->close();
-
-</code>
-
-
-<p>In this example a list of files is retrieved from the server.</p>
-
-<code>
-$this->load->library('ftp');<br />
-<br />
-$config['hostname'] = 'ftp.example.com';<br />
-$config['username'] = 'your-username';<br />
-$config['password'] = 'your-password';<br />
-$config['debug'] = TRUE;<br />
-<br />
-$this->ftp->connect($config);<br />
-<br />
-$list = $this->ftp->list_files('/public_html/');<br />
-<br />
-print_r($list);<br />
-<br />
-$this->ftp->close();
-</code>
-
-<p>In this example a local directory is mirrored on the server.</p>
-
-
-<code>
-$this->load->library('ftp');<br />
-<br />
-$config['hostname'] = 'ftp.example.com';<br />
-$config['username'] = 'your-username';<br />
-$config['password'] = 'your-password';<br />
-$config['debug'] = TRUE;<br />
-<br />
-$this->ftp->connect($config);<br />
-<br />
-$this->ftp->mirror('/path/to/myfolder/', '/public_html/myfolder/');<br />
-<br />
-$this->ftp->close();
-</code>
-
-
-<h1>Function Reference</h1>
-
-<h2>$this->ftp->connect()</h2>
-
-<p>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.</p>
-
-
-<p>Here is an example showing how you set preferences manually:</p>
-
-<code>
-$this->load->library('ftp');<br />
-<br />
-$config['hostname'] = 'ftp.example.com';<br />
-$config['username'] = 'your-username';<br />
-$config['password'] = 'your-password';<br />
-$config['port']&nbsp;&nbsp;&nbsp;&nbsp; = 21;<br />
-$config['passive']&nbsp;&nbsp;= FALSE;<br />
-$config['debug']&nbsp;&nbsp;&nbsp;&nbsp;= TRUE;<br />
-<br />
-$this->ftp->connect($config);<br />
-</code>
-
-<h3>Setting FTP Preferences in a Config File</h3>
-
-<p>If you prefer you can store your FTP preferences in a config file.
-Simply create a new file called the <var>ftp.php</var>, add the <var>$config</var>
-array in that file. Then save the file at <var>config/ftp.php</var> and it will be used automatically.</p>
-
-<h3>Available connection options:</h3>
-
-
-<ul>
-<li><strong>hostname</strong> - the FTP hostname. Usually something like:&nbsp; <dfn>ftp.example.com</dfn></li>
-<li><strong>username</strong> - the FTP username.</li>
-<li><strong>password</strong> - the FTP password.</li>
-<li><strong>port</strong> - The port number. Set to <dfn>21</dfn> by default.</li>
-<li><strong>debug</strong> - <kbd>TRUE/FALSE</kbd> (boolean). Whether to enable debugging to display error messages.</li>
-<li><strong>passive</strong> - <kbd>TRUE/FALSE</kbd> (boolean). Whether to use passive mode. Passive is set automatically by default.</li>
-</ul>
-
-
-
-<h2>$this->ftp->upload()</h2>
-
-<p>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:</p>
-
-
-<code>$this->ftp->upload('/local/path/to/myfile.html', '/public_html/myfile.html', 'ascii', 0775);</code>
-
-<p><strong>Mode options are:</strong>&nbsp; <kbd>ascii</kbd>, <kbd>binary</kbd>, and <kbd>auto</kbd> (the default). If
-<kbd>auto</kbd> is used it will base the mode on the file extension of the source file.</p>
-
-<p>Permissions can be passed as an <kbd>octal</kbd> value in the fourth parameter.</p>
-
-<h2>$this->ftp->download()</h2>
-
-<p>Downloads a file from your server. You must supply the remote path and the local path, and you can optionally set the mode.
-Example:</p>
-
-<code>$this->ftp->download('/public_html/myfile.html', '/local/path/to/myfile.html', 'ascii');</code>
-
-<p><strong>Mode options are:</strong>&nbsp; <kbd>ascii</kbd>, <kbd>binary</kbd>, and <kbd>auto</kbd> (the default). If
-<kbd>auto</kbd> is used it will base the mode on the file extension of the source file.</p>
-
-<p>Returns FALSE if the download does not execute successfully (including if PHP does not have permission to write the local file)</p>
-
-
-<h2>$this->ftp->rename()</h2>
-<p>Permits you to rename a file. Supply the source file name/path and the new file name/path.</p>
-
-<code>
-// Renames green.html to blue.html<br />
-$this->ftp->rename('/public_html/foo/green.html', '/public_html/foo/blue.html');
-</code>
-
-<h2>$this->ftp->move()</h2>
-<p>Lets you move a file. Supply the source and destination paths:</p>
-
-<code>
-// Moves blog.html from "joe" to "fred"<br />
-$this->ftp->move('/public_html/joe/blog.html', '/public_html/fred/blog.html');
-</code>
-
-<p>Note: if the destination file name is different the file will be renamed.</p>
-
-
-<h2>$this->ftp->delete_file()</h2>
-<p>Lets you delete a file. Supply the source path with the file name.</p>
-
-<code>
-$this->ftp->delete_file('/public_html/joe/blog.html');
-</code>
-
-
-<h2>$this->ftp->delete_dir()</h2>
-<p>Lets you delete a directory and everything it contains. Supply the source path to the directory with a trailing slash.</p>
-
-<p class="important"><strong>Important</strong>&nbsp; Be VERY careful with this function. It will recursively delete
-<b>everything</b> within the supplied path, including sub-folders and all files. Make absolutely sure your path is correct.
-Try using the <kbd>list_files()</kbd> function first to verify that your path is correct.</p>
-
-<code>
-$this->ftp->delete_dir('/public_html/path/to/folder/');
-</code>
-
-
-
-<h2>$this->ftp->list_files()</h2>
-<p>Permits you to retrieve a list of files on your server returned as an <dfn>array</dfn>. You must supply
-the path to the desired directory.</p>
-
-<code>
-$list = $this->ftp->list_files('/public_html/');<br />
-<br />
-print_r($list);
-</code>
-
-
-<h2>$this->ftp->mirror()</h2>
-
-<p>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:</p>
-
-<code>
-$this->ftp->mirror('/path/to/myfolder/', '/public_html/myfolder/');
-</code>
-
-
-
-<h2>$this->ftp->mkdir()</h2>
-
-<p>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 <kbd>octal</kbd> value in the second parameter.</p>
-
-<code>
-// Creates a folder named "bar"<br />
-$this->ftp->mkdir('/public_html/foo/bar/', DIR_WRITE_MODE);
-</code>
-
-
-<h2>$this->ftp->chmod()</h2>
-
-<p>Permits you to set file permissions. Supply the path to the file or folder you wish to alter permissions on:</p>
-
-<code>
-// Chmod "bar" to 777<br />
-$this->ftp->chmod('/public_html/foo/bar/', DIR_WRITE_MODE);
-</code>
-
-
-
-
-<h2>$this->ftp->close();</h2>
-<p>Closes the connection to your server. It's recommended that you use this when you are finished uploading.</p>
-
-
-
-
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="form_validation.html">Form Validation Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="table.html">HTML Table Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html
deleted file mode 100644
index 1caf791d8..000000000
--- a/user_guide/libraries/image_lib.html
+++ /dev/null
@@ -1,667 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Image Manipulation Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Image Manipulation Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Image Manipulation Class</h1>
-
-<p>CodeIgniter's Image Manipulation class lets you perform the following actions:</p>
-
-<ul>
-<li>Image Resizing</li>
-<li>Thumbnail Creation</li>
-<li>Image Cropping</li>
-<li>Image Rotating</li>
-<li>Image Watermarking</li>
-</ul>
-
-<p>All three major image libraries are supported: GD/GD2, NetPBM, and ImageMagick</p>
-
-<p class="important"><strong>Note:</strong> 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.</p>
-
-
-<h2>Initializing the Class</h2>
-
-<p>Like most other classes in CodeIgniter, the image class is initialized in your controller
-using the <dfn>$this->load-&gt;library</dfn> function:</p>
-<code>$this->load->library('image_lib');</code>
-
-<p>Once the library is loaded it will be ready for use. The image library object you will use to call all functions is: <dfn>$this->image_lib</dfn></p>
-
-
-<h2>Processing an Image</h2>
-
-<p>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:</p>
-
-<code>$config['image_library'] = 'gd2';<br />
-$config['source_image'] = '/path/to/image/mypic.jpg';<br />
-$config['create_thumb'] = TRUE;<br />
-$config['maintain_ratio'] = TRUE;<br />
-$config['width'] = 75;<br />
-$config['height'] = 50;<br />
-<br />
-$this->load->library('image_lib', $config);
-<br />
-<br />
-$this->image_lib->resize();</code>
-
-<p>The above code tells the <dfn>image_resize</dfn> function to look for an image called <em>mypic.jpg</em>
-located in the <dfn>source_image</dfn> folder, then create a thumbnail that is 75 X 50 pixels using the GD2 <dfn>image_library</dfn>.
-Since the <dfn>maintain_ratio</dfn> option is enabled, the thumb will be as close to the target <dfn>width</dfn> and
-<dfn>height</dfn> as possible while preserving the original aspect ratio. The thumbnail will be called <em>mypic_thumb.jpg</em>
-</p>
-
-<p class="important"><strong>Note:</strong> In order for the image class to be allowed to do any processing, the
-folder containing the image files must have write permissions.</p>
-
-<p class="important"><strong>Note:</strong> Image processing can require a considerable amount of server memory for some operations. If you are experiencing out of memory errors while processing images you may need to limit their maximum size, and/or adjust PHP memory limits.</p>
-
-<h2>Processing Functions</h2>
-
-<p>There are four available processing functions:</p>
-
-<ul>
-<li>$this->image_lib->resize()</li>
-<li>$this->image_lib->crop()</li>
-<li>$this->image_lib->rotate()</li>
-<li>$this->image_lib->watermark()</li>
-<li>$this-&gt;image_lib-&gt;clear()</li>
-</ul>
-
-<p>These functions return boolean TRUE upon success and FALSE for failure. If they fail you can retrieve the
-error message using this function:</p>
-
-<code>echo $this->image_lib->display_errors();</code>
-
-<p>A good practice is use the processing function conditionally, showing an error upon failure, like this:</p>
-
-<code>if ( ! $this->image_lib->resize())<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo $this->image_lib->display_errors();<br />
-}</code>
-
-<p>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:</p>
-
-<code>$this->image_lib->display_errors('<var>&lt;p></var>', '<var>&lt;/p></var>');</code>
-
-
-<h2>Preferences</h2>
-
-<p>The preferences described below allow you to tailor the image processing to suit your needs.</p>
-
-<p>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.</p>
-
-<p>Availability Legend:</p>
-
-<ul>
-<li><var>R</var> - Image Resizing</li>
-<li><var>C</var> - Image Cropping</li>
-<li><var>X</var> - Image Rotation</li>
-<li><var>W</var> - Image Watermarking</li>
-
-</ul>
-
-
-
-
-
-<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
-<tr>
-<th>Preference</th>
-<th>Default&nbsp;Value</th>
-<th>Options</th>
-<th>Description</th>
-<th>Availability</th>
-</tr>
-
-<tr>
-<td class="td"><strong>image_library</strong></td>
-<td class="td">GD2</td>
-<td class="td">GD, GD2, ImageMagick, NetPBM</td>
-<td class="td">Sets the image library to be used.</td>
-<td class="td">R, C, X, W</td>
-</tr>
-
-<tr>
-<td class="td"><strong>library_path</strong></td>
-<td class="td">None</td>
-<td class="td">None</td>
-<td class="td">Sets the server path to your ImageMagick or NetPBM library. If you use either of those libraries you must supply the path.</td>
-<td class="td">R, C, X</td>
-</tr>
-
-<tr>
-<td class="td"><strong>source_image</strong></td>
-<td class="td">None</td>
-<td class="td">None</td>
-<td class="td">Sets the source image name/path. The path must be a relative or absolute server path, not a URL.</td>
-<td class="td">R, C, S, W</td>
-</tr>
-
-<tr>
-<td class="td"><strong>dynamic_output</strong></td>
-<td class="td">FALSE</td>
-<td class="td">TRUE/FALSE (boolean)</td>
-<td class="td">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.</td>
-<td class="td">R, C, X, W</td>
-</tr>
-
-
-<tr>
-<td class="td"><strong>quality</strong></td>
-<td class="td">90%</td>
-<td class="td">1 - 100%</td>
-<td class="td">Sets the quality of the image. The higher the quality the larger the file size.</td>
-<td class="td">R, C, X, W</td>
-</tr>
-
-
-<tr>
-<td class="td"><strong>new_image</strong></td>
-<td class="td">None</td>
-<td class="td">None</td>
-<td class="td">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.</td>
-<td class="td">R, C, X, W</td>
-</tr>
-
-<tr>
-<td class="td"><strong>width</strong></td>
-<td class="td">None</td>
-<td class="td">None</td>
-<td class="td">Sets the width you would like the image set to.</td>
-<td class="td">R, C </td>
-</tr>
-
-<tr>
-<td class="td"><strong>height</strong></td>
-<td class="td">None</td>
-<td class="td">None</td>
-<td class="td">Sets the height you would like the image set to.</td>
-<td class="td">R, C </td>
-</tr>
-
-<tr>
-<td class="td"><strong>create_thumb</strong></td>
-<td class="td">FALSE</td>
-<td class="td">TRUE/FALSE (boolean)</td>
-<td class="td">Tells the image processing function to create a thumb.</td>
-<td class="td">R</td>
-</tr>
-
-<tr>
-<td class="td"><strong>thumb_marker</strong></td>
-<td class="td">_thumb</td>
-<td class="td">None</td>
-<td class="td">Specifies the thumbnail indicator. It will be inserted just before the file extension, so mypic.jpg would become mypic_thumb.jpg</td>
-<td class="td">R</td>
-</tr>
-
-<tr>
-<td class="td"><strong>maintain_ratio</strong></td>
-<td class="td">TRUE</td>
-<td class="td">TRUE/FALSE (boolean)</td>
-<td class="td">Specifies whether to maintain the original aspect ratio when resizing or use hard values.</td>
-<td class="td">R, C</td>
-</tr>
-
-
-<tr>
-<td class="td"><strong>master_dim</strong></td>
-<td class="td">auto</td>
-<td class="td">auto, width, height</td>
-<td class="td">Specifies 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.</td>
-<td class="td">R</td>
-</tr>
-
-
-
-
-<tr>
-<td class="td"><strong>rotation_angle</strong></td>
-<td class="td">None</td>
-<td class="td">90, 180, 270, vrt, hor</td>
-<td class="td">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.</td>
-<td class="td">X</td>
-</tr>
-
-<tr>
-<td class="td"><strong>x_axis</strong></td>
-<td class="td">None</td>
-<td class="td">None</td>
-<td class="td">Sets the X coordinate in pixels for image cropping. For example, a setting of 30 will crop an image 30 pixels from the left.</td>
-<td class="td">C</td>
-</tr>
-<tr>
-<td class="td"><strong>y_axis</strong></td>
-<td class="td">None</td>
-<td class="td">None</td>
-<td class="td">Sets the Y coordinate in pixels for image cropping. For example, a setting of 30 will crop an image 30 pixels from the top.</td>
-<td class="td">C</td>
-</tr>
-
-</table>
-
-
-<h2>Setting preferences in a config file</h2>
-
-<p>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 <var>image_lib.php</var>, add the <var>$config</var>
-array in that file. Then save the file in: <var>config/image_lib.php</var> and it will be used automatically. You
-will NOT need to use the <dfn>$this->image_lib->initialize</dfn> function if you save your preferences in a config file.</p>
-
-
-<h2>$this->image_lib->resize()</h2>
-
-<p>The image resizing function lets you resize the original image, create a copy (with or without resizing),
-or create a thumbnail image.</p>
-
-<p>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).</p>
-
-<p>All preferences listed in the table above are available for this function except these three: rotation_angle, x_axis, and y_axis.</p>
-
-<h3>Creating a Thumbnail</h3>
-
-<p>The resizing function will create a thumbnail file (and preserve the original) if you set this preference to TRUE:</p>
-
-<code>$config['create_thumb'] = TRUE;</code>
-
-<p>This single preference determines whether a thumbnail is created or not.</p>
-
-<h3>Creating a Copy</h3>
-
-<p>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:</p>
-
-<code>$config['new_image'] = '/path/to/new_image.jpg';</code>
-
-<p>Notes regarding this preference:</p>
-<ul>
-<li>If only the new image name is specified it will be placed in the same folder as the original</li>
-<li>If only the path is specified, the new image will be placed in the destination with the same name as the original.</li>
-<li>If both the path and image name are specified it will placed in its own destination and given the new name.</li>
-</ul>
-
-
-<h3>Resizing the Original Image</h3>
-
-<p>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.</p>
-
-
-<h2>$this->image_lib->crop()</h2>
-
-<p>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:</p>
-
-<code>$config['x_axis'] = '100';<br />
-$config['y_axis'] = '40';</code>
-
-<p>All preferences listed in the table above are available for this function except these: rotation_angle, width, height, create_thumb, new_image.</p>
-
-<p>Here's an example showing how you might crop an image:</p>
-
-<code>$config['image_library'] = 'imagemagick';<br />
-$config['library_path'] = '/usr/X11R6/bin/';<br />
-$config['source_image'] = '/path/to/image/mypic.jpg';<br />
-$config['x_axis'] = '100';<br />
-$config['y_axis'] = '60';<br />
-<br />
-$this->image_lib->initialize($config);
-<br />
-<br />
-if ( ! $this->image_lib->crop())<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo $this->image_lib->display_errors();<br />
-}</code>
-
-
-<p>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.</p>
-
-<h2>$this->image_lib->rotate()</h2>
-
-<p>The image rotation function requires that the angle of rotation be set via its preference:</p>
-
-<code>$config['rotation_angle'] = '90';</code>
-
-<p>There are 5 rotation options:</p>
-
-<ol>
-<li>90 - rotates counter-clockwise by 90 degrees.</li>
-<li>180 - rotates counter-clockwise by 180 degrees.</li>
-<li>270 - rotates counter-clockwise by 270 degrees.</li>
-<li>hor - flips the image horizontally.</li>
-<li>vrt - flips the image vertically.</li>
-</ol>
-
-<p>Here's an example showing how you might rotate an image:</p>
-
-<code>$config['image_library'] = 'netpbm';<br />
-$config['library_path'] = '/usr/bin/';<br />
-$config['source_image'] = '/path/to/image/mypic.jpg';<br />
-$config['rotation_angle'] = 'hor';<br />
-<br />
-$this->image_lib->initialize($config);
-<br />
-<br />
-if ( ! $this->image_lib->rotate())<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo $this->image_lib->display_errors();<br />
-}</code>
-
-
-
-<h2>$this-&gt;image_lib-&gt;clear()</h2>
-<p>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.</p>
-<p><code>$this-&gt;image_lib-&gt;clear();</code></p>
-<p>&nbsp;</p>
-<h1>Image Watermarking</h1>
-
-<p>The Watermarking feature requires the GD/GD2 library.</p>
-
-
-<h2>Two Types of Watermarking</h2>
-
-<p>There are two types of watermarking that you can use:</p>
-
-<ul>
-<li><strong>Text</strong>: 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).</li>
-
-<li><strong>Overlay</strong>: The watermark message will be generated by overlaying an image (usually a transparent PNG or GIF)
-containing your watermark over the source image.</li>
-
-</ul>
-
-
-<h2>Watermarking an Image</h2>
-
-<p>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:</p>
-
-<code>
-$config['source_image'] = '/path/to/image/mypic.jpg';<br />
-$config['wm_text'] = 'Copyright 2006 - John Doe';<br />
-$config['wm_type'] = 'text';<br />
-$config['wm_font_path'] = './system/fonts/texb.ttf';<br />
-$config['wm_font_size'] = '16';<br />
-$config['wm_font_color'] = 'ffffff';<br />
-$config['wm_vrt_alignment'] = 'bottom';<br />
-$config['wm_hor_alignment'] = 'center';<br />
-$config['wm_padding'] = '20';<br />
-<br />
-$this->image_lib->initialize($config);
-<br />
-<br />
-$this->image_lib->watermark();</code>
-
-
-<p>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.</p>
-
-<p class="important"><strong>Note:</strong> In order for the image class to be allowed to do any processing, the image file must have &quot;write&quot; file permissions. For example, 777.</p>
-
-
-<h2>Watermarking Preferences</h2>
-
-<p>This table shown the preferences that are available for both types of watermarking (text or overlay)</p>
-
-<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
-<tr>
-<th>Preference</th>
-<th>Default&nbsp;Value</th>
-<th>Options</th>
-<th>Description</th>
-</tr>
-
-<tr>
-<td class="td"><strong>wm_type</strong></td>
-<td class="td">text</td>
-<td class="td">text, overlay</td>
-<td class="td">Sets the type of watermarking that should be used.</td>
-</tr>
-
-<tr>
-<td class="td"><strong>source_image</strong></td>
-<td class="td">None</td>
-<td class="td">None</td>
-<td class="td">Sets the source image name/path. The path must be a relative or absolute server path, not a URL.</td>
-</tr>
-
-<tr>
-<td class="td"><strong>dynamic_output</strong></td>
-<td class="td">FALSE</td>
-<td class="td">TRUE/FALSE (boolean)</td>
-<td class="td">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.</td>
-</tr>
-
-<tr>
-<td class="td"><strong>quality</strong></td>
-<td class="td">90%</td>
-<td class="td">1 - 100%</td>
-<td class="td">Sets the quality of the image. The higher the quality the larger the file size.</td>
-</tr>
-
-<tr>
-<td class="td"><strong>padding</strong></td>
-<td class="td">None</td>
-<td class="td">A number</td>
-<td class="td">The amount of padding, set in pixels, that will be applied to the watermark to set it away from the edge of your images.</td>
-</tr>
-
-<tr>
-<td class="td"><strong>wm_vrt_alignment</strong></td>
-<td class="td">bottom</td>
-<td class="td">top, middle, bottom</td>
-<td class="td">Sets the vertical alignment for the watermark image.</td>
-</tr>
-
-<tr>
-<td class="td"><strong>wm_hor_alignment</strong></td>
-<td class="td">center</td>
-<td class="td">left, center, right</td>
-<td class="td">Sets the horizontal alignment for the watermark image.</td>
-</tr>
-
-<tr>
-<td class="td"><strong>wm_hor_offset</strong></td>
-<td class="td">None</td>
-<td class="td">None</td>
-<td class="td">You 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.</td>
-</tr>
-
-<tr>
-<td class="td"><strong>wm_vrt_offset</strong></td>
-<td class="td">None</td>
-<td class="td">None</td>
-<td class="td">You 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.</td>
-</tr>
-
-</table>
-
-
-
-<h3>Text Preferences</h3>
-<p>This table shown the preferences that are available for the text type of watermarking.</p>
-
-
-<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
-<tr>
-<th>Preference</th>
-<th>Default&nbsp;Value</th>
-<th>Options</th>
-<th>Description</th>
-</tr>
-
-<tr>
-<td class="td"><strong>wm_text</strong></td>
-<td class="td">None</td>
-<td class="td">None</td>
-<td class="td">The text you would like shown as the watermark. Typically this will be a copyright notice.</td>
-</tr>
-
-<tr>
-<td class="td"><strong>wm_font_path</strong></td>
-<td class="td">None</td>
-<td class="td">None</td>
-<td class="td">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.</td>
-</tr>
-
-<tr>
-<td class="td"><strong>wm_font_size</strong></td>
-<td class="td">16</td>
-<td class="td">None</td>
-<td class="td">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.</td>
-</tr>
-
-<tr>
-<td class="td"><strong>wm_font_color</strong></td>
-<td class="td">ffffff</td>
-<td class="td">None</td>
-<td class="td">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).</td>
-</tr>
-
-
-<tr>
-<td class="td"><strong>wm_shadow_color</strong></td>
-<td class="td">None</td>
-<td class="td">None</td>
-<td class="td">The 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).</td>
-</tr>
-
-<tr>
-<td class="td"><strong>wm_shadow_distance</strong></td>
-<td class="td">3</td>
-<td class="td">None</td>
-<td class="td">The distance (in pixels) from the font that the drop shadow should appear.</td>
-</tr>
-
-</table>
-
-
-
-
-<h3>Overlay Preferences</h3>
-<p>This table shown the preferences that are available for the overlay type of watermarking.</p>
-
-
-<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
-<tr>
-<th>Preference</th>
-<th>Default&nbsp;Value</th>
-<th>Options</th>
-<th>Description</th>
-</tr>
-
-<tr>
-<td class="td"><strong>wm_overlay_path</strong></td>
-<td class="td">None</td>
-<td class="td">None</td>
-<td class="td">The server path to the image you wish to use as your watermark. Required only if you are using the overlay method.</td>
-</tr>
-
-<tr>
-<td class="td"><strong>wm_opacity</strong></td>
-<td class="td">50</td>
-<td class="td">1 - 100</td>
-<td class="td">Image 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.</td>
-</tr>
-
-<tr>
-<td class="td"><strong>wm_x_transp</strong></td>
-<td class="td">4</td>
-<td class="td">A number</td>
-<td class="td">If 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.</td>
-</tr>
-
-<tr>
-<td class="td"><strong>wm_y_transp</strong></td>
-<td class="td">4</td>
-<td class="td">A number</td>
-<td class="td">Along with the previous setting, this allows you to specify the coordinate to a pixel representative of the color you want to be transparent.</td>
-</tr>
-</table>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="table.html">HTML Table Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="input.html">Input Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html
deleted file mode 100644
index 10c84a9ea..000000000
--- a/user_guide/libraries/input.html
+++ /dev/null
@@ -1,295 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Input Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Input Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Input Class</h1>
-
-<p>The Input Class serves two purposes:</p>
-
-<ol>
-<li>It pre-processes global input data for security.</li>
-<li>It provides some helper functions for fetching input data and pre-processing it.</li>
-</ol>
-
-<p class="important"><strong>Note:</strong> This class is initialized automatically by the system so there is no need to do it manually.</p>
-
-
-<h2>Security Filtering</h2>
-
-<p>The security filtering function is called automatically when a new <a href="../general/controllers.html">controller</a> is invoked. It does the following:</p>
-
-<ul>
-<li>If $config['allow_get_array'] is FALSE(default is TRUE), destroys the global GET array.</li>
-<li>Destroys all global variables in the event register_globals is turned on.</li>
-<li>Filters the GET/POST/COOKIE array keys, permitting only alpha-numeric (and a few other) characters.</li>
-<li>Provides XSS (Cross-site Scripting Hacks) filtering. This can be enabled globally, or upon request.</li>
-<li>Standardizes newline characters to \n(In Windows \r\n)</li>
-</ul>
-
-
-<h2>XSS Filtering</h2>
-
-<p>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
-<kbd>application/config/config.php</kbd> file and setting this:</p>
-
-<code>$config['global_xss_filtering'] = TRUE;</code>
-
-<p>Please refer to the <a href="security.html">Security class</a> documentation for information on using XSS Filtering in your application.</p>
-
-
-<h2>Using POST, COOKIE, or SERVER Data</h2>
-
-<p>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:</p>
-
-<code>
-if ( ! isset($_POST['something']))<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$something = FALSE;<br />
-}<br />
-else<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$something = $_POST['something'];<br />
-}</code>
-
-<p>With CodeIgniter's built in functions you can simply do this:</p>
-
-<code>$something = $this->input->post('something');</code>
-
-<p>The three functions are:</p>
-
-<ul>
-<li>$this->input->post()</li>
-<li>$this->input->cookie()</li>
-<li>$this->input->server()</li>
-</ul>
-
-<h2>$this->input->post()</h2>
-
-<p>The first parameter will contain the name of the POST item you are looking for:</p>
-
-<code>$this->input->post('some_data');</code>
-
-<p>The function returns FALSE (boolean) if the item you are attempting to retrieve does not exist.</p>
-
-<p>The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;</p>
-
-<code>$this->input->post('some_data', TRUE);</code>
-
-<p>To return an array of all POST items call without any parameters.</p>
-<p>To return all POST items and pass them through the XSS filter set the first parameter NULL while setting the second parameter to boolean;</p>
-<p>The function returns FALSE (boolean) if there are no items in the POST.</p>
-
-<code>
- $this->input->post(NULL, TRUE); // returns all POST items with XSS filter
- <br />
- $this->input->post(); // returns all POST items without XSS filter
-</code>
-
-<h2>$this->input->get()</h2>
-
-<p>This function is identical to the post function, only it fetches get data:</p>
-
-<code>$this->input->get('some_data', TRUE);</code>
-
-<p>To return an array of all GET items call without any parameters.</p>
-<p>To return all GET items and pass them through the XSS filter set the first parameter NULL while setting the second parameter to boolean;</p>
-<p>The function returns FALSE (boolean) if there are no items in the GET.</p>
-
-<code>
- $this->input->get(NULL, TRUE); // returns all GET items with XSS filter
- <br />
- $this->input->get(); // returns all GET items without XSS filtering
-</code>
-
-<h2>$this->input->get_post()</h2>
-
-<p>This function will search through both the post and get streams for data, looking first in post, and then in get:</p>
-
-<code>$this->input->get_post('some_data', TRUE);</code>
-
-<h2>$this->input->cookie()</h2>
-
-<p>This function is identical to the post function, only it fetches cookie data:</p>
-
-<code>$this->input->cookie('some_data', TRUE);</code>
-
-<h2>$this->input->server()</h2>
-
-<p>This function is identical to the above functions, only it fetches server data:</p>
-
-<code>$this->input->server('some_data');</code>
-
-
-<h2>$this->input->set_cookie()</h2>
-
-<p>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:</p>
-
-<h4>Array Method</h4>
-
-<p>Using this method, an associative array is passed to the first parameter:</p>
-
-<code>$cookie = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'name'&nbsp;&nbsp;&nbsp;=> 'The Cookie Name',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'value'&nbsp;&nbsp;=> 'The Value',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'expire' => '86500',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'domain' => '.some-domain.com',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'path'&nbsp;&nbsp;&nbsp;=> '/',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'prefix' => 'myprefix_',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'secure' => TRUE<br />
-);<br />
-<br />
-$this->input->set_cookie($cookie);
-</code>
-
-<p><strong>Notes:</strong></p>
-
-<p>Only the name and value are required. To delete a cookie set it with the expiration blank.</p>
-
-<p>The expiration is set in <strong>seconds</strong>, which will be added to the current time. Do not include the time, but rather only the
-number of seconds from <em>now</em> 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.</p>
-<p>For site-wide cookies regardless of how your site is requested, add your URL to the <strong>domain</strong> starting with a period, like this: .your-domain.com</p>
-<p>The path is usually not needed since the function sets a root path.</p>
-<p>The prefix is only needed if you need to avoid name collisions with other identically named cookies for your server.</p>
-<p>The secure boolean is only needed if you want to make it a secure cookie by setting it to TRUE.</p>
-
-<h4>Discrete Parameters</h4>
-
-<p>If you prefer, you can set the cookie by passing data using individual parameters:</p>
-
-<code>$this->input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure);</code>
-
-<h2>$this->input->cookie()</h2>
-
-<p>Lets you fetch a cookie. The first parameter will contain the name of the cookie you are looking for (including any prefixes):</p>
-
-<code>cookie('some_cookie');</code>
-
-<p>The function returns FALSE (boolean) if the item you are attempting to retrieve does not exist.</p>
-
-<p>The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;</p>
-
-<p><code>cookie('some_cookie', TRUE);</code></p>
-
-
-<h2>$this->input->ip_address()</h2>
-<p>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</p>
-<code>echo $this->input->ip_address();</code>
-
-
-<h2>$this->input->valid_ip(<var>$ip</var>)</h2>
-
-<p>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.</p>
-
-<code>if ( ! $this-&gt;input-&gt;valid_ip($ip))<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp; echo 'Not Valid';<br />
-}<br />
-else<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp; echo 'Valid';<br />
-}</code>
-
-
-<h2>$this->input->user_agent()</h2>
-<p>Returns the user agent (web browser) being used by the current user. Returns FALSE if it's not available.</p>
-<code>echo $this->input->user_agent();</code>
-<p>See the <a href="user_agent.html">User Agent Class</a> for methods which extract information from the user agent string.</p>
-
-<h2>$this->input->request_headers()</h2>
-<p>Useful if running in a non-Apache environment where <a href="http://php.net/apache_request_headers">apache_request_headers()</a> will not be supported. Returns an array of headers.</p>
-
-<code>$headers = $this->input->request_headers();</code>
-
-<h2>$this->input->get_request_header();</h2>
-<p>Returns a single member of the request headers array.</p>
-
-<code>$this->input->get_request_header('some-header', TRUE);</code>
-
-
-<h2>$this->input->is_ajax_request()</h2>
-<p>Checks to see if the <var>HTTP_X_REQUESTED_WITH</var> server header has been set, and returns a boolean response.</p>
-
-
-<h2>$this->input->is_cli_request()</h2>
-<p>Checks to see if the <var>STDIN</var> constant is set, which is a failsafe way to see if PHP is being run on the command line.</p>
-
-<code>$this->input->is_cli_request()</code>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="image_lib.html">Image Manipulation Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="loader.html">Loader Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/javascript.html b/user_guide/libraries/javascript.html
deleted file mode 100644
index 3dda1fd69..000000000
--- a/user_guide/libraries/javascript.html
+++ /dev/null
@@ -1,247 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<title>JavaScript Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="153" height="44" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-<a href="../general/drivers.html">Drivers</a> &nbsp;&#8250;&nbsp;
-JavaScript Driver
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<p class="important"><strong>Note:</strong> This driver is experimental. Its feature set and implementation may change in future releases.</p><br>
-
-<h1>Javascript Class</h1>
-<p>CodeIgniter provides a library to help you with certain common functions that you may want to use with Javascript. 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.</p>
-<h2>Initializing the Class</h2>
-<p>To initialize the Javascript class manually in your controller constructor, use the <dfn>$this-&gt;load-&gt;library</dfn> function. Currently, the only available library is jQuery, which will automatically be loaded like this:</p>
-
-<code>$this-&gt;load-&gt;library('javascript');</code>
-
-<p>The Javascript class also accepts parameters, <dfn>js_library_driver (string) default 'jquery'</dfn> and <dfn>autoload (bool) default TRUE</dfn>. You may override the defaults if you wish by sending an associative array:</p>
-
-<code>$this-&gt;load-&gt;library('javascript', array('js_library_driver' =&gt; 'scripto', 'autoload' =&gt; FALSE));</code>
-
-<p>Again, presently only 'jquery' is available. You may wish to set <dfn>autoload</dfn> 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.</p>
-
-<p>Once loaded, the jQuery library object will be available using: <dfn>$this-&gt;javascript</dfn></p>
-<h2>Setup and Configuration</h2>
-<h3>Set these variables in your view</h3>
-<p>As a Javascript library, your files must be available to your application.</p>
-<p>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 &lt;head&gt; sections of your output.</p>
-<p><code>&lt;?php echo $library_src;?&gt;<br />
-&lt;?php echo $script_head;?&gt;
-</code></p>
-<p>$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.</p>
-<h3>Set the path to the librarys with config items</h3>
-<p>There are some configuration items in Javascript library. These can either be set in application/config.php, within its own config/javascript.php file, or within any controller usings the set_item() function. </p>
-<p>An image to be used as an &quot;ajax loader&quot;, or progress indicator. Without one, the simple text message of &quot;loading&quot; will appear when Ajax calls need to be made.</p>
-<p><code>$config['javascript_location'] = 'http://localhost/codeigniter/themes/js/jquery/';<br />
- $config['javascript_ajax_img'] = 'images/ajax-loader.gif';</code></p>
-<p>If you keep your files in the same directories they were downloaded from, then you need not set this configuration items.</p>
-
-<h2>The jQuery Class</h2>
-
-<p>To initialize the jQuery class manually in your controller constructor, use the <dfn>$this-&gt;load-&gt;library</dfn> function:</p>
-
-<code>$this-&gt;load-&gt;library('jquery');</code>
-
-<p>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:</p>
-
-<code>$this-&gt;load-&gt;library('jquery', FALSE);</code>
-
-<p>Once loaded, the jQuery library object will be available using: <dfn>$this-&gt;jquery</dfn></p>
-
-<h2>jQuery Events</h2>
-
-<p>Events are set using the following syntax.</p>
-
-<p><code>$this-&gt;jquery-&gt;event('element_path', code_to_run());</code></p>
-
-<p>In the above example:</p>
-
-<ul>
- <li>&quot;event&quot; is any of blur, change, click, dblclick, error, focus, hover, keydown, keyup, load, mousedown, mouseup, mouseover, mouseup, resize, scroll, or unload.</li>
- <li>&quot;element_path&quot; is any valid <a href="http://docs.jquery.com/Selectors">jQuery selector</a>. Due to jQuery's unique selector syntax, this is usually an element id, or CSS selector. For example &quot;#notice_area&quot; would effect &lt;div id=&quot;notice_area&quot;&gt;, and &quot;#content a.notice&quot; would effect all anchors with a class of &quot;notice&quot; in the div with id &quot;content&quot;.</li>
- <li>&quot;code_to_run()&quot; is script your write yourself, or an action such as an effect from the jQuery library below.</li>
- </ul>
-
-<h2>Effects</h2>
-
-<p>The query library supports a powerful <a href="http://docs.jquery.com/Effects">Effects</a> repertoire. Before an effect can be used, it must be loaded:</p>
-
-<p><code>$this->jquery->effect([optional path] plugin name);
-// for example
-$this->jquery->effect('bounce');
-</code></p>
-
-<h3>hide() / show()</h3>
-
-<p>Each of this functions will affect the visibility of an item on your page. hide() will set an item invisible, show() will reveal it.</p>
-<p><code>$this-&gt;jquery-&gt;hide(target, optional speed, optional extra information);<br />
- $this-&gt;jquery-&gt;show(target, optional speed, optional extra information);</code></p>
-
-<ul>
- <li>&quot;target&quot; will be any valid jQuery selector or selectors.</li>
- <li>&quot;speed&quot; is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.</li>
- <li>&quot;extra information&quot; is optional, and could include a callback, or other additional information.</li>
-</ul>
-
-<h3>toggle()</h3>
-
-<p>toggle() will change the visibility of an item to the opposite of its current state, hiding visible elements, and revealing hidden ones.</p>
-<p><code>$this-&gt;jquery-&gt;toggle(target);</code></p>
-<ul>
- <li>&quot;target&quot; will be any valid jQuery selector or selectors.</li>
-</ul>
-
-<h3>animate()</h3>
-
-<p><code> $this-&gt;jquery-&gt;animate(target, parameters, optional speed, optional extra information);</code></p>
-<ul>
- <li>&quot;target&quot; will be any valid jQuery selector or selectors.</li>
- <li>&quot;parameters&quot; in jQuery would generally include a series of CSS properties that you wish to change.</li>
- <li>&quot;speed&quot; is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.</li>
- <li>&quot;extra information&quot; is optional, and could include a callback, or other additional information.</li>
-</ul>
-<p>For a full summary, see <a href="http://docs.jquery.com/Effects/animate">http://docs.jquery.com/Effects/animate</a></p>
-<p>Here is an example of an animate() called on a div with an id of &quot;note&quot;, and triggered by a click using the jQuery library's click() event.</p>
-<p><code> $params = array(<br />
- 'height' =&gt; 80,<br />
- 'width' =&gt; '50%',<br />
- 'marginLeft' =&gt; 125<br />
-);<br />
-$this-&gt;jquery-&gt;click('#trigger', $this-&gt;jquery-&gt;animate('#note', $params, normal));</code></p>
-
-<h3>fadeIn() / fadeOut()</h3>
-
-<p><code>$this-&gt;jquery-&gt;fadeIn(target, optional speed, optional extra information);<br />
- $this-&gt;jquery-&gt;fadeOut(target, optional speed, optional extra information);</code></p>
-<ul>
- <li>&quot;target&quot; will be any valid jQuery selector or selectors.</li>
- <li>&quot;speed&quot; is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.</li>
- <li>&quot;extra information&quot; is optional, and could include a callback, or other additional information.</li>
-</ul>
-
-<h3>toggleClass()</h3>
-
-<p>This function will add or remove a CSS class to its target.</p>
-<p><code>$this-&gt;jquery-&gt;toggleClass(target, class)</code></p>
-<ul>
- <li>&quot;target&quot; will be any valid jQuery selector or selectors.</li>
- <li>&quot;class&quot; is any CSS classname. Note that this class must be defined and available in a CSS that is already loaded.</li>
- </ul>
-
-<h3>fadeIn() / fadeOut()</h3>
-
-<p>These effects cause an element(s) to disappear or reappear over time.</p>
-<p><code>$this-&gt;jquery-&gt;fadeIn(target, optional speed, optional extra information);<br />
- $this-&gt;jquery-&gt;fadeOut(target, optional speed, optional extra information);</code></p>
-<ul>
- <li>&quot;target&quot; will be any valid jQuery selector or selectors.</li>
- <li>&quot;speed&quot; is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.</li>
- <li>&quot;extra information&quot; is optional, and could include a callback, or other additional information.</li>
-</ul>
-
-<h3>slideUp() / slideDown() / slideToggle()</h3>
-
-<p>These effects cause an element(s) to slide.</p>
-<p><code>$this-&gt;jquery-&gt;slideUp(target, optional speed, optional extra information);<br />
- $this-&gt;jquery-&gt;slideDown(target, optional speed, optional extra information);<br />
-$this-&gt;jquery-&gt;slideToggle(target, optional speed, optional extra information);</code></p>
-<ul>
- <li>&quot;target&quot; will be any valid jQuery selector or selectors.</li>
- <li>&quot;speed&quot; is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.</li>
- <li>&quot;extra information&quot; is optional, and could include a callback, or other additional information.</li>
-</ul>
-
-<h2>Plugins</h2>
-
-<p>
-
-<p>Some select jQuery plugins are made available using this library.</p>
-
-<h3>corner()</h3>
-<p>Used to add distinct corners to page elements. For full details see <a href="http://www.malsup.com/jquery/corner/">http://www.malsup.com/jquery/corner/</a></p>
-<p><code>$this-&gt;jquery-&gt;corner(target, corner_style);</code></p>
-<ul>
- <li>&quot;target&quot; will be any valid jQuery selector or selectors.</li>
- <li>&quot;corner_style&quot; 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 &quot;tl&quot; (top left), &quot;tr&quot; (top right), &quot;bl&quot; (bottom left), or &quot;br&quot; (bottom right).</li>
-</ul>
-<p><code>$this-&gt;jquery-&gt;corner(&quot;#note&quot;, &quot;cool tl br&quot;);</code></p>
-
-<h3>tablesorter()</h3>
-
-<p>description to come</p>
-
-<h3>modal()</h3>
-
-<p>description to come</p>
-
-<h3>calendar()</h3>
-
-<p>description to come</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="../database/index.html">Database Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="../helpers/array_helper.html">Array Helper</a></p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html>
diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html
deleted file mode 100644
index a9afcef90..000000000
--- a/user_guide/libraries/language.html
+++ /dev/null
@@ -1,137 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Language Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Language Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Language Class</h1>
-
-<p>The Language Class provides functions to retrieve language files and lines of text for purposes of internationalization.</p>
-
-<p>In your CodeIgniter system folder you'll find one called <dfn>language</dfn> 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.</p>
-
-<p>Language files are typically stored in your <dfn>system/language</dfn> directory. Alternately you can create a folder called <kbd>language</kbd> inside
-your <kbd>application</kbd> folder and store them there. CodeIgniter will look first in your <dfn>application/language</dfn>
-directory. If the directory does not exist or the specified language is not located there CI will instead look in your global
-<dfn>system/language</dfn> folder.</p>
-
-<p class="important"><strong>Note:</strong>&nbsp; Each language should be stored in its own folder. For example, the English files are located at:
-<dfn>system/language/english</dfn></p>
-
-
-
-<h2>Creating Language Files</h2>
-
-<p>Language files must be named with <kbd>_lang.php</kbd> as the file extension. For example, let's say you want to create a file
-containing error messages. You might name it: <kbd>error_lang.php</kbd></p>
-
-<p>Within the file you will assign each line of text to an array called <var>$lang</var> with this prototype:</p>
-
-<code>$lang['language_key'] = "The actual message to be shown";</code>
-
-<p><strong>Note:</strong> 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 <var>error_</var></p>
-
-<code>$lang['<var>error</var>_email_missing'] = "You must submit an email address";<br />
-$lang['<var>error</var>_url_missing'] = "You must submit a URL";<br />
-$lang['<var>error</var>_username_missing'] = "You must submit a username";</code>
-
-
-<h2>Loading A Language File</h2>
-
-<p>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:</p>
-
-<code>$this->lang->load('<samp>filename</samp>', '<dfn>language</dfn>');</code>
-
-<p>Where <samp>filename</samp> is the name of the file you wish to load (without the file extension), and <dfn>language</dfn>
-is the language set containing it (ie, english). If the second parameter is missing, the default language set in your
-<kbd>application/config/config.php</kbd> file will be used.</p>
-
-
-<h2>Fetching a Line of Text</h2>
-
-<p>Once your desired language file is loaded you can access any line of text using this function:</p>
-
-<code>$this->lang->line('<samp>language_key</samp>');</code>
-
-<p>Where <samp>language_key</samp> is the array key corresponding to the line you wish to show.</p>
-
-<p>Note: This function simply returns the line. It does not echo it for you.</p>
-
-<h3>Using language lines as form labels</h3>
-
-<p class="important">This feature has been deprecated from the language library and moved to the <kbd>lang()</kbd> function of the <a href="../helpers/language_helper.html">Language helper</a>.</p>
-
-<h2>Auto-loading Languages</h2>
-<p>If you find that you need a particular language globally throughout your application, you can tell CodeIgniter to <a href="../general/autoloader.html">auto-load</a> it during system initialization. This is done by opening the application/config/autoload.php file and adding the language(s) to the autoload array.</p>
-<p>&nbsp;</p>
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="loader.html">Loader Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="output.html">Output Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html
deleted file mode 100644
index 53440c53c..000000000
--- a/user_guide/libraries/loader.html
+++ /dev/null
@@ -1,273 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Loader Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Loader Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Loader Class</h1>
-
-<p>Loader, as the name suggests, is used to load elements. These elements can be libraries (classes) <a href="../general/views.html">View files</a>,
-<a href="../general/helpers.html">Helpers</a>, <a href="../general/models.html">Models</a>, or your own files.</p>
-
-<p class="important"><strong>Note:</strong> This class is initialized automatically by the system so there is no need to do it manually.</p>
-
-<p>The following functions are available in this class:</p>
-
-
-<h2>$this->load->library('<var>class_name</var>', <samp>$config</samp>, <kbd>'object name'</kbd>)</h2>
-
-
-<p>This function is used to load core classes. Where <var>class_name</var> is the name of the class you want to load.
-Note: We use the terms "class" and "library" interchangeably.</p>
-
-<p>For example, if you would like to send email with CodeIgniter, the first step is to load the email class within your controller:</p>
-
-<code>$this->load->library('email');</code>
-
-<p>Once loaded, the library will be ready for use, using <kbd>$this->email-></kbd><samp><em>some_function</em>()</samp>.</p>
-
-<p>Library files can be stored in subdirectories within the main "libraries" folder, or within your personal <dfn>application/libraries</dfn> 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:</p>
-
-<code>libraries/flavors/chocolate.php</code>
-
-<p>You will load it using:</p>
-
-<code>$this->load->library('flavors/chocolate');</code>
-
-<p>You may nest the file in as many subdirectories as you want.</p>
-
-<p>Additionally, multiple libraries can be loaded at the same time by passing an array of libraries to the load function.</p>
-
-<code>$this->load->library(array('<var>email</var>', '<var>table</var>'));</code>
-
-<h3>Setting options</h3>
-
-<p>The second (optional) parameter allows you to optionally pass configuration setting. You will typically pass these as an array:</p>
-
-<code>
-$config = array (<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'mailtype' => 'html',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'charset'&nbsp; => 'utf-8,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'priority' => '1'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-$this->load->library('email', $config);</code>
-
-<p>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.</p>
-
-<p>Please take note, when multiple libraries are supplied in an array for the first parameter, each will receive the same parameter information.</p>
-
-<h3>Assigning a Library to a different object name</h3>
-
-<p>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 <dfn>Session</dfn>, it
-will be assigned to a variable named <dfn>$this->session</dfn>.</p>
-
-<p>If you prefer to set your own class names you can pass its value to the third parameter:</p>
-
-<code>$this->load->library('session', '', 'my_session');<br /><br />
-
-// Session class is now accessed using:<br /><br />
-
-$this->my_session
-
-</code>
-
-<p>Please take note, when multiple libraries are supplied in an array for the first parameter, this parameter is discarded.</p>
-
-
-<h2>$this->load->view('<var>file_name</var>', <samp>$data</samp>, <kbd>true/false</kbd>)</h2>
-
-<p>This function is used to load your View files. If you haven't read the <a href="../general/views.html">Views</a> section of the
-user guide it is recommended that you do since it shows you how this function is typically used.</p>
-
-<p>The first parameter is required. It is the name of the view file you would like to load. &nbsp;Note: The .php file extension does not need to be specified unless you use something other than <kbd>.php</kbd>.</p>
-
-<p>The second <strong>optional</strong> parameter can take
-an associative array or an object as input, which it runs through the PHP <a href="http://www.php.net/extract">extract</a> function to
-convert to variables that can be used in your view files. Again, read the <a href="../general/views.html">Views</a> page to learn
-how this might be useful.</p>
-
-<p>The third <strong>optional</strong> 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 <kbd>true</kbd> (boolean) it will return data. The default behavior is <kbd>false</kbd>, which sends it
-to your browser. Remember to assign it to a variable if you want the data returned:</p>
-
-<code>$string = $this->load->view('<var>myfile</var>', '', <kbd>true</kbd>);</code>
-
-
-<h2>$this-&gt;load-&gt;model('<var>Model_name</var>');</h2>
-<p><code>$this-&gt;load-&gt;model('<var>Model_name</var>');</code></p>
-<p>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:</p>
-<p><code>$this-&gt;load-&gt;model('<var>blog/queries</var>');</code></p>
-<p>If you would like your model assigned to a different object name you can specify it via the second parameter of the loading
- function:</p>
-<code> $this-&gt;load-&gt;model('<var>Model_name</var>', '<kbd>fubar</kbd>');<br />
-<br />
-$this-&gt;<kbd>fubar</kbd>-&gt;function();</code>
-<h2>$this->load->database('<var>options</var>', <kbd>true/false</kbd>)</h2>
-<p>This function lets you load the database class. The two parameters are <strong>optional</strong>. Please see the
-<a href="../database/index.html">database</a> section for more info.</p>
-
-
-
-
-<h2>$this->load->vars(<samp>$array</samp>)</h2>
-
-<p>This function takes an associative array as input and generates variables using the PHP <a href="http://www.php.net/extract">extract</a> function.
-This function produces the same result as using the second parameter of the <dfn>$this->load->view()</dfn> 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.
-</p>
-
-
-<h2>$this->load->get_var(<samp>$key</samp>)</h2>
-
-<p>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().
-</p>
-
-
-<h2>$this->load->helper('<var>file_name</var>')</h2>
-<p>This function loads helper files, where <var>file_name</var> is the name of the file, without the <kbd>_helper.php</kbd> extension.</p>
-
-
-<h2>$this->load->file('<var>filepath/filename</var>', <kbd>true/false</kbd>)</h2>
-<p>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 <kbd>true</kbd> (boolean)
-it will instead return the data as a string.</p>
-
-
-<h2>$this->load->language('<var>file_name</var>')</h2>
-<p>This function is an alias of the <a href="language.html">language loading function</a>: $this->lang->load()</p>
-
-<h2>$this->load->config('<var>file_name</var>')</h2>
-<p>This function is an alias of the <a href="config.html">config file loading function</a>: $this->config->load()</p>
-
-
-<h2>Application "Packages"</h2>
-
-<p>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 <dfn>application/third_party</dfn> folder. Below is a sample map of an package directory</p>
-
-
-<h2>Sample Package "Foo Bar" Directory Map</h2>
-
-<p>The following is an example of a directory for an application package named "Foo Bar".</p>
-
-<code>/application/third_party/foo_bar<br />
-<br />
-config/<br />
-helpers/<br />
-language/<br />
-libraries/<br />
-models/<br />
-</code>
-
-<p>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.</p>
-
-<h3>$this->load->add_package_path()</h3>
-
-<p>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 <dfn>Foo_bar.php</dfn>. In our controller, we'd do the following:</p>
-
-<code>$this->load->add_package_path(<var>APPPATH</var>.'third_party/<var>foo_bar</var>/');<br />
-$this->load->library('foo_bar');</code>
-
-<h3>$this->load->remove_package_path()</h3>
-
-<p>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.</p>
-
-<h3>$this->load->remove_package_path()</h3>
-
-<p>Or to remove a specific package path, specify the same path previously given to <kbd>add_package_path() for a package.</kbd>:</p>
-
-<code>$this->load->remove_package_path(<var>APPPATH</var>.'third_party/<var>foo_bar</var>/');</code>
-
-<h3>Package view files</h3>
-
-<p>By Default, package view files paths are set when <samp>add_package_path()</samp> is called. View paths are looped through, and once a match is encountered that view is loaded.</p>
-<p>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 <var>FALSE</var> when calling <samp>add_package_path()</samp>.</p>
-
-<code>
-$this->load->add_package_path(APPPATH.'my_app', TRUE);<br>
-$this->load->view('my_app_index'); // Loads<br>
-$this->load->view('welcome_message'); // Will not load the default welcome_message b/c the second param to add_package_path is TRUE<br>
-<br>
-// Reset things<br>
-$this->load->remove_package_path(APPPATH.'my_app');<br>
-<br>
-// Again without the second parameter:<br>
-$this->load->add_package_path(APPPATH.'my_app', TRUE);<br>
-$this->load->view('my_app_index'); // Loads<br>
-$this->load->view('welcome_message'); // Loads<br>
-</code>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="input.html">Input Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="language.html">Language Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/migration.html b/user_guide/libraries/migration.html
deleted file mode 100644
index ed99044d1..000000000
--- a/user_guide/libraries/migration.html
+++ /dev/null
@@ -1,176 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Migration Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='CodeIgniter Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Migration Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Migration Class</h1>
-
-<p>Migrations are a convenient way for you to alter your database in a structured and organized manner. You could edit fragments of SQL by hand but you would then be responsible for telling other developers that they need to go and run them. You’d also have to keep track of which changes need to be run against the production machines next time you deploy.</p>
-
-<p>The database table <var>migration</var> tracks which migrations have already been run so all you have to do is update your application files and call <dfn>$this->migrate->current()</dfn> to work out which migrations should be run. The current version is found in <var>config/migration.php</var>.</p>
-
-<h2>Create a Migration</h2>
-
-<p>This will be the first migration for a new site which has a blog. All migrations go in the folder <var>application/migrations/</var> and have names such as: <kbd>001_add_blog.php</kbd>.</p>
-
-<pre>
-defined('BASEPATH') OR exit('No direct script access allowed');
-
-class Migration_Add_blog extends CI_Migration {
-
- public function up()
- {
- $this->dbforge->add_field(array(
- 'blog_id' => array(
- 'type' => 'INT',
- 'constraint' => 5,
- 'unsigned' => TRUE,
- 'auto_increment' => TRUE
- ),
- 'blog_title' => array(
- 'type' => 'VARCHAR',
- 'constraint' => '100',
- ),
- 'blog_description' => array(
- 'type' => 'TEXT',
- 'null' => TRUE,
- ),
- ));
-
- $this->dbforge->create_table('blog');
- }
-
- public function down()
- {
- $this->dbforge->drop_table('blog');
- }
-</pre>
-
-<p>Then in <var>application/config/migration.php</var> set <dfn>$config['migration_version'] = 1;</dfn>.
-
-<h2>Usage Example</h2>
-
-<p>In this example some simple code is placed in <var>application/controllers/migrate.php</var> to update the schema.</p>
-
-<pre>
-$this->load->library('migration');
-
-if ( ! $this->migration->current())
-{
- show_error($this->migration->error_string());
-}
-</pre>
-
-
-<h1>Function Reference</h1>
-
-<h2>$this->migration->current()</h2>
-
-<p>The current migration is whatever is set for <dfn>$config['migration_version']</dfn> in <var>application/config/migration.php</var>.</p>
-
-
-<h2>$this->migration->latest()</h2>
-
-<p>This works much the same way as current() but instead of looking for the <dfn>$config['migration_version']</dfn> the Migration class will use the very newest migration found in the filesystem.</p>
-
-<h2>$this->migration->version()</h2>
-
-<p>Version can be used to roll back changes or step forwards programmatically to specific versions. It works just like current but ignores <dfn>$config['migration_version']</dfn>.</p>
-
-<pre>
-$this->load->library('migration');
-
-$this->migration->version(5);
-</pre>
-
-<h2>Migration Preferences</h2>
-
-<p>The following is a list of all the config options for migrations.</p>
-
-
-<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
-<tr>
-<th>Preference</th>
-<th>Default&nbsp;Value</th>
-<th>Options</th>
-<th>Description</th>
-</tr><tr>
-<td class="td"><strong>migration_enabled</strong></td><td class="td">FALSE</td><td class="td">TRUE / FALSE</td><td class="td">Enable or disable migrations.</td>
-</tr><tr>
-<td class="td"><strong>migration_version</strong></td><td class="td">0</td><td class="td">None</td><td class="td">The current version your database should use.</td>
-</tr><tr>
-<td class="td"><strong>migration_path</strong></td><td class="td">APPPATH.'migrations/'</td><td class="td">None</td><td class="td">The path to your migrations folder.</td>
-</tr>
-</table>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="form_validation.html">Form Validation Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="table.html">HTML Table Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html
deleted file mode 100644
index 77fe464ce..000000000
--- a/user_guide/libraries/output.html
+++ /dev/null
@@ -1,177 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Output Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Output Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Output Class</h1>
-
-<p>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 <a href="../general/caching.html">caching</a> your web pages, if you use that feature.</p>
-
-<p class="important"><strong>Note:</strong> This class is initialized automatically by the system so there is no need to do it manually.</p>
-
-<p>Under normal circumstances you won't even notice the Output class since it works transparently without your intervention.
-For example, when you use the <a href="../libraries/loader.html">Loader</a> 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:</p>
-
-<h2>$this->output->set_output();</h2>
-
-<p>Permits you to manually set the final output string. Usage example:</p>
-
-<code>$this->output->set_output($data);</code>
-
-<p><strong>Important:</strong> 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.</p>
-
-
-<h2>$this->output->set_content_type();</h2>
-
-<p>Permits you to set the mime-type of your page so you can serve JSON data, JPEG's, XML, etc easily.</p>
-
-<code>$this->output<br/>
-&nbsp;&nbsp;&nbsp;&nbsp;->set_content_type('application/json')<br/>
-&nbsp;&nbsp;&nbsp;&nbsp;->set_output(json_encode(array('foo' => 'bar')));<br/>
-<br/>
-$this->output<br/>
-&nbsp;&nbsp;&nbsp;&nbsp;->set_content_type('jpeg') // You could also use ".jpeg" which will have the full stop removed before looking in config/mimes.php<br/>
-&nbsp;&nbsp;&nbsp;&nbsp;->set_output(file_get_contents('files/something.jpg'));</code>
-
-<p><strong>Important:</strong> Make sure any non-mime string you pass to this method exists in config/mimes.php or it will have no effect.</p>
-
-
-<h2>$this->output->get_output();</h2>
-
-<p>Permits you to manually retrieve any output that has been sent for storage in the output class. Usage example:</p>
-<code>$string = $this->output->get_output();</code>
-
-<p>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 <var>$this->load->view()</var>.</p>
-
-
-<h2>$this->output->append_output();</h2>
-
-<p>Appends data onto the output string. Usage example:</p>
-
-<code>$this->output->append_output($data);</code>
-
-
-
-<h2>$this->output->set_header();</h2>
-
-<p>Permits you to manually set server headers, which the output class will send for you when outputting the final rendered display. Example:</p>
-
-<code>
-$this->output->set_header("HTTP/1.0 200 OK");<br />
-$this->output->set_header("HTTP/1.1 200 OK");<br />
-$this->output->set_header('Last-Modified: '.gmdate('D, d M Y H:i:s', $last_update).' GMT');<br />
-$this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate");<br />
-$this->output->set_header("Cache-Control: post-check=0, pre-check=0");<br />
-$this->output->set_header("Pragma: no-cache"); </code>
-
-
-<h2>$this->output->set_status_header(<var>code</var>, '<var>text</var>');</h2>
-
-<p>Permits you to manually set a server status header. Example:</p>
-
-<code>$this->output->set_status_header('401');<br />
-// Sets the header as: Unauthorized</code>
-
-<p><a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">See here</a> for a full list of headers.</p>
-
-<h2>$this->output->enable_profiler();</h2>
-
-<p>Permits you to enable/disable the <a href="../general/profiling.html">Profiler</a>, which will display benchmark and other data
-at the bottom of your pages for debugging and optimization purposes.</p>
-
-<p>To enable the profiler place the following function anywhere within your <a href="../general/controllers.html">Controller</a> functions:</p>
-<code>$this->output->enable_profiler(TRUE);</code>
-
-<p>When enabled a report will be generated and inserted at the bottom of your pages.</p>
-
-<p>To disable the profiler you will use:</p>
-<code>$this->output->enable_profiler(FALSE);</code>
-
-<h2>$this->output->set_profiler_sections();</h2>
-
-<p>Permits you to enable/disable specific sections of the Profiler when enabled. Please refer to the <a href="../general/profiling.html">Profiler</a> documentation for further information.</p>
-
-<h2>$this->output->cache();</h2>
-<p>The CodeIgniter output library also controls caching. For more information, please see the <a href="../general/caching.html">caching documentation</a>.</p>
-
-<h2>Parsing Execution Variables</h2>
-
- <p>CodeIgniter will parse the pseudo-variables <var>{elapsed_time}</var> and <var>{memory_usage}</var> in your output by default. To disable this, set the <var>$parse_exec_vars</var> class property to <var>FALSE</var> in your controller.
-
- <code>$this->output->parse_exec_vars = FALSE;</code>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="language.html">Language Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="pagination.html">Pagination Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html
deleted file mode 100644
index 6478694d0..000000000
--- a/user_guide/libraries/pagination.html
+++ /dev/null
@@ -1,233 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Pagination Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Pagination Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Pagination Class</h1>
-
-<p>CodeIgniter's Pagination class is very easy to use, and it is 100% customizable, either dynamically or via stored preferences.</p>
-
-<p>If you are not familiar with the term "pagination", it refers to links that allows you to navigate from page to page, like this:</p>
-
-<code><a href="#">&laquo; First</a>&nbsp;&nbsp;<a href="#">&lt;</a>&nbsp;<a href="#">1</a>&nbsp;<a href="#">2</a>&nbsp;<b>3</b>&nbsp;<a href="#">4</a>&nbsp;<a href="#">5</a>&nbsp;<a href="#">&gt;</a>&nbsp;&nbsp;<a href="#">Last &raquo;</a></code>
-
-<h2>Example</h2>
-
-<p>Here is a simple example showing how to create pagination in one of your <a href="../general/controllers.html">controller</a> functions:</p>
-
-<code>
-$this->load->library('pagination');<br /><br />
-$config['base_url'] = 'http://example.com/index.php/test/page/';<br />
-$config['total_rows'] = 200;<br />
-$config['per_page'] = 20;
-<br /><br />
-$this->pagination->initialize($config);
-
-<br /><br />
-echo $this->pagination->create_links();</code>
-
-<h3>Notes:</h3>
-
-<p>The <var>$config</var> array contains your configuration variables. It is passed to the <dfn>$this->pagination->initialize</dfn> 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:</p>
-
-<ul>
- <li><strong>base_url</strong> 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
- <a href="../general/routing.html">re-route your URI</a> if you need a different structure.</li>
- <li><strong>total_rows</strong> 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.
- </li>
- <li><strong>per_page</strong> The number of items you intend to show per page. In the above example, you would be showing 20 items per page.</li>
-</ul>
-
-<p>The <var>create_links()</var> function returns an empty string when there is no pagination to show.</p>
-
-
-<h3>Setting preferences in a config file</h3>
-
-<p>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 <var>pagination.php</var>, add the <var>$config</var>
-array in that file. Then save the file in: <var>config/pagination.php</var> and it will be used automatically. You
-will NOT need to use the <dfn>$this->pagination->initialize</dfn> function if you save your preferences in a config file.</p>
-
-
-<h2>Customizing the Pagination</h2>
-
-<p>The following is a list of all the preferences you can pass to the initialization function to tailor the display.</p>
-
-
-<h4>$config['uri_segment'] = 3;</h4>
-
-<p>The pagination function automatically determines which segment of your URI contains the page number. If you need
-something different you can specify it.</p>
-
-<h4>$config['num_links'] = 2;</h4>
-
-<p>The number of &quot;digit&quot; 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.</p>
-
-<h4>$config['use_page_numbers'] = TRUE;</h4>
-<p>By default, the URI segment will use the starting index for the items you are paginating. If you prefer to show the the actual page number, set this to TRUE.</p>
-
-<h4>$config['page_query_string'] = TRUE;</h4>
-<p>By default, the pagination library assume you are using <a href="../general/urls.html">URI Segments</a>, and constructs your links something like</p>
-<p><code>http://example.com/index.php/test/page/20</code></p>
-<p>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.</p>
-<p><code>http://example.com/index.php?c=test&amp;m=page&amp;per_page=20</code></p>
-<p>Note that &quot;per_page&quot; is the default query string passed, however can be configured using $config['query_string_segment'] = 'your_string'</p>
-<h2>Adding Enclosing Markup</h2>
-
-<p>If you would like to surround the entire pagination with some markup you can do it with these two prefs:</p>
-
-<h4>$config['full_tag_open'] = '&lt;p>';</h4>
-<p>The opening tag placed on the left side of the entire result.</p>
-
-<h4>$config['full_tag_close'] = '&lt;/p>';</h4>
-<p>The closing tag placed on the right side of the entire result.</p>
-
-
-<h2>Customizing the First Link</h2>
-
-<h4>$config['first_link'] = 'First';</h4>
-<p>The text you would like shown in the "first" link on the left. If you do not want this link rendered, you can set its value to FALSE.</p>
-
-<h4>$config['first_tag_open'] = '&lt;div>';</h4>
-<p>The opening tag for the "first" link.</p>
-
-<h4>$config['first_tag_close'] = '&lt;/div>';</h4>
-<p>The closing tag for the "first" link.</p>
-
-<h2>Customizing the Last Link</h2>
-
-<h4>$config['last_link'] = 'Last';</h4>
-<p>The text you would like shown in the "last" link on the right. If you do not want this link rendered, you can set its value to FALSE.</p>
-
-<h4>$config['last_tag_open'] = '&lt;div>';</h4>
-<p>The opening tag for the "last" link.</p>
-
-<h4>$config['last_tag_close'] = '&lt;/div>';</h4>
-<p>The closing tag for the "last" link.</p>
-
-<h2>Customizing the "Next" Link</h2>
-
-<h4>$config['next_link'] = '&amp;gt;';</h4>
-<p>The text you would like shown in the "next" page link. If you do not want this link rendered, you can set its value to FALSE.</p>
-
-<h4>$config['next_tag_open'] = '&lt;div>';</h4>
-<p>The opening tag for the "next" link.</p>
-
-<h4>$config['next_tag_close'] = '&lt;/div>';</h4>
-<p>The closing tag for the "next" link.</p>
-
-<h2>Customizing the "Previous" Link</h2>
-
-<h4>$config['prev_link'] = '&amp;lt;';</h4>
-<p>The text you would like shown in the "previous" page link. If you do not want this link rendered, you can set its value to FALSE.</p>
-
-<h4>$config['prev_tag_open'] = '&lt;div>';</h4>
-<p>The opening tag for the "previous" link.</p>
-
-<h4>$config['prev_tag_close'] = '&lt;/div>';</h4>
-<p>The closing tag for the "previous" link.</p>
-
-<h2>Customizing the "Current Page" Link</h2>
-
-<h4>$config['cur_tag_open'] = '&lt;b>';</h4>
-<p>The opening tag for the "current" link.</p>
-
-<h4>$config['cur_tag_close'] = '&lt;/b>';</h4>
-<p>The closing tag for the "current" link.</p>
-
-
-<h2>Customizing the "Digit" Link</h2>
-
-<h4>$config['num_tag_open'] = '&lt;div>';</h4>
-<p>The opening tag for the "digit" link.</p>
-
-<h4>$config['num_tag_close'] = '&lt;/div>';</h4>
-<p>The closing tag for the "digit" link.</p>
-
-<h2>Hiding the Pages</h2>
-
-<p>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:</p>
-
-<code>
-$config['display_pages'] = FALSE;
-</code>
-
-
-<h2>Adding a class to every anchor</h2>
-
-<p>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.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="output.html">Output Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="sessions.html">Session Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html
deleted file mode 100644
index f449145ac..000000000
--- a/user_guide/libraries/parser.html
+++ /dev/null
@@ -1,212 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Template Parser Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Template Parser Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-
-
-<h1>Template Parser Class</h1>
-
-<p>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:</p>
-
-<code>&lt;html&gt;<br />
-&lt;head&gt;<br />
-&lt;title&gt;<kbd>{blog_title}</kbd>&lt;/title&gt;<br />
-&lt;/head&gt;<br />
-&lt;body&gt;<br />
-<br />
-&lt;h3&gt;<kbd>{blog_heading}</kbd>&lt;/h3&gt;<br />
-<br />
-<kbd>{blog_entries}</kbd><br />
-&lt;h5&gt;<kbd>{title}</kbd>&lt;/h5&gt;<br />
-&lt;p&gt;<kbd>{body}</kbd>&lt;/p&gt;<br />
-<kbd>{/blog_entries}</kbd><br />
-
-&lt;/body&gt;<br />
-&lt;/html&gt;</code>
-
-<p>These variables are not actual PHP variables, but rather plain text representations that allow you to eliminate
-PHP from your templates (view files).</p>
-
-<p class="important"><strong>Note:</strong> CodeIgniter does <strong>not</strong> 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.</p>
-
-<p><strong>Also Note:</strong> The Template Parser Class is <strong>not</strong> a
-full-blown template parsing solution. We've kept it very lean on purpose in order to maintain maximum performance.</p>
-
-
-<h2>Initializing the Class</h2>
-
-<p>Like most other classes in CodeIgniter, the Parser class is initialized in your controller using the <dfn>$this->load->library</dfn> function:</p>
-
-<code>$this->load->library('parser');</code>
-<p>Once loaded, the Parser library object will be available using: <dfn>$this->parser</dfn></p>
-
-
-<p>The following functions are available in this library:</p>
-
-<h2>$this->parser->parse()</h2>
-
-<p>This method accepts a template name and data array as input, and it generates a parsed version. Example:</p>
-
-<code>$this->load->library('parser');<br />
-<br />
-$data = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'blog_title' => 'My Blog Title',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'blog_heading' => 'My Blog Heading'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-$this->parser->parse('blog_template', $data);</code>
-
-<p>The first parameter contains the name of the <a href="../general/views.html">view file</a> (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}</p>
-
-<p>There is no need to "echo" or do something with the data returned by <dfn>$this->parser->parse()</dfn>. 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:</p>
-
-<code>$string = $this->parser->parse('blog_template', $data, TRUE);</code>
-
-<h2>$this->parser->parse_string()</h2>
-
-<p>This method works exactly like parse(), only accepts a string as the first parameter in place of a view file.</p>
-
-
-<h2>Variable Pairs</h2>
-
-<p>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:</p>
-
-<code>&lt;html&gt;<br />
-&lt;head&gt;<br />
-&lt;title&gt;<kbd>{blog_title}</kbd>&lt;/title&gt;<br />
-&lt;/head&gt;<br />
-&lt;body&gt;<br />
-<br />
-&lt;h3&gt;<kbd>{blog_heading}</kbd>&lt;/h3&gt;<br />
-<br />
-<kbd>{blog_entries}</kbd><br />
-&lt;h5&gt;<kbd>{title}</kbd>&lt;/h5&gt;<br />
-&lt;p&gt;<kbd>{body}</kbd>&lt;/p&gt;<br />
-<kbd>{/blog_entries}</kbd><br />
-
-&lt;/body&gt;<br />
-&lt;/html&gt;</code>
-
-<p>In the above code you'll notice a pair of variables: <kbd>{blog_entries}</kbd> data... <kbd>{/blog_entries}</kbd>.
-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.</p>
-
-<p>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:</p>
-
-
-<code>$this->load->library('parser');<br />
-<br />
-$data = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'blog_title'&nbsp;&nbsp; => 'My Blog Title',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'blog_heading' => 'My Blog Heading',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'blog_entries' => array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('title' => 'Title 1', 'body' => 'Body 1'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('title' => 'Title 2', 'body' => 'Body 2'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('title' => 'Title 3', 'body' => 'Body 3'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('title' => 'Title 4', 'body' => 'Body 4'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('title' => 'Title 5', 'body' => 'Body 5')<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-$this->parser->parse('blog_template', $data);</code>
-
-<p>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:</p>
-
-<code>
-$query = $this->db->query("SELECT * FROM blog");<br />
-<br />
-$this->load->library('parser');<br />
-<br />
-$data = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'blog_title'&nbsp;&nbsp; => 'My Blog Title',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'blog_heading' => 'My Blog Heading',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'blog_entries' => $query->result_array()<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-$this->parser->parse('blog_template', $data);</code>
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="trackback.html">Trackback Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="typography.html">Typography</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/security.html b/user_guide/libraries/security.html
deleted file mode 100644
index ad1d9ae86..000000000
--- a/user_guide/libraries/security.html
+++ /dev/null
@@ -1,135 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Security Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Security Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Security Class</h1>
-
-<p>The Security Class contains methods that help you create a secure application, processing input data for security.</p>
-
-<h2>XSS Filtering</h2>
-
-<p>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 <strong>not</strong>
-run globally since it requires a bit of processing overhead, and since you may not need it in all cases.</p>
-
-<p>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.</p>
-
-<p>
-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.</p>
-
-
-<p>To filter data through the XSS filter use this function:</p>
-
-<h2>$this->security->xss_clean()</h2>
-
-<p>Here is an usage example:</p>
-
-<code>$data = $this->security->xss_clean($data);</code>
-
-<p>If you want the filter to run automatically every time it encounters POST or COOKIE data you can enable it by opening your
-<kbd>application/config/config.php</kbd> file and setting this:</p>
-
-<code>$config['global_xss_filtering'] = TRUE;</code>
-
-<p>Note: If you use the form validation class, it gives you the option of XSS filtering as well.</p>
-
-<p>An optional second parameter, <dfn>is_image</dfn>, 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 <dfn>TRUE</dfn>, 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.</p>
-
-<code>if ($this->security->xss_clean($file, TRUE) === FALSE)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;// file failed the XSS test<br />
-}</code>
-
-
-<h2>$this->security->sanitize_filename()</h2>
-
-<p>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 <dfn>sanitize_filename()</dfn> method of the Security class. Here is an example:</p>
-
-<code>$filename = $this->security->sanitize_filename($this->input->post('filename'));</code>
-
-<p>If it is acceptable for the user input to include relative paths, e.g. <kbd>file/in/some/approved/folder.txt</kbd>, you can set the second optional parameter,
- <samp>$relative_path</samp> to TRUE.</p>
-
-<code>$filename = $this->security->sanitize_filename($this->input->post('filename'), TRUE);</code>
-
-<!-- @todo write docs for CSRF methods -->
-
-<h2>Cross-site request forgery (CSRF)</h2>
-
-<p>You can enable csrf protection by opening your <kbd>application/config/config.php</kbd> file and setting this:</p>
-<code>$config['csrf_protection'] = TRUE;</code>
-
-<p>If you use the <a href="../helpers/form_helper.html">form helper</a> the <var>form_open()</var> function will automatically insert a hidden csrf field in your forms.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="pagination.html">Pagination Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="sessions.html">Session Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html
deleted file mode 100644
index dfb732491..000000000
--- a/user_guide/libraries/sessions.html
+++ /dev/null
@@ -1,341 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Session Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Session Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Session Class</h1>
-
-<p>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.
-</p>
-
-<p class="important"><strong>Note:</strong> The Session class does <strong>not</strong> utilize native PHP sessions. It
-generates its own session data, offering more flexibility for developers.</p>
-
-<p class="important"><strong>Note:</strong> Even if you are not using encrypted sessions, you must set
-an <a href="./encryption.html">encryption key</a> in your config file which is used to aid in preventing session data manipulation.</p>
-
-<h2>Initializing a Session</h2>
-
-<p>Sessions will typically run globally with each page load, so the session class must either be
-<a href="../general/libraries.html">initialized</a> in your
-<a href="../general/controllers.html">controller</a> constructors, or it can be
-<a href="../general/autoloader.html">auto-loaded</a> 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.</p>
-
-
-<p>To initialize the Session class manually in your controller constructor, use the <dfn>$this->load->library</dfn> function:</p>
-
-<code>$this->load->library('session');</code>
-<p>Once loaded, the Sessions library object will be available using: <dfn>$this->session</dfn></p>
-
-
-<h2>How do Sessions work?</h2>
-
-<p>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 <strong>not</strong> 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.</p>
-
-<p>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.</p>
-
-
-<h2>What is Session Data?</h2>
-
-<p>A <em>session</em>, as far as CodeIgniter is concerned, is simply an array containing the following information:</p>
-
-<ul>
-<li>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)</li>
-<li>The user's IP Address</li>
-<li>The user's User Agent data (the first 120 characters of the browser data string)</li>
-<li>The "last activity" time stamp.</li>
-</ul>
-
-<p>The above data is stored in a cookie as a serialized array with this prototype:</p>
-
-<code>[array]<br />
-(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'session_id'&nbsp;&nbsp;&nbsp;&nbsp;=> random hash,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'ip_address'&nbsp;&nbsp;&nbsp;&nbsp;=> 'string - user IP address',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'user_agent'&nbsp;&nbsp;&nbsp;&nbsp;=> 'string - user agent data',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'last_activity' => timestamp<br />
-)</code>
-
-<p>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 <a href="encryption.html">found here</a>, although the Session class will take care of initializing
-and encrypting the data automatically.</p>
-
-<p>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.</p>
-
-<h2>Retrieving Session Data</h2>
-
-<p>Any piece of information from the session array is available using the following function:</p>
-
-<code>$this->session->userdata('<samp>item</samp>');</code>
-
-<p>Where <samp>item</samp> is the array index corresponding to the item you wish to fetch. For example, to fetch the session ID you
-will do this:</p>
-
-<code>$session_id = $this->session->userdata('<samp>session_id</samp>');</code>
-
-<p><strong>Note:</strong> The function returns FALSE (boolean) if the item you are trying to access does not exist.</p>
-
-
-<h2>Adding Custom Session Data</h2>
-
-<p>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:</p>
-
-<p>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.</p>
-
-<p>To add your data to the session array involves passing an array containing your new data to this function:</p>
-
-<code>$this->session->set_userdata(<samp>$array</samp>);</code>
-
-<p>Where <samp>$array</samp> is an associative array containing your new data. Here's an example:</p>
-
-
-<p><code>$newdata = array(<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'username'&nbsp; => 'johndoe',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'email'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> 'johndoe@some-site.com',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'logged_in' => TRUE<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
- <br />
- $this->session->set_userdata(<samp>$newdata</samp>);</code></p>
-<p>If you want to add userdata one value at a time, set_userdata() also supports this syntax. </p>
-<p><code>$this-&gt;session-&gt;set_userdata('some_name', 'some_value');</code></p>
-<p class="important"><strong>Note:</strong> 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.</p>
-
-<h2>Retrieving All Session Data</h2>
-<p>An array of all userdata can be retrieved as follows:</p>
-<code>$this-&gt;session-&gt;all_userdata()</code>
-
-<p>And returns an associative array like the following:</p>
-
-<pre>
-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
-)
-</pre>
-
-
-<h2>Removing Session Data</h2>
-<p>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: </p>
-<p><code>$this-&gt;session-&gt;unset_userdata('some_name');</code></p>
-<p>This function can also be passed an associative array of items to unset.</p>
-<p><code>$array_items = array('username' => '', 'email' => '');<br />
-<br />
-$this-&gt;session-&gt;unset_userdata(<samp>$array_items</samp>);</code></p>
-<h2>Flashdata</h2>
-<p>CodeIgniter supports &quot;flashdata&quot;, 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: &quot;record 2 deleted&quot;).</p>
-<p>Note: Flash variables are prefaced with &quot;flash_&quot; so avoid this prefix in your own session names.</p>
-<p>To add flashdata:</p>
-<p><code>$this-&gt;session-&gt;set_flashdata('item', 'value');</code></p>
-<p>You can also pass an array to set_flashdata(), in the same manner as set_userdata(). </p>
-<p>To read a flashdata variable:</p>
-<p><code>$this-&gt;session-&gt;flashdata('item');</code></p>
-<p>If you find that you need to preserve a flashdata variable through an additional request, you can do so using the keep_flashdata() function.</p>
-<p><code>$this-&gt;session-&gt;keep_flashdata('item');</code></p>
-<h2>Saving Session Data to a Database</h2>
-<p>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
-could be restored by a user modifying their cookies.</p>
-
-<p>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.</p>
-
-
-<p>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:</p>
-
-<textarea class="textarea" style="width:100%" cols="50" rows="10">
-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(120) 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`)
-);
-</textarea>
-
-<p><strong>Note:</strong> By default the table is called <dfn>ci_sessions</dfn>, but you can name it anything you want
-as long as you update the <kbd>application/config/config.php</kbd> 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:</p>
-
-<code>$config['sess_use_database'] = TRUE;</code>
-
-<p>Once enabled, the Session class will store session data in the DB.</p>
-
-<p>Make sure you've specified the table name in your config file as well:</p>
-
-<code>$config['sess_table_name'] = 'ci_sessions';</code>
-
-<p class="important"><strong>Note:</strong> 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.</p>
-
-
-<h2>Destroying a Session </h2>
-<p>To clear the current session: </p>
-<code>$this-&gt;session-&gt;sess_destroy();</code>
-<p class="important"><strong>Note:</strong> 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 <dfn>unset_userdata()</dfn>.</p>
-
-
-
-<h2>Session Preferences</h2>
-<p>You'll find the following Session related preferences in your <kbd>application/config/config.php</kbd> file:</p>
-
-
-<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
-<tr>
- <th>Preference</th>
- <th>Default</th>
- <th>Options</th>
- <th>Description</th>
-</tr>
-<tr>
- <td class="td"><strong>sess_cookie_name</strong></td>
- <td class="td">ci_session</td>
- <td class="td">None</td>
- <td class="td">The name you want the session cookie saved as.</td>
-</tr>
-<tr>
- <td class="td"><strong>sess_expiration</strong></td>
- <td class="td">7200</td>
- <td class="td">None</td>
- <td class="td">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</td>
-</tr>
-<tr>
- <td class="td"><strong>sess_expire_on_close</strong></td>
- <td class="td">FALSE</td>
- <td class="td">TRUE/FALSE (boolean)</td>
- <td class="td">Whether to cause the session to expire automatically when the browser window is closed.</td>
-</tr>
-<tr>
- <td class="td"><strong>sess_encrypt_cookie</strong></td>
- <td class="td">FALSE</td>
- <td class="td">TRUE/FALSE (boolean)</td>
- <td class="td">Whether to encrypt the session data.</td>
-</tr>
-<tr>
- <td class="td"><strong>sess_use_database</strong></td>
- <td class="td">FALSE</td>
- <td class="td">TRUE/FALSE (boolean)</td>
- <td class="td">Whether to save the session data to a database. You must create the table before enabling this option.</td>
-</tr>
-<tr>
- <td class="td"><strong>sess_table_name</strong></td>
- <td class="td">ci_sessions</td>
- <td class="td">Any valid SQL table name</td>
- <td class="td">The name of the session database table.</td>
-</tr>
-<tr>
- <td class="td"><strong>sess_time_to_update</strong></td>
- <td class="td">300</td>
- <td class="td">Time in seconds</td>
- <td class="td">This options controls how often the session class will regenerate itself and create a new session id.</td>
-</tr>
-<tr>
- <td class="td"><strong>sess_match_ip</strong></td>
- <td class="td">FALSE</td>
- <td class="td">TRUE/FALSE (boolean)</td>
- <td class="td">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.</td>
-</tr>
-<tr>
- <td class="td"><strong>sess_match_useragent</strong></td>
- <td class="td">TRUE</td>
- <td class="td">TRUE/FALSE (boolean)</td>
- <td class="td">Whether to match the User Agent when reading the session data.</td>
-</tr>
-</table>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="security.html">Security Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="trackback.html">Trackback Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html
deleted file mode 100644
index 003916ef3..000000000
--- a/user_guide/libraries/table.html
+++ /dev/null
@@ -1,315 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<title>CodeIgniter User Guide : HTML Table Class</title>
-
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="153" height="44" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-HTML Table Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>HTML Table Class</h1>
-
-<p>The Table Class provides functions that enable you to auto-generate HTML tables from arrays or database result sets.</p>
-
-<h2>Initializing the Class</h2>
-
-<p>Like most other classes in CodeIgniter, the Table class is initialized in your controller using the <dfn>$this->load->library</dfn> function:</p>
-
-<code>$this->load->library('table');</code>
-<p>Once loaded, the Table library object will be available using: <dfn>$this->table</dfn></p>
-
-
-<h2>Examples</h2>
-
-<p>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
-<dfn>set_heading()</dfn> function described in the function reference below).</p>
-
-<code>
-$this->load->library('table');<br />
-<br />
-$data = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('Name', 'Color', 'Size'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('Fred', 'Blue', 'Small'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('Mary', 'Red', 'Large'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('John', 'Green', 'Medium') <br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-echo $this->table->generate($data);
-</code>
-
-<p>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 <dfn>set_heading()</dfn> function described
-in the function reference below).</p>
-
-<code>
-$this->load->library('table');<br />
-<br />
-$query = $this->db->query("SELECT * FROM my_table");<br />
-<br />
-echo $this->table->generate($query);
-</code>
-
-
-<p>Here is an example showing how you might create a table using discrete parameters:</p>
-
-<code>
-$this->load->library('table');<br />
-<br />
-$this->table->set_heading('Name', 'Color', 'Size');<br />
-<br />
-$this->table->add_row('Fred', 'Blue', 'Small');<br />
-$this->table->add_row('Mary', 'Red', 'Large');<br />
-$this->table->add_row('John', 'Green', 'Medium');<br />
-<br />
-echo $this->table->generate();
-</code>
-
-<p>Here is the same example, except instead of individual parameters, arrays are used:</p>
-
-<code>
-$this->load->library('table');<br />
-<br />
-$this->table->set_heading(array('Name', 'Color', 'Size'));<br />
-<br />
-$this->table->add_row(array('Fred', 'Blue', 'Small'));<br />
-$this->table->add_row(array('Mary', 'Red', 'Large'));<br />
-$this->table->add_row(array('John', 'Green', 'Medium'));<br />
-<br />
-echo $this->table->generate();
-</code>
-
-
-<h2>Changing the Look of Your Table</h2>
-
-<p>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:</p>
-
-<code>
-$tmpl = array (<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'table_open'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;table border="0" cellpadding="4" cellspacing="0">',<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'heading_row_start'&nbsp;&nbsp;&nbsp;=> '&lt;tr>',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'heading_row_end'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/tr>',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'heading_cell_start'&nbsp;&nbsp;=> '&lt;th>',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'heading_cell_end'&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/th>',<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'row_start'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;tr>',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'row_end'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/tr>',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'cell_start'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;td>',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'cell_end'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/td>',<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'row_alt_start'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;tr>',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'row_alt_end'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/tr>',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'cell_alt_start'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;td>',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'cell_alt_end'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/td>',<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'table_close'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/table>'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-
-<br />
-$this->table->set_template($tmpl);
-</code>
-
-<p class="important"><strong>Note:</strong>&nbsp; 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.</p>
-
-<p>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:</p>
-
-<code>
-$tmpl = array ( 'table_open'&nbsp;&nbsp;=> '&lt;table border="1" cellpadding="2" cellspacing="1" class="mytable">' );<br />
-
-<br />
-$this->table->set_template($tmpl);
-</code>
-
-<br />
-<h1>Function Reference</h1>
-
-<h2>$this->table->generate()</h2>
-<p>Returns a string containing the generated table. Accepts an optional parameter which can be an array or a database result object.</p>
-
-<h2>$this->table->set_caption()</h2>
-
-<p>Permits you to add a caption to the table.</p>
-
-<code>$this->table->set_caption('Colors');</code>
-
-<h2>$this->table->set_heading()</h2>
-
-<p>Permits you to set the table heading. You can submit an array or discrete params:</p>
-
-<code>$this->table->set_heading('Name', 'Color', 'Size');</code>
-<code>$this->table->set_heading(array('Name', 'Color', 'Size'));</code>
-
-<h2>$this->table->add_row()</h2>
-
-<p>Permits you to add a row to your table. You can submit an array or discrete params:</p>
-
-<code>$this->table->add_row('Blue', 'Red', 'Green');</code>
-<code>$this->table->add_row(array('Blue', 'Red', 'Green'));</code>
-
-<p>If you would like to set an individual cell's tag attributes, you can use an associative array for that cell. The associative key <dfn>'data'</dfn> defines the cell's data. Any other key =&gt; val pairs are added as <dfn>key='val'</dfn> attributes to the tag:</p>
-
-<code>$cell = array('data' => 'Blue', 'class' => 'highlight', 'colspan' => 2);<br />
-$this->table->add_row($cell, 'Red', 'Green');<br />
-<br />
-// generates<br />
-// &lt;td class='highlight' colspan='2'&gt;Blue&lt;/td&gt;&lt;td&gt;Red&lt;/td&gt;&lt;td&gt;Green&lt;/td&gt;
-</code>
-
-<h2>$this->table->make_columns()</h2>
-
-<p>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:</p>
-
-<code>
-$list = array('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve');<br />
-<br />
-$new_list = $this->table->make_columns($list, 3);<br />
-<br />
-$this->table->generate($new_list);<br />
-<br />
-// Generates a table with this prototype<br />
-<br />
-&lt;table border="0" cellpadding="4" cellspacing="0"&gt;<br />
-&lt;tr&gt;<br />
-&lt;td&gt;one&lt;/td&gt;&lt;td&gt;two&lt;/td&gt;&lt;td&gt;three&lt;/td&gt;<br />
-&lt;/tr&gt;&lt;tr&gt;<br />
-&lt;td&gt;four&lt;/td&gt;&lt;td&gt;five&lt;/td&gt;&lt;td&gt;six&lt;/td&gt;<br />
-&lt;/tr&gt;&lt;tr&gt;<br />
-&lt;td&gt;seven&lt;/td&gt;&lt;td&gt;eight&lt;/td&gt;&lt;td&gt;nine&lt;/td&gt;<br />
-&lt;/tr&gt;&lt;tr&gt;<br />
-&lt;td&gt;ten&lt;/td&gt;&lt;td&gt;eleven&lt;/td&gt;&lt;td&gt;twelve&lt;/td&gt;&lt;/tr&gt;<br />
-&lt;/table&gt;</code>
-
-
-
-<h2>$this->table->set_template()</h2>
-
-<p>Permits you to set your template. You can submit a full or partial template.</p>
-
-<code>
-$tmpl = array ( 'table_open'&nbsp;&nbsp;=> '&lt;table border="1" cellpadding="2" cellspacing="1" class="mytable">' );<br />
-
-<br />
-$this->table->set_template($tmpl);
-</code>
-
-
-<h2>$this->table->set_empty()</h2>
-
-<p>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:</p>
-
-<code>
-$this->table->set_empty("&amp;nbsp;");
-</code>
-
-<h2>$this->table->clear()</h2>
-
-<p>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:</p>
-
-<code>
-$this->load->library('table');<br />
-<br />
-$this->table->set_heading('Name', 'Color', 'Size');<br />
-$this->table->add_row('Fred', 'Blue', 'Small');<br />
-$this->table->add_row('Mary', 'Red', 'Large');<br />
-$this->table->add_row('John', 'Green', 'Medium');<br />
-<br />
-echo $this->table->generate();<br />
-<br />
-<kbd>$this->table->clear();</kbd><br />
-<br />
-$this->table->set_heading('Name', 'Day', 'Delivery');<br />
-$this->table->add_row('Fred', 'Wednesday', 'Express');<br />
-$this->table->add_row('Mary', 'Monday', 'Air');<br />
-$this->table->add_row('John', 'Saturday', 'Overnight');<br />
-<br />
-echo $this->table->generate();
-</code>
-
-<h2>$this->table->function</h2>
-
-<p>Allows you to specify a native PHP function or a valid function array object to be applied to all cell data.</p>
-
-<code>$this->load->library('table');<br />
-<br />
-$this->table->set_heading('Name', 'Color', 'Size');<br />
-$this->table->add_row('Fred', '&lt;strong&gt;Blue&lt;/strong&gt;', 'Small');<br />
-<br />
-$this->table->function = 'htmlspecialchars';<br />
-echo $this->table->generate();<br />
-</code>
-
-<p>In the above example, all cell data would be ran through PHP's <dfn>htmlspecialchars()</dfn> function, resulting in:</p>
-
-<code>&lt;td&gt;Fred&lt;/td&gt;&lt;td&gt;&amp;lt;strong&amp;gt;Blue&amp;lt;/strong&amp;gt;&lt;/td&gt;&lt;td&gt;Small&lt;/td&gt;</code>
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;<a href="ftp.html">&nbsp;FTP Class</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="image_lib.html">Image Manipulation Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html
deleted file mode 100644
index 035158463..000000000
--- a/user_guide/libraries/trackback.html
+++ /dev/null
@@ -1,246 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Trackback Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Trackback Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Trackback Class</h1>
-
-<p>The Trackback Class provides functions that enable you to send and receive Trackback data.</p>
-
-
-<p>If you are not familiar with Trackbacks you'll find more information <a href="http://en.wikipedia.org/wiki/Trackback">here</a>.</p>
-
-<h2>Initializing the Class</h2>
-
-<p>Like most other classes in CodeIgniter, the Trackback class is initialized in your controller using the <dfn>$this->load->library</dfn> function:</p>
-
-<code>$this->load->library('trackback');</code>
-<p>Once loaded, the Trackback library object will be available using: <dfn>$this->trackback</dfn></p>
-
-
-<h2>Sending Trackbacks</h2>
-
-<p>A Trackback can be sent from any of your controller functions using code similar to this example:</p>
-
-<code>$this->load->library('trackback');<br />
-<br />
-$tb_data = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'ping_url'&nbsp;&nbsp;=> 'http://example.com/trackback/456',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'url'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> 'http://www.my-example.com/blog/entry/123',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'title'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> 'The Title of My Entry',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'excerpt'&nbsp;&nbsp;&nbsp;=> 'The entry content.',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'blog_name' => 'My Blog Name',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'charset'&nbsp;&nbsp;&nbsp;=> 'utf-8'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-if ( ! $this->trackback->send($tb_data))<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo $this->trackback->display_errors();<br />
-}<br />
-else<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo 'Trackback was sent!';<br />
-}</code>
-
-<p>Description of array data:</p>
-
-<ul>
-<li><strong>ping_url</strong> - 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.</li>
-<li><strong>url</strong> - The URL to YOUR site where the weblog entry can be seen.</li>
-<li><strong>title</strong> - The title of your weblog entry.</li>
-<li><strong>excerpt</strong> - 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.</li>
-<li><strong>blog_name</strong> - The name of your weblog.</li>
-<li><strong>charset</strong> - The character encoding your weblog is written in. If omitted, UTF-8 will be used.</li>
-</ul>
-
-<p>The Trackback sending function returns TRUE/FALSE (boolean) on success or failure. If it fails, you can retrieve the error message using:</p>
-
-<code>$this->trackback->display_errors();</code>
-
-
-<h2>Receiving Trackbacks</h2>
-
-<p>Before you can receive Trackbacks you must create a weblog. If you don't have a blog yet there's no point in continuing.</p>
-
-<p>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.</p>
-
-<h2>Your Ping URL</h2>
-
-<p>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").</p>
-
-<p>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.</p>
-
-<p>For example, if your controller class is called <dfn>Trackback</dfn>, and the receiving function is called <dfn>receive</dfn>, your
-Ping URLs will look something like this:</p>
-
-<code>http://example.com/index.php/trackback/receive/<samp>entry_id</samp></code>
-
-<p>Where <samp>entry_id</samp> represents the individual ID number for each of your entries.</p>
-
-
-<h2>Creating a Trackback Table</h2>
-
-<p>Before you can receive Trackbacks you must create a table in which to store them. Here is a basic prototype for such a table:</p>
-
-<textarea class="textarea" style="width:100%" cols="50" rows="13">
-CREATE TABLE trackbacks (
- tb_id int(10) unsigned NOT NULL auto_increment,
- entry_id int(10) unsigned NOT NULL default 0,
- url varchar(200) NOT NULL,
- title varchar(100) NOT NULL,
- excerpt text NOT NULL,
- blog_name varchar(100) NOT NULL,
- tb_date int(10) NOT NULL,
- ip_address varchar(16) NOT NULL,
- PRIMARY KEY `tb_id` (`tb_id`),
- KEY `entry_id` (`entry_id`)
-);</textarea>
-
-
-<p>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.).</p>
-
-<h2>Processing a Trackback</h2>
-
-<p>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.</p>
-
-<code>$this->load->library('trackback');<br />
-$this->load->database();<br />
-<br />
-if ($this->uri->segment(3) == FALSE)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$this->trackback->send_error("Unable to determine the entry ID");<br />
-}<br />
-<br />
-if ( ! $this->trackback->receive())<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$this->trackback->send_error("The Trackback did not contain valid data");<br />
-}<br />
-<br />
-$data = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'tb_id'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'entry_id'&nbsp;&nbsp;&nbsp;=> $this->uri->segment(3),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'url'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> $this->trackback->data('url'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'title'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> $this->trackback->data('title'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'excerpt'&nbsp;&nbsp;&nbsp;&nbsp;=> $this->trackback->data('excerpt'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'blog_name'&nbsp;&nbsp;=> $this->trackback->data('blog_name'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'tb_date'&nbsp;&nbsp;&nbsp;&nbsp;=> time(),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'ip_address' => $this->input->ip_address()<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-$sql = $this->db->insert_string('trackbacks', $data);<br />
-$this->db->query($sql);<br />
-<br />
-$this->trackback->send_success();</code>
-
-<h4>Notes:</h4>
-
-<p>The entry ID number is expected in the third segment of your URL. This is based on the URI example we gave earlier:</p>
-
-<code>http://example.com/index.php/trackback/receive/<samp>entry_id</samp></code>
-
-<p>Notice the entry_id is in the third URI segment, which you can retrieve using:</p>
-
-<code>$this->uri->segment(3);</code>
-
-<p>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.</p>
-
-<p>The <dfn>$this->trackback->receive()</dfn> 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.</p>
-
-<p>The incoming Trackback data can be retrieved using this function:</p>
-
-<code>$this->trackback->data('<var>item</var>')</code>
-
-<p>Where <var>item</var> represents one of these four pieces of info: url, title, excerpt, or blog_name</p>
-
-<p>If the Trackback data is successfully received, you will issue a success message using:</p>
-
-<code>$this->trackback->send_success();</code>
-
-<p class="important"><strong>Note:</strong> The above code contains no data validation, which you are encouraged to add.</p>
-
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="sessions.html">Session Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="parser.html">Template Parser Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/typography.html b/user_guide/libraries/typography.html
deleted file mode 100644
index 12be119cc..000000000
--- a/user_guide/libraries/typography.html
+++ /dev/null
@@ -1,160 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Typography Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Typography Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Typography Class</h1>
-
-<p>The Typography Class provides functions that help you format text.</p>
-
-
-<h2>Initializing the Class</h2>
-
-<p>Like most other classes in CodeIgniter, the Typography class is initialized in your controller using the <dfn>$this->load->library</dfn> function:</p>
-
-<code>$this->load->library('typography');</code>
-<p>Once loaded, the Typography library object will be available using: <dfn>$this->typography</dfn></p>
-
-
-<h2>auto_typography()</h2>
-
-<p>Formats text so that it is semantically and typographically correct HTML. Takes a string as input and returns it with
-the following formatting:</p>
-
-<ul>
-<li>Surrounds paragraphs within &lt;p&gt;&lt;/p&gt; (looks for double line breaks to identify paragraphs).</li>
-<li>Single line breaks are converted to &lt;br /&gt;, except those that appear within &lt;pre&gt; tags.</li>
-<li>Block level elements, like &lt;div&gt; tags, are not wrapped within paragraphs, but their contained text is if it contains paragraphs.</li>
-<li>Quotes are converted to correctly facing curly quote entities, except those that appear within tags.</li>
-<li>Apostrophes are converted to curly apostrophe entities.</li>
-<li>Double dashes (either like -- this or like--this) are converted to em&#8212;dashes.</li>
-<li>Three consecutive periods either preceding or following a word are converted to ellipsis&#8230;</li>
-<li>Double spaces following sentences are converted to non-breaking spaces to mimic double spacing.</li>
-</ul>
-
-<p>Usage example:</p>
-
-<code>$string = $this->typography->auto_typography($string);</code>
-
-<h3>Parameters</h3>
-
-<p>There is one optional parameters that determines whether the parser should reduce more then two consecutive line breaks down to two. Use boolean <kbd>TRUE</kbd> or <kbd>FALSE</kbd>.</p>
-
-<p>By default the parser does not reduce line breaks. In other words, if no parameters are submitted, it is the same as doing this:</p>
-
-<code>$string = $this->typography->auto_typography($string, <kbd>FALSE</kbd>);</code>
-
-
-<p class="important"><strong>Note:</strong> 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
-<a href="../general/caching.html">caching</a> your pages.</p>
-
-
-
-<h2>format_characters()</h2>
-
-<p>This function is similar to the <dfn>auto_typography</dfn> function above, except that it only does character conversion:</p>
-
-<ul>
-<li>Quotes are converted to correctly facing curly quote entities, except those that appear within tags.</li>
-<li>Apostrophes are converted to curly apostrophe entities.</li>
-<li>Double dashes (either like -- this or like--this) are converted to em&#8212;dashes.</li>
-<li>Three consecutive periods either preceding or following a word are converted to ellipsis&#8230;</li>
-<li>Double spaces following sentences are converted to non-breaking spaces to mimic double spacing.</li>
-</ul>
-
-<p>Usage example:</p>
-
-<code>$string = $this->typography->format_characters($string);</code>
-
-
-<h2>nl2br_except_pre()</h2>
-
-<p>Converts newlines to &lt;br /&gt; tags unless they appear within &lt;pre&gt; tags.
-This function is identical to the native PHP <dfn>nl2br()</dfn> function, except that it ignores &lt;pre&gt; tags.</p>
-
-<p>Usage example:</p>
-
-<code>$string = $this->typography->nl2br_except_pre($string);</code>
-
-<h2>protect_braced_quotes</h2>
-
-<p>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 <kbd>protect_braced_quotes</kbd> class property to <samp>TRUE</samp>.</p>
-
-<p>Usage example:</p>
-
-<code>$this->load->library('typography');<br />
-$this->typography->protect_braced_quotes = TRUE;
-</code>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="parser.html">Template Parser</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="unit_testing.html">Unit Testing Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html
deleted file mode 100644
index 7d27ff1dd..000000000
--- a/user_guide/libraries/unit_testing.html
+++ /dev/null
@@ -1,226 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Unit Testing Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Unit Testing Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Unit Testing Class</h1>
-
-<p>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.</p>
-
-<p>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.
-</p>
-
-
-<h2>Initializing the Class</h2>
-
-<p>Like most other classes in CodeIgniter, the Unit Test class is initialized in your controller using the <dfn>$this->load->library</dfn> function:</p>
-
-<code>$this->load->library('unit_test');</code>
-<p>Once loaded, the Unit Test object will be available using: <dfn>$this->unit</dfn></p>
-
-
-<h2>Running Tests</h2>
-
-<p>Running a test involves supplying a test and an expected result to the following function:</p>
-
-<h2>$this->unit->run( <var>test</var>, <var>expected result</var>, '<var>test name</var>', '<var>notes</var>');</h2>
-
-<p>Where <var>test</var> is the result of the code you wish to test, <var>expected result</var> is the data type you expect,
-<var>test name</var> is an optional name you can give your test, and <var>notes</var> are optional notes. Example:</p>
-
-<code>$test = 1 + 1;<br />
-<br />
-$expected_result = 2;<br />
-<br />
-$test_name = 'Adds one plus one';<br />
-<br />
-$this->unit->run($test, $expected_result, $test_name);</code>
-
-<p>The expected result you supply can either be a literal match, or a data type match. Here's an example of a literal:</p>
-
-<code>$this->unit->run('Foo', 'Foo');</code>
-
-<p>Here is an example of a data type match:</p>
-
-<code>$this->unit->run('Foo', 'is_string');</code>
-
-<p>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:</p>
-
-<ul>
-<li>is_object</li>
-<li>is_string</li>
-<li>is_bool</li>
-<li>is_true</li>
-<li>is_false</li>
-<li>is_int</li>
-<li>is_numeric</li>
-<li>is_float</li>
-<li>is_double</li>
-<li>is_array</li>
-<li>is_null</li>
-</ul>
-
-
-<h2>Generating Reports</h2>
-
-<p>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 <var>run</var> function:</p>
-
-<code>echo $this->unit->run($test, $expected_result);</code>
-
-<p>To run a full report of all tests, use this:</p>
-
-<code>echo $this->unit->report();</code>
-
-<p>The report will be formatted in an HTML table for viewing. If you prefer the raw data you can retrieve an array using:</p>
-
-<code>echo $this->unit->result();</code>
-
-
-<h2>Strict Mode</h2>
-
-<p>By default the unit test class evaluates literal matches loosely. Consider this example:</p>
-
-<code>$this->unit->run(1, TRUE);</code>
-
-<p>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:</p>
-
-<code>if (1 == TRUE) echo 'This evaluates as true';</code>
-
-<p>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:</p>
-
-<code>if (1 === TRUE) echo 'This evaluates as FALSE';</code>
-
-<p>To enable strict mode use this:</p>
-
-<code>$this->unit->use_strict(TRUE);</code>
-
-<h2>Enabling/Disabling Unit Testing</h2>
-
-<p>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:</p>
-
-<code>$this->unit->active(FALSE)</code>
-
-<h2>Unit Test Display</h2>
-
-<p>When your unit test results display, the following items show by default:</p>
-
-<ul>
- <li>Test Name (test_name)</li>
- <li>Test Datatype (test_datatype)</li>
- <li>Expected Datatype (res_datatype)</li>
- <li>Result (result)</li>
- <li>File Name (file)</li>
- <li>Line Number (line)</li>
- <li>Any notes you entered for the test (notes)</li>
-</ul>
-
-You can customize which of these items get displayed by using <kbd>$this->unit->set_items()</kbd>. For example, if you only wanted the test name and the result displayed:</p>
-
-<h3>Customizing displayed tests</h3>
-
-<code>
- $this->unit->set_test_items(array('test_name', 'result'));
-</code>
-
-<h3>Creating a Template</h3>
-
-<p>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:</p>
-
-<code>
-$str = '<br />
-&lt;table border="0" cellpadding="4" cellspacing="1"><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<kbd>{rows}</kbd><br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr><br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td><kbd>{item}</kbd>&lt;/td><br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td><kbd>{result}</kbd>&lt;/td><br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr><br />
-&nbsp;&nbsp;&nbsp;&nbsp;<kbd>{/rows}</kbd><br />
-&lt;/table>';<br />
-<br />
-$this->unit->set_template($str);
-</code>
-
-<p class="important"><strong>Note:</strong> Your template must be declared <strong>before</strong> running the unit test process.</p>
-
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="typography.html">Typography Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="uri.html">URI Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html
deleted file mode 100644
index f04bb9f10..000000000
--- a/user_guide/libraries/uri.html
+++ /dev/null
@@ -1,252 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>URI Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-URI Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>URI Class</h1>
-
-<p>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.</p>
-
-<p class="important"><strong>Note:</strong> This class is initialized automatically by the system so there is no need to do it manually.</p>
-
-<h2>$this->uri->segment(<var>n</var>)</h2>
-
-<p>Permits you to retrieve a specific segment. Where <var>n</var> is the segment number you wish to retrieve.
-Segments are numbered from left to right. For example, if your full URL is this:</p>
-
-<code>http://example.com/index.php/news/local/metro/crime_is_up</code>
-
-<p>The segment numbers would be this:</p>
-
-<ol>
-<li>news</li>
-<li>local</li>
-<li>metro</li>
-<li>crime_is_up</li>
-</ol>
-
-<p>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:</p>
-
-<code>$product_id = $this->uri->segment(3, 0);</code>
-
-<p>It helps avoid having to write code like this:</p>
-
-<code>if ($this->uri->segment(3) === FALSE)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$product_id = 0;<br />
-}<br />
-else<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$product_id = $this->uri->segment(3);<br />
-}<br />
-</code>
-
-<h2>$this->uri->rsegment(<var>n</var>)</h2>
-
-<p>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 <a href="../general/routing.html">URI Routing</a> feature.</p>
-
-
-<h2>$this->uri->slash_segment(<var>n</var>)</h2>
-
-<p>This function is almost identical to <dfn>$this->uri->segment()</dfn>, 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:</p>
-
-<code>$this->uri->slash_segment(<var>3</var>);<br />
-$this->uri->slash_segment(<var>3</var>, 'leading');<br />
-$this->uri->slash_segment(<var>3</var>, 'both');</code>
-
-<p>Returns:</p>
-
-<ol>
-<li>segment/</li>
-<li>/segment</li>
-<li>/segment/</li>
-</ol>
-
-
-<h2>$this->uri->slash_rsegment(<var>n</var>)</h2>
-
-<p>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 <a href="../general/routing.html">URI Routing</a> feature.</p>
-
-
-
-<h2>$this->uri->uri_to_assoc(<var>n</var>)</h2>
-
-<p>This function lets you turn URI segments into and associative array of key/value pairs. Consider this URI:</p>
-
-<code>index.php/user/search/name/joe/location/UK/gender/male</code>
-
-<p>Using this function you can turn the URI into an associative array with this prototype:</p>
-
-<code>[array]<br />
-(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'name' => 'joe'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'location' => 'UK'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;'gender' => 'male'<br />
-)</code>
-
-<p>The first parameter of the function lets you set an offset. By default it is set to <kbd>3</kbd> since your
-URI will normally contain a controller/function in the first and second segments. Example:</p>
-
-<code>
-$array = $this->uri->uri_to_assoc(3);<br />
-<br />
-echo $array['name'];
-</code>
-
-
-<p>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:</p>
-
-<code>
-$default = array('name', 'gender', 'location', 'type', 'sort');<br />
-<br />
-$array = $this->uri->uri_to_assoc(3, $default);</code>
-
-<p>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.</p>
-
-<p>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).</p>
-
-
-<h2>$this->uri->ruri_to_assoc(<var>n</var>)</h2>
-
-<p>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 <a href="../general/routing.html">URI Routing</a> feature.</p>
-
-
-<h2>$this->uri->assoc_to_uri()</h2>
-
-<p>Takes an associative array as input and generates a URI string from it. The array keys will be included in the string. Example:</p>
-
-<code>$array = array('product' => 'shoes', 'size' => 'large', 'color' => 'red');<br />
-<br />
-$str = $this->uri->assoc_to_uri($array);<br />
-<br />
-// Produces: product/shoes/size/large/color/red
-</code>
-
-
-<h2>$this->uri->uri_string()</h2>
-
-<p>Returns a string with the complete URI. For example, if this is your full URL:</p>
-
-<code>http://example.com/index.php/news/local/345</code>
-
-<p>The function would return this:</p>
-
-<code>/news/local/345</code>
-
-
-<h2>$this->uri->ruri_string()</h2>
-
-<p>This function is identical to the previous one, except that it returns the
-re-routed URI in the event you are using CodeIgniter's <a href="../general/routing.html">URI Routing</a> feature.</p>
-
-
-
-<h2>$this->uri->total_segments()</h2>
-
-<p>Returns the total number of segments.</p>
-
-
-<h2>$this->uri->total_rsegments()</h2>
-
-<p>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 <a href="../general/routing.html">URI Routing</a> feature.</p>
-
-
-
-<h2>$this->uri->segment_array()</h2>
-
-<p>Returns an array containing the URI segments. For example:</p>
-
-<code>
-$segs = $this->uri->segment_array();<br />
-<br />
-foreach ($segs as $segment)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo $segment;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo '&lt;br />';<br />
-}</code>
-
-<h2>$this->uri->rsegment_array()</h2>
-
-<p>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 <a href="../general/routing.html">URI Routing</a> feature.</p>
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="unit_testing.html">Unit Testing Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="user_agent.html">User Agent Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html
deleted file mode 100644
index 8b3dcee62..000000000
--- a/user_guide/libraries/user_agent.html
+++ /dev/null
@@ -1,226 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>User Agent Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-User Agent Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>User Agent Class</h1>
-
-<p>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.</p>
-
-<h2>Initializing the Class</h2>
-
-<p>Like most other classes in CodeIgniter, the User Agent class is initialized in your controller using the <dfn>$this->load->library</dfn> function:</p>
-
-<code>$this->load->library('user_agent');</code>
-<p>Once loaded, the object will be available using: <dfn>$this->agent</dfn></p>
-
-<h2>User Agent Definitions</h2>
-
-<p>The user agent name definitions are located in a config file located at: <dfn>application/config/user_agents.php</dfn>. You may add items to the
-various user agent arrays if needed.</p>
-
-<h2>Example</h2>
-
-<p>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.</p>
-
-
-<code>
-$this->load->library('user_agent');<br />
-<br />
-if ($this->agent->is_browser())<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$agent = $this->agent->browser().' '.$this->agent->version();<br />
-}<br />
-elseif ($this->agent->is_robot())<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$agent = $this->agent->robot();<br />
-}<br />
-elseif ($this->agent->is_mobile())<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$agent = $this->agent->mobile();<br />
-}<br />
-else<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$agent = 'Unidentified User Agent';<br />
-}<br />
-<br />
-echo $agent;<br />
-<br />
-echo $this->agent->platform(); // Platform info (Windows, Linux, Mac, etc.)
-</code>
-
-
-<h1>Function Reference</h1>
-
-
-<h2>$this->agent->is_browser()</h2>
-<p>Returns TRUE/FALSE (boolean) if the user agent is a known web browser.</p>
-
-<code> if ($this->agent->is_browser('Safari'))<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo 'You are using Safari.';<br />
-}<br />
-else if ($this->agent->is_browser())<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo 'You are using a browser.';<br />
-}</code>
-
-<p class="important"><strong>Note:</strong>&nbsp; The string "Safari" in this example is an array key in the list of browser definitions.
-You can find this list in <dfn>application/config/user_agents.php</dfn> if you want to add new browsers or change the stings.</p>
-
-<h2>$this->agent->is_mobile()</h2>
-<p>Returns TRUE/FALSE (boolean) if the user agent is a known mobile device.</p>
-
-<code> if ($this->agent->is_mobile('iphone'))<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$this->load->view('iphone/home');<br />
-}<br />
-else if ($this->agent->is_mobile())<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$this->load->view('mobile/home');<br />
-}<br/>
-else<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;$this->load->view('web/home');<br />
-}</code>
-
-<h2>$this->agent->is_robot()</h2>
-<p>Returns TRUE/FALSE (boolean) if the user agent is a known robot.</p>
-
-<p class="important"><strong>Note:</strong>&nbsp; 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
-<dfn>application/config/user_agents.php</dfn> file.</p>
-
-<h2>$this->agent->is_referral()</h2>
-<p>Returns TRUE/FALSE (boolean) if the user agent was referred from another site.</p>
-
-
-<h2>$this->agent->browser()</h2>
-<p>Returns a string containing the name of the web browser viewing your site.</p>
-
-<h2>$this->agent->version()</h2>
-<p>Returns a string containing the version number of the web browser viewing your site.</p>
-
-<h2>$this->agent->mobile()</h2>
-<p>Returns a string containing the name of the mobile device viewing your site.</p>
-
-<h2>$this->agent->robot()</h2>
-<p>Returns a string containing the name of the robot viewing your site.</p>
-
-<h2>$this->agent->platform()</h2>
-<p>Returns a string containing the platform viewing your site (Linux, Windows, OS X, etc.).</p>
-
-<h2>$this->agent->referrer()</h2>
-<p>The referrer, if the user agent was referred from another site. Typically you'll test for this as follows:</p>
-
-<code> if ($this->agent->is_referral())<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo $this->agent->referrer();<br />
-}</code>
-
-
-<h2>$this->agent->agent_string()</h2>
-<p>Returns a string containing the full user agent string. Typically it will be something like this:</p>
-
-<code>Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.4) Gecko/20060613 Camino/1.0.2</code>
-
-
-<h2>$this->agent->accept_lang()</h2>
-<p>Lets you determine if the user agent accepts a particular language. Example:</p>
-
-<code>if ($this->agent->accept_lang('en'))<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo 'You accept English!';<br />
-}</code>
-
-<p class="important"><strong>Note:</strong> 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. </p>
-
-
-
-<h2>$this->agent->accept_charset()</h2>
-<p>Lets you determine if the user agent accepts a particular character set. Example:</p>
-
-<code>if ($this->agent->accept_charset('utf-8'))<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo 'You browser supports UTF-8!';<br />
-}</code>
-
-<p class="important"><strong>Note:</strong> 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. </p>
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="uri.html">URI Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="xmlrpc.html">XML-RPC Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html
deleted file mode 100644
index bb939dff4..000000000
--- a/user_guide/libraries/xmlrpc.html
+++ /dev/null
@@ -1,519 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>XML-RPC and XML-RPC Server Classes : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-XML-RPC and XML-RPC Server Classes
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>XML-RPC and XML-RPC Server Classes</h1>
-
-
-<p>CodeIgniter's XML-RPC classes permit you to send requests to another server, or set up
-your own XML-RPC server to receive requests.</p>
-
-
-<h2>What is XML-RPC?</h2>
-
-<p>Quite simply it is a way for two computers to communicate over the internet using XML.
-One computer, which we will call the <dfn>client</dfn>, sends an XML-RPC <strong>request</strong> to
-another computer, which we will call the <dfn>server</dfn>. Once the server receives and processes the request it
-will send back a <strong>response</strong> to the client.</p>
-
-<p>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.</p>
-
-<p>For detailed specifications, you can visit the <a href="http://www.xmlrpc.com/">XML-RPC</a> site.</p>
-
-<h2>Initializing the Class</h2>
-
-<p>Like most other classes in CodeIgniter, the XML-RPC and XML-RPCS classes are initialized in your controller using the <dfn>$this->load->library</dfn> function:</p>
-
-<p>To load the XML-RPC class you will use:</p>
-<code>$this->load->library('xmlrpc');</code>
-<p>Once loaded, the xml-rpc library object will be available using: <dfn>$this->xmlrpc</dfn></p>
-
-<p>To load the XML-RPC Server class you will use:</p>
-<code>
-$this->load->library('xmlrpc');<br />
-$this->load->library('xmlrpcs');
-</code>
-<p>Once loaded, the xml-rpcs library object will be available using: <dfn>$this->xmlrpcs</dfn></p>
-
-<p class="important"><strong>Note:</strong>&nbsp; When using the XML-RPC Server class you must load BOTH the XML-RPC class and the XML-RPC Server class.</p>
-
-
-
-<h2>Sending XML-RPC Requests</h2>
-
-<p>To send a request to an XML-RPC server you must specify the following information:</p>
-
-<ul>
-<li>The URL of the server</li>
-<li>The method on the server you wish to call</li>
-<li>The <em>request</em> data (explained below).</li>
-</ul>
-
-<p>Here is a basic example that sends a simple Weblogs.com ping to the <a href="http://pingomatic.com/">Ping-o-Matic</a></p>
-
-
-<code>$this->load->library('xmlrpc');<br />
-<br />
-$this->xmlrpc->server('http://rpc.pingomatic.com/', 80);<br />
-$this->xmlrpc->method('weblogUpdates.ping');<br />
-
-<br />
-$request = array('My Photoblog', 'http://www.my-site.com/photoblog/');<br />
-$this->xmlrpc->request($request);<br />
-<br />
-if ( ! $this->xmlrpc->send_request())<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;echo $this-&gt;xmlrpc->display_error();<br />
-}</code>
-
-<h3>Explanation</h3>
-
-<p>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 <dfn>send_request()</dfn> method returns false we will display the error message
-sent back from the XML-RPC Server.</p>
-
-<h2>Anatomy of a Request</h2>
-
-<p>An XML-RPC <dfn>request</dfn> is simply the data you are sending to the XML-RPC server. Each piece of data in a request
-is referred to as a <dfn>request parameter</dfn>. 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.</p>
-
-<p>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.</p>
-
-<p>Here is an example of a simple array with three parameters:</p>
-
-<code>$request = array('John', 'Doe', 'www.some-site.com');<br />
-$this->xmlrpc->request($request);</code>
-
-<p>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:</p>
-
-<code>
-$request = array (<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('John', 'string'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('Doe', 'string'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(FALSE, 'boolean'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(12345, 'int')<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);
-<br />
-$this->xmlrpc->request($request);</code>
-
-The <a href="#datatypes">Data Types</a> section below has a full list of data types.
-
-
-
-<h2>Creating an XML-RPC Server</h2>
-
-<p>An XML-RPC Server acts as a traffic cop of sorts, waiting for incoming requests and redirecting them to the
-appropriate functions for processing.</p>
-
-<p>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.</p>
-
-<p>Here is an example to illustrate:</p>
-
-<code>
-$this->load->library('xmlrpc');<br />
-$this->load->library('xmlrpcs');<br />
-<br />
-$config['functions']['<var>new_post</var>'] = array('function' => '<dfn>My_blog.new_entry</dfn>'),<br />
-$config['functions']['<var>update_post</var>'] = array('function' => '<dfn>My_blog.update_entry</dfn>');<br />
-$config['object'] = $this;<br />
-<br />
-$this->xmlrpcs->initialize($config);<br />
-$this->xmlrpcs->serve();</code>
-
-<p>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.</p>
-
-<p>The '<var>object</var>' 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.</p>
-
-<p>In other words, if an XML-RPC Client sends a request for the <var>new_post</var> method, your
-server will load the <dfn>My_blog</dfn> class and call the <dfn>new_entry</dfn> function.
-If the request is for the <var>update_post</var> method, your
-server will load the <dfn>My_blog</dfn> class and call the <dfn>update_entry</dfn> function.</p>
-
-<p>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.</p>
-
-<p>There are two additional configuration keys you may make use of when initializing the server class: <var>debug</var> can be set to TRUE in order to enable debugging, and <var>xss_clean</var> may be set to FALSE to prevent sending data through the Security library's xss_clean function.
-
-<h2>Processing Server Requests</h2>
-
-<p>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.</p>
-
-<p>Using the above example, if the <var>new_post</var> method is requested, the server will expect a class
-to exist with this prototype:</p>
-
-<code>class <kbd>My_blog</kbd> extends CI_Controller {<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;function <kbd>new_post</kbd>(<var>$request</var>)<br />
-&nbsp;&nbsp;&nbsp;&nbsp;{<br />
- <br />
-&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-}
-</code>
-
-<p>The <var>$request</var> 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 <em>request parameters</em> enabling you to process the request. When
-you are done you will send a <dfn>Response</dfn> back to the Client.</p>
-
-<p>Below is a real-world example, using the Blogger API. One of the methods in the Blogger API is <dfn>getUserInfo()</dfn>.
-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:</p>
-
-
-<code>class <kbd>My_blog</kbd> extends CI_Controller {<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;function <kbd>getUserInfo</kbd>(<var>$request</var>)<br />
-&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$username = 'smitty';<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$password = 'secretsmittypass';<br /><br />
-
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this->load->library('xmlrpc');<br />
-&nbsp;&nbsp;&nbsp;&nbsp;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$parameters&nbsp;=&nbsp;$request->output_parameters();<br />
-&nbsp;&nbsp;&nbsp;&nbsp;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;($parameters['1'] != $username AND $parameters['2'] != $password)<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;$this->xmlrpc->send_error_message('100',&nbsp;'Invalid&nbsp;Access');<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-&nbsp;&nbsp;&nbsp;&nbsp;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$response&nbsp;=&nbsp;array(array('nickname'&nbsp;&nbsp;=>&nbsp;array('Smitty','string'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'userid'&nbsp;&nbsp;&nbsp;&nbsp;=>&nbsp;array('99','string'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'url'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=>&nbsp;array('http://yoursite.com','string'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'email'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=>&nbsp;array('jsmith@yoursite.com','string'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'lastname'&nbsp;&nbsp;=>&nbsp;array('Smith','string'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'firstname'&nbsp;=>&nbsp;array('John','string')<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'struct');<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return $this->xmlrpc->send_response($response);<br />
-&nbsp;&nbsp;&nbsp;&nbsp;}<br />
-}
-</code>
-
-<h3>Notes:</h3>
-<p>The <dfn>output_parameters()</dfn> 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.</p>
-
-<p>If the username and password sent by the client were not valid, and error message is returned using <dfn>send_error_message()</dfn>.</p>
-
-<p>If the operation was successful, the client will be sent back a response array containing the user's info.</p>
-
-
-<h2>Formatting a Response</h2>
-
-<p>Similar to <em>Requests</em>, <em>Responses</em> must be formatted as an array. However, unlike requests, a response is an array
-<strong>that contains a single item</strong>. 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:</p>
-
-<code>$response = array('Response data', 'array');</code>
-
-<p>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:</p>
-
-<code>
-$response = array (<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'first_name' => array('John', 'string'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'last_name' => array('Doe', 'string'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'member_id' => array(123435, 'int'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'todo_list' => array(array('clean house', 'call mom', 'water plants'), 'array'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'struct'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);
-</code>
-
-<p class="important">Notice that the above array is formatted as a <dfn>struct</dfn>. This is the most common data type for responses.</p>
-
-<p>As with Requests, a response can be one of the seven data types listed in the <a href="#datatypes">Data Types</a> section.</p>
-
-
-<h2>Sending an Error Response</h2>
-
-<p>If you need to send the client an error response you will use the following:</p>
-
-<code>return $this->xmlrpc->send_error_message('123', 'Requested data not available');</code>
-
-<p>The first parameter is the error number while the second parameter is the error message.</p>
-
-
-
-
-
-
-<h2>Creating Your Own Client and Server</h2>
-
-<p>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.</p>
-
-<h3>The Client</h3>
-
-<p>Using a text editor, create a controller called <dfn>xmlrpc_client.php</dfn>.
-In it, place this code and save it to your <samp>applications/controllers/</samp> folder:</p>
-
-<textarea class="textarea" style="width:100%" cols="50" rows="32">&lt;?php
-
-class Xmlrpc_client extends CI_Controller {
-
- function index()
- {
- $this->load->helper('url');
- $server_url = site_url('xmlrpc_server');
-
- $this->load->library('xmlrpc');
-
- $this->xmlrpc->server($server_url, 80);
- $this->xmlrpc->method('Greetings');
-
- $request = array('How is it going?');
- $this->xmlrpc->request($request);
-
- if ( ! $this->xmlrpc->send_request())
- {
- echo $this->xmlrpc->display_error();
- }
- else
- {
- echo '<pre>';
- print_r($this->xmlrpc->display_response());
- echo '</pre>';
- }
- }
-}
-?></textarea>
-
-<p>Note: In the above code we are using a "url helper". You can find more information in the <a href="../general/helpers.html">Helpers Functions</a> page.</p>
-
-<h3>The Server</h3>
-
-<p>Using a text editor, create a controller called <dfn>xmlrpc_server.php</dfn>.
-In it, place this code and save it to your <samp>applications/controllers/</samp> folder:</p>
-
-<textarea class="textarea" style="width:100%" cols="50" rows="30">&lt;?php
-
-class Xmlrpc_server extends CI_Controller {
-
- function index()
- {
- $this->load->library('xmlrpc');
- $this->load->library('xmlrpcs');
-
- $config['functions']['Greetings'] = array('function' => 'Xmlrpc_server.process');
-
- $this->xmlrpcs->initialize($config);
- $this->xmlrpcs->serve();
- }
-
-
- function process($request)
- {
- $parameters = $request->output_parameters();
-
- $response = array(
- array(
- 'you_said' => $parameters['0'],
- 'i_respond' => 'Not bad at all.'),
- 'struct');
-
- return $this->xmlrpc->send_response($response);
- }
-}
-?></textarea>
-
-<h3>Try it!</h3>
-
-<p>Now visit the your site using a URL similar to this:</p>
-<code>example.com/index.php/<var>xmlrpc_client</var>/</code>
-
-<p>You should now see the message you sent to the server, and its response back to you.</p>
-
-<p>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.</p>
-
-<h2>Using Associative Arrays In a Request Parameter</h2>
-
-<p>If you wish to use an associative array in your method parameters you will need to use a struct datatype:</p>
-
-<code>$request = array(<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Param 0<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name'=&gt;'John'<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ),<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'struct'<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Param 1<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'size'=&gt;'large',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'shape'=&gt;'round'<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ),<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'struct'<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
- $this-&gt;xmlrpc-&gt;request($request);</code>
-
-<p>You can retrieve the associative array when processing the request in the Server.</p>
-
-<code>$parameters = $request-&gt;output_parameters();<br />
- $name = $parameters['0']['name'];<br />
- $size = $parameters['1']['size'];<br />
- $size = $parameters['1']['shape']; </code>
-
-<h1>XML-RPC Function Reference</h1>
-
-<h2>$this->xmlrpc->server()</h2>
-<p>Sets the URL and port number of the server to which a request is to be sent:</p>
-<code>$this->xmlrpc->server('http://www.sometimes.com/pings.php', 80);</code>
-
-<h2>$this->xmlrpc->timeout()</h2>
-<p>Set a time out period (in seconds) after which the request will be canceled:</p>
-<code>$this->xmlrpc->timeout(6);</code>
-
-<h2>$this->xmlrpc->method()</h2>
-<p>Sets the method that will be requested from the XML-RPC server:</p>
-<code>$this->xmlrpc->method('<var>method</var>');</code>
-
-<p>Where <var>method</var> is the name of the method.</p>
-
-<h2>$this->xmlrpc->request()</h2>
-<p>Takes an array of data and builds request to be sent to XML-RPC server:</p>
-<code>$request = array(array('My Photoblog', 'string'), 'http://www.yoursite.com/photoblog/');<br />
-$this->xmlrpc->request($request);</code>
-
-<h2>$this->xmlrpc->send_request()</h2>
-<p>The request sending function. Returns boolean TRUE or FALSE based on success for failure, enabling it to be used conditionally.</p>
-
-<h2>$this->xmlrpc->set_debug(TRUE);</h2>
-<p>Enables debugging, which will display a variety of information and error data helpful during development.</p>
-
-
-<h2>$this->xmlrpc->display_error()</h2>
-<p>Returns an error message as a string if your request failed for some reason.</p>
-<code>echo $this->xmlrpc->display_error();</code>
-
-<h2>$this->xmlrpc->display_response()</h2>
-<p>Returns the response from the remote server once request is received. The response will typically be an associative array.</p>
-<code>$this->xmlrpc->display_response();</code>
-
-<h2>$this->xmlrpc->send_error_message()</h2>
-<p>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.</p>
-<code>return $this->xmlrpc->send_error_message('123', 'Requested data not available');</code>
-
-<h2>$this->xmlrpc->send_response()</h2>
-<p>Lets you send the response from your server to the client. An array of valid data values must be sent with this method.</p>
-<code>$response = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'flerror' => array(FALSE, 'boolean'),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'message' => "Thanks for the ping!"<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'struct');<br />
-return $this->xmlrpc->send_response($response);</code>
-
-
-<a name="datatypes"></a>
-<h2>Data Types</h2>
-
-<p>According to the <a href="http://www.xmlrpc.com/spec">XML-RPC spec</a> there are seven types
-of values that you can send via XML-RPC:</p>
-
-<ul>
-<li><em>int</em> or <em>i4</em></li>
-<li><em>boolean</em></li>
-<li><em>string</em></li>
-<li><em>double</em></li>
-<li><em>dateTime.iso8601</em></li>
-<li><em>base64</em></li>
-<li><em>struct</em> (contains array of values)</li>
-<li><em>array</em> (contains array of values)</li>
-</ul>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="user_agent.html">User Agent Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="zip.html">Zip Encoding Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html
deleted file mode 100644
index 53fc71ef3..000000000
--- a/user_guide/libraries/zip.html
+++ /dev/null
@@ -1,288 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Zip Encoding Class : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Zip Encoding Class
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Zip Encoding Class</h1>
-<p>CodeIgniter's Zip Encoding Class classes permit you to create Zip archives. Archives can be downloaded to your
-desktop or saved to a directory.</p>
-
-
-<h2>Initializing the Class</h2>
-<p>Like most other classes in CodeIgniter, the Zip class is initialized in your controller using the <dfn>$this->load->library</dfn> function:</p>
-
-<code>$this->load->library('zip');</code>
-<p>Once loaded, the Zip library object will be available using: <dfn>$this->zip</dfn></p>
-
-
-<h2>Usage Example</h2>
-
-<p>This example demonstrates how to compress a file, save it to a folder on your server, and download it to your desktop.</p>
-
-<code>
-$name = 'mydata1.txt';<br />
-$data = 'A Data String!';<br />
-<br />
-$this->zip->add_data($name, $data);<br />
-<br />
-// Write the zip file to a folder on your server. Name it "my_backup.zip"<br />
-$this->zip->archive('/path/to/directory/my_backup.zip');
-<br /><br />
- // Download the file to your desktop. Name it "my_backup.zip"<br />
-$this->zip->download('my_backup.zip');
-</code>
-
-<h1>Function Reference</h1>
-
-<h2>$this->zip->add_data()</h2>
-
-<p>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:</p>
-
-<code>
-$name = 'my_bio.txt';<br />
-$data = 'I was born in an elevator...';<br />
-<br />
-$this->zip->add_data($name, $data);
-</code>
-
-<p>You are allowed multiple calls to this function in order to
-add several files to your archive. Example:</p>
-
-<code>
-$name = 'mydata1.txt';<br />
-$data = 'A Data String!';<br />
-$this->zip->add_data($name, $data);<br />
-<br />
-$name = 'mydata2.txt';<br />
-$data = 'Another Data String!';<br />
-$this->zip->add_data($name, $data);<br />
-</code>
-
-<p>Or you can pass multiple files using an array:</p>
-
-<code>
-$data = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'mydata1.txt' => 'A Data String!',<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'mydata2.txt' => 'Another Data String!'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-$this->zip->add_data($data);<br />
-<br />
-$this->zip->download('my_backup.zip');
-</code>
-
-<p>If you would like your compressed data organized into sub-folders, include the path as part of the filename:</p>
-
-<code>
-$name = '<kbd>personal/</kbd>my_bio.txt';<br />
-$data = 'I was born in an elevator...';<br />
-<br />
-$this->zip->add_data($name, $data);
-</code>
-
-<p>The above example will place <dfn>my_bio.txt</dfn> inside a folder called <kbd>personal</kbd>.</p>
-
-
-<h2>$this->zip->add_dir()</h2>
-
-<p>Permits you to add a directory. Usually this function is unnecessary since you can place your data into folders when
-using <dfn>$this->zip->add_data()</dfn>, but if you would like to create an empty folder you can do so. Example:</p>
-
-<code>$this->zip->add_dir('myfolder'); // Creates a folder called "myfolder"</code>
-
-
-
-<h2>$this->zip->read_file()</h2>
-
-<p>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:</p>
-
-<code>
-$path = '/path/to/photo.jpg';<br /><br />
-$this->zip->read_file($path);
-<br /><br />
- // Download the file to your desktop. Name it "my_backup.zip"<br />
-$this->zip->download('my_backup.zip');
-</code>
-
-<p>If you would like the Zip archive to maintain the directory structure of the file in it, pass <kbd>TRUE</kbd> (boolean) in the
-second parameter. Example:</p>
-
-
-<code>
-$path = '/path/to/photo.jpg';<br /><br />
-$this->zip->read_file($path, <kbd>TRUE</kbd>);
-<br /><br />
- // Download the file to your desktop. Name it "my_backup.zip"<br />
-$this->zip->download('my_backup.zip');
-</code>
-
-<p>In the above example, <dfn>photo.jpg</dfn> will be placed inside two folders: <kbd>path/to/</kbd></p>
-
-
-
-<h2>$this->zip->read_dir()</h2>
-
-<p>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:</p>
-
-<code>
-$path = '/path/to/your/directory/';<br /><br />
-$this->zip->read_dir($path);
-<br /><br />
- // Download the file to your desktop. Name it "my_backup.zip"<br />
-$this->zip->download('my_backup.zip');
-</code>
-
-<p>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 <kbd>FALSE</kbd> (boolean) in the second parameter. Example:</p>
-
-<code>
-$path = '/path/to/your/directory/';<br /><br />
-$this->zip->read_dir($path, FALSE);
-</code>
-
-<p>This will create a ZIP with the folder "directory" inside, then all sub-folders stored correctly inside that, but will not include the folders <samp>/path/to/your</samp>.</p>
-
-
-
-
-<h2>$this->zip->archive()</h2>
-
-<p>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:</p>
-
-<code>$this->zip->archive('/path/to/folder/myarchive.zip'); // Creates a file named myarchive.zip</code>
-
-
-<h2>$this->zip->download()</h2>
-
-<p>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:</p>
-
-<code>$this->zip->download('latest_stuff.zip'); // File will be named "latest_stuff.zip"</code>
-
-<p class="important"><strong>Note:</strong>&nbsp; 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.</p>
-
-
-<h2>$this->zip->get_zip()</h2>
-
-<p>Returns the Zip-compressed file data. Generally you will not need this function unless you want to do something unique with the data.
-Example:</p>
-
-<code>
-$name = 'my_bio.txt';<br />
-$data = 'I was born in an elevator...';<br />
-<br />
-$this->zip->add_data($name, $data);<br /><br />
-
-$zip_file = $this->zip->get_zip();
-</code>
-
-
-<h2>$this->zip->clear_data()</h2>
-
-<p>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:</p>
-
-<code>
-$name = 'my_bio.txt';<br />
-$data = 'I was born in an elevator...';<br />
-<br />
-$this->zip->add_data($name, $data);<br />
-$zip_file = $this->zip->get_zip();<br />
-<br />
-<kbd>$this->zip->clear_data();</kbd>
-<br /><br />
-
-$name = 'photo.jpg';<br />
-$this->zip->read_file("/path/to/photo.jpg"); // Read the file's contents<br />
-<br /><br />
-$this->zip->download('myphotos.zip');
-</code>
-
-
-
-
-
-
-
-
-
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="xmlrpc.html"> XML-RPC Class</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="caching.html">Caching Class</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/license.html b/user_guide/license.html
deleted file mode 100644
index f9769a417..000000000
--- a/user_guide/license.html
+++ /dev/null
@@ -1,107 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter License Agreement : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='userguide.css' />
-
-<script type="text/javascript" src="nav/nav.js"></script>
-<script type="text/javascript" src="nav/prototype.lite.js"></script>
-<script type="text/javascript" src="nav/moo.fx.js"></script>
-<script type="text/javascript" src="nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('null');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-License Agreement
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>CodeIgniter License Agreement</h1>
-
-<p>Copyright (c) 2008 - 2011, EllisLab, Inc.<br />
-All rights reserved.</p>
-
-<p>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.</p>
-
-<h2>Permitted Use</h2>
-<p>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:</p>
-
-<ol>
-<li>A copy of this license agreement must be included with the distribution.</li>
-<li>Redistributions of source code must retain the above copyright notice in all source code files.</li>
-<li>Redistributions in binary form must reproduce the above copyright notice in the documentation and/or other materials provided with the distribution.</li>
-<li>Any files that have been modified must carry notices stating the nature of the change and the names of those who changed them.</li>
-<li>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.</li>
-<li>Products derived from the Software may not be called "CodeIgniter", nor may "CodeIgniter" appear in their name, without prior written permission from EllisLab, Inc.</li>
-</ol>
-
-<h2>Indemnity</h2>
-<p>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.</p>
-
-<h2>Disclaimer of Warranty</h2>
-<p>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.</p>
-
-<h2>Limitations of Liability</h2>
-<p>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.</p>
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="general/requirements.html">Server Requirements</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="changelog.html">Change Log</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/nav/hacks.txt b/user_guide/nav/hacks.txt
deleted file mode 100644
index 8c17f008a..000000000
--- a/user_guide/nav/hacks.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-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
-
-
-Also removed fx.Opacity and fx.Height from moo.fx.js -- Pascal \ No newline at end of file
diff --git a/user_guide/nav/moo.fx.js b/user_guide/nav/moo.fx.js
deleted file mode 100755
index 256371d19..000000000
--- a/user_guide/nav/moo.fx.js
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
-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);
- }
-});
diff --git a/user_guide/nav/nav.js b/user_guide/nav/nav.js
deleted file mode 100644
index b9b6e0943..000000000
--- a/user_guide/nav/nav.js
+++ /dev/null
@@ -1,156 +0,0 @@
-function create_menu(basepath)
-{
- var base = (basepath == 'null') ? '' : basepath;
-
- document.write(
- '<table cellpadding="0" cellspaceing="0" border="0" style="width:98%"><tr>' +
- '<td class="td" valign="top">' +
-
- '<ul>' +
- '<li><a href="'+base+'index.html">User Guide Home</a></li>' +
- '<li><a href="'+base+'toc.html">Table of Contents Page</a></li>' +
- '</ul>' +
-
- '<h3>Basic Info</h3>' +
- '<ul>' +
- '<li><a href="'+base+'general/requirements.html">Server Requirements</a></li>' +
- '<li><a href="'+base+'license.html">License Agreement</a></li>' +
- '<li><a href="'+base+'changelog.html">Change Log</a></li>' +
- '<li><a href="'+base+'general/credits.html">Credits</a></li>' +
- '</ul>' +
-
- '<h3>Installation</h3>' +
- '<ul>' +
- '<li><a href="'+base+'installation/downloads.html">Downloading CodeIgniter</a></li>' +
- '<li><a href="'+base+'installation/index.html">Installation Instructions</a></li>' +
- '<li><a href="'+base+'installation/upgrading.html">Upgrading from a Previous Version</a></li>' +
- '<li><a href="'+base+'installation/troubleshooting.html">Troubleshooting</a></li>' +
- '</ul>' +
-
- '<h3>Introduction</h3>' +
- '<ul>' +
- '<li><a href="'+base+'overview/getting_started.html">Getting Started</a></li>' +
- '<li><a href="'+base+'overview/at_a_glance.html">CodeIgniter at a Glance</a></li>' +
- '<li><a href="'+base+'overview/cheatsheets.html">CodeIgniter Cheatsheets</a></li>' +
- '<li><a href="'+base+'overview/features.html">Supported Features</a></li>' +
- '<li><a href="'+base+'overview/appflow.html">Application Flow Chart</a></li>' +
- '<li><a href="'+base+'overview/mvc.html">Model-View-Controller</a></li>' +
- '<li><a href="'+base+'overview/goals.html">Architectural Goals</a></li>' +
- '</ul>' +
-
- '<h3>Tutorial</h3>' +
- '<ul>' +
- '<li><a href="'+base+'tutorial/index.html">Introduction</a></li>' +
- '<li><a href="'+base+'tutorial/static_pages.html">Static pages</a></li>' +
- '<li><a href="'+base+'tutorial/news_section.html">News section</a></li>' +
- '<li><a href="'+base+'tutorial/create_news_items.html">Create news items</a></li>' +
- '<li><a href="'+base+'tutorial/conclusion.html">Conclusion</a></li>' +
- '</ul>' +
-
- '</td><td class="td_sep" valign="top">' +
-
- '<h3>General Topics</h3>' +
- '<ul>' +
- '<li><a href="'+base+'general/urls.html">CodeIgniter URLs</a></li>' +
- '<li><a href="'+base+'general/controllers.html">Controllers</a></li>' +
- '<li><a href="'+base+'general/reserved_names.html">Reserved Names</a></li>' +
- '<li><a href="'+base+'general/views.html">Views</a></li>' +
- '<li><a href="'+base+'general/models.html">Models</a></li>' +
- '<li><a href="'+base+'general/helpers.html">Helpers</a></li>' +
- '<li><a href="'+base+'general/libraries.html">Using CodeIgniter Libraries</a></li>' +
- '<li><a href="'+base+'general/creating_libraries.html">Creating Your Own Libraries</a></li>' +
- '<li><a href="'+base+'general/drivers.html">Using CodeIgniter Drivers</a></li>' +
- '<li><a href="'+base+'general/creating_drivers.html">Creating Your Own Drivers</a></li>' +
- '<li><a href="'+base+'general/core_classes.html">Creating Core Classes</a></li>' +
- '<li><a href="'+base+'general/hooks.html">Hooks - Extending the Core</a></li>' +
- '<li><a href="'+base+'general/autoloader.html">Auto-loading Resources</a></li>' +
- '<li><a href="'+base+'general/common_functions.html">Common Functions</a></li>' +
- '<li><a href="'+base+'general/routing.html">URI Routing</a></li>' +
- '<li><a href="'+base+'general/errors.html">Error Handling</a></li>' +
- '<li><a href="'+base+'general/caching.html">Caching</a></li>' +
- '<li><a href="'+base+'general/profiling.html">Profiling Your Application</a></li>' +
- '<li><a href="'+base+'general/cli.html">Running via the CLI</a></li>' +
- '<li><a href="'+base+'general/managing_apps.html">Managing Applications</a></li>' +
- '<li><a href="'+base+'general/environments.html">Handling Multiple Environments</a></li>' +
- '<li><a href="'+base+'general/alternative_php.html">Alternative PHP Syntax</a></li>' +
- '<li><a href="'+base+'general/security.html">Security</a></li>' +
- '<li><a href="'+base+'general/styleguide.html">PHP Style Guide</a></li>' +
- '<li><a href="'+base+'doc_style/index.html">Writing Documentation</a></li>' +
- '</ul>' +
-
- '<h3>Additional Resources</h3>' +
- '<ul>' +
- '<li><a href="http://codeigniter.com/forums/">Community Forums</a></li>' +
- '<li><a href="http://codeigniter.com/wiki/">Community Wiki</a></li>' +
- '</ul>' +
-
- '</td><td class="td_sep" valign="top">' +
-
- '<h3>Class Reference</h3>' +
- '<ul>' +
- '<li><a href="'+base+'libraries/benchmark.html">Benchmarking Class</a></li>' +
- '<li><a href="'+base+'libraries/calendar.html">Calendar Class</a></li>' +
- '<li><a href="'+base+'libraries/cart.html">Cart Class</a></li>' +
- '<li><a href="'+base+'libraries/config.html">Config Class</a></li>' +
- '<li><a href="'+base+'libraries/email.html">Email Class</a></li>' +
- '<li><a href="'+base+'libraries/encryption.html">Encryption Class</a></li>' +
- '<li><a href="'+base+'libraries/file_uploading.html">File Uploading Class</a></li>' +
- '<li><a href="'+base+'libraries/form_validation.html">Form Validation Class</a></li>' +
- '<li><a href="'+base+'libraries/ftp.html">FTP Class</a></li>' +
- '<li><a href="'+base+'libraries/table.html">HTML Table Class</a></li>' +
- '<li><a href="'+base+'libraries/image_lib.html">Image Manipulation Class</a></li>' +
- '<li><a href="'+base+'libraries/input.html">Input Class</a></li>' +
- '<li><a href="'+base+'libraries/javascript.html">Javascript Class</a></li>' +
- '<li><a href="'+base+'libraries/loader.html">Loader Class</a></li>' +
- '<li><a href="'+base+'libraries/language.html">Language Class</a></li>' +
- '<li><a href="'+base+'libraries/migration.html">Migration Class</a></li>' +
- '<li><a href="'+base+'libraries/output.html">Output Class</a></li>' +
- '<li><a href="'+base+'libraries/pagination.html">Pagination Class</a></li>' +
- '<li><a href="'+base+'libraries/security.html">Security Class</a></li>' +
- '<li><a href="'+base+'libraries/sessions.html">Session Class</a></li>' +
- '<li><a href="'+base+'libraries/trackback.html">Trackback Class</a></li>' +
- '<li><a href="'+base+'libraries/parser.html">Template Parser Class</a></li>' +
- '<li><a href="'+base+'libraries/typography.html">Typography Class</a></li>' +
- '<li><a href="'+base+'libraries/unit_testing.html">Unit Testing Class</a></li>' +
- '<li><a href="'+base+'libraries/uri.html">URI Class</a></li>' +
- '<li><a href="'+base+'libraries/user_agent.html">User Agent Class</a></li>' +
- '<li><a href="'+base+'libraries/xmlrpc.html">XML-RPC Class</a></li>' +
- '<li><a href="'+base+'libraries/zip.html">Zip Encoding Class</a></li>' +
- '</ul>' +
-
- '</td><td class="td_sep" valign="top">' +
-
- '<h3>Driver Reference</h3>' +
- '<ul>' +
- '<li><a href="'+base+'libraries/caching.html">Caching Class</a></li>' +
- '<li><a href="'+base+'database/index.html">Database Class</a></li>' +
- '<li><a href="'+base+'libraries/javascript.html">Javascript Class</a></li>' +
- '</ul>' +
-
- '<h3>Helper Reference</h3>' +
- '<ul>' +
- '<li><a href="'+base+'helpers/array_helper.html">Array Helper</a></li>' +
- '<li><a href="'+base+'helpers/captcha_helper.html">CAPTCHA Helper</a></li>' +
- '<li><a href="'+base+'helpers/cookie_helper.html">Cookie Helper</a></li>' +
- '<li><a href="'+base+'helpers/date_helper.html">Date Helper</a></li>' +
- '<li><a href="'+base+'helpers/directory_helper.html">Directory Helper</a></li>' +
- '<li><a href="'+base+'helpers/download_helper.html">Download Helper</a></li>' +
- '<li><a href="'+base+'helpers/email_helper.html">Email Helper</a></li>' +
- '<li><a href="'+base+'helpers/file_helper.html">File Helper</a></li>' +
- '<li><a href="'+base+'helpers/form_helper.html">Form Helper</a></li>' +
- '<li><a href="'+base+'helpers/html_helper.html">HTML Helper</a></li>' +
- '<li><a href="'+base+'helpers/inflector_helper.html">Inflector Helper</a></li>' +
- '<li><a href="'+base+'helpers/language_helper.html">Language Helper</a></li>' +
- '<li><a href="'+base+'helpers/number_helper.html">Number Helper</a></li>' +
- '<li><a href="'+base+'helpers/path_helper.html">Path Helper</a></li>' +
- '<li><a href="'+base+'helpers/security_helper.html">Security Helper</a></li>' +
- '<li><a href="'+base+'helpers/smiley_helper.html">Smiley Helper</a></li>' +
- '<li><a href="'+base+'helpers/string_helper.html">String Helper</a></li>' +
- '<li><a href="'+base+'helpers/text_helper.html">Text Helper</a></li>' +
- '<li><a href="'+base+'helpers/typography_helper.html">Typography Helper</a></li>' +
- '<li><a href="'+base+'helpers/url_helper.html">URL Helper</a></li>' +
- '<li><a href="'+base+'helpers/xml_helper.html">XML Helper</a></li>' +
- '</ul>' +
-
- '</td></tr></table>');
-} \ No newline at end of file
diff --git a/user_guide/nav/prototype.lite.js b/user_guide/nav/prototype.lite.js
deleted file mode 100755
index e6c362279..000000000
--- a/user_guide/nav/prototype.lite.js
+++ /dev/null
@@ -1,127 +0,0 @@
-/* Prototype JavaScript framework
- * (c) 2005 Sam Stephenson <sam@conio.net>
- *
- * 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
deleted file mode 100644
index ce5d0776c..000000000
--- a/user_guide/nav/user_guide_menu.js
+++ /dev/null
@@ -1,4 +0,0 @@
-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
deleted file mode 100644
index 61bf907a6..000000000
--- a/user_guide/overview/appflow.html
+++ /dev/null
@@ -1,95 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Application Flow Chart : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Appflow
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Application Flow Chart</h1>
-
-<p>The following graphic illustrates how data flows throughout the system:</p>
-
-<div><img src="../images/appflowchart.gif" width="769" height="212" alt="CodeIgniter application flow"></div>
-
-
-<ol>
-<li>The index.php serves as the front controller, initializing the base resources needed to run CodeIgniter.</li>
-<li>The Router examines the HTTP request to determine what should be done with it.</li>
-<li>If a cache file exists, it is sent directly to the browser, bypassing the normal system execution.</li>
-<li>Security. Before the application controller is loaded, the HTTP request and any user submitted data is filtered for security.</li>
-<li>The Controller loads the model, core libraries, helpers, and any other resources needed to process the specific request.</li>
-<li>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.</li>
-</ol>
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="features.html">CodeIgniter Features</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="mvc.html">Model-View-Controller</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html
deleted file mode 100644
index 7e93bd2a6..000000000
--- a/user_guide/overview/at_a_glance.html
+++ /dev/null
@@ -1,162 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter at a Glance : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-What is CodeIgniter?
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>CodeIgniter at a Glance</h1>
-
-
-<h2>CodeIgniter is an Application Framework</h2>
-
-<p>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.</p>
-
-<h2>CodeIgniter is Free</h2>
-<p>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 <a href="../license.html">license agreement</a>.</p>
-
-<h2>CodeIgniter is Light Weight</h2>
-<p>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.
-</p>
-
-<h2>CodeIgniter is Fast</h2>
-<p>Really fast. We challenge you to find a framework that has better performance than CodeIgniter.</p>
-
-
-<h2>CodeIgniter Uses M-V-C</h2>
-<p>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.</p>
-
-<h2>CodeIgniter Generates Clean URLs</h2>
-<p>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:</p>
-
-<code>example.com/<var>news</var>/<dfn>article</dfn>/<samp>345</samp></code>
-
-<p>Note: By default the index.php file is included in the URL but it can be removed using a simple .htaccess file.</p>
-
-<h2>CodeIgniter Packs a Punch</h2>
-<p>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.</p>
-
-<h2>CodeIgniter is Extensible</h2>
-<p>The system can be easily extended through the use of your own libraries, helpers, or through class extensions or system hooks.</p>
-
-
-<h2>CodeIgniter Does Not Require a Template Engine</h2>
-<p>Although CodeIgniter <em>does</em> 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:</p>
-
-<code>&lt;ul><br />
-<br />
-&lt;?php foreach ($addressbook as $name):?><br />
-<br />
-&lt;li>&lt;?=$name?>&lt;/li><br />
-<br />
-&lt;?php endforeach; ?><br />
-<br />
-&lt;/ul></code>
-
-<p>Contrast this with the pseudo-code used by a template engine:</p>
-
-<code>&lt;ul><br />
-<br />
-{foreach from=$addressbook item="name"}<br />
-<br />
-&lt;li>{$name}&lt;/li><br />
-<br />
-{/foreach}<br />
-<br />
-&lt;/ul></code>
-
-<p>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 <em>maximum performance</em>, we opted to not require the use of a template engine.</p>
-
-
-<h2>CodeIgniter is Thoroughly Documented</h2>
-<p>Programmers love to code and hate to write documentation. We're no different, of course, but
-since documentation is <strong>as important</strong> as the code itself,
-we are committed to doing it. Our source code is extremely clean and well commented as well.</p>
-
-
-<h2>CodeIgniter has a Friendly Community of Users</h2>
-
-<p>Our growing community of users can be seen actively participating in our <a href="http://codeigniter.com/forums/">Community Forums</a>.</p>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="getting_started.html">Getting Started</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="cheatsheets.html">CodeIgniter Cheatsheets</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/overview/cheatsheets.html b/user_guide/overview/cheatsheets.html
deleted file mode 100644
index 60e655229..000000000
--- a/user_guide/overview/cheatsheets.html
+++ /dev/null
@@ -1,83 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter Cheatsheets : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-CodeIgniter Cheatsheets
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>CodeIgniter Cheatsheets</h1>
-
-<h2>Library Reference</h2>
-
-<div><a href="../images/codeigniter_1.7.1_library_reference.pdf"><img src="../images/codeigniter_1.7.1_library_reference.png" width="600" height="195" border="0" alt="CodeIgniter Library Reference" /></a></div>
-
-<h2>Helpers Reference</h2>
-<div><a href="../images/codeigniter_1.7.1_helper_reference.pdf"><img src="../images/codeigniter_1.7.1_helper_reference.png" width="600" height="196" border="0" alt="CodeIgniter Library Reference" /></a></div>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="at_a_glance.html">CodeIgniter at a Glance</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="features.html">CodeIgniter Features</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html
deleted file mode 100644
index d1d5c8c25..000000000
--- a/user_guide/overview/features.html
+++ /dev/null
@@ -1,118 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter Features : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Features
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>CodeIgniter Features</h1>
-
-<p>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. <a href="../installation/">Installing</a>
-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.</p>
-
-<ul>
-<li>Model-View-Controller Based System</li>
-<li>Extremely Light Weight</li>
-<li>Full Featured database classes with support for several platforms.</li>
-<li>Active Record Database Support</li>
-<li>Form and Data Validation</li>
-<li>Security and XSS Filtering</li>
-<li>Session Management</li>
-<li>Email Sending Class. Supports Attachments, HTML/Text email, multiple protocols (sendmail, SMTP, and Mail) and more.</li>
-<li>Image Manipulation Library (cropping, resizing, rotating, etc.). Supports GD, ImageMagick, and NetPBM</li>
-<li>File Uploading Class</li>
-<li>FTP Class</li>
-<li>Localization</li>
-<li>Pagination</li>
-<li>Data Encryption</li>
-<li>Benchmarking</li>
-<li>Full Page Caching</li>
-<li>Error Logging</li>
-<li>Application Profiling</li>
-<li>Calendaring Class</li>
-<li>User Agent Class</li>
-<li>Zip Encoding Class</li>
-<li>Template Engine Class</li>
-<li>Trackback Class</li>
-<li>XML-RPC Library</li>
-<li>Unit Testing Class</li>
-<li>Search-engine Friendly URLs</li>
-<li>Flexible URI Routing</li>
-<li>Support for Hooks and Class Extensions</li>
-<li>Large library of "helper" functions</li>
-</ul>
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="cheatsheets.html">CodeIgniter Cheatsheets</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="appflow.html">Application Flow Chart</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/overview/getting_started.html b/user_guide/overview/getting_started.html
deleted file mode 100644
index ad6fa01ed..000000000
--- a/user_guide/overview/getting_started.html
+++ /dev/null
@@ -1,92 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Getting Started With CodeIgniter : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Getting Started
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>Getting Started With CodeIgniter</h1>
-
-<p>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.
-</p>
-
-<p>The first step is to <a href="../installation/index.html">install</a> CodeIgniter, then read
-all the topics in the <strong>Introduction</strong> section of the Table of Contents.</p>
-
-<p>Next, read each of the <strong>General Topics</strong> pages in order.
-Each topic builds on the previous one, and includes code examples that you are encouraged to try.</p>
-
-<p>Once you understand the basics you'll be ready to explore the <strong>Class Reference</strong> and
-<strong>Helper Reference</strong> pages to learn to utilize the native libraries and helper files.</p>
-
-<p>Feel free to take advantage of our <a href="http://codeigniter.com/forums/">Community Forums</a>
-if you have questions or problems, and
-our <a href="http://codeigniter.com/wiki/">Wiki</a> to see code examples posted by other users.</p>
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="at_a_glance.html">CodeIgniter At a Glance</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html
deleted file mode 100644
index f2263c7ae..000000000
--- a/user_guide/overview/goals.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Design and Architectural Goals : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Goals
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-
-<h2>Design and Architectural Goals</h2>
-
-<p>Our goal for CodeIgniter is <dfn>maximum performance, capability, and flexibility in the smallest, lightest possible package</dfn>.</p>
-
-<p>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.</p>
-
-<p>From a technical and architectural standpoint, CodeIgniter was created with the following objectives:</p>
-
-<ul>
-<li><strong>Dynamic Instantiation.</strong> 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.</li>
-<li><strong>Loose Coupling.</strong> 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.</li>
-<li><strong>Component Singularity.</strong> 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.</li>
-</ul>
-
-<p>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.</p>
-
-
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="mvc.html">Model-View-Controller</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="./getting_started.html">Getting Started</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html
deleted file mode 100644
index f295d4e81..000000000
--- a/user_guide/overview/index.html
+++ /dev/null
@@ -1,84 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter Overview : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Introduction
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-<h1>CodeIgniter Overview</h1>
-
-<p>The following pages describe the broad concepts behind CodeIgniter:</p>
-
- <ul>
- <li><a href="at_a_glance.html">CodeIgniter at a Glance</a></li>
- <li><a href="features.html">Supported Features</a></li>
- <li><a href="appflow.html">Application Flow Chart</a></li>
- <li><a href="mvc.html">Introduction to the Model-View-Controller</a></li>
- <li><a href="goals.html">Design and Architectural Goals</a></li>
- <li><a href="package.html">Package Description</a></li>
- </ul>
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p><a href="#top">Top of Page</a> &nbsp;&middot;&nbsp; <a href="../index.html">User Guide Home</a></p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html
deleted file mode 100644
index 4aebb1095..000000000
--- a/user_guide/overview/mvc.html
+++ /dev/null
@@ -1,100 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Model-View-Controller : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-MVC
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Model-View-Controller</h1>
-
-<p>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.</p>
-
-<ul>
-<li>The <strong>Model</strong> represents your data structures. Typically your model classes will contain functions that help you
-retrieve, insert, and update information in your database.</li>
-<li>The <strong>View</strong> 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".</li>
-<li>The <strong>Controller</strong> serves as an <em>intermediary</em> between the Model, the View,
-and any other resources needed to process the HTTP request and generate a web page.</li>
-
-</ul>
-
-<p>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.</p>
-
-
-
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="appflow.html">Application Flow Chart</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="goals.html">Architectural Goals</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/toc.html b/user_guide/toc.html
deleted file mode 100644
index 01b5a7b92..000000000
--- a/user_guide/toc.html
+++ /dev/null
@@ -1,229 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Table of Contents : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='userguide.css' />
-
-<script type="text/javascript" src="nav/nav.js"></script>
-<script type="text/javascript" src="nav/prototype.lite.js"></script>
-<script type="text/javascript" src="nav/moo.fx.js"></script>
-<script type="text/javascript" src="nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('null');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Table of Contents
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Table of Contents</h1>
-
-<table cellpadding="0" cellspacing="10" border="0" width="100%">
-<tr>
-<td valign="top" width="25%">
-
-<h3>Basic Info</h3>
-<ul>
- <li><a href="./general/requirements.html">Server Requirements</a></li>
- <li><a href="license.html">License Agreement</a></li>
- <li><a href="changelog.html">Change Log</a></li>
- <li><a href="./general/credits.html">Credits</a></li>
-</ul>
-
-<h3>Installation</h3>
-<ul>
- <li><a href="./installation/downloads.html">Downloading CodeIgniter </a></li>
- <li><a href="./installation/index.html">Installation Instructions</a></li>
- <li><a href="./installation/upgrading.html">Upgrading from a Previous Version</a></li>
- <li><a href="./installation/troubleshooting.html">Troubleshooting</a></li>
-</ul>
-
-<h3>Introduction</h3>
-<ul>
- <li><a href="./overview/getting_started.html">Getting Started</a></li>
- <li><a href="./overview/at_a_glance.html">CodeIgniter at a Glance</a></li>
- <li><a href="./overview/cheatsheets.html">CodeIgniter Cheatsheets</a></li>
- <li><a href="./overview/features.html">Supported Features</a></li>
- <li><a href="./overview/appflow.html">Application Flow Chart</a></li>
- <li><a href="./overview/mvc.html">Model-View-Controller</a></li>
- <li><a href="./overview/goals.html">Architectural Goals</a></li>
-</ul>
-
-<h3>Tutorial</h3>
-<ul>
- <li><a href="./tutorial/index.html">Introduction</a></li>
- <li><a href="./tutorial/static_pages.html">Static pages</a></li>
- <li><a href="./tutorial/news_section.html">News section</a></li>
- <li><a href="./tutorial/create_news_items.html">Create news items</a></li>
- <li><a href="./tutorial/conclusion.html">Conclusion</a></li>
-</ul>
-
-</td>
-<td valign="top" width="25%">
-
-<h3>General Topics</h3>
-<ul>
- <li><a href="./general/urls.html">CodeIgniter URLs</a></li>
- <li><a href="./general/controllers.html">Controllers</a></li>
- <li><a href="./general/reserved_names.html">Reserved Names</a></li>
- <li><a href="./general/views.html">Views</a></li>
- <li><a href="./general/models.html">Models</a></li>
- <li><a href="./general/helpers.html">Helpers</a></li>
- <li><a href="./general/libraries.html">Using CodeIgniter Libraries</a></li>
- <li><a href="./general/creating_libraries.html">Creating Your Own Libraries</a></li>
- <li><a href="./general/drivers.html">Using CodeIgniter Drivers</a></li>
- <li><a href="./general/creating_drivers.html">Creating Your Own Drivers</a></li>
- <li><a href="./general/core_classes.html">Creating Core Classes</a></li>
- <li><a href="./general/hooks.html">Hooks - Extending the Core</a></li>
- <li><a href="./general/autoloader.html">Auto-loading Resources</a></li>
- <li><a href="./general/common_functions.html">Common Functions</a></li>
- <li><a href="./general/routing.html">URI Routing</a></li>
- <li><a href="./general/errors.html">Error Handling</a></li>
- <li><a href="./general/caching.html">Caching</a></li>
- <li><a href="./general/profiling.html">Profiling Your Application</a></li>
- <li><a href="./general/cli.html">Running via the CLI</a></li>
- <li><a href="./general/managing_apps.html">Managing Applications</a></li>
- <li><a href="./general/environments.html">Handling Multiple Environments</a></li>
- <li><a href="./general/alternative_php.html">Alternative PHP Syntax</a></li>
- <li><a href="./general/security.html">Security</a></li>
- <li><a href="./general/styleguide.html">PHP Style Guide</a></li>
- <li><a href="./doc_style/index.html">Writing Documentation</a></li>
-</ul>
-
-<h3>Additional Resources</h3>
-
-<ul>
-<li><a href="http://codeigniter.com/forums/">Community Forums</a></li>
-<li><a href="http://codeigniter.com/wiki/">Community Wiki</a></li>
-</ul>
-
-</td>
-<td valign="top" width="25%">
-
-<h3>Class Reference</h3>
-<ul>
-<li><a href="./libraries/benchmark.html">Benchmarking Class</a></li>
-<li><a href="./libraries/calendar.html">Calendar Class</a></li>
-<li><a href="./libraries/cart.html">Cart Class</a></li>
-<li><a href="./libraries/config.html">Config Class</a></li>
-<li><a href="./libraries/email.html">Email Class</a></li>
-<li><a href="./libraries/encryption.html">Encryption Class</a></li>
-<li><a href="./libraries/file_uploading.html">File Uploading Class</a></li>
-<li><a href="./libraries/form_validation.html">Form Validation Class</a></li>
-<li><a href="./libraries/ftp.html">FTP Class</a></li>
-<li><a href="./libraries/table.html">HTML Table Class</a></li>
-<li><a href="./libraries/image_lib.html">Image Manipulation Class</a></li>
-<li><a href="./libraries/input.html">Input Class</a></li>
-<li><a href="./libraries/javascript.html">Javascript Class</a></li>
-<li><a href="./libraries/loader.html">Loader Class</a></li>
-<li><a href="./libraries/language.html">Language Class</a></li>
-<li><a href="./libraries/migration.html">Migration Class</a></li>
-<li><a href="./libraries/output.html">Output Class</a></li>
-<li><a href="./libraries/pagination.html">Pagination Class</a></li>
-<li><a href="./libraries/security.html">Security Class</a></li>
-<li><a href="./libraries/sessions.html">Session Class</a></li>
-<li><a href="./libraries/trackback.html">Trackback Class</a></li>
-<li><a href="./libraries/parser.html">Template Parser Class</a></li>
-<li><a href="./libraries/typography.html">Typography Class</a></li>
-<li><a href="./libraries/unit_testing.html">Unit Testing Class</a></li>
-<li><a href="./libraries/uri.html">URI Class</a></li>
-<li><a href="./libraries/user_agent.html">User Agent Class</a></li>
-<li><a href="./libraries/xmlrpc.html">XML-RPC Class</a></li>
-<li><a href="./libraries/zip.html">Zip Encoding Class</a></li>
-</ul>
-
-
-</td>
-<td valign="top" width="25%">
-
-<h3>Driver Reference</h3>
-<ul>
-<li><a href="./libraries/caching.html">Caching Class</a></li>
-<li><a href="./database/index.html">Database Class</a></li>
-<li><a href="./libraries/javascript.html">Javascript Class</a></li>
-</ul>
-
-<h3>Helper Reference</h3>
-<ul>
-<li><a href="./helpers/array_helper.html">Array Helper</a></li>
-<li><a href="./helpers/captcha_helper.html">CAPTCHA Helper</a></li>
-<li><a href="./helpers/cookie_helper.html">Cookie Helper</a></li>
-<li><a href="./helpers/date_helper.html">Date Helper</a></li>
-<li><a href="./helpers/directory_helper.html">Directory Helper</a></li>
-<li><a href="./helpers/download_helper.html">Download Helper</a></li>
-<li><a href="./helpers/email_helper.html">Email Helper</a></li>
-<li><a href="./helpers/file_helper.html">File Helper</a></li>
-<li><a href="./helpers/form_helper.html">Form Helper</a></li>
-<li><a href="./helpers/html_helper.html">HTML Helper</a></li>
-<li><a href="./helpers/inflector_helper.html">Inflector Helper</a></li>
-<li><a href="./helpers/language_helper.html">Language Helper</a></li>
-<li><a href="./helpers/number_helper.html">Number Helper</a></li>
-<li><a href="./helpers/path_helper.html">Path Helper</a></li>
-<li><a href="./helpers/security_helper.html">Security Helper</a></li>
-<li><a href="./helpers/smiley_helper.html">Smiley Helper</a></li>
-<li><a href="./helpers/string_helper.html">String Helper</a></li>
-<li><a href="./helpers/text_helper.html">Text Helper</a></li>
-<li><a href="./helpers/typography_helper.html">Typography Helper</a></li>
-<li><a href="./helpers/url_helper.html">URL Helper</a></li>
-<li><a href="./helpers/xml_helper.html">XML Helper</a></li>
-</ul>
-
-
-
-
-</td>
-</tr>
-</table>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p><a href="#top">Top of Page</a></p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/tutorial/conclusion.html b/user_guide/tutorial/conclusion.html
deleted file mode 100644
index 9cf146746..000000000
--- a/user_guide/tutorial/conclusion.html
+++ /dev/null
@@ -1,91 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter Features : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-<a href="index.html">Tutorial</a> &nbsp;&#8250;&nbsp;
-Conclusion
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Tutorial - Conclusion</h1>
-
-<p>This tutorial did not cover all of the things you might expect of a full-fledged content management system, but it introduced you to the more important topics of routing, writing controllers, and models. We hope this tutorial gave you an insight into some of CodeIgniter's basic design patterns, which you can expand upon.</p>
-
-<p>Now that you've completed this tutorial, we recommend you check out the rest of the documentation. CodeIgniter is often praised because of its comprehensive documentation. Use this to your advantage and read the "Introduction" and "General Topics" sections thoroughly. You should read the class and helper references when needed.</p>
-
-<p>Every intermediate PHP programmer should be able to get the hang of CodeIgniter within a few days.</p>
-
-<p>If you still have questions about the framework or your own CodeIgniter code, you can:</p>
-<ul>
- <li>Check out our <a href="http://codeigniter.com/forums">forums</a></li>
- <li>Visit our <a href="http://codeigniter.com/wiki/IRC">IRC chatroom</a></li>
- <li>Explore the <a href="http://codeigniter.com/wiki/">Wiki</a></li>
-</ul>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="create_news_items.html">Create news items</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="../general/urls.html">CodeIgniter URLs</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/tutorial/create_news_items.html b/user_guide/tutorial/create_news_items.html
deleted file mode 100644
index 26b1ed10f..000000000
--- a/user_guide/tutorial/create_news_items.html
+++ /dev/null
@@ -1,179 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter Features : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-<a href="index.html">Tutorial</a> &nbsp;&#8250;&nbsp;
-Create news items
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Tutorial - Create news items</h1>
-
-<p>You now know how you can read data from a database using CodeIgnite, but you haven't written any information to the database yet. In this section you'll expand your news controller and model created earlier to include this functionality.</p>
-
-<h2>Create a form</h2>
-
-<p>To input data into the database you need to create a form where you can input the information to be stored. This means you'll be needing a form with two fields, one for the title and one for the text. You'll derive the slug from our title in the model. Create the new view at <dfn>application/views/news/create.php</dfn>.</p>
-
-<textarea class="textarea" style="width:100%" cols="50" rows="16">
-<h2>Create a news item</h2>
-
-&lt;?php echo validation_errors(); ?>
-
-&lt;?php echo form_open('news/create') ?>
-
- <label for="title">Title</label>
- <input type="input" name="title" /><br />
-
- <label for="text">Text</label>
- <textarea name="text">&lt;/textarea><br />
-
- <input type="submit" name="submit" value="Create news item" />
-
-&lt;/form>
-</textarea>
-
-<p>There are only two things here that probably look unfamiliar to you: the <dfn>form_open()</dfn> function and the <dfn>validation_errors()</dfn> function.</p>
-
-<p>The first function is provided by the <a href="../helpers/form_helper.html">form helper</a> and renders the form element and adds extra functionality, like adding a hidden <a href="../libraries/security.html">CSFR prevention field</a>. The latter is used to report errors related to form validation.</p>
-
-<p>Go back to your news controller. You're going to do two things here, check whether the form was submitted and whether the submitted data passed the validation rules. You'll use the <a href="../libraries/form_validation.html">form validation</a> library to do this.</p>
-
-<pre>
-public function create()
-{
- $this->load->helper('form');
- $this->load->library('form_validation');
-
- $data['title'] = 'Create a news item';
-
- $this->form_validation->set_rules('title', 'Title', 'required');
- $this->form_validation->set_rules('text', 'text', 'required');
-
- if ($this->form_validation->run() === FALSE)
- {
- $this->load->view('templates/header', $data);
- $this->load->view('news/create');
- $this->load->view('templates/footer');
-
- }
- else
- {
- $this->news_model->set_news();
- $this->load->view('news/success');
- }
-}
-</pre>
-
-<p>The code above adds a lot of functionality. The first few lines load the form helper and the form validation library. After that, rules for the form validation are set. The <var>set_rules()</var> method takes three arguments; the name of the input field, the name to be used in error messages, and the rule. In this case the title and text fields are required.</p>
-
-<p>CodeIgniter has a powerful form validation library as demonstrated above. You can read <a href="../libraries/form_validation.html">more about this library here</a>.</p>
-
-<p>Continuing down, you can see a condition that checks whether the form validation ran successfully. If it did not, the form is displayed, if it was submitted <strong>and</strong> passed all the rules, the model is called. After this, a view is loaded to display a success message. Create a view at <dfn>application/view/news/success.php</dfn> and write a success message.</p>
-
-<h2>Model</h2>
-
-<p>The only thing that remains is writing a method that writes the data to the database. You'll use the Active Record class to insert the information and use the input library to get the posted data. Open up the model created earlier and add the following:</p>
-
-<pre>
-public function set_news()
-{
- $this->load->helper('url');
-
- $slug = url_title($this->input->post('title'), 'dash', TRUE);
-
- $data = array(
- 'title' => $this->input->post('title'),
- 'slug' => $slug,
- 'text' => $this->input->post('text')
- );
-
- return $this->db->insert('news', $data);
-}
-</pre>
-
-<p>This new method takes care of inserting the news item into the database. The third line contains a new function, <dfn>url_title()</dfn>. This function - provided by the <a href="../helpers/url_helper.html">URL helper</a> - strips down the string you pass it, replacing all spaces by dashes (-) and makes sure everything is in lowercase characters. This leaves you with a nice slug, perfect for creating URIs.</p>
-
-<p>Let's continue with preparing the record that is going to be inserted later, inside the <var>$data</var> array. Each element corresponds with a column in the database table created earlier. You might notice a new method here, namely the <dfn>post()</dfn> method from the <a href="../libraries/input.html">input library</a>. This method makes sure the data is sanitized, protecting you from nasty attacks from others. The input library is loaded by default. At last, you insert our <var>$data</var> array into our database.</p>
-
-<h2>Routing</h2>
-
-<p>Before you can start adding news items into your CodeIgniter application you have to add an extra rule to <dfn>config/routes.php</dfn> file. Make sure your file contains the following. This makes sure CodeIgniter sees 'create' as a method instead of a news item's slug.</p>
-
-<pre>
-$route['news/create'] = 'news/create';
-$route['news/(:any)'] = 'news/view/$1';
-$route['news'] = 'news';
-$route['(:any)'] = 'pages/view/$1';
-$route['default_controller'] = 'pages/view';
-</pre>
-
-<p>Now point your browser to your local development environment where you installed CodeIgniter and add <dfn>index.php/news/create</dfn> to the URL. Congratulations, you just created your first CodeIgniter application! Add some news and check out the different pages you made.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="news_section.html">News section</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="conclusion.html">Conclusion</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/tutorial/hard_coded_pages.html b/user_guide/tutorial/hard_coded_pages.html
deleted file mode 100644
index b34e9f1be..000000000
--- a/user_guide/tutorial/hard_coded_pages.html
+++ /dev/null
@@ -1,158 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter Features : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Features
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Tutorial - Hard coded pages</h1>
-
-<p>The first thing we're going to do is setting up a controller to handle our hard coded pages. A controller is a class with a collection of methods that represent the different actions you can perform on a certain object. In our case, we want to be able to view a page.</p>
-
-<p class="important"><strong>Note:</strong> This tutorial assumes you've downloaded CodeIgniter and installed the framework in your development environment.</p>
-
-<p>Create a file at <dfn>application/controllers/pages.php</dfn> with the following code.</p>
-
-<textarea class="textarea" style="width:100%" cols="50" rows="9">
-&lt;?php
-class Pages extends CI_Controller {
-
- public function view($page = 'home')
- {
-
- }
-}
-</textarea>
-
-<p>If you're familiar with PHP classes you see that we create a Pages class with a view method that accepts one parameter, <var>$page</var>. Another interesting observation is that the Pages class is extending the CI_Controller class. This means that the new Pages class can access the methods and variables defined in the CI_Controller class. When you look at this class in <dfn>system/core/controller.php</dfn> you can see this class is doing something really important; assigning an instance from the CodeIgniter super object to the <var>$this</var> object. In most of your code, <var>$this</var> is the object you will use to interact with the framework.</p>
-
-<p>Now we've created our first method, it is time to do some basic templating. For this tutorial, we will be creating two views to acts as our footer and header. Let's create our header at <dfn>application/views/templates/header.php</dfn> and ad the following code.</p>
-
-<textarea class="textarea" style="width:100%" cols="50" rows="8">
-<html>
-<head>
- <title><?php echo $title ?> - CodeIgniter 2 Tutorial</title>
-</head>
-<body>
- <h1>CodeIgniter 2 Tutorial</h1>
-
-</textarea>
-
-<p>Our header doesn't do anything exciting. It contains the basic HTML code that we will want to display before loading the main view. You can also see that we echo the <var>$title</var> variable, which we didn't define. We will set this variable in the Pages controller a bit later. Let's go ahead and create a footer at <dfn>application/views/templates/footer.php</dfn> that includes the following code.</p>
-
-<textarea class="textarea" style="width:100%" cols="50" rows="4">
-<strong>&copy; 2011</strong>
-</body>
-</html>
-</textarea>
-
-<h2>Adding logic to the controller</h2>
-
-<p>Now we've set up the basics so we can finally do some real programming. Earlier we set up our controller with a view method. Because we don't want to write a separate method for every page, we made the view method accept one parameter, the name of the page. These hard coded pages will be located in <dfn>application/views/pages/</dfn>. Create two files in this directory named <dfn>home.php</dfn> and <dfn>about.php</dfn> and put in some HTML content.</p>
-
-<p>In order to load these pages we'll have to check whether these page actually exists. When the page does exist, we load the view for that pages, including the header and footer and display it to the user. If it doesn't, we show a "404 Page not found" error.</p>
-
-<textarea class="textarea" style="width:100%" cols="50" rows="16">
-public function view($page = 'home')
-{
-
- if ( ! file_exists('application/views/pages/' . $page . EXT))
- {
- show_404();
- }
-
- $data['title'] = ucfirst($page);
-
- $this->load->view('templates/header', $data);
- $this->load->view('pages/'.$page);
- $this->load->view('templates/footer');
-}
-</textarea>
-
-<p>The first thing we do is checking whether the page we're looking for does actually exist. We use PHP's native file_exists() to do this check and pass the path where the file is supposed to be. Next is the function show_404(), a CodeIgniter function that renders the default error page and sets the appropriate HTTP headers.</p>
-
-<p>In the header template you saw we were using the <var>$title</var> variable to customize our page title. This is where we define the title, but instead of assigning the value to a variable, we assign it to the title element in the <var>$data</var> array. The last thing we need to do is loading the views in the order we want them to be displayed. We also pass the <var>$data</var> array to the header view to make its elements available in the header view file.<p>
-
-<h2>Routing</h2>
-
-<p>Actually, our controller is already functioning. Point your browser to <dfn>index.php/pages/view</dfn> to see your homepage. When you visit <dfn>index.php/pages/view/about</dfn> you will see the about page, again including your header and footer. Now we're going to get rid of the pages/view part in our URI. As you may have seen, CodeIgniter does its routing by the class, method and parameter, separated by slashes.</p>
-
-<p>Open the routing file located at <dfn>application/config/routes.php</dfn> and add the following two lines. Remove all other code that sets any element in the <var>$route</var> array.</p>
-
-<textarea class="textarea" style="width:100%" cols="50" rows="3">
-$route['(:any)'] = 'pages/view/$1';
-$route['default_controller'] = 'pages/view';
-</textarea>
-
-<p>CodeIgniter reads its routing rules from top to bottom and routes the request to the first matching rule. These routes are stored in the <var>$route</var> array where the keys represent the incoming request and the value the path to the method, as described above.</p>
-
-<p>The first rule in our <var>$routes</var> array matches every request - using the wildcard operator <dfn>(:any)</dfn> - and passes the value to the view method of the pages class we created earlier. The default controller route makes sure every request to the root goes to the view method as well, which has the first parameter set to 'home' by default.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="cheatsheets.html">CodeIgniter Cheatsheets</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="appflow.html">Application Flow Chart</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/tutorial/index.html b/user_guide/tutorial/index.html
deleted file mode 100644
index 65075fb2a..000000000
--- a/user_guide/tutorial/index.html
+++ /dev/null
@@ -1,101 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter Features : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-<a href="index.html">Tutorial</a> &nbsp;&#8250;&nbsp;
-Introduction
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Tutorial &minus; Introduction</h1>
-
-<p>This tutorial is intended to introduce you to the CodeIgniter framework and the basic principles of MVC architecture. It will show you how a basic CodeIgniter application is constructed in step-by-step fashion.</p>
-
-<p>In this tutorial, you will be creating a <strong>basic news application</strong>. You will begin by writing the code that can load static pages. Next, you will create a news section that reads news items from a database. Finally, you'll add a form to create news items in the database.</p>
-
-<p>This tutorial will primarily focus on:</p>
-<ul>
-<li>Model-View-Controller basics</li>
-<li>Routing basics</li>
-<li>Form validation</li>
-<li>Performing basic database queries using &quot;Active Record&quot;</li>
-</ul>
-
-<p>The entire tutorial is split up over several pages, each explaining a small part of the functionality of the CodeIgniter framework. You'll go through the following pages:</p>
-<ul>
-<li>Introduction, this page, which gives you an overview of what to expect.</li>
-<li><a href="static_pages.html">Static pages</a>, which will teach you the basics of controllers, views and routing.</li>
-<li><a href="news_section.html">News section</a>, where you'll start using models and will be doing some basic database operations.</li>
-<li><a href="create_news_items.html">Create news items</a>, which will introduce more advanced database operations and form validation.</li>
-<li><a href="conclusion.html">Conclusion</a>, which will give you some pointers on further reading and other resources.</li>
-</ul>
-
-<p>Enjoy your exploration of the CodeIgniter framework.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="../overview/goals.html">Goals</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="static_pages.html">Static pages</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/tutorial/news_section.html b/user_guide/tutorial/news_section.html
deleted file mode 100644
index cf3377ff9..000000000
--- a/user_guide/tutorial/news_section.html
+++ /dev/null
@@ -1,230 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter Features : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-<a href="index.html">Tutorial</a> &nbsp;&#8250;&nbsp;
-News section
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Tutorial &minus; News section</h1>
-
-<p>In the last section, we went over some basic concepts of the framework by writing a class that includes static pages. We cleaned up the URI by adding custom routing rules. Now it's time to introduce dynamic content and start using a database.</p>
-
-<h2>Setting up your model</h2>
-
-<p>Instead of writing database operations right in the controller, queries should be placed in a model, so they can easily be reused later. Models are the place where you retrieve, insert, and update information in your database or other data stores. They represent your data.</p>
-
-<p>Open up the <dfn>application/models</dfn> directory and create a new file called <dfn>news_model.php</dfn> and add the following code. Make sure you've configured your database properly as described <a href="../database/configuration.html">here</a>.</p>
-
-<pre>
-&lt;?php
-class News_model extends CI_Model {
-
- public function __construct()
- {
- $this->load->database();
- }
-}
-</pre>
-
-<p>This code looks similar to the controller code that was used earlier. It creates a new model by extending CI_Model and loads the database library. This will make the database class available through the <var>$this->db</var> object.</p>
-
-<p>Before querying the database, a database schema has to be created. Connect to your database and run the SQL command below. Also add some seed records.</p>
-
-<pre>
-CREATE TABLE news (
- id int(11) NOT NULL AUTO_INCREMENT,
- title varchar(128) NOT NULL,
- slug varchar(128) NOT NULL,
- text text NOT NULL,
- PRIMARY KEY (id),
- KEY slug (slug)
-);
-</pre>
-
-<p>Now that the database and a model have been set up, you'll need a method to get all of our posts from our database. To do this, the database abstraction layer that is included with CodeIgniter — <a href="../database/active_record.html">Active Record</a> — is used. This makes it possible to write your 'queries' once and make them work on <a href="../general/requirements.html">all supported database systems</a>. Add the following code to your model.</p>
-
-<pre>
-public function get_news($slug = FALSE)
-{
- if ($slug === FALSE)
- {
- $query = $this->db->get('news');
- return $query->result_array();
- }
-
- $query = $this->db->get_where('news', array('slug' => $slug));
- return $query->row_array();
-}
-</pre>
-
-<p>With this code you can perform two different queries. You can get all news records, or get a news item by its <a href="#" title="a URL friendly version of a string">slug</a>. You might have noticed that the <var>$slug</var> variable wasn't sanitized before running the query; Active Record does this for you.</p>
-
-<h2>Display the news</h2>
-
-<p>Now that the queries are written, the model should be tied to the views that are going to display the news items to the user. This could be done in our pages controller created earlier, but for the sake of clarity, a new "news" controller is defined. Create the new controller at <dfn>application/controllers/news.php</dfn>.</p>
-
-<pre>
-&lt;?php
-class News extends CI_Controller {
-
- public function __construct()
- {
- parent::__construct();
- $this->load->model('news_model');
- }
-
- public function index()
- {
- $data['news'] = $this->news_model->get_news();
- }
-
- public function view($slug)
- {
- $data['news'] = $this->news_model->get_news($slug);
- }
-}
-</pre>
-
-<p>Looking at the code, you may see some similarity with the files we created earlier. First, the "__construct" method: it calls the constructor of its parent class (<dfn>CI_Controller</dfn>) and loads the model, so it can be used in all other methods in this controller.</p>
-
-<p>Next, there are two methods to view all news items and one for a specific news item. You can see that the <var>$slug</var> variable is passed to the model's method in the second method. The model is using this slug to identify the news item to be returned.</p>
-
-<p>Now the data is retrieved by the controller through our model, but nothing is displayed yet. The next thing to do is passing this data to the views.</p>
-
-<pre>
-public function index()
-{
- $data['news'] = $this->news_model->get_news();
- $data['title'] = 'News archive';
-
- $this->load->view('templates/header', $data);
- $this->load->view('news/index', $data);
- $this->load->view('templates/footer');
-}
-</pre>
-
-<p>The code above gets all news records from the model and assigns it to a variable. The value for the title is also assigned to the <var>$data['title']</var> element and all data is passed to the views. You now need to create a view to render the news items. Create <dfn>application/views/news/index.php</dfn> and add the next piece of code.</p>
-
-<pre>
-&lt;?php foreach ($news as $news_item): ?&gt;
-
- &lt;h2&gt;&lt;?php echo $news_item['title'] ?&gt;&lt;/h2&gt;
- &lt;div id="main"&gt;
- &lt;?php echo $news_item['text'] ?&gt;
- &lt;/div&gt;
- &lt;p&gt;&lt;a href="news/&lt;?php echo $news_item['slug'] ?&gt;"&gt;View article&lt;/a&gt;&lt;/p&gt;
-
-&lt;?php endforeach ?&gt;
-</pre>
-
-<p>Here, each news item is looped and displayed to the user. You can see we wrote our template in PHP mixed with HTML. If you prefer to use a template language, you can use CodeIgniter's <a href="../libraries/parser.html">Template Parser</a> class or a third party parser.</p>
-
-<p>The news overview page is now done, but a page to display individual news items is still absent. The model created earlier is made in such way that it can easily be used for this functionality. You only need to add some code to the controller and create a new view. Go back to the news controller and add the following lines to the file.</p>
-
-<pre>
-public function view($slug)
-{
- $data['news_item'] = $this->news_model->get_news($slug);
-
- if (empty($data['news_item']))
- {
- show_404();
- }
-
- $data['title'] = $data['news_item']['title'];
-
- $this->load->view('templates/header', $data);
- $this->load->view('news/view', $data);
- $this->load->view('templates/footer');
-}
-</pre>
-
-<p>Instead of calling the <var>get_news()</var> method without a parameter, the <var>$slug</var> variable is passed, so it will return the specific news item. The only things left to do is create the corresponding view at <dfn>application/views/news/view.php</dfn>. Put the following code in this file.</p>
-
-<pre>
-&lt;?php
-echo '&lt;h2&gt;'.$news_item['title'].'&lt;/h2&gt;';
-echo $news_item['text'];
-</pre>
-
-<h2>Routing</h2>
-<p>Because of the wildcard routing rule created earlier, you need need an extra route to view the controller that you just made. Modify your routing file (<dfn>application/config/routes.php</dfn>) so it looks as follows. This makes sure the requests reaches the news controller instead of going directly to the pages controller. The first line routes URI's with a slug to the view method in the news controller.</p>
-
-<pre>
-$route['news/(:any)'] = 'news/view/$1';
-$route['news'] = 'news';
-$route['(:any)'] = 'pages/view/$1';
-$route['default_controller'] = 'pages/view';
-</pre>
-
-<p>Point your browser to your document root, followed by <dfn>index.php/news</dfn> and watch your news page.</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="static_pages.html">Static pages</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="create_news_items.html">Create news items</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/tutorial/static_pages.html b/user_guide/tutorial/static_pages.html
deleted file mode 100644
index da2c58cda..000000000
--- a/user_guide/tutorial/static_pages.html
+++ /dev/null
@@ -1,206 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>CodeIgniter Features : CodeIgniter User Guide</title>
-
-<style type='text/css' media='all'>@import url('../userguide.css');</style>
-<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
-
-<script type="text/javascript" src="../nav/nav.js"></script>
-<script type="text/javascript" src="../nav/prototype.lite.js"></script>
-<script type="text/javascript" src="../nav/moo.fx.js"></script>
-<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
-
-<meta http-equiv='expires' content='-1' />
-<meta http-equiv= 'pragma' content='no-cache' />
-<meta name='robots' content='all' />
-<meta name='author' content='ExpressionEngine Dev Team' />
-<meta name='description' content='CodeIgniter User Guide' />
-
-</head>
-<body>
-
-<!-- START NAVIGATION -->
-<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
-<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
-<div id="masthead">
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td><h1>CodeIgniter User Guide Version 2.1.0</h1></td>
-<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
-</tr>
-</table>
-</div>
-<!-- END NAVIGATION -->
-
-
-<!-- START BREADCRUMB -->
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
-<tr>
-<td id="breadcrumb">
-<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
-<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-<a href="index.html">Tutorial</a> &nbsp;&#8250;&nbsp;
-Static pages
-</td>
-<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
-</tr>
-</table>
-<!-- END BREADCRUMB -->
-
-<br clear="all" />
-
-
-<!-- START CONTENT -->
-<div id="content">
-
-
-<h1>Tutorial &minus; Static pages</h1>
-
-<p class="important"><strong>Note:</strong> This tutorial assumes you've downloaded CodeIgniter and <a href="../installation/index.html">installed the framework</a> in your development environment.</p>
-
-<p>The first thing you're going to do is set up a <strong>controller</strong> to handle static pages.
-A controller is simply a class that helps delegate work. It is the glue of your
-web application.</p>
-
-<p>For example, when a call is made to: <code>http://example.com/news/latest/10</code> We might imagine
-that there is a controller named &quot;news&quot;. The method being called on news
-would be &quot;latest&quot;. The news method's job could be to grab 10
-news items, and render them on the page. Very often in MVC, you'll see URL
-patterns that match: <code>http://example.com/[controller-class]/[controller-method]/[arguments]</code>
-As URL schemes become more complex, this may change. But for now, this is all we will need to know.</p>
-
-<p>Create a file at <dfn>application/controllers/pages.php</dfn> with the following code.</p>
-
-<textarea class="textarea" style="width:100%" cols="50" rows="10">
-&lt;?php
-
-class Pages extends CI_Controller {
-
- public function view($page = 'home')
- {
-
- }
-}
-</textarea>
-
-<p>You have created a class named &quot;pages&quot;, with a view method that accepts one argument named <var>$page</var>.
-The pages class is extending the CI_Controller class.
-This means that the new pages class can access the methods and variables defined in the CI_Controller class
-(<dfn>system/core/Controller.php</dfn>).</p>
-
-<p>The <strong>controller is what will become the center of every request</strong> to your web application.
-In very technical CodeIgniter discussions, it may be referred to as the <em>super object</em>.
-Like any php class, you refer to it within your controllers as <var>$this</var>.
-Referring to <var>$this</var> is how you will load libraries, views, and generally
-command the framework.</p>
-
-<p>Now you've created your first method, it's time to make some basic page templates.
-We will be creating two &quot;views&quot; (page templates) that act as our page footer and header.</p>
-
-<p>Create the header at <dfn>application/views/templates/header.php</dfn> and add the following code.</p>
-
-<textarea class="textarea" style="width:100%" cols="50" rows="8">
-<html>
-<head>
- <title><?php echo $title ?> - CodeIgniter 2 Tutorial</title>
-</head>
-<body>
- <h1>CodeIgniter 2 Tutorial</h1>
-
-</textarea>
-
-<p>The header contains the basic HTML code that you'll want to display before loading the main view, together with a heading.
-It will also output the <var>$title</var> variable, which we'll define later in the controller.
-Now create a footer at <dfn>application/views/templates/footer.php</dfn> that includes the following code:</p>
-
-<textarea class="textarea" style="width:100%" cols="50" rows="4">
-<strong>&#38;copy; 2011</strong>
-</body>
-</html>
-</textarea>
-
-<h2>Adding logic to the controller</h2>
-
-<p>Earlier you set up a controller with a view() method. The method accepts one parameter, which is the name of the page to be loaded.
-The static page templates will be located in the <dfn>application/views/pages/</dfn> directory.</p>
-
-<p>In that directory, create two files named <dfn>home.php</dfn> and <dfn>about.php</dfn>.
-Within those files, type some text &minus; anything you'd like &minus; and save them.
-If you like to be particularly un-original, try &quot;Hello World!&quot;.</p>
-
-<p>In order to load those pages, you'll have to check whether the requested page actually exists:</p>
-
-<pre>
-public function view($page = 'home')
-{
-
- if ( ! file_exists('application/views/pages/'.$page.'.php'))
- {
- // Whoops, we don't have a page for that!
- show_404();
- }
-
- $data['title'] = ucfirst($page); // Capitalize the first letter
-
- $this->load->view('templates/header', $data);
- $this->load->view('pages/'.$page, $data);
- $this->load->view('templates/footer', $data);
-
-}
-</pre>
-
-<p>Now, when the page does exist, it is loaded, including the header and footer, and displayed to the user. If the page doesn't exist, a "404 Page not found" error is shown.</p>
-
-<p>The first line in this method checks whether the page actually exists. PHP's native <var>file_exists()</var> function is used to check whether the file is where it's expected to be. <var>show_404()</var> is a built-in CodeIgniter function that renders the default error page.</p>
-
-<p>In the header template, the <var>$title</var> variable was used to customize the page title. The value of title is defined in this method, but instead of assigning the value to a variable, it is assigned to the title element in the <var>$data</var> array.</p>
-
-<p>The last thing that has to be done is loading the views in the order they should be displayed.
-The second parameter in the <var>view()</var> method is used to pass values to the view. Each value in the <var>$data</var> array is assigned to a variable with the name of its key. So the value of <var>$data['title']</var> in the controller is equivalent to $title in the view.<p>
-
-<h2>Routing</h2>
-
-<p>The controller is now functioning! Point your browser to <dfn>[your-site-url]index.php/pages/view</dfn> to see your page. When you visit <dfn>index.php/pages/view/about</dfn> you'll see the about page, again including the header and footer.</p>
-
-<p>Using custom routing rules, you have the power to map any URI to any controller and method, and break free from the normal convention:
-<code>http://example.com/[controller-class]/[controller-method]/[arguments]</code></p>
-
-<p>Let's do that. Open the routing file located at <dfn>application/config/routes.php</dfn> and add the following two lines. Remove all other code that sets any element in the <var>$route</var> array.</p>
-
-<pre>
-$route['default_controller'] = 'pages/view';
-$route['(:any)'] = 'pages/view/$1';
-</pre>
-
-<p>CodeIgniter reads its routing rules from top to bottom and routes the request to the first matching rule. Each rule is a regular expression
-(left-side) mapped to a controller and method name separated by slashes (right-side).
-When a request comes in, CodeIgniter looks for the first match, and calls the appropriate controller and method, possibly with arguments.</p>
-
-<p>More information about routing can be found in the URI Routing <a href="../general/routing.html">documentation</a>.</p>
-
-<p>Here, the second rule in the <var>$routes</var> array matches <strong>any</strong> request using the wildcard string <dfn>(:any)</dfn>.
-and passes the parameter to the view() method of the pages class.</p>
-
-<p>Now visit <dfn>index.php/about</dfn>. Did it get routed correctly to the <var>view()</var> method
-in the pages controller? Awesome!</p>
-
-</div>
-<!-- END CONTENT -->
-
-
-<div id="footer">
-<p>
-Previous Topic:&nbsp;&nbsp;<a href="index.html">Introduction</a>
-&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="news_section.html">News section</a>
-</p>
-<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/user_guide/userguide.css b/user_guide/userguide.css
deleted file mode 100644
index f93ff0d75..000000000
--- a/user_guide/userguide.css
+++ /dev/null
@@ -1,415 +0,0 @@
-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;
- outline-style: none;
-}
-a:visited {
- color: #0134c5;
- background-color: transparent;
- text-decoration: none;
- outline-style: none;
-}
-a:hover {
- color: #000;
- text-decoration: none;
- background-color: transparent;
- outline-style: none;
-}
-
-#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;
- outline-style: none;
-}
-
-#nav_inner a:visited {
- color: #eee;
- background-color: transparent;
- text-decoration: none;
- outline-style: none;
-}
-
-#nav_inner a:hover {
- color: #ccc;
- text-decoration: none;
- background-color: transparent;
- outline-style: none;
-}
-
-#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;
-}
-
-li.reactor {
- list-style-image: url(images/reactor-bullet.png);
-}
-#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
diff --git a/user_guide_src/Makefile b/user_guide_src/Makefile
new file mode 100644
index 000000000..519e1136f
--- /dev/null
+++ b/user_guide_src/Makefile
@@ -0,0 +1,130 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+PAPER =
+BUILDDIR = build
+
+# Internal variables.
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
+
+help:
+ @echo "Please use \`make <target>' where <target> is one of"
+ @echo " html to make standalone HTML files"
+ @echo " dirhtml to make HTML files named index.html in directories"
+ @echo " singlehtml to make a single large HTML file"
+ @echo " pickle to make pickle files"
+ @echo " json to make JSON files"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " qthelp to make HTML files and a qthelp project"
+ @echo " devhelp to make HTML files and a Devhelp project"
+ @echo " epub to make an epub"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
+ @echo " text to make text files"
+ @echo " man to make manual pages"
+ @echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " linkcheck to check all external links for integrity"
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+ -rm -rf $(BUILDDIR)/*
+
+html:
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+ @echo
+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+ @echo
+ @echo "Build finished; now you can process the pickle files."
+
+json:
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+ @echo
+ @echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+ @echo
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
+ ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+ @echo
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/CodeIgniter.qhcp"
+ @echo "To view the help file:"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/CodeIgniter.qhc"
+
+devhelp:
+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+ @echo
+ @echo "Build finished."
+ @echo "To view the help file:"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/CodeIgniter"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/CodeIgniter"
+ @echo "# devhelp"
+
+epub:
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+ @echo
+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo
+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
+ "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through pdflatex..."
+ make -C $(BUILDDIR)/latex all-pdf
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+ @echo
+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+ @echo
+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+changes:
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+ @echo
+ @echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+ @echo
+ @echo "Link check complete; look for any errors in the above output " \
+ "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+ @echo "Testing of doctests in the sources finished, look at the " \
+ "results in $(BUILDDIR)/doctest/output.txt."
diff --git a/user_guide_src/README.rst b/user_guide_src/README.rst
new file mode 100644
index 000000000..1c27fc22a
--- /dev/null
+++ b/user_guide_src/README.rst
@@ -0,0 +1,63 @@
+######################
+CodeIgniter User Guide
+######################
+
+******************
+Setup Instructions
+******************
+
+The CodeIgniter user guide uses Sphinx to manage the documentation and
+output it to various formats. Pages are written in human-readable
+`ReStructured Text <http://sphinx.pocoo.org/rest.html>`_ format.
+
+Prerequisites
+=============
+
+Sphinx requires Python, which is already installed if you are running OS X.
+You can confirm in a Terminal window by executing the ``python`` command
+without any parameters. It should load up and tell you which version you have
+installed. If you're not on 2.7+, go ahead and install 2.7.2 from
+http://python.org/download/releases/2.7.2/
+
+Installation
+============
+
+1. Install `easy_install <http://peak.telecommunity.com/DevCenter/EasyInstall#installing-easy-install>`_
+2. ``easy_install sphinx``
+3. ``easy_install sphinxcontrib-phpdomain``
+4. Install the CI Lexer which allows PHP, HTML, CSS, and JavaScript syntax highlighting in code examples (see *cilexer/README*)
+5. ``cd user_guide_src``
+6. ``make html``
+
+Editing and Creating Documentation
+==================================
+
+All of the source files exist under *source/* and is where you will add new
+documentation or modify existing documentation. Just as with code changes,
+we recommend working from feature branches and making pull requests to
+the *develop* branch of this repo.
+
+So where's the HTML?
+====================
+
+Obviously, the HTML documentation is what we care most about, as it is the
+primary documentation that our users encounter. Since revisions to the built
+files are not of value, they are not under source control. This also allows
+you to regenerate as necessary if you want to "preview" your work. Generating
+the HTML is very simple. From the root directory of your user guide repo
+fork issue the command you used at the end of the installation instructions::
+
+ make html
+
+You will see it do a whiz-bang compilation, at which point the fully rendered
+user guide and images will be in *build/html/*. After the HTML has been built,
+each successive build will only rebuild files that have changed, saving
+considerable time. If for any reason you want to "reset" your build files,
+simply delete the *build* folder's contents and rebuild.
+
+***************
+Style Guideline
+***************
+
+Please refer to source/documentation/index.rst for general guidelines for
+using Sphinx to document CodeIgniter. \ No newline at end of file
diff --git a/user_guide_src/cilexer/README b/user_guide_src/cilexer/README
new file mode 100644
index 000000000..b9d9baf09
--- /dev/null
+++ b/user_guide_src/cilexer/README
@@ -0,0 +1,22 @@
+To install the CodeIgniter Lexer to Pygments, run:
+
+ sudo python setup.py install
+
+Confirm with
+
+ pygmentize -L
+
+
+You should see in the lexer output:
+
+* ci, codeigniter:
+ CodeIgniter (filenames *.html, *.css, *.php, *.xml, *.static)
+
+You will need to run setup.py and install the cilexer package anytime after cilexer/cilexer.py is updated
+
+NOTE: Depending on how you installed Sphinx and Pygments,
+you may be installing to the wrong version.
+If you need to install to a different version of python
+specify its path when using setup.py, e.g.:
+
+ sudo /usr/bin/python2.5 setup.py install \ No newline at end of file
diff --git a/user_guide_src/cilexer/cilexer/__init__.py b/user_guide_src/cilexer/cilexer/__init__.py
new file mode 100644
index 000000000..8b1378917
--- /dev/null
+++ b/user_guide_src/cilexer/cilexer/__init__.py
@@ -0,0 +1 @@
+
diff --git a/user_guide_src/cilexer/cilexer/cilexer.py b/user_guide_src/cilexer/cilexer/cilexer.py
new file mode 100644
index 000000000..713268e9c
--- /dev/null
+++ b/user_guide_src/cilexer/cilexer/cilexer.py
@@ -0,0 +1,46 @@
+# CodeIgniter
+# http://codeigniter.com
+#
+# An open source application development framework for PHP 5.1.6 or newer
+#
+# NOTICE OF LICENSE
+#
+# Licensed under the Open Software License version 3.0
+#
+# This source file is subject to the Open Software License (OSL 3.0) that is
+# bundled with this package in the files license.txt / license.rst. It is
+# also available through the world wide web at this URL:
+# http://opensource.org/licenses/OSL-3.0
+# If you did not receive a copy of the license and are unable to obtain it
+# through the world wide web, please send an email to
+# licensing@ellislab.com so we can send you a copy immediately.
+#
+# Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+# http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
+
+
+
+import re
+import copy
+
+from pygments.lexer import DelegatingLexer
+from pygments.lexers.web import PhpLexer, HtmlLexer
+
+__all__ = ['CodeIgniterLexer']
+
+
+class CodeIgniterLexer(DelegatingLexer):
+ """
+ Handles HTML, PHP, JavaScript, and CSS is highlighted
+ PHP is highlighted with the "startline" option
+ """
+
+ name = 'CodeIgniter'
+ aliases = ['ci', 'codeigniter']
+ filenames = ['*.html', '*.css', '*.php', '*.xml', '*.static']
+ mimetypes = ['text/html', 'application/xhtml+xml']
+
+ def __init__(self, **options):
+ super(CodeIgniterLexer, self).__init__(HtmlLexer,
+ PhpLexer,
+ startinline=True)
diff --git a/user_guide_src/cilexer/setup.py b/user_guide_src/cilexer/setup.py
new file mode 100644
index 000000000..db4bbea43
--- /dev/null
+++ b/user_guide_src/cilexer/setup.py
@@ -0,0 +1,23 @@
+"""
+Install and setup CodeIgniter highlighting for Pygments.
+"""
+
+from setuptools import setup
+
+entry_points = """
+[pygments.lexers]
+cilexer = cilexer.cilexer:CodeIgniterLexer
+"""
+
+setup(
+ name='pycilexer',
+ version='0.1',
+ description=__doc__,
+ author="EllisLab, Inc.",
+ packages=['cilexer'],
+ install_requires=(
+ 'sphinx >= 1.0.7',
+ 'sphinxcontrib-phpdomain >= 0.1.3-1'
+ ),
+ entry_points=entry_points
+)
diff --git a/user_guide_src/source/_themes/eldocs/layout.html b/user_guide_src/source/_themes/eldocs/layout.html
new file mode 100644
index 000000000..4b1a0221c
--- /dev/null
+++ b/user_guide_src/source/_themes/eldocs/layout.html
@@ -0,0 +1,172 @@
+{%- block doctype -%}
+<!DOCTYPE html>
+{%- endblock %}
+{%- set reldelim1 = reldelim1 is not defined and ' &rsaquo;' or reldelim1 %}
+{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %}
+{%- set url_root = pathto('', 1) %}
+{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
+{% set project_abbreviation = 'ee' %}{% set project_domain = 'expressionengine.com' %}
+{%- if project == 'ExpressionEngine' %}{% set project_abbreviation = 'ee' %}{% set project_domain = 'expressionengine.com' %}{% endif -%}
+{%- if project == 'CodeIgniter' %}{% set project_abbreviation = 'ci' %}{% set project_domain = 'codeigniter.com' %}{% endif -%}
+{%- if project == 'MojoMotor' %}{% set project_abbreviation = 'mm' %}{% set project_domain = 'mojomotor.com' %}{% endif -%}
+
+<html>
+ <head>
+ <meta charset="{{ encoding }}">
+ {{ metatags }}
+ {%- if not embedded and docstitle %}
+ {%- set titlesuffix = " &mdash; "|safe + docstitle|e %}
+ {%- else %}
+ {%- set titlesuffix = "" %}
+ {%- endif %}
+ {%- block htmltitle %}
+ <title>{{ title|striptags|e }}{{ titlesuffix }}</title>
+ {%- endblock %}
+
+ <link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
+ <link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
+ {%- for cssfile in css_files %}
+ <link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" />
+ {%- endfor %}
+
+ {%- if not embedded %}
+ <script type="text/javascript">
+ var DOCUMENTATION_OPTIONS = {
+ URL_ROOT: '{{ url_root }}',
+ VERSION: '{{ release|e }}',
+ COLLAPSE_INDEX: false,
+ FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
+ HAS_SOURCE: {{ has_source|lower }}
+ };
+ </script>
+ {%- for scriptfile in script_files %}
+ <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
+ {%- endfor %}
+
+ {%- if favicon %}
+ <link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
+ {%- endif %}
+ {%- endif %}
+
+ {%- block linktags %}
+ {%- if hasdoc('about') %}
+ <link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" />
+ {%- endif %}
+ {%- if hasdoc('genindex') %}
+ <link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" />
+ {%- endif %}
+ {%- if hasdoc('search') %}
+ <link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" />
+ {%- endif %}
+ {%- if hasdoc('copyright') %}
+ <link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" />
+ {%- endif %}
+ <link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}" />
+ {%- if parents %}
+ <link rel="up" title="{{ parents[-1].title|striptags|e }}" href="{{ parents[-1].link|e }}" />
+ {%- endif %}
+ {%- if next %}
+ <link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}" />
+ {%- endif %}
+ {%- if prev %}
+ <link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" />
+ {%- endif %}
+ {%- endblock %}
+ {%- block extrahead %} {% endblock %}
+ </head>
+ <body>
+ {%- block content %}
+ <div id="table-contents">
+ <div class="toctree-wrapper compound">
+ {{ toctree(collapse=true) }}
+ </div>
+ </div>
+
+ <div id="brand" class="{{ project_abbreviation }}">
+ <a href="http://{{ project_domain }}/"><img src="{{ pathto('_static/asset/img/' + project_abbreviation + '-logo.gif', 1) }}" alt="{{ project }}"></a>
+ <p>{{ release }} User Guide</p>
+ {%- if show_source and has_source and sourcename %}
+ <p><a href="{{ pathto('_sources/' + sourcename, true)|e }}"
+ rel="nofollow">{{ _('Show Source') }}</a></p>
+ {%- endif %}
+ </div><!-- /#brand -->
+
+ <div id="header">
+ <form method="get" action="http://www.google.com/search">
+ <fieldset>
+ <input type="text" name="q" id="q" value="">
+ <input type="hidden" name="as_sitesearch" id="as_sitesearch" value="{{ project_domain }}/user_guide/" />
+ <input class="grades" type="submit" value="search">
+ </fieldset>
+ </form>
+ <ul>
+ {%- block rootrellink %}
+ <li><a href="{{ pathto(master_doc) }}">Home</a>&nbsp;&nbsp;{{ reldelim1 }}</li>
+ <li><a id="toc-link" href="{{ pathto(master_doc) }}">Table of Contents</a>&nbsp;&nbsp;{{ reldelim1 }}</li>
+ {%- endblock %}
+
+ {%- for parent in parents %}
+ <li><a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a>&nbsp;&nbsp; {{ reldelim1 }}</li>
+ {%- endfor %}
+
+ <li><strong>{{ title }}</strong></li>
+ </ul>
+ </div><!-- /#header -->
+
+ <div class="section" id="content">
+ {{ body }}
+ </div>
+ {%- endblock %}
+
+ {% if pagename not in exclude_comments -%}
+ <!-- {user_guide_comments} -->
+ {% endif %}
+
+ {%- block footer %}
+ <div id="footer">
+ <p class="top">
+ {% if prev %}
+ <span class="prev">Previous Topic: <a href="{{ prev.link }}">{{ prev.title }}</a></span>
+ {% endif %}
+ {% if next %}
+ <span class="next">Next Topic: <a href="{{ next.link }}">{{ next.title }}</a></span>
+ {% endif %}
+ <a href="#header" title="Return to top">Return to top</a>
+ </p>
+ <p><a href="{{ project_url }}">{{ project }}</a> &ndash; Copyright &copy; {{ copyright }}</a> &ndash; Last updated: {{ last_updated }}</p>
+ </div><!-- /#footer -->
+ {%- endblock %}
+
+ <script src="{{ pathto('_static/asset/js/jquery-ui-min.js', 1) }}" type="text/javascript" charset="utf-8" async></script>
+ <script type="text/javascript" charset="utf-8">
+ $('#toc-link').click(function(){
+ $('#table-contents').animate({ left: '0' },1000);
+ return false;
+ });
+ $('html').click(function(){
+ if ($('#table-contents').css("left") == '0px'){
+ $('#table-contents').animate({ left: '-520' },1000);
+ }
+ });
+ $('#table-contents').click(function(event){
+ event.stopPropagation();
+ });
+/* $('*:not(#table-contents,#toc-link)').click(function(){
+ if ($('#table-contents').css("left") == '0px'){
+ $('#table-contents').animate({ left: '-520' },1000);
+ }
+ });
+/* $("#toc-link").click(function () {
+ $('#table-contents').show("slide", { direction: "left" }, 100);
+ event.stopPropagation();
+ return false;
+ });
+ $('*:not(#table-contents,#toc-link)').click(function () {
+ if ($('#table-contents').is(":visible")) {
+ $('#table-contents').hide("slide", { direction: "left" }, 100);
+ event.stopPropagation();
+ }
+ }); */
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/user_guide_src/source/_themes/eldocs/static/asset/css/common.css b/user_guide_src/source/_themes/eldocs/static/asset/css/common.css
new file mode 100644
index 000000000..b9e28aec0
--- /dev/null
+++ b/user_guide_src/source/_themes/eldocs/static/asset/css/common.css
@@ -0,0 +1,313 @@
+/*
+CodeIgniter
+http://codeigniter.com
+
+An open source application development framework for PHP 5.1.6 or newer
+
+NOTICE OF LICENSE
+
+Licensed under the Open Software License version 3.0
+
+This source file is subject to the Open Software License (OSL 3.0) that is
+bundled with this package in the files license.txt / license.rst. It is
+also available through the world wide web at this URL:
+http://opensource.org/licenses/OSL-3.0
+If you did not receive a copy of the license and are unable to obtain it
+through the world wide web, please send an email to
+licensing@ellislab.com so we can send you a copy immediately.
+
+Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
+http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
+*/
+
+html, body,
+h1, h2, h3, h4, h5, h6,
+p, ul, ol, li, dl, dd, dt, pre, form, fieldset{ margin: 0; padding: 0; }
+
+body{ background-color: #F9F9F9; color: #444444; font: normal normal 14px "Helvetica", "Arial", Sans-Serif; }
+
+pre, kbd, var, samp, tt{ font-family: "Courier", Monospace; }
+
+pre,
+#header,
+#footer,
+#table-contents .toctree-wrapper{ font-size: 12px; }
+
+dfn, var,
+em.dfn, em.var{
+ background-color: #FFFDED;
+ color: #578236;
+ font-style: italic;
+ padding: 3px;
+}
+
+kbd, samp{ color: #B83044; }
+
+ kbd{ font-style: italic; }
+
+h1, h2, h3, h4, h5, h6, pre{ color: #094776; }
+
+h1{ font-size: 28px; }
+
+h2{ font-size: 24px; }
+
+h2, h3{ border-bottom: 2px solid #EEEEEE; padding: 0 0 3px; }
+
+h3{ border-color: #E5E5E5; border-width: 1px; }
+
+h4{ background-color: #FFFDED; display: inline-block; font-size: 18px; margin: 0; padding: 5px; }
+
+ h1 a, h2 a{ font-weight: normal; }
+
+ h1 a, h2 a, h3 a{ text-decoration: none; }
+
+h3, h5, h6{ font-size: 18px; margin: 20px 0; }
+
+ h4, h5, h6{ font-size: 14px; }
+
+p, dl, ul, ol{ margin: 20px 0; }
+
+ p, dl, ul, ol, h3, h4, h5, h6{ margin-left: 20px; }
+
+ li > ul,
+ li > ol{ margin: 0; margin-left: 40px; }
+
+ dl > dd{ margin-left: 20px; }
+
+p, li, dd, dt, pre{ line-height: 1.5; }
+
+table{
+ background-color: #F5FBFF;
+ border: 1px solid #C8DEF0;
+ border-collapse: collapse;
+ margin-bottom: 20px;
+}
+
+ th, td{
+ border: 0;
+ border-bottom: 1px solid #C8DEF0;
+ padding: 8px;
+ }
+
+ th{
+ background-color: #326B95;
+ color: #FFFFFF;
+ text-align: left;
+ }
+
+ td{ font-size: 12px; }
+
+ .descname{ color: #000080; font-weight: bold; }
+ .descclassname{ color: #094776; }
+
+ .class .descname{ font-size: 18px; font-style: italic; }
+ .method .descname{ font-style: normal; }
+
+ .class .property{ color: #094776; }
+
+ .method big,
+ .method .optional{ color: #094776; padding: 0 4px 0 6px; }
+
+ .class em,
+ .method em{ color: #008080; }
+
+ .method dt{ margin: 20px 0; }
+
+ .method table{ margin-bottom: 0; margin-left: 20px; }
+
+ .method th,
+ .method td{ padding: 10px; }
+
+ .method td > ul{ margin: 0; margin-left: 20px; }
+ .method td.field-body > p { margin: 0; margin-left: 20px; }
+
+a:link,
+a:visited{ color: #1A5B8D; }
+
+a:hover,
+a:active{ color: #742CAC; }
+
+a.headerlink{ visibility: hidden; }
+
+ :hover > a.headerlink { visibility: visible; }
+
+a img{
+ border: 0;
+ outline: 0;
+}
+
+img{ display: block; max-width: 100%; }
+
+fieldset{ border: 0; }
+
+.top{ float: right; }
+.next{ padding: 0 20px 0 10px; }
+.prev{ padding-right: 10px; }
+
+.highlight-ci,
+.highlight-ee,
+.highlight-rst,
+.highlight-bash,
+.highlight-perl,
+.cp-path,
+.important,
+.note{
+ background-color: #F5FBFF;
+ border: 1px solid #C8DEF0;
+ margin: 20px 0 20px 20px;
+ padding: 10px 10px 8px;
+}
+
+ .highlight-ci,
+ .highlight-ee,
+ .highlight-rst,
+ .highlight-bash,
+ .highlight-perl{
+ -moz-box-shadow: 4px 4px 0 rgba(0,0,0,0.03);
+ -webkit-box-shadow: 4px 4px 0 rgba(0,0,0,0.03);
+ box-shadow: 4px 4px 0 rgba(0,0,0,0.03);
+ }
+
+ .cp-path{ background-color: #FFFDED; border-color: #D1CDB0; }
+ .important, .note{ background-color: #F2FFE8; border-color: #B9D3A6; }
+ .highlight-rst{ background-color: #F9FEFE; border-color: #AACFCF; }
+
+ .important p,
+ .note p{ margin: 0; }
+
+.admonition-title{
+ float: left;
+ font-weight: bold;
+ padding-right: 4px;
+ text-transform: uppercase;
+}
+
+.admonition-title:after{ content: ': '; }
+
+#table-contents{
+ bottom: 0;
+ left: -520px;
+ position: fixed;
+ top: 0;
+}
+
+#table-contents .toctree-wrapper{
+ background-color: #444444;
+ background-color: rgba(0,0,0,0.9);
+ *+background-color: #444444;
+ bottom: 0;
+ left: 0;
+ overflow-y: auto;
+ padding: 20px 10px;
+ position: absolute;
+ top: 0;
+ width: 500px;
+}
+
+ #table-contents .toctree-wrapper ul{margin-bottom: 0; margin-top: 0; }
+
+ #table-contents .toctree-wrapper li{ color: #999999; line-height: 1.7; padding: 1px 0; }
+
+ #table-contents .toctree-l1{ list-style-type: none; }
+
+ #table-contents .toctree-l1 > a{
+ background: transparent url(../../asset/img/paper-ico.gif) no-repeat 0 0;
+ font-size: 14px;
+ font-weight: bold;
+ padding-left: 20px;
+ }
+
+ #header a:link,
+ #header a:visited,
+ #table-contents .toctree-wrapper a:link,
+ #table-contents .toctree-wrapper a:visited{ color: #FFFFFF; }
+
+ #header a:hover,
+ #header a:active,
+ #table-contents .toctree-wrapper a:hover,
+ #table-contents .toctree-wrapper a:active{ color: #FFF8C3; }
+
+#content{ background-color: #FFFFFF; padding: 40px 40px 20px; }
+
+#brand{
+ background-color: #F5F5F5;
+ color: #FFFFFF;
+ overflow: hidden;
+ padding: 10px 20px 13px;
+}
+
+ #brand > *{ float: left; }
+
+ #brand p{ font-size: 14px; margin: 2px 0 0 5px; }
+ #brand.ci p{ margin-top: 8px; }
+
+ #brand.ee{ background-color: #27343C; }
+ #brand.ci{ background-color: #4A0202; }
+ #brand.mm{ background-color: #222627; }
+ #brand.el{ background-color: #4A0202; }
+
+#header{
+ background-color: #3B7EB0;
+ border-top: 2px solid #539ECC;
+ color: #FFFFFF;
+ overflow: hidden;
+ padding: 15px 15px 16px 20px;
+}
+
+ #header form{ float: right; overflow: hidden; }
+
+ #header input{ float: left; }
+
+ #header input[type="text"]{
+ background-color: #FFFFFF;
+ border: 1px solid;
+ border-color: #033861 #13598F #13598F #033861;
+ font-size: inherit;
+ margin-right: 5px;
+ padding: 5px;
+ width: 175px;
+ }
+
+ #header input[type="text"]:focus{ background-color: #FFFDED; outline: 0; }
+
+ #header input[type="submit"]{
+ background: #F0F9FF url(../../asset/img/grades.gif) repeat-x 0 -58px;
+ border: 1px solid #033861;
+ color: #094776;
+ cursor: pointer;
+ font-weight: bold;
+ padding: 5px 10px 4px;
+ text-transform: uppercase;
+ }
+
+ #header input[type="submit"]:hover{ background-position: 0 -83px; }
+
+ #header ul{
+ float: left;
+ list-style-type: none;
+ margin: 0;
+ overflow: hidden;
+ }
+
+ #header li{ float: left; margin: 4px 5px 0 0; }
+
+#footer{ background-color: #F9F9F9; border-top: 1px solid #CCCCCC; padding: 20px; }
+
+ #footer p{ margin: 0; }
+
+@media (max-width:800px){
+ #footer .top,
+ #header form{ float: none; margin-bottom: 10px; }
+ #content{ padding: 20px; }
+}
+
+@media (max-width:340px){
+ body{ font-size: 12px; }
+ h1{ font-size: 18px; }
+ h2{ font-size: 16px; }
+ h3,h4,h5,h6{ font-size: 14px; }
+}
+
+@media screen and (-webkit-min-device-pixel-ratio:0){
+ #header input[type="submit"]{ padding-bottom: 7px; }
+} \ No newline at end of file
diff --git a/user_guide_src/source/_themes/eldocs/static/asset/img/ci-logo.gif b/user_guide_src/source/_themes/eldocs/static/asset/img/ci-logo.gif
new file mode 100644
index 000000000..ca2252351
--- /dev/null
+++ b/user_guide_src/source/_themes/eldocs/static/asset/img/ci-logo.gif
Binary files differ
diff --git a/user_guide_src/source/_themes/eldocs/static/asset/img/ee-logo.gif b/user_guide_src/source/_themes/eldocs/static/asset/img/ee-logo.gif
new file mode 100644
index 000000000..986729437
--- /dev/null
+++ b/user_guide_src/source/_themes/eldocs/static/asset/img/ee-logo.gif
Binary files differ
diff --git a/user_guide_src/source/_themes/eldocs/static/asset/img/grades.gif b/user_guide_src/source/_themes/eldocs/static/asset/img/grades.gif
new file mode 100644
index 000000000..2b37967e8
--- /dev/null
+++ b/user_guide_src/source/_themes/eldocs/static/asset/img/grades.gif
Binary files differ
diff --git a/user_guide_src/source/_themes/eldocs/static/asset/img/mm-logo.gif b/user_guide_src/source/_themes/eldocs/static/asset/img/mm-logo.gif
new file mode 100644
index 000000000..7cb07f0d1
--- /dev/null
+++ b/user_guide_src/source/_themes/eldocs/static/asset/img/mm-logo.gif
Binary files differ
diff --git a/user_guide_src/source/_themes/eldocs/static/asset/img/paper-ico.gif b/user_guide_src/source/_themes/eldocs/static/asset/img/paper-ico.gif
new file mode 100644
index 000000000..5fc199474
--- /dev/null
+++ b/user_guide_src/source/_themes/eldocs/static/asset/img/paper-ico.gif
Binary files differ
diff --git a/user_guide_src/source/_themes/eldocs/static/asset/js/jquery-ui-min.js b/user_guide_src/source/_themes/eldocs/static/asset/js/jquery-ui-min.js
new file mode 100755
index 000000000..f9e4f1e84
--- /dev/null
+++ b/user_guide_src/source/_themes/eldocs/static/asset/js/jquery-ui-min.js
@@ -0,0 +1,789 @@
+/*!
+ * jQuery UI 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI
+ */
+(function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.14",
+keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();
+b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,
+"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",
+function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,
+outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a,"tabindex"),d=isNaN(b);
+return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=
+0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);
+;/*!
+ * jQuery UI Widget 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Widget
+ */
+(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,
+a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h;
+e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,
+this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},
+widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},
+enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
+;/*!
+ * jQuery UI Mouse 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Mouse
+ *
+ * Depends:
+ * jquery.ui.widget.js
+ */
+(function(b){var d=false;b(document).mousedown(function(){d=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(c){return a._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(true===b.data(c.target,a.widgetName+".preventClickEvent")){b.removeData(c.target,a.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+
+this.widgetName)},_mouseDown:function(a){if(!d){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var c=this,f=a.which==1,g=typeof this.options.cancel=="string"?b(a.target).closest(this.options.cancel).length:false;if(!f||g||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=this._mouseStart(a)!==
+false;if(!this._mouseStarted){a.preventDefault();return true}}true===b.data(a.target,this.widgetName+".preventClickEvent")&&b.removeData(a.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(e){return c._mouseMove(e)};this._mouseUpDelegate=function(e){return c._mouseUp(e)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return d=true}},_mouseMove:function(a){if(b.browser.msie&&
+!(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=
+false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
+;/*
+ * jQuery UI Position 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Position
+ */
+(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY,
+left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+=
+k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-=
+m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left=
+d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+=
+a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b),
+g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery);
+;/*
+ * jQuery UI Draggable 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Draggables
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.mouse.js
+ * jquery.ui.widget.js
+ */
+(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper==
+"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b=
+this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;d(b.iframeFix===true?"iframe":b.iframeFix).each(function(){d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")});return true},_mouseStart:function(a){var b=this.options;this.helper=
+this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});
+this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);d.ui.ddmanager&&d.ui.ddmanager.dragStart(this,a);return true},
+_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=
+false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,
+10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},_mouseUp:function(a){this.options.iframeFix===true&&d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});d.ui.ddmanager&&d.ui.ddmanager.dragStop(this,a);return d.ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||
+!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone().removeAttr("id"):this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&
+a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=
+this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),
+10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),
+10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[a.containment=="document"?0:d(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a.containment=="document"?0:d(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,
+(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){a=d(a.containment);var b=a[0];if(b){a.offset();var c=d(b).css("overflow")!=
+"hidden";this.containment=[(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),
+10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=a}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+
+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&
+!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,h=a.pageY;if(this.originalPosition){var g;if(this.containment){if(this.relative_container){g=this.relative_container.offset();g=[this.containment[0]+g.left,this.containment[1]+g.top,this.containment[2]+g.left,this.containment[3]+g.top]}else g=this.containment;if(a.pageX-this.offset.click.left<g[0])e=g[0]+this.offset.click.left;
+if(a.pageY-this.offset.click.top<g[1])h=g[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>g[2])e=g[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>g[3])h=g[3]+this.offset.click.top}if(b.grid){h=b.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/b.grid[1])*b.grid[1]:this.originalPageY;h=g?!(h-this.offset.click.top<g[1]||h-this.offset.click.top>g[3])?h:!(h-this.offset.click.top<g[1])?h-b.grid[1]:h+b.grid[1]:h;e=b.grid[0]?this.originalPageX+Math.round((e-this.originalPageX)/
+b.grid[0])*b.grid[0]:this.originalPageX;e=g?!(e-this.offset.click.left<g[0]||e-this.offset.click.left>g[2])?e:!(e-this.offset.click.left<g[0])?e-b.grid[0]:e+b.grid[0]:e}}return{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop()),left:e-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version<
+526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.call(this,a,[b,c]);if(a=="drag")this.positionAbs=this._convertPositionTo("absolute");return d.Widget.prototype._trigger.call(this,a,b,
+c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.14"});d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sortables=[];d(f.connectToSortable).each(function(){var h=d.data(this,"sortable");if(h&&!h.options.disabled){c.sortables.push({instance:h,shouldRevert:h.options.revert});
+h.refreshPositions();h._trigger("activate",a,e)}})},stop:function(a,b){var c=d(this).data("draggable"),f=d.extend({},b,{item:c.element});d.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(a);this.instance.options.helper=this.instance.options._helper;c.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=
+false;this.instance._trigger("deactivate",a,f)}})},drag:function(a,b){var c=d(this).data("draggable"),f=this;d.each(c.sortables,function(){this.instance.positionAbs=c.positionAbs;this.instance.helperProportions=c.helperProportions;this.instance.offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=d(f).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",true);
+this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return b.helper[0]};a.target=this.instance.currentItem[0];this.instance._mouseCapture(a,true);this.instance._mouseStart(a,true,true);this.instance.offset.click.top=c.offset.click.top;this.instance.offset.click.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top;
+c._trigger("toSortable",a);c.dropped=this.instance.element;c.currentItem=c.element;this.instance.fromOutside=c}this.instance.currentItem&&this.instance._mouseDrag(a)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",a,this.instance._uiHash(this.instance));this.instance._mouseStop(a,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&
+this.instance.placeholder.remove();c._trigger("fromSortable",a);c.dropped=false}})}});d.ui.plugin.add("draggable","cursor",{start:function(){var a=d("body"),b=d(this).data("draggable").options;if(a.css("cursor"))b._cursor=a.css("cursor");a.css("cursor",b.cursor)},stop:function(){var a=d(this).data("draggable").options;a._cursor&&d("body").css("cursor",a._cursor)}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity=
+a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!=
+"x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop+c.scrollSpeed;else if(a.pageY-b.overflowOffset.top<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop-c.scrollSpeed;if(!c.axis||c.axis!="y")if(b.overflowOffset.left+b.scrollParent[0].offsetWidth-a.pageX<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft+c.scrollSpeed;else if(a.pageX-b.overflowOffset.left<
+c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(!c.axis||c.axis!="x")if(a.pageY-d(document).scrollTop()<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()-c.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()+c.scrollSpeed);if(!c.axis||c.axis!="y")if(a.pageX-d(document).scrollLeft()<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()-
+c.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()+c.scrollSpeed)}f!==false&&d.ui.ddmanager&&!c.dropBehaviour&&d.ui.ddmanager.prepareOffsets(b,a)}});d.ui.plugin.add("draggable","snap",{start:function(){var a=d(this).data("draggable"),b=a.options;a.snapElements=[];d(b.snap.constructor!=String?b.snap.items||":data(draggable)":b.snap).each(function(){var c=d(this),f=c.offset();this!=a.element[0]&&a.snapElements.push({item:this,
+width:c.outerWidth(),height:c.outerHeight(),top:f.top,left:f.left})})},drag:function(a,b){for(var c=d(this).data("draggable"),f=c.options,e=f.snapTolerance,h=b.offset.left,g=h+c.helperProportions.width,n=b.offset.top,o=n+c.helperProportions.height,i=c.snapElements.length-1;i>=0;i--){var j=c.snapElements[i].left,l=j+c.snapElements[i].width,k=c.snapElements[i].top,m=k+c.snapElements[i].height;if(j-e<h&&h<l+e&&k-e<n&&n<m+e||j-e<h&&h<l+e&&k-e<o&&o<m+e||j-e<g&&g<l+e&&k-e<n&&n<m+e||j-e<g&&g<l+e&&k-e<o&&
+o<m+e){if(f.snapMode!="inner"){var p=Math.abs(k-o)<=e,q=Math.abs(m-n)<=e,r=Math.abs(j-g)<=e,s=Math.abs(l-h)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:k-c.helperProportions.height,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:m,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:j-c.helperProportions.width}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:l}).left-c.margins.left}var t=
+p||q||r||s;if(f.snapMode!="outer"){p=Math.abs(k-n)<=e;q=Math.abs(m-o)<=e;r=Math.abs(j-h)<=e;s=Math.abs(l-g)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:k,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:m-c.helperProportions.height,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:j}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:l-c.helperProportions.width}).left-c.margins.left}if(!c.snapElements[i].snapping&&
+(p||q||r||s||t))c.options.snap.snap&&c.options.snap.snap.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[i].item}));c.snapElements[i].snapping=p||q||r||s||t}else{c.snapElements[i].snapping&&c.options.snap.release&&c.options.snap.release.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[i].item}));c.snapElements[i].snapping=false}}}});d.ui.plugin.add("draggable","stack",{start:function(){var a=d(this).data("draggable").options;a=d.makeArray(d(a.stack)).sort(function(c,f){return(parseInt(d(c).css("zIndex"),
+10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(a.length){var b=parseInt(a[0].style.zIndex)||0;d(a).each(function(c){this.style.zIndex=b+c});this[0].style.zIndex=b+a.length}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("zIndex"))b._zIndex=a.css("zIndex");a.css("zIndex",b.zIndex)},stop:function(a,b){a=d(this).data("draggable").options;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}})})(jQuery);
+;/*
+ * jQuery UI Droppable 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Droppables
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ * jquery.ui.mouse.js
+ * jquery.ui.draggable.js
+ */
+(function(d){d.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var a=this.options,b=a.accept;this.isover=0;this.isout=1;this.accept=d.isFunction(b)?b:function(c){return c.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};d.ui.ddmanager.droppables[a.scope]=d.ui.ddmanager.droppables[a.scope]||[];d.ui.ddmanager.droppables[a.scope].push(this);
+a.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){for(var a=d.ui.ddmanager.droppables[this.options.scope],b=0;b<a.length;b++)a[b]==this&&a.splice(b,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(a,b){if(a=="accept")this.accept=d.isFunction(b)?b:function(c){return c.is(b)};d.Widget.prototype._setOption.apply(this,arguments)},_activate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&
+this.element.addClass(this.options.activeClass);b&&this._trigger("activate",a,this.ui(b))},_deactivate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);b&&this._trigger("deactivate",a,this.ui(b))},_over:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.addClass(this.options.hoverClass);
+this._trigger("over",a,this.ui(b))}},_out:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("out",a,this.ui(b))}},_drop:function(a,b){var c=b||d.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return false;var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var g=
+d.data(this,"droppable");if(g.options.greedy&&!g.options.disabled&&g.options.scope==c.options.scope&&g.accept.call(g.element[0],c.currentItem||c.element)&&d.ui.intersect(c,d.extend(g,{offset:g.element.offset()}),g.options.tolerance)){e=true;return false}});if(e)return false;if(this.accept.call(this.element[0],c.currentItem||c.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("drop",
+a,this.ui(c));return this.element}return false},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}});d.extend(d.ui.droppable,{version:"1.8.14"});d.ui.intersect=function(a,b,c){if(!b.offset)return false;var e=(a.positionAbs||a.position.absolute).left,g=e+a.helperProportions.width,f=(a.positionAbs||a.position.absolute).top,h=f+a.helperProportions.height,i=b.offset.left,k=i+b.proportions.width,j=b.offset.top,l=j+b.proportions.height;
+switch(c){case "fit":return i<=e&&g<=k&&j<=f&&h<=l;case "intersect":return i<e+a.helperProportions.width/2&&g-a.helperProportions.width/2<k&&j<f+a.helperProportions.height/2&&h-a.helperProportions.height/2<l;case "pointer":return d.ui.isOver((a.positionAbs||a.position.absolute).top+(a.clickOffset||a.offset.click).top,(a.positionAbs||a.position.absolute).left+(a.clickOffset||a.offset.click).left,j,i,b.proportions.height,b.proportions.width);case "touch":return(f>=j&&f<=l||h>=j&&h<=l||f<j&&h>l)&&(e>=
+i&&e<=k||g>=i&&g<=k||e<i&&g>k);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f<c.length;f++)if(!(c[f].options.disabled||a&&!c[f].accept.call(c[f].element[0],a.currentItem||a.element))){for(var h=0;h<g.length;h++)if(g[h]==c[f].element[0]){c[f].proportions.height=0;continue a}c[f].visible=c[f].element.css("display")!=
+"none";if(c[f].visible){e=="mousedown"&&c[f]._activate.call(c[f],b);c[f].offset=c[f].element.offset();c[f].proportions={width:c[f].element[0].offsetWidth,height:c[f].element[0].offsetHeight}}}},drop:function(a,b){var c=false;d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(this.options){if(!this.options.disabled&&this.visible&&d.ui.intersect(a,this,this.options.tolerance))c=c||this._drop.call(this,b);if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],a.currentItem||
+a.element)){this.isout=1;this.isover=0;this._deactivate.call(this,b)}}});return c},dragStart:function(a,b){a.element.parentsUntil("body").bind("scroll.droppable",function(){a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)})},drag:function(a,b){a.options.refreshPositions&&d.ui.ddmanager.prepareOffsets(a,b);d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var c=d.ui.intersect(a,this,this.options.tolerance);if(c=
+!c&&this.isover==1?"isout":c&&this.isover==0?"isover":null){var e;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");if(g.length){e=d.data(g[0],"droppable");e.greedyChild=c=="isover"?1:0}}if(e&&c=="isover"){e.isover=0;e.isout=1;e._out.call(e,b)}this[c]=1;this[c=="isout"?"isover":"isout"]=0;this[c=="isover"?"_over":"_out"].call(this,b);if(e&&c=="isout"){e.isout=0;e.isover=1;e._over.call(e,b)}}}})},dragStop:function(a,b){a.element.parentsUntil("body").unbind("scroll.droppable");
+a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)}}})(jQuery);
+;/*
+ * jQuery UI Resizable 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Resizables
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.mouse.js
+ * jquery.ui.widget.js
+ */
+(function(e){e.widget("ui.resizable",e.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,a=this.options;this.element.addClass("ui-resizable");e.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element,
+_proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&e.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(e('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),
+top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=
+this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",
+nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d<c.length;d++){var f=e.trim(c[d]),g=e('<div class="ui-resizable-handle '+("ui-resizable-"+f)+'"></div>');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor==
+String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),l=0;l=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,l);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection();
+this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){if(!a.disabled){e(this).removeClass("ui-resizable-autohide");b._handles.show()}},function(){if(!a.disabled)if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();
+var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=
+false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"});
+this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff=
+{width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio:this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis];
+if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize",b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},
+_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height;f=f?0:c.sizeDiff.width;f={width:c.helper.width()-f,height:c.helper.height()-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f,
+{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",b);this._helper&&this.helper.remove();return false},_updateVirtualBoundaries:function(b){var a=this.options,c,d,f;a={minWidth:k(a.minWidth)?a.minWidth:0,maxWidth:k(a.maxWidth)?a.maxWidth:Infinity,minHeight:k(a.minHeight)?a.minHeight:0,maxHeight:k(a.maxHeight)?a.maxHeight:
+Infinity};if(this._aspectRatio||b){b=a.minHeight*this.aspectRatio;d=a.minWidth/this.aspectRatio;c=a.maxHeight*this.aspectRatio;f=a.maxWidth/this.aspectRatio;if(b>a.minWidth)a.minWidth=b;if(d>a.minHeight)a.minHeight=d;if(c<a.maxWidth)a.maxWidth=c;if(f<a.maxHeight)a.maxHeight=f}this._vBoundaries=a},_updateCache:function(b){this.offset=this.helper.offset();if(k(b.left))this.position.left=b.left;if(k(b.top))this.position.top=b.top;if(k(b.height))this.size.height=b.height;if(k(b.width))this.size.width=
+b.width},_updateRatio:function(b){var a=this.position,c=this.size,d=this.axis;if(k(b.height))b.width=b.height*this.aspectRatio;else if(k(b.width))b.height=b.width/this.aspectRatio;if(d=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(d=="nw"){b.top=a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this._vBoundaries,c=this.axis,d=k(b.width)&&a.maxWidth&&a.maxWidth<b.width,f=k(b.height)&&a.maxHeight&&a.maxHeight<b.height,g=k(b.width)&&a.minWidth&&
+a.minWidth>b.width,h=k(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height,l=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&l)b.left=i-a.minWidth;if(d&&l)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=
+null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a<this._proportionallyResizeElements.length;a++){var c=this._proportionallyResizeElements[a];if(!this.borderDif){var d=[c.css("borderTopWidth"),c.css("borderRightWidth"),c.css("borderBottomWidth"),c.css("borderLeftWidth")],f=[c.css("paddingTop"),c.css("paddingRight"),c.css("paddingBottom"),c.css("paddingLeft")];this.borderDif=e.map(d,function(g,h){g=parseInt(g,10)||
+0;h=parseInt(f[h],10)||0;return g+h})}e.browser.msie&&(e(b).is(":hidden")||e(b).parents(":hidden").length)||c.css({height:b.height()-this.borderDif[0]-this.borderDif[2]||0,width:b.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var b=this.options;this.elementOffset=this.element.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+
+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+
+c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]);
+b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable,{version:"1.8.14"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),
+10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize,function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top-
+f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var l=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:l.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n=(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(l.css("position"))){c._revertToRelativePosition=true;l.css({position:"absolute",top:"auto",left:"auto"})}l.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType?
+e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition=false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=
+e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing,
+step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement=
+e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top","Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset;
+var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset,f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left:
+a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top-
+d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition,
+f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,
+display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b=
+e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height=
+d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},k=function(b){return!isNaN(parseInt(b,10))}})(jQuery);
+;/*
+ * jQuery UI Selectable 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Selectables
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.mouse.js
+ * jquery.ui.widget.js
+ */
+(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),
+selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX,
+c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting",
+c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d=
+this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.right<b||a.top>i||a.bottom<g);else if(d.tolerance=="fit")k=a.left>b&&a.right<h&&a.top>g&&a.bottom<i;if(k){if(a.selected){a.$element.removeClass("ui-selected");a.selected=false}if(a.unselecting){a.$element.removeClass("ui-unselecting");
+a.unselecting=false}if(!a.selecting){a.$element.addClass("ui-selecting");a.selecting=true;f._trigger("selecting",c,{selecting:a.element})}}else{if(a.selecting)if(c.metaKey&&a.startselected){a.$element.removeClass("ui-selecting");a.selecting=false;a.$element.addClass("ui-selected");a.selected=true}else{a.$element.removeClass("ui-selecting");a.selecting=false;if(a.startselected){a.$element.addClass("ui-unselecting");a.unselecting=true}f._trigger("unselecting",c,{unselecting:a.element})}if(a.selected)if(!c.metaKey&&
+!a.startselected){a.$element.removeClass("ui-selected");a.selected=false;a.$element.addClass("ui-unselecting");a.unselecting=true;f._trigger("unselecting",c,{unselecting:a.element})}}}});return false}},_mouseStop:function(c){var f=this;this.dragged=false;e(".ui-unselecting",this.element[0]).each(function(){var d=e.data(this,"selectable-item");d.$element.removeClass("ui-unselecting");d.unselecting=false;d.startselected=false;f._trigger("unselected",c,{unselected:d.element})});e(".ui-selecting",this.element[0]).each(function(){var d=
+e.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected");d.selecting=false;d.selected=true;d.startselected=true;f._trigger("selected",c,{selected:d.element})});this._trigger("stop",c);this.helper.remove();return false}});e.extend(e.ui.selectable,{version:"1.8.14"})})(jQuery);
+;/*
+ * jQuery UI Sortable 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Sortables
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.mouse.js
+ * jquery.ui.widget.js
+ */
+(function(d){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){var a=this.options;this.containerCache={};this.element.addClass("ui-sortable");
+this.refresh();this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a===
+"disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&
+!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem=c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,
+left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};
+this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment();if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=
+document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);
+return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop+b.scrollSpeed;else if(a.pageY-this.overflowOffset.top<
+b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop-b.scrollSpeed;if(this.overflowOffset.left+this.scrollParent[0].offsetWidth-a.pageX<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft+b.scrollSpeed;else if(a.pageX-this.overflowOffset.left<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft-b.scrollSpeed}else{if(a.pageY-d(document).scrollTop()<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()-
+b.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()+b.scrollSpeed);if(a.pageX-d(document).scrollLeft()<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()-b.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()+b.scrollSpeed)}c!==false&&d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,
+a)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(b=this.items.length-1;b>=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],
+e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a,c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();
+c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):
+this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,
+dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")},
+toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+j<k&&b+l>g&&b+l<h;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||
+this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?j:g<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<h&&i<e+this.helperProportions.height/2&&f-this.helperProportions.height/2<k},_intersectsWithPointer:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left,a.width);b=b&&a;a=this._getDragVerticalDirection();
+var c=this._getDragHorizontalDirection();if(!b)return false;return this.floating?c&&c=="right"||a=="down"?2:1:a&&(a=="down"?2:1)},_intersectsWithSides:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top+a.height/2,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left+a.width/2,a.width);var c=this._getDragVerticalDirection(),e=this._getDragHorizontalDirection();return this.floating&&e?e=="right"&&a||e=="left"&&!a:c&&(c=="down"&&b||c=="up"&&!b)},
+_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();
+if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),
+this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(a){this.items=[];this.containers=[this];var b=this.items,c=[[d.isFunction(this.options.items)?this.options.items.call(this.element[0],a,{item:this.currentItem}):d(this.options.items,this.element),
+this]],e=this._connectWith();if(e)for(var f=e.length-1;f>=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h<g;h++){i=d(e[h]);i.data("sortable-item",a);b.push({item:i,instance:a,width:0,height:0,left:0,top:0})}}},refreshPositions:function(a){if(this.offsetParent&&
+this.helper)this.offset.parent=this._getParentOffset();for(var b=this.items.length-1;b>=0;b--){var c=this.items[b];if(!(c.instance!=this.currentContainer&&this.currentContainer&&c.item[0]!=this.currentItem[0])){var e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=
+this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=
+d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||
+0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",
+a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-
+f)<b){b=Math.abs(h-f);e=this.items[g]}}if(e||this.options.dropOnEmpty){this.currentContainer=this.containers[c];e?this._rearrange(a,e,null,true):this._rearrange(a,null,this.containers[c].element,true);this._trigger("change",a,this._uiHash());this.containers[c]._trigger("change",a,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}}},_createHelper:function(a){var b=
+this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a,this.currentItem])):b.helper=="clone"?this.currentItem.clone():this.currentItem;a.parents("body").length||d(b.appendTo!="parent"?b.appendTo:this.currentItem[0].parentNode)[0].appendChild(a[0]);if(a[0]==this.currentItem[0])this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};if(a[0].style.width==
+""||b.forceHelperSize)a.width(this.currentItem.width());if(a[0].style.height==""||b.forceHelperSize)a.height(this.currentItem.height());return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=
+this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a=
+{top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),
+10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?
+document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)){var b=d(a.containment)[0];a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),
+10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(a,b){if(!b)b=
+this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&
+this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();
+var f=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])f=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-
+this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;f=this.originalPageX+Math.round((f-this.originalPageX)/b.grid[0])*b.grid[0];f=this.containment?!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:!(f-this.offset.click.left<this.containment[0])?f-b.grid[0]:f+b.grid[0]:f}}return{top:g-
+this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())}},_rearrange:function(a,b,c,e){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],
+this.direction=="down"?b.item[0]:b.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var f=this,g=this.counter;window.setTimeout(function(){g==f.counter&&f.refreshPositions(!e)},0)},_clear:function(a,b){this.reverting=false;var c=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var e in this._storedCSS)if(this._storedCSS[e]=="auto"||this._storedCSS[e]=="static")this._storedCSS[e]=
+"";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!b&&c.push(function(f){this._trigger("receive",f,this._uiHash(this.fromOutside))});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!b)c.push(function(f){this._trigger("update",f,this._uiHash())});if(!d.ui.contains(this.element[0],this.currentItem[0])){b||c.push(function(f){this._trigger("remove",
+f,this._uiHash())});for(e=this.containers.length-1;e>=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,
+this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",
+a,this._uiHash());for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}return false}b||this._trigger("beforeStop",a,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!b){for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){d.Widget.prototype._trigger.apply(this,arguments)===false&&this.cancel()},
+_uiHash:function(a){var b=a||this;return{helper:b.helper,placeholder:b.placeholder||d([]),position:b.position,originalPosition:b.originalPosition,offset:b.positionAbs,item:b.currentItem,sender:a?a.element:null}}});d.extend(d.ui.sortable,{version:"1.8.14"})})(jQuery);
+;/*
+ * jQuery UI Accordion 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Accordion
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ */
+(function(c){c.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");
+a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
+if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var h=d.closest(".ui-accordion-header");a.active=h.length?h:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion",
+function(f){return a._keydown(f)}).next().attr("role","tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(f){a._clickHandler.call(a,f,this);f.preventDefault()})},_createIcons:function(){var a=
+this.options;if(a.icons){c("<span></span>").addClass("ui-icon "+a.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex");
+this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons();
+b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,h=this.headers.index(a.target),f=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:f=this.headers[(h+1)%d];break;case b.LEFT:case b.UP:f=this.headers[(h-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target);
+a.preventDefault()}if(f){c(a.target).attr("tabIndex",-1);c(f).attr("tabIndex",0);f.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+
+c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options;
+if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){var h=this.active;j=a.next();g=this.active.next();e={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):j,oldContent:g};var f=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(j,g,e,b,f);h.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);
+if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);a.next().addClass("ui-accordion-content-active")}}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var g=this.active.next(),
+e={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:g},j=this.active=c([]);this._toggle(j,g,e)}},_toggle:function(a,b,d,h,f){var g=this,e=g.options;g.toShow=a;g.toHide=b;g.data=d;var j=function(){if(g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data);g.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&h?{toShow:c([]),toHide:b,complete:j,down:f,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:f,autoHeight:e.autoHeight||
+e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;h=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!h[k]&&!c.easing[k])k="slide";h[k]||(h[k]=function(l){this.slide(l,{easing:k,duration:i||700})});h[k](d)}else{if(e.collapsible&&h)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false",
+"aria-selected":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.14",
+animations:{slide:function(a,b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),h=0,f={},g={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){g[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/);
+f[i]={value:j[1],unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(g,{step:function(j,i){if(i.prop=="height")h=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=h*f[i.prop].value+f[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide",
+paddingTop:"hide",paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery);
+;/*
+ * jQuery UI Autocomplete 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Autocomplete
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ * jquery.ui.position.js
+ */
+(function(d){var e=0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,g;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.attr("readonly"))){g=
+false;var f=d.ui.keyCode;switch(c.keyCode){case f.PAGE_UP:a._move("previousPage",c);break;case f.PAGE_DOWN:a._move("nextPage",c);break;case f.UP:a._move("previous",c);c.preventDefault();break;case f.DOWN:a._move("next",c);c.preventDefault();break;case f.ENTER:case f.NUMPAD_ENTER:if(a.menu.active){g=true;c.preventDefault()}case f.TAB:if(!a.menu.active)return;a.menu.select(c);break;case f.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!=
+a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay);break}}}).bind("keypress.autocomplete",function(c){if(g){g=false;c.preventDefault()}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)};
+this.menu=d("<ul></ul>").addClass("ui-autocomplete").appendTo(d(this.options.appendTo||"body",b)[0]).mousedown(function(c){var f=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(h){h.target!==a.element[0]&&h.target!==f&&!d.ui.contains(f,h.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,f){f=f.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:f})&&/^key/.test(c.originalEvent.type)&&
+a.element.val(f.value)},selected:function(c,f){var h=f.item.data("item.autocomplete"),i=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=i;setTimeout(function(){a.previous=i;a.selectedItem=h},1)}false!==a._trigger("select",c,{item:h})&&a.element.val(h.value);a.term=a.element.val();a.close(c);a.selectedItem=h},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");
+d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0]);a==="disabled"&&
+b&&this.xhr&&this.xhr.abort()},_initSource:function(){var a=this,b,g;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,f){f(d.ui.autocomplete.filter(b,c.term))}}else if(typeof this.options.source==="string"){g=this.options.source;this.source=function(c,f){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:g,data:c,dataType:"json",autocompleteRequest:++e,success:function(h){this.autocompleteRequest===e&&f(h)},error:function(){this.autocompleteRequest===e&&f([])}})}}else this.source=
+this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)!==false)return this._search(a)},_search:function(a){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:a},this.response)},_response:function(a){if(!this.options.disabled&&a&&a.length){a=this._normalize(a);this._suggest(a);this._trigger("open")}else this.close();
+this.pending--;this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(a){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.deactivate();this._trigger("close",a)}},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(a){if(a.length&&a[0].label&&a[0].value)return a;return d.map(a,function(b){if(typeof b==="string")return{label:b,value:b};return d.extend({label:b.label||
+b.value,value:b.value||b.label},b)})},_suggest:function(a){var b=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(b,a);this.menu.deactivate();this.menu.refresh();b.show();this._resizeMenu();b.position(d.extend({of:this.element},this.options.position));this.options.autoFocus&&this.menu.next(new d.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth(),this.element.outerWidth()))},_renderMenu:function(a,b){var g=this;
+d.each(b,function(c,f){g._renderItem(a,f)})},_renderItem:function(a,b){return d("<li></li>").data("item.autocomplete",b).append(d("<a></a>").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b);else this.search(null,b)},widget:function(){return this.menu.element}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,
+"\\$&")},filter:function(a,b){var g=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return g.test(c.label||c.value||c)})}})})(jQuery);
+(function(d){d.widget("ui.menu",{_create:function(){var e=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(a){if(d(a.target).closest(".ui-menu-item a").length){a.preventDefault();e.select(a)}});this.refresh()},refresh:function(){var e=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex",
+-1).mouseenter(function(a){e.activate(a,d(this).parent())}).mouseleave(function(){e.deactivate()})},activate:function(e,a){this.deactivate();if(this.hasScroll()){var b=a.offset().top-this.element.offset().top,g=this.element.scrollTop(),c=this.element.height();if(b<0)this.element.scrollTop(g+b);else b>=c&&this.element.scrollTop(g+b-c+a.height())}this.active=a.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",e,{item:a})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");
+this._trigger("blur");this.active=null}},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,a,b){if(this.active){e=this.active[e+"All"](".ui-menu-item").eq(0);e.length?this.activate(b,e):this.activate(b,this.element.children(a))}else this.activate(b,
+this.element.children(a))},nextPage:function(e){if(this.hasScroll())if(!this.active||this.last())this.activate(e,this.element.children(".ui-menu-item:first"));else{var a=this.active.offset().top,b=this.element.height(),g=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-a-b+d(this).height();return c<10&&c>-10});g.length||(g=this.element.children(".ui-menu-item:last"));this.activate(e,g)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||
+this.last()?":first":":last"))},previousPage:function(e){if(this.hasScroll())if(!this.active||this.first())this.activate(e,this.element.children(".ui-menu-item:last"));else{var a=this.active.offset().top,b=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var g=d(this).offset().top-a+b-d(this).height();return g<10&&g>-10});result.length||(result=this.element.children(".ui-menu-item:first"));this.activate(e,result)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||
+this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[d.fn.prop?"prop":"attr"]("scrollHeight")},select:function(e){this._trigger("selected",e,{item:this.active})}})})(jQuery);
+;/*
+ * jQuery UI Button 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Button
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ */
+(function(b){var h,i,j,g,l=function(){var a=b(this).find(":ui-button");setTimeout(function(){a.button("refresh")},1)},k=function(a){var c=a.name,e=a.form,f=b([]);if(c)f=e?b(e).find("[name='"+c+"']"):b("[name='"+c+"']",a.ownerDocument).filter(function(){return!this.form});return f};b.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",l);if(typeof this.options.disabled!==
+"boolean")this.options.disabled=this.element.attr("disabled");this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var a=this,c=this.options,e=this.type==="checkbox"||this.type==="radio",f="ui-state-hover"+(!e?" ui-state-active":"");if(c.label===null)c.label=this.buttonElement.html();if(this.element.is(":disabled"))c.disabled=true;this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",function(){if(!c.disabled){b(this).addClass("ui-state-hover");
+this===h&&b(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){c.disabled||b(this).removeClass(f)}).bind("click.button",function(d){if(c.disabled){d.preventDefault();d.stopImmediatePropagation()}});this.element.bind("focus.button",function(){a.buttonElement.addClass("ui-state-focus")}).bind("blur.button",function(){a.buttonElement.removeClass("ui-state-focus")});if(e){this.element.bind("change.button",function(){g||a.refresh()});this.buttonElement.bind("mousedown.button",function(d){if(!c.disabled){g=
+false;i=d.pageX;j=d.pageY}}).bind("mouseup.button",function(d){if(!c.disabled)if(i!==d.pageX||j!==d.pageY)g=true})}if(this.type==="checkbox")this.buttonElement.bind("click.button",function(){if(c.disabled||g)return false;b(this).toggleClass("ui-state-active");a.buttonElement.attr("aria-pressed",a.element[0].checked)});else if(this.type==="radio")this.buttonElement.bind("click.button",function(){if(c.disabled||g)return false;b(this).addClass("ui-state-active");a.buttonElement.attr("aria-pressed",true);
+var d=a.element[0];k(d).not(d).map(function(){return b(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed",false)});else{this.buttonElement.bind("mousedown.button",function(){if(c.disabled)return false;b(this).addClass("ui-state-active");h=this;b(document).one("mouseup",function(){h=null})}).bind("mouseup.button",function(){if(c.disabled)return false;b(this).removeClass("ui-state-active")}).bind("keydown.button",function(d){if(c.disabled)return false;if(d.keyCode==b.ui.keyCode.SPACE||
+d.keyCode==b.ui.keyCode.ENTER)b(this).addClass("ui-state-active")}).bind("keyup.button",function(){b(this).removeClass("ui-state-active")});this.buttonElement.is("a")&&this.buttonElement.keyup(function(d){d.keyCode===b.ui.keyCode.SPACE&&b(this).click()})}this._setOption("disabled",c.disabled);this._resetButton()},_determineButtonType:function(){this.type=this.element.is(":checkbox")?"checkbox":this.element.is(":radio")?"radio":this.element.is("input")?"input":"button";if(this.type==="checkbox"||this.type===
+"radio"){var a=this.element.parents().filter(":last"),c="label[for="+this.element.attr("id")+"]";this.buttonElement=a.find(c);if(!this.buttonElement.length){a=a.length?a.siblings():this.element.siblings();this.buttonElement=a.filter(c);if(!this.buttonElement.length)this.buttonElement=a.find(c)}this.element.addClass("ui-helper-hidden-accessible");(a=this.element.is(":checked"))&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("aria-pressed",a)}else this.buttonElement=this.element},
+widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass("ui-button ui-widget ui-state-default ui-corner-all ui-state-hover ui-state-active ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only").removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());this.hasTitle||this.buttonElement.removeAttr("title");
+b.Widget.prototype.destroy.call(this)},_setOption:function(a,c){b.Widget.prototype._setOption.apply(this,arguments);if(a==="disabled")c?this.element.attr("disabled",true):this.element.removeAttr("disabled");else this._resetButton()},refresh:function(){var a=this.element.is(":disabled");a!==this.options.disabled&&this._setOption("disabled",a);if(this.type==="radio")k(this.element[0]).each(function(){b(this).is(":checked")?b(this).button("widget").addClass("ui-state-active").attr("aria-pressed",true):
+b(this).button("widget").removeClass("ui-state-active").attr("aria-pressed",false)});else if(this.type==="checkbox")this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed",true):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed",false)},_resetButton:function(){if(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var a=this.buttonElement.removeClass("ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only"),
+c=b("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(a.empty()).text(),e=this.options.icons,f=e.primary&&e.secondary,d=[];if(e.primary||e.secondary){if(this.options.text)d.push("ui-button-text-icon"+(f?"s":e.primary?"-primary":"-secondary"));e.primary&&a.prepend("<span class='ui-button-icon-primary ui-icon "+e.primary+"'></span>");e.secondary&&a.append("<span class='ui-button-icon-secondary ui-icon "+e.secondary+"'></span>");if(!this.options.text){d.push(f?"ui-button-icons-only":
+"ui-button-icon-only");this.hasTitle||a.attr("title",c)}}else d.push("ui-button-text-only");a.addClass(d.join(" "))}}});b.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(a,c){a==="disabled"&&this.buttons.button("option",a,c);b.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var a=this.element.css("direction")===
+"ltr";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(a?"ui-corner-left":"ui-corner-right").end().filter(":last").addClass(a?"ui-corner-right":"ui-corner-left").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");
+b.Widget.prototype.destroy.call(this)}})})(jQuery);
+;/*
+ * jQuery UI Dialog 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Dialog
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ * jquery.ui.button.js
+ * jquery.ui.draggable.js
+ * jquery.ui.mouse.js
+ * jquery.ui.position.js
+ * jquery.ui.resizable.js
+ */
+(function(c,l){var m={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},n={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},o=c.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,
+position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||"&#160;",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+
+b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),
+h=c('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("<span></span>")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("<span></span>").addClass("ui-dialog-title").attr("id",
+e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");
+a.uiDialog.remove();a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!==
+b.uiDialog[0]){e=c(this).css("z-index");isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};c.ui.dialog.maxZ+=
+1;d.uiDialog.css("z-index",c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target===
+f[0]&&e.shiftKey){g.focus(1);return false}}});c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("<div></div>").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a,
+function(){return!(d=true)});if(d){c.each(a,function(f,h){h=c.isFunction(h)?{click:h,text:f}:h;var i=c('<button type="button"></button>').click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.each(h,function(j,k){if(j!=="click")j in o?i[j](k):i.attr(j,k)});c.fn.button&&i.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",
+handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition,
+originalSize:f.originalSize,position:f.position,size:f.size}}a=a===l?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize",
+f,b(h))},stop:function(f,h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "):
+[a[0],a[1]];if(b.length===1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]){d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._setOption(g,f);
+if(g in m)e=true;if(g in n)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"):
+e.removeClass("ui-dialog-disabled");break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||"&#160;"));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a=
+this.options,b,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height-
+b,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.14",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),
+create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()<c.ui.dialog.overlay.maxZ)return false})},1);c(document).bind("keydown.dialog-overlay",function(d){if(a.options.closeOnEscape&&d.keyCode&&d.keyCode===c.ui.keyCode.ESCAPE){a.close(d);d.preventDefault()}});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var b=(this.oldInstances.pop()||c("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),
+height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);
+b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a<b?c(window).height()+"px":a+"px"}else return c(document).height()+"px"},width:function(){var a,b;if(c.browser.msie){a=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);b=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return a<b?c(window).width()+"px":a+"px"}else return c(document).width()+"px"},resize:function(){var a=c([]);c.each(c.ui.dialog.overlay.instances,function(){a=
+a.add(this)});a.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height:c.ui.dialog.overlay.height()})}});c.extend(c.ui.dialog.overlay.prototype,{destroy:function(){c.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);
+;/*
+ * jQuery UI Slider 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Slider
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.mouse.js
+ * jquery.ui.widget.js
+ */
+(function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var b=this,a=this.options,c=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f=a.values&&a.values.length||1,e=[];this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+
+this.orientation+" ui-widget ui-widget-content ui-corner-all"+(a.disabled?" ui-slider-disabled ui-disabled":""));this.range=d([]);if(a.range){if(a.range===true){if(!a.values)a.values=[this._valueMin(),this._valueMin()];if(a.values.length&&a.values.length!==2)a.values=[a.values[0],a.values[0]]}this.range=d("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(a.range==="min"||a.range==="max"?" ui-slider-range-"+a.range:""))}for(var j=c.length;j<f;j+=1)e.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");
+this.handles=c.add(d(e.join("")).appendTo(b.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){a.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(a.disabled)d(this).blur();else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(g){d(this).data("index.ui-slider-handle",
+g)});this.handles.keydown(function(g){var k=true,l=d(this).data("index.ui-slider-handle"),i,h,m;if(!b.options.disabled){switch(g.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:k=false;if(!b._keySliding){b._keySliding=true;d(this).addClass("ui-state-active");i=b._start(g,l);if(i===false)return}break}m=b.options.step;i=b.options.values&&b.options.values.length?
+(h=b.values(l)):(h=b.value());switch(g.keyCode){case d.ui.keyCode.HOME:h=b._valueMin();break;case d.ui.keyCode.END:h=b._valueMax();break;case d.ui.keyCode.PAGE_UP:h=b._trimAlignValue(i+(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=b._trimAlignValue(i-(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(i===b._valueMax())return;h=b._trimAlignValue(i+m);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(i===b._valueMin())return;h=b._trimAlignValue(i-
+m);break}b._slide(g,l,h);return k}}).keyup(function(g){var k=d(this).data("index.ui-slider-handle");if(b._keySliding){b._keySliding=false;b._stop(g,k);b._change(g,k);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();
+return this},_mouseCapture:function(b){var a=this.options,c,f,e,j,g;if(a.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:b.pageX,y:b.pageY});f=this._valueMax()-this._valueMin()+1;j=this;this.handles.each(function(k){var l=Math.abs(c-j.values(k));if(f>l){f=l;e=d(this);g=k}});if(a.range===true&&this.values(1)===a.min){g+=1;e=d(this.handles[g])}if(this._start(b,g)===false)return false;
+this._mouseSliding=true;j._handleIndex=g;e.addClass("ui-state-active").focus();a=e.offset();this._clickOffset=!d(b.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:b.pageX-a.left-e.width()/2,top:b.pageY-a.top-e.height()/2-(parseInt(e.css("borderTopWidth"),10)||0)-(parseInt(e.css("borderBottomWidth"),10)||0)+(parseInt(e.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(b,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(b){var a=
+this._normValueFromMouse({x:b.pageX,y:b.pageY});this._slide(b,this._handleIndex,a);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(b){var a;if(this.orientation==="horizontal"){a=
+this.elementSize.width;b=b.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{a=this.elementSize.height;b=b.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}a=b/a;if(a>1)a=1;if(a<0)a=0;if(this.orientation==="vertical")a=1-a;b=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+a*b)},_start:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);
+c.values=this.values()}return this._trigger("start",b,c)},_slide:function(b,a,c){var f;if(this.options.values&&this.options.values.length){f=this.values(a?0:1);if(this.options.values.length===2&&this.options.range===true&&(a===0&&c>f||a===1&&c<f))c=f;if(c!==this.values(a)){f=this.values();f[a]=c;b=this._trigger("slide",b,{handle:this.handles[a],value:c,values:f});this.values(a?0:1);b!==false&&this.values(a,c,true)}}else if(c!==this.value()){b=this._trigger("slide",b,{handle:this.handles[a],value:c});
+b!==false&&this.value(c)}},_stop:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);c.values=this.values()}this._trigger("stop",b,c)},_change:function(b,a){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);c.values=this.values()}this._trigger("change",b,c)}},value:function(b){if(arguments.length){this.options.value=
+this._trimAlignValue(b);this._refreshValue();this._change(null,0)}else return this._value()},values:function(b,a){var c,f,e;if(arguments.length>1){this.options.values[b]=this._trimAlignValue(a);this._refreshValue();this._change(null,b)}else if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;f=arguments[0];for(e=0;e<c.length;e+=1){c[e]=this._trimAlignValue(f[e]);this._change(null,e)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(b):
+this.value();else return this._values()},_setOption:function(b,a){var c,f=0;if(d.isArray(this.options.values))f=this.options.values.length;d.Widget.prototype._setOption.apply(this,arguments);switch(b){case "disabled":if(a){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled")}break;case "orientation":this._detectOrientation();
+this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case "values":this._animateOff=true;this._refreshValue();for(c=0;c<f;c+=1)this._change(null,c);this._animateOff=false;break}},_value:function(){var b=this.options.value;return b=this._trimAlignValue(b)},_values:function(b){var a,c;if(arguments.length){a=this.options.values[b];
+return a=this._trimAlignValue(a)}else{a=this.options.values.slice();for(c=0;c<a.length;c+=1)a[c]=this._trimAlignValue(a[c]);return a}},_trimAlignValue:function(b){if(b<=this._valueMin())return this._valueMin();if(b>=this._valueMax())return this._valueMax();var a=this.options.step>0?this.options.step:1,c=(b-this._valueMin())%a;alignValue=b-c;if(Math.abs(c)*2>=a)alignValue+=c>0?a:-a;return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},
+_refreshValue:function(){var b=this.options.range,a=this.options,c=this,f=!this._animateOff?a.animate:false,e,j={},g,k,l,i;if(this.options.values&&this.options.values.length)this.handles.each(function(h){e=(c.values(h)-c._valueMin())/(c._valueMax()-c._valueMin())*100;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";d(this).stop(1,1)[f?"animate":"css"](j,a.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(h===0)c.range.stop(1,1)[f?"animate":"css"]({left:e+"%"},a.animate);
+if(h===1)c.range[f?"animate":"css"]({width:e-g+"%"},{queue:false,duration:a.animate})}else{if(h===0)c.range.stop(1,1)[f?"animate":"css"]({bottom:e+"%"},a.animate);if(h===1)c.range[f?"animate":"css"]({height:e-g+"%"},{queue:false,duration:a.animate})}g=e});else{k=this.value();l=this._valueMin();i=this._valueMax();e=i!==l?(k-l)/(i-l)*100:0;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[f?"animate":"css"](j,a.animate);if(b==="min"&&this.orientation==="horizontal")this.range.stop(1,
+1)[f?"animate":"css"]({width:e+"%"},a.animate);if(b==="max"&&this.orientation==="horizontal")this.range[f?"animate":"css"]({width:100-e+"%"},{queue:false,duration:a.animate});if(b==="min"&&this.orientation==="vertical")this.range.stop(1,1)[f?"animate":"css"]({height:e+"%"},a.animate);if(b==="max"&&this.orientation==="vertical")this.range[f?"animate":"css"]({height:100-e+"%"},{queue:false,duration:a.animate})}}});d.extend(d.ui.slider,{version:"1.8.14"})})(jQuery);
+;/*
+ * jQuery UI Tabs 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Tabs
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ */
+(function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&&
+e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=
+d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]||
+(q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");
+this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected=
+this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");
+if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))[0]))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));
+this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+
+g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal",
+function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")};
+this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected=
+-1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";
+d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e=
+d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b,
+e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]);
+j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();
+if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1<this.anchors.length?1:-1));e.disabled=d.map(d.grep(e.disabled,function(h){return h!=b}),function(h){return h>=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null,
+this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this},
+load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c,
+"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},
+url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.14"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k<a.anchors.length?k:0)},b);j&&j.stopPropagation()});e=a._unrotate||(a._unrotate=!e?function(j){j.clientX&&
+a.rotate(null)}:function(){t=c.selected;h()});if(b){this.element.bind("tabsshow",h);this.anchors.bind(c.event+".tabs",e);h()}else{clearTimeout(a.rotation);this.element.unbind("tabsshow",h);this.anchors.unbind(c.event+".tabs",e);delete this._rotate;delete this._unrotate}return this}})})(jQuery);
+;/*
+ * jQuery UI Datepicker 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Datepicker
+ *
+ * Depends:
+ * jquery.ui.core.js
+ */
+(function(d,C){function M(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass=
+"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su",
+"Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",
+minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=N(d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function N(a){return a.bind("mouseout",function(b){b=
+d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");b.length&&b.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!(d.datepicker._isDisabledDatepicker(J.inline?a.parent()[0]:J.input[0])||!b.length)){b.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");b.addClass("ui-state-hover");
+b.hasClass("ui-datepicker-prev")&&b.addClass("ui-datepicker-prev-hover");b.hasClass("ui-datepicker-next")&&b.addClass("ui-datepicker-next-hover")}})}function H(a,b){d.extend(a,b);for(var c in b)if(b[c]==null||b[c]==C)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.14"}});var A=(new Date).getTime(),J;d.extend(M.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){H(this._defaults,
+a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0,
+selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:N(d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=
+h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&b.append.remove();if(c){b.append=d('<span class="'+this._appendClass+'">'+c+"</span>");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=
+this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(f==""?c:d("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,
+"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;g<f.length;g++)if(f[g].length>h){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",
+function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),true);this._updateDatepicker(b);this._updateAlternate(b);b.dpDiv.show()}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);
+a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}H(a.settings,e||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",
+this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",
+this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span"){b=
+b.children("."+this._inlineClass);b.children().removeClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",
+cursor:"default"})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().addClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return true;return false},
+_getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?d.extend({},d.datepicker._defaults):e?b=="all"?d.extend({},e.settings):this._get(e,b):null;var f=b||{};if(typeof b=="string"){f={};f[b]=c}if(e){this._curInst==e&&this._hideDatepicker();var h=this._getDateDatepicker(a,true),i=this._getMinMaxDate(e,"min"),g=this._getMinMaxDate(e,
+"max");H(e.settings,f);if(i!==null&&f.dateFormat!==C&&f.minDate===C)e.settings.minDate=this._formatDate(e,i);if(g!==null&&f.dateFormat!==C&&f.maxDate===C)e.settings.maxDate=this._formatDate(e,g);this._attachments(d(a),e);this._autoSize(e);this._setDate(e,h);this._updateAlternate(e);this._updateDatepicker(e)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a=this._getInst(a)){this._setDate(a,
+b);this._updateDatepicker(a);this._updateAlternate(a)}},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(a){var b=d.datepicker._getInst(a.target),c=true,e=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=true;if(d.datepicker._datepickerShowing)switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=false;break;case 13:c=d("td."+d.datepicker._dayOverClass+":not(."+d.datepicker._currentClass+")",b.dpDiv);
+c[0]?d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]):d.datepicker._hideDatepicker();return false;case 27:d.datepicker._hideDatepicker();break;case 33:d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey)d.datepicker._clearDate(a.target);
+c=a.ctrlKey||a.metaKey;break;case 36:if(a.ctrlKey||a.metaKey)d.datepicker._gotoToday(a.target);c=a.ctrlKey||a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?+1:-1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 38:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,-7,"D");c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||
+a.metaKey)d.datepicker._adjustDate(a.target,e?-1:+1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 40:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,+7,"D");c=a.ctrlKey||a.metaKey;break;default:c=false}else if(a.keyCode==36&&a.ctrlKey)d.datepicker._showDatepicker(this);else c=false;if(c){a.preventDefault();a.stopPropagation()}},_doKeyPress:function(a){var b=
+d.datepicker._getInst(a.target);if(d.datepicker._get(b,"constrainInput")){b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat"));var c=String.fromCharCode(a.charCode==C?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||c<" "||!b||b.indexOf(c)>-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);
+d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);if(d.datepicker._curInst&&d.datepicker._curInst!=b){d.datepicker._datepickerShowing&&d.datepicker._triggerOnClose(d.datepicker._curInst);d.datepicker._curInst.dpDiv.stop(true,true)}var c=
+d.datepicker._get(b,"beforeShow");H(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c=
+{left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){var i=b.dpDiv.find("iframe.ui-datepicker-cover");
+if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.datepicker._datepickerShowing=true;d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){this.maxRows=4;var b=d.datepicker._getBorders(a.dpDiv);
+J=a;a.dpDiv.empty().append(this._generateHTML(a));var c=a.dpDiv.find("iframe.ui-datepicker-cover");c.length&&c.css({left:-b[0],top:-b[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("."+this._dayOverClass+" a").mouseover();b=this._getNumberOfMonths(a);c=b[1];a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");c>1&&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(b[0]!=1||b[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");
+a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var e=a.yearshtml;setTimeout(function(){e===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);e=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||
+c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+
+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_triggerOnClose:function(a){var b=this._get(a,"onClose");if(b)b.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a])},_hideDatepicker:function(a){var b=
+this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();d.datepicker._triggerOnClose(b);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",
+left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&
+d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=
+b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear=false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b=this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear=
+!b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);
+a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));
+d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%
+100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=B+1<a.length&&a.charAt(B+1)==p)&&B++;return p},m=function(p){var D=o(p);p=new RegExp("^\\d{1,"+(p=="@"?14:p=="!"?20:p=="y"&&D?4:p=="o"?3:2)+"}");p=b.substring(q).match(p);if(!p)throw"Missing number at position "+q;q+=
+p[0].length;return parseInt(p[0],10)},n=function(p,D,K){p=d.map(o(p)?K:D,function(w,x){return[[x,w]]}).sort(function(w,x){return-(w[1].length-x[1].length)});var E=-1;d.each(p,function(w,x){w=x[1];if(b.substr(q,w.length).toLowerCase()==w.toLowerCase()){E=x[0];q+=w.length;return false}});if(E!=-1)return E+1;else throw"Unknown name at position "+q;},s=function(){if(b.charAt(q)!=a.charAt(B))throw"Unexpected literal at position "+q;q++},q=0,B=0;B<a.length;B++)if(k)if(a.charAt(B)=="'"&&!o("'"))k=false;
+else s();else switch(a.charAt(B)){case "d":l=m("d");break;case "D":n("D",f,h);break;case "o":u=m("o");break;case "m":j=m("m");break;case "M":j=n("M",i,g);break;case "y":c=m("y");break;case "@":var v=new Date(m("@"));c=v.getFullYear();j=v.getMonth()+1;l=v.getDate();break;case "!":v=new Date((m("!")-this._ticksTo1970)/1E4);c=v.getFullYear();j=v.getMonth()+1;l=v.getDate();break;case "'":if(o("'"))s();else k=true;break;default:s()}if(q<b.length)throw"Extra/unparsed characters found in date: "+b.substring(q);
+if(c==-1)c=(new Date).getFullYear();else if(c<100)c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=e?0:-100);if(u>-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,j-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=j||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",
+TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=k+1<a.length&&a.charAt(k+1)==o)&&k++;return o},g=function(o,m,n){m=""+m;if(i(o))for(;m.length<
+n;)m="0"+m;return m},j=function(o,m,n,s){return i(o)?s[m]:n[m]},l="",u=false;if(b)for(var k=0;k<a.length;k++)if(u)if(a.charAt(k)=="'"&&!i("'"))u=false;else l+=a.charAt(k);else switch(a.charAt(k)){case "d":l+=g("d",b.getDate(),2);break;case "D":l+=j("D",b.getDay(),e,f);break;case "o":l+=g("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864E5),3);break;case "m":l+=g("m",b.getMonth()+1,2);break;case "M":l+=j("M",b.getMonth(),h,
+c);break;case "y":l+=i("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case "@":l+=b.getTime();break;case "!":l+=b.getTime()*1E4+this._ticksTo1970;break;case "'":if(i("'"))l+="'";else u=true;break;default:l+=a.charAt(k)}return l},_possibleChars:function(a){for(var b="",c=false,e=function(h){(h=f+1<a.length&&a.charAt(f+1)==h)&&f++;return h},f=0;f<a.length;f++)if(c)if(a.charAt(f)=="'"&&!e("'"))c=false;else b+=a.charAt(f);else switch(a.charAt(f)){case "d":case "m":case "y":case "@":b+=
+"0123456789";break;case "D":case "M":return null;case "'":if(e("'"))b+="'";else c=true;break;default:b+=a.charAt(f)}return b},_get:function(a,b){return a.settings[b]!==C?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),e=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a);var i=this._getFormatConfig(a);try{f=this.parseDate(c,e,i)||h}catch(g){this.log(g);e=b?"":e}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=
+f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=e?f.getDate():0;a.currentMonth=e?f.getMonth():0;a.currentYear=e?f.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var e=function(h){var i=new Date;i.setDate(i.getDate()+h);return i},f=function(h){try{return d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),h,d.datepicker._getFormatConfig(a))}catch(i){}var g=
+(h.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,j=g.getFullYear(),l=g.getMonth();g=g.getDate();for(var u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,k=u.exec(h);k;){switch(k[2]||"d"){case "d":case "D":g+=parseInt(k[1],10);break;case "w":case "W":g+=parseInt(k[1],10)*7;break;case "m":case "M":l+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break;case "y":case "Y":j+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break}k=u.exec(h)}return new Date(j,
+l,g)};if(b=(b=b==null||b===""?c:typeof b=="string"?f(b):typeof b=="number"?isNaN(b)?c:e(b):new Date(b.getTime()))&&b.toString()=="Invalid Date"?c:b){b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0)}return this._daylightSavingAdjust(b)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=
+a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),
+b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=
+this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&n<k?k:n;this._daylightSavingAdjust(new Date(m,g,1))>n;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+A+".datepicker._adjustDate('#"+a.id+"', -"+j+", 'M');\" title=\""+n+'"><span class="ui-icon ui-icon-circle-triangle-'+
+(c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>";var s=this._get(a,"nextText");s=!h?s:this.formatDate(s,this._daylightSavingAdjust(new Date(m,g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+A+".datepicker._adjustDate('#"+a.id+"', +"+j+", 'M');\" title=\""+s+'"><span class="ui-icon ui-icon-circle-triangle-'+
+(c?"w":"e")+'">'+s+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>";j=this._get(a,"currentText");s=this._get(a,"gotoCurrent")&&a.currentDay?u:b;j=!h?j:this.formatDate(j,s,this._getFormatConfig(a));h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+A+'.datepicker._hideDatepicker();">'+this._get(a,
+"closeText")+"</button>":"";e=e?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,s)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+A+".datepicker._gotoToday('#"+a.id+"');\">"+j+"</button>":"")+(c?"":h)+"</div>":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");s=this._get(a,"dayNames");this._get(a,"dayNamesShort");var q=this._get(a,"dayNamesMin"),B=
+this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),D=this._get(a,"showOtherMonths"),K=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var E=this._getDefaultDate(a),w="",x=0;x<i[0];x++){var O="";this.maxRows=4;for(var G=0;G<i[1];G++){var P=this._daylightSavingAdjust(new Date(m,g,a.selectedDay)),t=" ui-corner-all",y="";if(l){y+='<div class="ui-datepicker-group';if(i[1]>1)switch(G){case 0:y+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":
+"left");break;case i[1]-1:y+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:y+=" ui-datepicker-group-middle";t="";break}y+='">'}y+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&&x==0?c?f:n:"")+(/all|right/.test(t)&&x==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,x>0||G>0,B,v)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var z=j?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":
+"";for(t=0;t<7;t++){var r=(t+h)%7;z+="<th"+((t+h+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+s[r]+'">'+q[r]+"</span></th>"}y+=z+"</tr></thead><tbody>";z=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,z);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;z=Math.ceil((t+z)/7);this.maxRows=z=l?this.maxRows>z?this.maxRows:z:z;r=this._daylightSavingAdjust(new Date(m,g,1-t));for(var Q=0;Q<z;Q++){y+="<tr>";var R=!j?"":'<td class="ui-datepicker-week-col">'+
+this._get(a,"calculateWeek")(r)+"</td>";for(t=0;t<7;t++){var I=p?p.apply(a.input?a.input[0]:null,[r]):[true,""],F=r.getMonth()!=g,L=F&&!K||!I[0]||k&&r<k||o&&r>o;R+='<td class="'+((t+h+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(r.getTime()==P.getTime()&&g==a.selectedMonth&&a._keyEvent||E.getTime()==r.getTime()&&E.getTime()==P.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!D?"":" "+I[1]+(r.getTime()==u.getTime()?" "+
+this._currentClass:"")+(r.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!F||D)&&I[2]?' title="'+I[2]+'"':"")+(L?"":' onclick="DP_jQuery_'+A+".datepicker._selectDay('#"+a.id+"',"+r.getMonth()+","+r.getFullYear()+', this);return false;"')+">"+(F&&!D?"&#xa0;":L?'<span class="ui-state-default">'+r.getDate()+"</span>":'<a class="ui-state-default'+(r.getTime()==b.getTime()?" ui-state-highlight":"")+(r.getTime()==u.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+'" href="#">'+
+r.getDate()+"</a>")+"</td>";r.setDate(r.getDate()+1);r=this._daylightSavingAdjust(r)}y+=R+"</tr>"}g++;if(g>11){g=0;m++}y+="</tbody></table>"+(l?"</div>"+(i[0]>0&&G==i[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");O+=y}w+=O}w+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");a._keyEvent=false;return w},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),
+l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='<div class="ui-datepicker-title">',o="";if(h||!j)o+='<span class="ui-datepicker-month">'+i[b]+"</span>";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+A+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" onclick=\"DP_jQuery_"+A+".datepicker._clickMonthYear('#"+a.id+"');\">";for(var n=0;n<12;n++)if((!i||n>=e.getMonth())&&(!m||n<=f.getMonth()))o+='<option value="'+
+n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</option>";o+="</select>"}u||(k+=o+(h||!(j&&l)?"&#xa0;":""));if(!a.yearshtml){a.yearshtml="";if(h||!l)k+='<span class="ui-datepicker-year">'+c+"</span>";else{g=this._get(a,"yearRange").split(":");var s=(new Date).getFullYear();i=function(q){q=q.match(/c[+-].*/)?c+parseInt(q.substring(1),10):q.match(/[+-].*/)?s+parseInt(q,10):parseInt(q,10);return isNaN(q)?s:q};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):
+g;for(a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+A+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" onclick=\"DP_jQuery_"+A+".datepicker._clickMonthYear('#"+a.id+"');\">";b<=g;b++)a.yearshtml+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>";a.yearshtml+="</select>";k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?"&#xa0;":"")+o;k+="</div>";return k},_adjustInstDate:function(a,b,c){var e=a.drawYear+(c==
+"Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return b=a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");
+if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);
+c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,
+"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=
+function(a){if(!this.length)return this;if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,
+[this[0]].concat(b));return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new M;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.14";window["DP_jQuery_"+A]=d})(jQuery);
+;/*
+ * jQuery UI Progressbar 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Progressbar
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ */
+(function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");
+this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*
+this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.14"})})(jQuery);
+;/*
+ * jQuery UI Effects 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/
+ */
+jQuery.effects||function(f,j){function m(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1],
+16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return n.transparent;return n[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return m(b)}function o(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,
+a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function p(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d=
+a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function l(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor",
+"borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=m(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var n={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,
+0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,
+211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},q=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b,
+d){if(f.isFunction(b)){d=b;b=null}return this.queue(function(){var e=f(this),g=e.attr("style")||" ",h=p(o.call(this)),r,v=e.attr("class");f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});r=p(o.call(this));e.attr("class",v);e.animate(u(h,r),{queue:false,duration:a,easing:b,complete:function(){f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments);f.dequeue(this)}})})};
+f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,
+[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.14",save:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.data("ec.storage."+a[b],c[0].style[a[b]])},restore:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))},setMode:function(c,a){if(a=="toggle")a=c.is(":hidden")?"show":"hide";return a},getBaseline:function(c,a){var b;switch(c[0]){case "top":b=
+0;break;case "middle":b=0.5;break;case "bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case "left":c=0;break;case "center":c=0.5;break;case "right":c=1;break;default:c=c[1]/a.width}return{x:c,y:b}},createWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent();var a={width:c.outerWidth(true),height:c.outerHeight(true),"float":c.css("float")},b=f("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});
+c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c);return c},setTransition:function(c,
+a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)});return d.call(this,b)},_show:f.fn.show,show:function(c){if(l(c))return this._show.apply(this,arguments);else{var a=k.apply(this,arguments);
+a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(l(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(l(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%",
+"pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*
+((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=
+e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=
+e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/
+h);return-(h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g))+b},easeOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*a)*Math.sin((a*e-c)*2*Math.PI/g)+d+b},easeInOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e/2)==2)return b+d;g||(g=e*0.3*1.5);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);if(a<1)return-0.5*
+h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)+b;return h*Math.pow(2,-10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)*0.5+d+b},easeInBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*(a/=e)*a*((g+1)*a-g)+b},easeOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*((a=a/e-1)*a*((g+1)*a+g)+1)+b},easeInOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;if((a/=e/2)<1)return d/2*a*a*(((g*=1.525)+1)*a-g)+b;return d/2*((a-=2)*a*(((g*=1.525)+1)*a+g)+2)+b},easeInBounce:function(c,a,b,d,e){return d-f.easing.easeOutBounce(c,
+e-a,0,d,e)+b},easeOutBounce:function(c,a,b,d,e){return(a/=e)<1/2.75?d*7.5625*a*a+b:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?d*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},easeInOutBounce:function(c,a,b,d,e){if(a<e/2)return f.easing.easeInBounce(c,a*2,0,d,e)*0.5+b;return f.easing.easeOutBounce(c,a*2-e,0,d,e)*0.5+d*0.5+b}})}(jQuery);
+;/*
+ * jQuery UI Effects Blind 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Blind
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(b){b.effects.blind=function(c){return this.queue(function(){var a=b(this),g=["position","top","bottom","left","right"],f=b.effects.setMode(a,c.options.mode||"hide"),d=c.options.direction||"vertical";b.effects.save(a,g);a.show();var e=b.effects.createWrapper(a).css({overflow:"hidden"}),h=d=="vertical"?"height":"width";d=d=="vertical"?e.height():e.width();f=="show"&&e.css(h,0);var i={};i[h]=f=="show"?d:0;e.animate(i,c.duration,c.options.easing,function(){f=="hide"&&a.hide();b.effects.restore(a,
+g);b.effects.removeWrapper(a);c.callback&&c.callback.apply(a[0],arguments);a.dequeue()})})}})(jQuery);
+;/*
+ * jQuery UI Effects Bounce 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Bounce
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(e){e.effects.bounce=function(b){return this.queue(function(){var a=e(this),l=["position","top","bottom","left","right"],h=e.effects.setMode(a,b.options.mode||"effect"),d=b.options.direction||"up",c=b.options.distance||20,m=b.options.times||5,i=b.duration||250;/show|hide/.test(h)&&l.push("opacity");e.effects.save(a,l);a.show();e.effects.createWrapper(a);var f=d=="up"||d=="down"?"top":"left";d=d=="up"||d=="left"?"pos":"neg";c=b.options.distance||(f=="top"?a.outerHeight({margin:true})/3:a.outerWidth({margin:true})/
+3);if(h=="show")a.css("opacity",0).css(f,d=="pos"?-c:c);if(h=="hide")c/=m*2;h!="hide"&&m--;if(h=="show"){var g={opacity:1};g[f]=(d=="pos"?"+=":"-=")+c;a.animate(g,i/2,b.options.easing);c/=2;m--}for(g=0;g<m;g++){var j={},k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing);c=h=="hide"?c*2:c/2}if(h=="hide"){g={opacity:0};g[f]=(d=="pos"?"-=":"+=")+c;a.animate(g,i/2,b.options.easing,function(){a.hide();e.effects.restore(a,l);e.effects.removeWrapper(a);
+b.callback&&b.callback.apply(this,arguments)})}else{j={};k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing,function(){e.effects.restore(a,l);e.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments)})}a.queue("fx",function(){a.dequeue()});a.dequeue()})}})(jQuery);
+;/*
+ * jQuery UI Effects Clip 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Clip
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(b){b.effects.clip=function(e){return this.queue(function(){var a=b(this),i=["position","top","bottom","left","right","height","width"],f=b.effects.setMode(a,e.options.mode||"hide"),c=e.options.direction||"vertical";b.effects.save(a,i);a.show();var d=b.effects.createWrapper(a).css({overflow:"hidden"});d=a[0].tagName=="IMG"?d:a;var g={size:c=="vertical"?"height":"width",position:c=="vertical"?"top":"left"};c=c=="vertical"?d.height():d.width();if(f=="show"){d.css(g.size,0);d.css(g.position,
+c/2)}var h={};h[g.size]=f=="show"?c:0;h[g.position]=f=="show"?0:c/2;d.animate(h,{queue:false,duration:e.duration,easing:e.options.easing,complete:function(){f=="hide"&&a.hide();b.effects.restore(a,i);b.effects.removeWrapper(a);e.callback&&e.callback.apply(a[0],arguments);a.dequeue()}})})}})(jQuery);
+;/*
+ * jQuery UI Effects Drop 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Drop
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(c){c.effects.drop=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right","opacity"],e=c.effects.setMode(a,d.options.mode||"hide"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a);var f=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var g=d.options.distance||(f=="top"?a.outerHeight({margin:true})/2:a.outerWidth({margin:true})/2);if(e=="show")a.css("opacity",0).css(f,b=="pos"?-g:g);var i={opacity:e==
+"show"?1:0};i[f]=(e=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+g;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){e=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
+;/*
+ * jQuery UI Effects Explode 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Explode
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(j){j.effects.explode=function(a){return this.queue(function(){var c=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3,d=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3;a.options.mode=a.options.mode=="toggle"?j(this).is(":visible")?"hide":"show":a.options.mode;var b=j(this).show().css("visibility","hidden"),g=b.offset();g.top-=parseInt(b.css("marginTop"),10)||0;g.left-=parseInt(b.css("marginLeft"),10)||0;for(var h=b.outerWidth(true),i=b.outerHeight(true),e=0;e<c;e++)for(var f=
+0;f<d;f++)b.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+
+e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery);
+;/*
+ * jQuery UI Effects Fade 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Fade
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);
+;/*
+ * jQuery UI Effects Fold 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Fold
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","bottom","left","right"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1],
+10)/100*f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery);
+;/*
+ * jQuery UI Effects Highlight 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Highlight
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&&
+this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
+;/*
+ * jQuery UI Effects Pulsate 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Pulsate
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c<times;c++){b.animate({opacity:animateTo},duration,a.options.easing);animateTo=(animateTo+1)%2}b.animate({opacity:animateTo},duration,
+a.options.easing,function(){animateTo==0&&b.hide();a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()}).dequeue()})}})(jQuery);
+;/*
+ * jQuery UI Effects Scale 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Scale
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(c){c.effects.puff=function(b){return this.queue(function(){var a=c(this),e=c.effects.setMode(a,b.options.mode||"hide"),g=parseInt(b.options.percent,10)||150,h=g/100,i={height:a.height(),width:a.width()};c.extend(b.options,{fade:true,mode:e,percent:e=="hide"?g:100,from:e=="hide"?i:{height:i.height*h,width:i.width*h}});a.effect("scale",b.options,b.duration,b.callback);a.dequeue()})};c.effects.scale=function(b){return this.queue(function(){var a=c(this),e=c.extend(true,{},b.options),g=c.effects.setMode(a,
+b.options.mode||"effect"),h=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:g=="hide"?0:100),i=b.options.direction||"both",f=b.options.origin;if(g!="effect"){e.origin=f||["middle","center"];e.restore=true}f={height:a.height(),width:a.width()};a.from=b.options.from||(g=="show"?{height:0,width:0}:f);h={y:i!="horizontal"?h/100:1,x:i!="vertical"?h/100:1};a.to={height:f.height*h.y,width:f.width*h.x};if(b.options.fade){if(g=="show"){a.from.opacity=0;a.to.opacity=1}if(g=="hide"){a.from.opacity=
+1;a.to.opacity=0}}e.from=a.from;e.to=a.to;e.mode=g;a.effect("size",e,b.duration,b.callback);a.dequeue()})};c.effects.size=function(b){return this.queue(function(){var a=c(this),e=["position","top","bottom","left","right","width","height","overflow","opacity"],g=["position","top","bottom","left","right","overflow","opacity"],h=["width","height","overflow"],i=["fontSize"],f=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],k=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],
+p=c.effects.setMode(a,b.options.mode||"effect"),n=b.options.restore||false,m=b.options.scale||"both",l=b.options.origin,j={height:a.height(),width:a.width()};a.from=b.options.from||j;a.to=b.options.to||j;if(l){l=c.effects.getBaseline(l,j);a.from.top=(j.height-a.from.height)*l.y;a.from.left=(j.width-a.from.width)*l.x;a.to.top=(j.height-a.to.height)*l.y;a.to.left=(j.width-a.to.width)*l.x}var d={from:{y:a.from.height/j.height,x:a.from.width/j.width},to:{y:a.to.height/j.height,x:a.to.width/j.width}};
+if(m=="box"||m=="both"){if(d.from.y!=d.to.y){e=e.concat(f);a.from=c.effects.setTransition(a,f,d.from.y,a.from);a.to=c.effects.setTransition(a,f,d.to.y,a.to)}if(d.from.x!=d.to.x){e=e.concat(k);a.from=c.effects.setTransition(a,k,d.from.x,a.from);a.to=c.effects.setTransition(a,k,d.to.x,a.to)}}if(m=="content"||m=="both")if(d.from.y!=d.to.y){e=e.concat(i);a.from=c.effects.setTransition(a,i,d.from.y,a.from);a.to=c.effects.setTransition(a,i,d.to.y,a.to)}c.effects.save(a,n?e:g);a.show();c.effects.createWrapper(a);
+a.css("overflow","hidden").css(a.from);if(m=="content"||m=="both"){f=f.concat(["marginTop","marginBottom"]).concat(i);k=k.concat(["marginLeft","marginRight"]);h=e.concat(f).concat(k);a.find("*[width]").each(function(){child=c(this);n&&c.effects.save(child,h);var o={height:child.height(),width:child.width()};child.from={height:o.height*d.from.y,width:o.width*d.from.x};child.to={height:o.height*d.to.y,width:o.width*d.to.x};if(d.from.y!=d.to.y){child.from=c.effects.setTransition(child,f,d.from.y,child.from);
+child.to=c.effects.setTransition(child,f,d.to.y,child.to)}if(d.from.x!=d.to.x){child.from=c.effects.setTransition(child,k,d.from.x,child.from);child.to=c.effects.setTransition(child,k,d.to.x,child.to)}child.css(child.from);child.animate(child.to,b.duration,b.options.easing,function(){n&&c.effects.restore(child,h)})})}a.animate(a.to,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){a.to.opacity===0&&a.css("opacity",a.from.opacity);p=="hide"&&a.hide();c.effects.restore(a,
+n?e:g);c.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
+;/*
+ * jQuery UI Effects Shake 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Shake
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(d){d.effects.shake=function(a){return this.queue(function(){var b=d(this),j=["position","top","bottom","left","right"];d.effects.setMode(b,a.options.mode||"effect");var c=a.options.direction||"left",e=a.options.distance||20,l=a.options.times||3,f=a.duration||a.options.duration||140;d.effects.save(b,j);b.show();d.effects.createWrapper(b);var g=c=="up"||c=="down"?"top":"left",h=c=="up"||c=="left"?"pos":"neg";c={};var i={},k={};c[g]=(h=="pos"?"-=":"+=")+e;i[g]=(h=="pos"?"+=":"-=")+e*2;k[g]=
+(h=="pos"?"-=":"+=")+e*2;b.animate(c,f,a.options.easing);for(e=1;e<l;e++)b.animate(i,f,a.options.easing).animate(k,f,a.options.easing);b.animate(i,f,a.options.easing).animate(c,f/2,a.options.easing,function(){d.effects.restore(b,j);d.effects.removeWrapper(b);a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()});b.dequeue()})}})(jQuery);
+;/*
+ * jQuery UI Effects Slide 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Slide
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(c){c.effects.slide=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right"],f=c.effects.setMode(a,d.options.mode||"show"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a).css({overflow:"hidden"});var g=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var e=d.options.distance||(g=="top"?a.outerHeight({margin:true}):a.outerWidth({margin:true}));if(f=="show")a.css(g,b=="pos"?isNaN(e)?"-"+e:-e:e);
+var i={};i[g]=(f=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+e;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){f=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
+;/*
+ * jQuery UI Effects Transfer 1.8.14
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Transfer
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(e){e.effects.transfer=function(a){return this.queue(function(){var b=e(this),c=e(a.options.to),d=c.offset();c={top:d.top,left:d.left,height:c.innerHeight(),width:c.innerWidth()};d=b.offset();var f=e('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments);
+b.dequeue()})})}})(jQuery);
+; \ No newline at end of file
diff --git a/user_guide_src/source/_themes/eldocs/static/jquery.js b/user_guide_src/source/_themes/eldocs/static/jquery.js
new file mode 100644
index 000000000..8cdc80eb8
--- /dev/null
+++ b/user_guide_src/source/_themes/eldocs/static/jquery.js
@@ -0,0 +1,18 @@
+/*!
+ * jQuery JavaScript Library v1.6.2
+ * http://jquery.com/
+ *
+ * Copyright 2011, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Thu Jun 30 14:16:56 2011 -0400
+ */
+(function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cr(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cq(){cn=b}function cp(){setTimeout(cq,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function bZ(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bY(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bC.test(a)?d(a,e):bY(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)bY(a+"["+e+"]",b[e],c,d);else d(a,b)}function bX(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bR,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bX(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bX(a,c,d,e,"*",g));return l}function bW(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bN),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bA(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bv:bw;if(d>0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bx(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bk)}function bk(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bj(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bi(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bh(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function bg(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function W(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(R.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(a,b){return(a&&a!=="*"?a+".":"")+b.replace(z,"`").replace(A,"&")}function M(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;i<s.length;i++)g=s[i],g.origType.replace(x,"")===a.type?q.push(g.selector):s.splice(i--,1);e=f(a.target).closest(q,a.currentTarget);for(j=0,k=e.length;j<k;j++){m=e[j];for(i=0;i<s.length;i++){g=s[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,d=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,d=f(a.relatedTarget).closest(g.selector)[0],d&&f.contains(h,d)&&(d=h);(!d||d!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){e=p[j];if(c&&e.level>c)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function K(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function E(){return!0}function D(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z])/ig,x=function(a,b){return b.toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!A){A=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||D.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b){if(H)return H.call(b,a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;f.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=f.type(i),j==="array"?e.done.apply(e,i):j==="function"&&a.push(i);k&&e.resolveWith(k[0],k[1])}return this},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(e,f)}finally{b=[e,f],c=0}}return this},resolve:function(){e.resolveWith(this,arguments);return this},isResolved:function(){return!!c||!!b},cancel:function(){d=1,a=[];return this}};return e},Deferred:function(a){var b=f._Deferred(),c=f._Deferred(),d;f.extend(b,{then:function(a,c){b.done(a).fail(c);return this},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments)},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[c,"reject"]},function(a,c){var e=c[0],g=c[1],h;f.isFunction(e)?b[a](function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g](h)}):b[a](d[g])})}).promise()},promise:function(a){if(a==null){if(d)return d;d=a={}}var c=g.length;while(c--)a[g[c]]=b[g[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c<d;c++)b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e;e||g.resolveWith(g,b)}else g!==a&&g.resolveWith(g,d?[a]:[]);return g.promise()}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;a.setAttribute("className","t"),a.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0},m&&f.extend(p,{position:"absolute",left:-1e3,top:-1e3});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]||i[c]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h<i;h++)g=e[h].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]))}}return d}if(typeof a=="object")return this.each(function(){f.data(this,a)});var j=a.split(".");j[1]=j[1]?"."+j[1]:"";if(c===b){d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d));return d===b&&j[1]?this.data(j[0]):d}return this.each(function(){var b=f(this),d=[j[0],c];b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0))},_unmark:function(a,c,d){a!==!0&&(d=c,c=a,a=!1);if(c){d=d||"fx";var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"))}},queue:function(a,c,d){if(a){c=(c||"fx")+"queue";var e=f.data(a,c,b,!0);d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d));return e||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e;d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){f.dequeue(a,b)})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){f.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f._Deferred(),!0))h++,l.done(m);m();return d.promise()}});var n=/[\n\t\r]/g,o=/\s+/,p=/\r/g,q=/^(?:button|input)$/i,r=/^(?:button|input|object|select|textarea)$/i,s=/^a(?:rea)?$/i,t=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,u=/\:|^on/,v,w;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(o);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(o);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(n," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(o);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(n," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h<i;h++){var j=e[h];if(j.selected&&(f.support.optDisabled?!j.disabled:j.getAttribute("disabled")===null)&&(!j.parentNode.disabled||!f.nodeName(j.parentNode,"optgroup"))){b=f(j).val();if(g)return b;d.push(b)}}if(g&&!d.length&&e.length)return f(e[c]).val();return d},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=w:v&&c!=="className"&&(f.nodeName(a,"form")||u.test(c))&&(i=v)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}},value:{get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return f.prop(a,c)?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.attrHooks.title=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=/\.(.*)$/,y=/^(?:textarea|input|select)$/i,z=/\./g,A=/ /g,B=/[^\w\s.|`]/g,C=function(a){return a.replace(B,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=D;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=D);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),C).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))f.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=f.event.special[h]||{};for(j=e||0;j<p.length;j++){q=p[j];if(d.guid===q.guid){if(l||n.test(q.namespace))e==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(e!=null)break}}if(p.length===0||e!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&f.removeEvent(a,h,s.handle),g=null,delete t[h]}if(f.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0)}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.
+shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h<i;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando])return a;var d=a;a=f.Event(d);for(var e=this.props.length,g;e;)g=this.props[--e],a[g]=d[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,N(a.origType,a.selector),f.extend({},a,{handler:M,guid:a.handler.guid}))},remove:function(a){f.event.remove(this,N(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!this.preventDefault)return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?E:D):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=E;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=E;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=E,this.stopPropagation()},isDefaultPrevented:D,isPropagationStopped:D,isImmediatePropagationStopped:D};var F=function(a){var b=a.relatedTarget,c=!1,d=a.type;a.type=a.data,b!==this&&(b&&(c=f.contains(this,b)),c||(f.event.handle.apply(this,arguments),a.type=d))},G=function(a){a.type=a.data,f.event.handle.apply(this,arguments)};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?G:F,a)},teardown:function(a){f.event.remove(this,b,a&&a.selector?G:F)}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form"))f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&f(b).closest("form").length&&K("submit",this,arguments)}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&K("submit",this,arguments)});else return!1},teardown:function(a){f.event.remove(this,".specialSubmit")}});if(!f.support.changeBubbles){var H,I=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},J=function(c){var d=c.target,e,g;if(!!y.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=I(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:J,beforedeactivate:J,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&J.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&J.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",I(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in H)f.event.add(this,c+".specialChange",H[c]);return y.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return y.test(this.nodeName)}},H=f.event.special.change.filters,H.focus=H.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i<j;i++)f.event.add(this[i],a,g,d);return this}}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault)for(var c in a)this.unbind(c,a[c]);else for(var d=0,e=this.length;d<e;d++)f.event.remove(this[d],a,b);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var L={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a)n[c](o,d,a[o],m);return this}if(c==="die"&&!a&&g&&g.charAt(0)==="."){n.unbind(g);return this}if(d===!1||f.isFunction(d))e=d||D,d=b;a=(a||"").split(" ");while((h=a[i++])!=null){j=x.exec(h),k="",j&&(k=j[0],h=h.replace(x,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,L[h]?(a.push(L[h]+k),h=h+k):h=(L[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)f.event.add(n[p],"live."+N(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l});else n.unbind("live."+N(h,m),e)}return this}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f)g=o=!0;else if(f===!0)continue}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)},"~":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c<f;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){if(a===b){g=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains}();var O=/Until$/,P=/^(?:parents|prevUntil|prevAll)/,Q=/,/,R=/^.[^:#\[\.,]*$/,S=Array.prototype.slice,T=f.expr.match.POS,U={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(W(this,a,!1),"not",a)},filter:function(a){return this.pushStack(W(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d<e;d++)i=a[d],j[i]||(j[i]=T.test(i)?f(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=T.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(l?l.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var X=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,$=/<([\w:]+)/,_=/<tbody/i,ba=/<|&#?\w+;/,bb=/<(?:script|object|embed|option|style)/i,bc=/checked\s*(?:[^=]|=\s*.checked.)/i,bd=/\/(java|ecma)script/i,be=/^\s*<!(?:\[CDATA\[|\-\-)/,bf={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(X,""):null;if(typeof a=="string"&&!bb.test(a)&&(f.support.leadingWhitespace||!Y.test(a))&&!bf[($.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Z,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bc.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bg(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bm)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i;b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!bb.test(a[0])&&(f.support.checkClone||!bc.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j
+)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++h)bi(e[h],g[h])}if(b){bh(a,d);if(c){e=bj(a),g=bj(d);for(h=0;e[h];++h)bh(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!ba.test(k))k=b.createTextNode(k);else{k=k.replace(Z,"<$1></$2>");var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=_.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bl(k[i]);else bl(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||bd.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()])continue;c=j[f.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var k in b.events)g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]}}}});var bn=/alpha\([^)]*\)/i,bo=/opacity=([^)]*)/,bp=/([A-Z]|^ms)/g,bq=/^-?\d+(?:px)?$/i,br=/^-?\d/,bs=/^[+\-]=/,bt=/[^+\-\.\de]+/g,bu={position:"absolute",visibility:"hidden",display:"block"},bv=["Left","Right"],bw=["Top","Bottom"],bx,by,bz;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bx(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d;if(h==="number"&&isNaN(d)||d==null)return;h==="string"&&bs.test(d)&&(d=+d.replace(bt,"")+parseFloat(f.css(a,c)),h="number"),h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bx)return bx(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bA(a,b,d);f.swap(a,bu,function(){e=bA(a,b,d)});return e}},set:function(a,b){if(!bq.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bo.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bn.test(g)?g.replace(bn,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bx(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;c=c.replace(bp,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bq.test(d)&&br.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bx=by||bz,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bB=/%20/g,bC=/\[\]$/,bD=/\r?\n/g,bE=/#.*$/,bF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bG=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bH=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bI=/^(?:GET|HEAD)$/,bJ=/^\/\//,bK=/\?/,bL=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bM=/^(?:select|textarea)/i,bN=/\s+/,bO=/([?&])_=[^&]*/,bP=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bQ=f.fn.load,bR={},bS={},bT,bU;try{bT=e.href}catch(bV){bT=c.createElement("a"),bT.href="",bT=bT.href}bU=bP.exec(bT.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bQ)return bQ.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bL,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bM.test(this.nodeName)||bG.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bD,"\r\n")}}):{name:b.name,value:c.replace(bD,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bT,isLocal:bH.test(bU[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bW(bR),ajaxTransport:bW(bS),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?bZ(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=b$(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bF.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bE,"").replace(bJ,bU[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bN),d.crossDomain==null&&(r=bP.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bU[1]&&r[2]==bU[2]&&(r[3]||(r[1]==="http:"?80:443))==(bU[3]||(bU[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bX(bR,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bI.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bK.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bO,"$1_="+x);d.url=y+(y===d.url?(bK.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bX(bS,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bB,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn,co=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cr("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cs(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cr("hide",3),a,b,c);for(var d=0,e=this.length;d<e;d++)if(this[d].style){var g=f.css(this[d],"display");g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g)}for(d=0;d<e;d++)this[d].style&&(this[d].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cr("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(f.support.inlineBlockNeedsLayout?(j=cs(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)k=new f.fx(this,b,i),h=a[i],cj.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=ck.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""));return!0})},stop:function(a,b){a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;b||f._unmark(!0,this);while(c--)a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))}),b||this.dequeue();return this}}),f.each({slideDown:cr("show",1),slideUp:cr("hide",1),slideToggle:cr("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function h(a){return d.step(a)}var d=this,e=f.fx,g;this.startTime=cn||cp(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,h.elem=this.elem,h()&&f.timers.push(h)&&!cl&&(co?(cl=!0,g=function(){cl&&(co(g),e.tick())},co(g)):cl=setInterval(e.tick,e.interval))},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=cn||cp(),c=!0,d=this.elem,e=this.options,g,h;if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b<a.length;++b)a[b]()||a.splice(b--,1);a.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cl),cl=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var ct=/^t(?:able|d|h)$/i,cu=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cv(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);f.offset.initialize();var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!ct.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cu.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cu.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cv(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cv(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file
diff --git a/user_guide_src/source/_themes/eldocs/static/pygments.css b/user_guide_src/source/_themes/eldocs/static/pygments.css
new file mode 100644
index 000000000..99f6a8540
--- /dev/null
+++ b/user_guide_src/source/_themes/eldocs/static/pygments.css
@@ -0,0 +1,60 @@
+.highlight .hll { background-color: #ffffcc }
+.highlight { background: inherit; }
+.highlight .c { color: #999988; font-style: italic } /* Comment */
+.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
+.highlight .k { font-weight: bold } /* Keyword */
+.highlight .o { font-weight: bold } /* Operator */
+.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
+.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
+.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
+.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
+.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
+.highlight .ge { font-style: italic } /* Generic.Emph */
+.highlight .gr { color: #aa0000 } /* Generic.Error */
+.highlight .gh { color: #999999 } /* Generic.Heading */
+.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
+.highlight .go { color: #888888 } /* Generic.Output */
+.highlight .gp { color: #555555 } /* Generic.Prompt */
+.highlight .gs { font-weight: bold } /* Generic.Strong */
+.highlight .gu { color: #aaaaaa } /* Generic.Subheading */
+.highlight .gt { color: #aa0000 } /* Generic.Traceback */
+.highlight .kc { font-weight: bold } /* Keyword.Constant */
+.highlight .kd { font-weight: bold } /* Keyword.Declaration */
+.highlight .kn { font-weight: bold } /* Keyword.Namespace */
+.highlight .kp { font-weight: bold } /* Keyword.Pseudo */
+.highlight .kr { font-weight: bold } /* Keyword.Reserved */
+.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
+.highlight .m { color: #009999 } /* Literal.Number */
+.highlight .s { color: #bb8844 } /* Literal.String */
+.highlight .na { color: #008080 } /* Name.Attribute */
+.highlight .nb { color: #999999 } /* Name.Builtin */
+.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
+.highlight .no { color: #008080 } /* Name.Constant */
+.highlight .ni { color: #800080 } /* Name.Entity */
+.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
+.highlight .nf { color: #000080; font-weight: bold } /* Name.Function */
+.highlight .nn { color: #555555 } /* Name.Namespace */
+.highlight .nt { color: #000080 } /* Name.Tag */
+.highlight .nv { color: #008080 } /* Name.Variable */
+.highlight .ow { font-weight: bold } /* Operator.Word */
+.highlight .w { color: #bbbbbb } /* Text.Whitespace */
+.highlight .mf { color: #009999 } /* Literal.Number.Float */
+.highlight .mh { color: #009999 } /* Literal.Number.Hex */
+.highlight .mi { color: #009999 } /* Literal.Number.Integer */
+.highlight .mo { color: #009999 } /* Literal.Number.Oct */
+.highlight .sb { color: #bb8844 } /* Literal.String.Backtick */
+.highlight .sc { color: #bb8844 } /* Literal.String.Char */
+.highlight .sd { color: #bb8844 } /* Literal.String.Doc */
+.highlight .s2 { color: #bb8844 } /* Literal.String.Double */
+.highlight .se { color: #bb8844 } /* Literal.String.Escape */
+.highlight .sh { color: #bb8844 } /* Literal.String.Heredoc */
+.highlight .si { color: #bb8844 } /* Literal.String.Interpol */
+.highlight .sx { color: #bb8844 } /* Literal.String.Other */
+.highlight .sr { color: #808000 } /* Literal.String.Regex */
+.highlight .s1 { color: #bb8844 } /* Literal.String.Single */
+.highlight .ss { color: #bb8844 } /* Literal.String.Symbol */
+.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
+.highlight .vc { color: #008080 } /* Name.Variable.Class */
+.highlight .vg { color: #008080 } /* Name.Variable.Global */
+.highlight .vi { color: #008080 } /* Name.Variable.Instance */
+.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */ \ No newline at end of file
diff --git a/user_guide_src/source/_themes/eldocs/theme.conf b/user_guide_src/source/_themes/eldocs/theme.conf
new file mode 100644
index 000000000..609e74d7c
--- /dev/null
+++ b/user_guide_src/source/_themes/eldocs/theme.conf
@@ -0,0 +1,3 @@
+[theme]
+inherit = basic
+stylesheet = asset/css/common.css \ No newline at end of file
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
new file mode 100644
index 000000000..39f8d3d1b
--- /dev/null
+++ b/user_guide_src/source/changelog.rst
@@ -0,0 +1,2295 @@
+##########
+Change Log
+##########
+
+Version 3.0 (planned)
+=======================
+
+Release Date: Not Released
+
+- License
+
+ - CodeIgniter has been relicensed with the Open Software License (3.0),
+ eliminating its old proprietary licensing.
+
+ - All system files are licensed with OSL 3.0.
+ - Config, error, and sample files shipped in the application folder are
+ licensed with the Academic Free License (3.0) to allow you to retain
+ all licensing authority over your own application code.
+
+- General Changes
+
+ - Added an optional backtrace to php-error template.
+ - Added Android to the list of user agents.
+ - Added Windows 7 to the list of user platforms.
+ - Ability to log certain error types, not all under a threshold.
+ - Added support for pem, p10, p12, p7a, p7c, p7m, p7r, p7s, crt, crl, der, kdb, rsa, cer, sst, csr Certs to mimes.php.
+ - Added support for pgp and gpg to mimes.php.
+ - Added support for 3gp, 3g2, mp4, wmv, f4v, vlc Video files to mimes.php.
+ - Added support for m4a, aac, m4u, xspf, au, ac3, flac, ogg Audio files to mimes.php.
+ - Added support for kmz and kml (Google Earth) files to mimes.php.
+ - Added application/xml for xml and application/xml, text/xsl for xsl in mimes.php.
+ - Changed logger to only chmod when file is first created.
+ - Removed previously deprecated SHA1 Library.
+ - Removed previously deprecated use of ``$autoload['core']`` in application/config/autoload.php.
+ Only entries in ``$autoload['libraries']`` are auto-loaded now.
+
+- Helpers
+
+ - url_title() will now trim extra dashes from beginning and end.
+ - Added XHTML Basic 1.1 doctype to :doc:`HTML Helper <helpers/html_helper>`.
+ - Changed humanize to include a second param for the separator.
+
+- Database
+
+ - Added new :doc:`Active Record <database/active_record>` methods that return
+ the SQL string of queries without executing them: get_compiled_select(),
+ get_compiled_insert(), get_compiled_update(), get_compiled_delete().
+ - Taking care of LIKE condition when used with MySQL UPDATE statement.
+ - Adding $escape parameter to the order_by function, this enables ordering by custom fields.
+ - MySQLi driver now uses mysqli_get_server_info() for server version checking.
+ - MySQLi driver now supports persistent connections when running on PHP >= 5.3.
+ - Added dsn if the group connections in the config use PDO or any driver which need DSN.
+ - Improved PDO database support.
+ - An optional database name parameter was added db_select().
+
+- Libraries
+
+ - Added max_filename_increment config setting for Upload library.
+ - CI_Loader::_ci_autoloader() is now a protected method.
+ - Modified valid_ip() to use PHP's filter_var() when possible (>= PHP 5.2) in the :doc:`Form Validation library <libraries/form_validation>`.
+ - Added custom filename to Email::attach() as $this->email->attach($filename, $disposition, $newname)
+ - Cart library changes include:
+ - It now auto-increments quantity's instead of just resetting it, this is the default behaviour of large e-commerce sites.
+ - Product Name strictness can be disabled via the Cart Library by switching "$product_name_safe"
+ - Added function remove() to remove a cart item, updating with quantity of 0 seemed like a hack but has remained to retain compatability
+ - Image manipulation library changes include:
+ - The initialize() method now only sets existing class properties.
+ - Added support for 3-length hex color values for wm_font_color and wm_shadow_color properties, as well as validation for them.
+ - Class properties wm_font_color, wm_shadow_color and wm_use_drop_shadow are now protected, to avoid breaking the text_watermark() method
+ if they are set manually after initialization.
+ - If property maintain_ratio is set to TRUE, image_reproportion() now doesn't need both width and height to be specified.
+ - Minor speed optimizations and method & property visibility declarations in the Calendar Library.
+ - Removed SHA1 function in the :doc:`Encryption Library <libraries/encryption>`.
+ - Added $config['csrf_regeneration'] to the CSRF protection in the :doc:`Security library <libraries/security>`, which makes token regeneration optional.
+
+- Core
+
+ - Changed private functions in CI_URI to protected so MY_URI can override them.
+ - Removed CI_CORE boolean constant from CodeIgniter.php (no longer Reactor and Core versions).
+ - Added method get_vars() to CI_Loader to retrieve all variables loaded with $this->load->vars().
+ - is_loaded() function from system/core/Commons.php now returns a reference.
+
+Bug fixes for 3.0
+------------------
+
+- Unlink raised an error if cache file did not exist when you try to delete it.
+- Fixed a bug (#181) where a mis-spelling was in the form validation
+ language file.
+- Fixed a bug (#159, #163) that mishandled Active Record nested transactions because _trans_depth was not getting incremented.
+- Fixed a bug (#737, #75) where pagination anchor class was not set properly when using initialize method.
+- Fixed a bug (#419) - auto_link() now recognizes URLs that come after a word boundary.
+- Fixed a bug (#724) - is_unique in form validation now checks that you are connected to a database.
+- Fixed a bug (#647) - _get_mod_time() in Zip library no longer generates stat failed errors
+- Fixed a bug (#608) - Fixes an issue with the Image_lib class not clearing properties completely
+- Fixed bugs (#157 and #174) - the Image_lib clear() function now resets all variables to their default values.
+- Fixed a bug where using $this->dbforge->create_table() with PostgreSQL database could lead to fetching whole table.
+- Fixed a bug (#795) - Fixed form method and accept-charset when passing an empty array.
+- Fixed a bug (#797) - timespan was using incorrect seconds for year and month.
+- Fixed a bug in CI_Cart::contents() where if called without a TRUE (or equal) parameter, it would fail due to a typo.
+- Fixed a bug (#696) - make oci_execute calls inside num_rows non-committing, since they are only there to reset which row is next in line for oci_fetch calls and thus don't need to be committed.
+- Fixed a bug (#406) - sqlsrv DB driver not reuturning resource on <samp>db_pconnect()</samp>.
+- Fixed a bug in CI_Image_lib::gd_loaded() where it was possible for the script execution to end or a PHP E_WARNING message to be emitted.
+- In Pagination library, when use_page_numbers=TRUE previous link and page 1 link do not have the same url
+- Fixed a bug (#561) - Errors in :doc:`XML-RPC Library <libraries/xmlrpc>` were not properly escaped.
+- Fixed a bug (#904) - ``CI_Loader::initialize()`` caused a PHP Fatal error to be triggered if error level E_STRICT is used.
+- Fixed a hosting edge case where an empty $_SERVER['HTTPS'] variable would evaluate to 'on'
+- Fixed a bug (#154) - ``CI_Session::sess_update()`` caused the session to be destroyed on pages where multiple AJAX requests were executed at once.
+- Fixed a possible bug in ``CI_Input::is_ajax_request()`` where some clients might not send the X-Requested-With HTTP header value exactly as 'XmlHttpRequest'.
+- Fixed a bug (#1039) - MySQL's _backup() method failed due to a table name not being escaped.
+- Fixed a bug (#1070) - CI_DB_driver::initialize() didn't set a character set if a database is not selected.
+- Fixed a bug (#177) - CI_Form_validation::set_value() didn't set the default value if POST data is NULL.
+
+
+Version 2.1.1
+=============
+
+Release Date: Not Released
+
+- General Changes
+ - Fixed support for docx, xlsx files in mimes.php.
+
+- Libraries
+ - Further improved MIME type detection in the :doc:`File Uploading Library <libraries/file_uploading>`.
+
+
+Bug fixes for 2.1.1
+-------------------
+
+- Fixed a bug (#697) - A wrong array key was used in the Upload library to check for mime-types.
+- Fixed a bug - form_open() compared $action against site_url() instead of base_url().
+- Fixed a bug - CI_Upload::_file_mime_type() could've failed if mime_content_type() is used for the detection and returns FALSE.
+- Fixed a bug (#538) - Windows paths were ignored when using the :doc:`Image Manipulation Library <libraries/image_lib>` to create a new file.
+
+
+Version 2.1.0
+=============
+
+Release Date: November 14, 2011
+
+- General Changes
+
+ - Callback validation rules can now accept parameters like any other
+ validation rule.
+ - Added html_escape() to :doc:`Common
+ functions <general/common_functions>` to escape HTML output
+ for preventing XSS.
+
+- Helpers
+
+ - Added increment_string() to :doc:`String
+ Helper <helpers/string_helper>` to turn "foo" into "foo-1"
+ or "foo-1" into "foo-2".
+ - Altered form helper - made action on form_open_multipart helper
+ function call optional. Fixes (#65)
+ - url_title() will now trim extra dashes from beginning and end.
+ - Improved speed of :doc:`String Helper <helpers/string_helper>`'s random_string() method
+
+- Database
+
+ - Added a `CUBRID <http://www.cubrid.org/>`_ driver to the :doc:`Database
+ Driver <database/index>`. Thanks to the CUBRID team for
+ supplying this patch.
+ - Added a PDO driver to the :doc:`Database Driver <database/index>`.
+ - Typecast limit and offset in the :doc:`Database
+ Driver <database/queries>` to integers to avoid possible
+ injection.
+ - Added additional option 'none' for the optional third argument for
+ $this->db->like() in the :doc:`Database
+ Driver <database/active_record>`.
+ - Added $this->db->insert_batch() support to the OCI8 (Oracle) driver.
+ - Added failover if the main connections in the config should fail
+
+- Libraries
+
+ - Changed $this->cart->insert() in the :doc:`Cart
+ Library <libraries/cart>` to return the Row ID if a single
+ item was inserted successfully.
+ - Added support to set an optional parameter in your callback rules
+ of validation using the :doc:`Form Validation
+ Library <libraries/form_validation>`.
+ - Added a :doc:`Migration library <libraries/migration>` to assist with applying
+ incremental updates to your database schema.
+ - Driver children can be located in any package path.
+ - Added max_filename_increment config setting for Upload library.
+ - Added is_unique to the :doc:`Form Validation
+ library <libraries/form_validation>`.
+ - Added $config['use_page_numbers'] to the :doc:`Pagination library <libraries/pagination>`, which enables real page numbers in the URI.
+ - Added TLS and SSL Encryption for SMTP.
+
+- Core
+
+ - Changed private functions in CI_URI to protected so MY_URI can
+ override them.
+ - Removed CI_CORE boolean constant from CodeIgniter.php (no longer Reactor and Core versions).
+
+
+Bug fixes for 2.1.0
+-------------------
+
+
+- Fixed #378 Robots identified as regular browsers by the User Agent
+ class.
+- If a config class was loaded first then a library with the same name
+ is loaded, the config would be ignored.
+- 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.
+- Fixed a bug (Reactor #89) where MySQL export would fail if the table
+ had hyphens or other non alphanumeric/underscore characters.
+- Fixed a bug (#200) where MySQL queries would be malformed after calling $this->db->count_all() then $this->db->get()
+- Fixed a bug (#105) that stopped query errors from being logged unless database debugging was enabled
+- Fixed a bug (#160) - Removed unneeded array copy in the file cache
+ driver.
+- Fixed a bug (#150) - field_data() now correctly returns column
+ length.
+- Fixed a bug (#8) - load_class() now looks for core classes in
+ APPPATH first, allowing them to be replaced.
+- Fixed a bug (#24) - ODBC database driver called incorrect parent in __construct().
+- Fixed a bug (#85) - OCI8 (Oracle) database escape_str() function did not escape correct.
+- Fixed a bug (#344) - Using schema found in :doc:`Saving Session Data to a Database <libraries/sessions>`, system would throw error "user_data does not have a default value" when deleting then creating a session.
+- Fixed a bug (#112) - OCI8 (Oracle) driver didn't pass the configured database character set when connecting.
+- Fixed a bug (#182) - OCI8 (Oracle) driver used to re-execute the statement whenever num_rows() is called.
+- Fixed a bug (#82) - WHERE clause field names in the DB update_string() method were not escaped, resulting in failed queries in some cases.
+- Fixed a bug (#89) - Fix a variable type mismatch in DB display_error() where an array is expected, but a string could be set instead.
+- Fixed a bug (#467) - Suppress warnings generated from get_magic_quotes_gpc() (deprecated in PHP 5.4)
+- Fixed a bug (#484) - First time _csrf_set_hash() is called, hash is never set to the cookie (in Security.php).
+- Fixed a bug (#60) - Added _file_mime_type() method to the :doc:`File Uploading Library <libraries/file_uploading>` in order to fix a possible MIME-type injection.
+- Fixed a bug (#537) - Support for all wav type in browser.
+- Fixed a bug (#576) - Using ini_get() function to detect if apc is enabled or not.
+- Fixed invalid date time format in :doc:`Date helper <helpers/date_helper>` and :doc:`XMLRPC library <libraries/xmlrpc>`.
+- Fixed a bug (#200) - MySQL queries would be malformed after calling count_all() then db->get().
+
+Version 2.0.3
+=============
+
+Release Date: August 20, 2011
+
+- 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
+
+ - Fixed a bug where there was a misspelling within a code comment in
+ the index.php file.
+ - 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 <https://bitbucket.org/danijelb>`_
+ for the pull request.
+ - Added insert_batch() function to the PostgreSQL database driver.
+ Thanks to epallerols for the patch.
+ - Added "application/x-csv" to mimes.php.
+ - Added CSRF protection URI whitelisting.
+ - Fixed a bug where :doc:`Email library <libraries/email>`
+ attachments with a "." in the name would using invalid MIME-types.
+
+- 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)
+ - Re-worked plural() and singular() functions in the :doc:`Inflector
+ helper <helpers/inflector_helper>` to support considerably
+ more words.
+
+- Libraries
+
+ - Altered Session to use a longer match against the user_agent
+ string. See upgrade notes if using database sessions.
+ - Added $this->db->set_dbprefix() to the :doc:`Database
+ Driver <database/queries>`.
+ - Changed $this->cart->insert() in the :doc:`Cart
+ Library <libraries/cart>` to return the Row ID if a single
+ item was inserted successfully.
+ - Added $this->load->get_var() to the :doc:`Loader
+ library <libraries/loader>` to retrieve global vars set with
+ $this->load->view() and $this->load->vars().
+ - Changed $this->db->having() to insert quotes using escape() rather
+ than escape_str().
+
+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 :doc:`Upgrade
+ Notes <installation/upgrade_203>`.
+- 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 issue #199 - Attributes passed as string does not include a
+ space between it and the opening tag.
+- Fixed a bug where the method $this->cart->total_items() from :doc:`Cart
+ Library <libraries/cart>` now returns the sum of the quantity
+ of all items in the cart instead of your total count.
+- 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.
+- Fixed a bug where using $this->db->select_max(),
+ $this->db->select_min(), etc could throw notices. Thanks to w43l for
+ the patch.
+- Replace checks for STDIN with php_sapi_name() == 'cli' which on the
+ whole is more reliable. This should get parameters in crontab
+ working.
+
+Version 2.0.2
+=============
+
+Release Date: April 7, 2011
+Hg Tag: v2.0.2
+
+- General changes
+
+ - The :doc:`Security library <./libraries/security>` was moved to
+ the core and is now loaded automatically. Please remove your
+ loading calls.
+ - The CI_SHA class is now deprecated. All supported versions of PHP
+ provide a sha1() function.
+ - constants.php will now be loaded from the environment folder if
+ available.
+ - Added language key error logging
+ - Made Environment Support optional. Comment out or delete the
+ constant to stop environment checks.
+ - Added Environment Support for Hooks.
+ - Added CI\_ Prefix to the :doc:`Cache driver <libraries/caching>`.
+ - Added :doc:`CLI usage <./general/cli>` documentation.
+
+- Helpers
+
+ - Removed the previously deprecated dohash() from the :doc:`Security
+ helper <./helpers/security_helper>`; use do_hash() instead.
+ - Changed the 'plural' function so that it doesn't ruin the
+ captalization of your string. It also take into consideration
+ acronyms which are all caps.
+
+- Database
+
+ - $this->db->count_all_results() will now return an integer
+ instead of a string.
+
+Bug fixes for 2.0.2
+-------------------
+
+- Fixed a bug (Reactor #145) where the Output Library had
+ parse_exec_vars set to protected.
+- Fixed a bug (Reactor #80) where is_really_writable would create an
+ empty file when on Windows or with safe_mode enabled.
+- Fixed various bugs with User Guide.
+- Added is_cli_request() method to documentation for :doc:`Input
+ class <libraries/input>`.
+- Added form_validation_lang entries for decimal, less_than and
+ greater_than.
+- `Fixed issue
+ #153 <https://bitbucket.org/ellislab/codeigniter-reactor/issue/153/escape-str-bug-in-mssql-driver>`_
+ Escape Str Bug in MSSQL driver.
+- `Fixed issue
+ #172 <https://bitbucket.org/ellislab/codeigniter-reactor/issue/172/bug-in-chrome-and-form_open-in-201>`_
+ Google Chrome 11 posts incorrectly when action is empty.
+
+Version 2.0.1
+=============
+
+Release Date: March 15, 2011
+Hg Tag: v2.0.1
+
+- General changes
+
+ - Added $config['cookie_secure'] to the config file to allow
+ requiring a secure (HTTPS) in order to set cookies.
+ - Added the constant CI_CORE to help differentiate between Core:
+ TRUE and Reactor: FALSE.
+ - Added an ENVIRONMENT constant in index.php, which affects PHP
+ error reporting settings, and optionally, which configuration
+ files are loaded (see below). Read more on the :doc:`Handling
+ Environments <general/environments>` page.
+ - Added support for
+ :ref:`environment-specific <config-environments>`
+ configuration files.
+
+- Libraries
+
+ - Added decimal, less_than and greater_than rules to the :doc:`Form
+ validation Class <libraries/form_validation>`.
+ - :doc:`Input Class <libraries/input>` methods post() and get()
+ will now return a full array if the first argument is not
+ provided.
+ - Secure cookies can now be made with the set_cookie() helper and
+ :doc:`Input Class <libraries/input>` method.
+ - Added set_content_type() to :doc:`Output
+ Class <libraries/output>` to set the output Content-Type
+ HTTP header based on a MIME Type or a config/mimes.php array key.
+ - :doc:`Output Class <libraries/output>` will now support method
+ chaining.
+
+- Helpers
+
+ - Changed the logic for form_open() in :doc:`Form
+ helper <helpers/form_helper>`. If no value is passed it will
+ submit to the current URL.
+
+Bug fixes for 2.0.1
+-------------------
+
+- CLI requests can now be run from any folder, not just when CD'ed next
+ to index.php.
+- 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.
+
+.. _2.0.0-changelog:
+
+Version 2.0.0
+=============
+
+Release Date: January 28, 2011
+Hg Tag: v2.0.0
+
+- General changes
+
+ - PHP 4 support is removed. CodeIgniter now requires PHP 5.1.6.
+ - 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
+ :doc:`documented <./helpers/captcha_helper>`. The JavaScript
+ calendar plugin was removed due to the ready availability of great
+ JavaScript calendars, particularly with jQuery.
+ - Added new special Library type:
+ :doc:`Drivers <./general/drivers>`.
+ - Added full query-string support. See the config file for details.
+ - Moved the application folder outside of the system folder.
+ - Moved system/cache and system/logs directories to the application
+ directory.
+ - 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 :doc:`Loader class <libraries/loader>`
+ documentation for more details.
+ - In-development code is now hosted at
+ `BitBucket <http://bitbucket.org/ellislab/codeigniter-reactor/>`_.
+ - Removed the deprecated Validation Class.
+ - Added CI\_ Prefix to all core classes.
+ - Package paths can now be set in application/config/autoload.php.
+ - :doc:`Upload library <libraries/file_uploading>` file_name can
+ now be set without an extension, the extension will be taken from
+ the uploaded file instead of the given name.
+ - In :doc:`Database Forge <database/forge>` the name can be omitted
+ from $this->dbforge->modify_column()'s 2nd param if you aren't
+ changing the name.
+ - $config['base_url'] is now empty by default and will guess what
+ it should be.
+ - Enabled full Command Line Interface compatibility with
+ config['uri_protocol'] = 'CLI';.
+
+- Libraries
+
+ - Added a :doc:`Cache driver <libraries/caching>` with APC,
+ memcached, and file-based support.
+ - Added $prefix, $suffix and $first_url properties to :doc:`Pagination
+ library <./libraries/pagination>`.
+ - Added the ability to suppress first, previous, next, last, and
+ page links by setting their values to FALSE in the :doc:`Pagination
+ library <./libraries/pagination>`.
+ - Added :doc:`Security library <./libraries/security>`, which now
+ contains the xss_clean function, filename_security function and
+ other security related functions.
+ - Added CSRF (Cross-site Reference Forgery) protection to the
+ :doc:`Security library <./libraries/security>`.
+ - Added $parse_exec_vars property to Output library.
+ - Added ability to enable / disable individual sections of the
+ :doc:`Profiler <general/profiling>`
+ - Added a wildcard option $config['allowed_types'] = '\*' to the
+ :doc:`File Uploading Class <./libraries/file_uploading>`.
+ - 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 :doc:`Parser
+ Class <libraries/parser>`.
+ - Added HTTP headers and Config information to the
+ :doc:`Profiler <general/profiling>` output.
+ - Added Chrome and Flock to the list of detectable browsers by
+ browser() in the :doc:`User Agent Class <libraries/user_agent>`.
+ - The :doc:`Unit Test Class <libraries/unit_testing>` 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 :doc:`FTP
+ library <libraries/ftp>`
+ - 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.
+ - Modified the Session class to prevent use if no encryption key is
+ set in the config file.
+ - 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.
+ - Improved performance of the Encryption library on servers where
+ Mcrypt is available.
+ - Changed the default encryption mode in the Encryption library to
+ CBC.
+ - 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 :doc:`upgrade
+ instructions <./installation/upgrade_200>` for details.
+ - Altered Form_Validation library to allow for method chaining on
+ set_rules(), set_message() and set_error_delimiters()
+ functions.
+ - Altered Email Library to allow for method chaining.
+ - Added request_headers(), get_request_header() and
+ is_ajax_request() to the input class.
+ - Altered :doc:`User agent library <libraries/user_agent>` so that
+ is_browser(), is_mobile() and is_robot() can optionally check
+ for a specific browser or mobile device.
+ - Altered :doc:`Input library <libraries/input>` so that post() and
+ get() will return all POST and GET items (respectively) if there
+ are no parameters passed in.
+
+- Database
+
+ - :doc:`database configuration <./database/configuration>`.
+ - Added autoinit value to :doc:`database
+ configuration <./database/configuration>`.
+ - Added stricton value to :doc:`database
+ configuration <./database/configuration>`.
+ - Added database_exists() to the :doc:`Database Utilities
+ Class <database/utilities>`.
+ - 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.
+ - Improved dbforge create_table() function for the Postgres driver.
+
+- Helpers
+
+ - Added convert_accented_characters() function to :doc:`text
+ helper <./helpers/text_helper>`.
+ - Added accept-charset to the list of inserted attributes of
+ form_open() in the :doc:`Form Helper <helpers/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 :doc:`File Helper <helpers/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
+ :doc:`Directory Helper <helpers/directory_helper>` to accept an
+ integer to specify recursion depth.
+ - Modified delete_files() in the :doc:`File
+ Helper <helpers/file_helper>` to return FALSE on failure.
+ - Added an optional second parameter to byte_format() in the
+ :doc:`Number Helper <helpers/number_helper>` to allow for decimal
+ precision.
+ - Added alpha, and sha1 string types to random_string() in the
+ :doc:`String Helper <helpers/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.
+ - The img() function of the :doc:`HTML
+ helper <./helpers/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 :doc:`Security
+ helper <./helpers/security_helper>`.
+ - Added ellipsize() to the :doc:`Text
+ Helper <./helpers/text_helper>`
+ - Added elements() to the :doc:`Array
+ Helper <./helpers/array_helper>`
+
+- 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.
+ - get_mime_by_extension() is now case insensitive.
+ - Added "default" to the list :doc:`Reserved
+ Names <general/reserved_names>`.
+ - Added 'application/x-msdownload' for .exe files and
+ 'application/x-gzip-compressed' for .tgz files to
+ 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 :doc:`Output
+ Class <libraries/output>`.
+ - Documented a second argument in the decode() function for the
+ :doc:`Encryption Class <libraries/encryption>`.
+ - Documented db->close().
+ - Updated the router to support a default route with any number of
+ segments.
+ - Moved _remove_invisible_characters() function from the
+ :doc:`Security Library <libraries/security>` to :doc:`common
+ functions. <general/common_functions>`
+ - Added audio/mpeg3 as a valid mime type for MP3.
+
+Bug fixes for 2.0.0
+-------------------
+
+- Fixed a bug where you could not change the User-Agent when sending
+ email.
+- Fixed a bug where the Output class would send incorrect cached output
+ for controllers implementing their own _output() method.
+- 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".
+- Fixed an error in the Zip library that didn't allow downloading on
+ PHP 4 servers.
+- Fixed a bug in the Form Validation library where fields passed as
+ rule parameters were not being translated (#9132)
+- Modified inflector helper to properly pluralize words that end in
+ 'ch' or 'sh'
+- Fixed a bug in xss_clean() that was not allowing hyphens in query
+ strings of submitted URLs.
+- 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.
+- 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.
+- 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().
+- Fixed a bug in the Encryption library where an empty key was not
+ triggering an error.
+- Fixed a bug in the Email library where CC and BCC recipients were not
+ reset when using the clear() method (#109).
+- Fixed a bug in the URL Helper where prep_url() could cause a PHP
+ error on PHP versions < 5.1.2.
+- Added a log message in core/output if the cache directory config
+ value was not found.
+- Fixed a bug where multiple libraries could not be loaded by passing
+ an array to load->library()
+- Fixed a bug in the html helper where too much white space was
+ rendered between the src and alt tags in the img() function.
+- Fixed a bug in the profilers _compile_queries() function.
+- Fixed a bug in the date helper where the DATE_ISO8601 variable was
+ returning an incorrectly formatted date string.
+
+Version 1.7.2
+=============
+
+Release Date: September 11, 2009
+Hg Tag: v1.7.2
+
+- Libraries
+
+ - Added a new :doc:`Cart Class <libraries/cart>`.
+ - Added the ability to pass $config['file_name'] for the :doc:`File
+ Uploading Class <libraries/file_uploading>` and rename the
+ uploaded file.
+ - Changed order of listed user-agents so Safari would more
+ accurately report itself. (#6844)
+
+- 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.
+ - Added reconnect() method to DB drivers to try to keep alive /
+ reestablish a connection after a long idle.
+ - Modified MSSQL driver to use mssql_get_last_message() for error
+ messages.
+
+- Helpers
+
+ - Added form_multiselect() to the :doc:`Form
+ helper <helpers/form_helper>`.
+ - Modified form_hidden() in the :doc:`Form
+ helper <helpers/form_helper>` to accept multi-dimensional
+ arrays.
+ - Modified form_prep() in the :doc:`Form
+ helper <helpers/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 :doc:`Directory
+ helper <helpers/directory_helper>` to allow the inclusion of
+ hidden files, and to return FALSE on failure to read directory.
+ - Modified the :doc:`Smiley helper <helpers/smiley_helper>` to work
+ with multiple fields and insert the smiley at the last known
+ cursor position.
+
+- General
+
+ - Compatible with PHP 5.3.0.
+ - Modified :doc:`show_error() <general/errors>` to allow sending
+ of HTTP server response codes.
+ - Modified :doc:`show_404() <general/errors>` to send 404 status
+ code, removing non-CGI compatible header() statement from
+ error_404.php template.
+ - Added set_status_header() to the :doc:`Common
+ functions <general/common_functions>` to allow use when the
+ Output class is unavailable.
+ - Added is_php() to :doc:`Common
+ functions <general/common_functions>` to facilitate PHP
+ version comparisons.
+ - Added 2 CodeIgniter "cheatsheets" (thanks to DesignFellow.com for
+ this contribution).
+
+Bug fixes for 1.7.2
+-------------------
+
+- Fixed assorted user guide typos or examples (#6743, #7214, #7516,
+ #7287, #7852, #8224, #8324, #8349).
+- 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 in the language class when outputting an error for an
+ unfound file.
+- Fixed a bug in the Calendar library where the shortname was output
+ for "May".
+- 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 xml_from_result() was checking for a nonexistent
+ method.
+- 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.
+- 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.
+- Fixed a bug in the typography class where heading tags could have
+ paragraph tags inserted when using auto_typography().
+
+Version 1.7.1
+=============
+
+Release Date: February 10, 2009
+Hg Tag: 1.7.1
+
+- Libraries
+
+ - Fixed an arbitrary script execution security flaw (#6068) in the
+ Form Validation library (thanks to hkk)
+ - 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.
+ - Removed a strict type check from the rotate() function of the
+ :doc:`Image Manipulation Class <libraries/image_lib>`.
+ - Added enhanced error checking in file saving in the Image library
+ when using the GD lib.
+ - Added an additional newline between multipart email headers and
+ the MIME message text for better compatibility with a variety of
+ MUAs.
+ - Made modest improvements to efficiency and accuracy of
+ explode_name() in the Image lib.
+
+- Database
+
+ - Added where_in to the list of expected arguments received by
+ delete().
+
+- Helpers
+
+ - Added the ability to have optgroups in form_dropdown() within the
+ :doc:`form helper <helpers/form_helper>`.
+ - Added a doctype() function to the :doc:`HTML
+ helper <helpers/html_helper>`.
+ - Added ability to force lowercase for url_title() in the :doc:`URL
+ helper <helpers/url_helper>`.
+ - Changed the default "type" of form_button() to "button" from
+ "submit" in the :doc:`form helper <helpers/form_helper>`.
+ - Changed redirect() in the URL helper to allow redirections to URLs
+ outside of the CI site.
+ - Updated get_cookie() to try to fetch the cookie using the global
+ cookie prefix if the requested cookie name doesn't exist.
+
+- Other Changes
+
+ - Improved security in xss_clean() to help prevent attacks
+ targeting Internet Explorer.
+ - Added 'application/msexcel' to config/mimes.php for .xls files.
+ - Added 'proxy_ips' config item to whitelist reverse proxy servers
+ from which to trust the HTTP_X_FORWARDED_FOR header to to
+ determine the visitor's IP address.
+ - Improved accuracy of Upload::is_allowed_filetype() for images
+ (#6715)
+
+Bug fixes for 1.7.1
+-------------------
+
+- Database
+
+ - Fixed a bug when doing 'random' on order_by() (#5706).
+ - Fixed a bug where adding a primary key through Forge could fail
+ (#5731).
+ - Fixed a bug when using DB cache on multiple databases (#5737).
+ - 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 assorted user guide typos or examples (#5998, #6093, #6259,
+ #6339, #6432, #6521).
+- 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.
+- 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.
+- Fixed a bug where HTML comments and <pre> tags were being parsed in
+ Typography::auto_typography().
+- Fixed a bug with non-breaking space cleanup in
+ Typography::auto_typography().
+- Fixed a bug in database escaping where a compound statement (ie:
+ SUM()) wasn't handled correctly with database prefixes.
+- Fixed a bug when an opening quote is preceded by a paragraph tag and
+ immediately followed by another tag.
+- Fixed a bug in the Text Helper affecting some locales where
+ word_censor() would not work on words beginning or ending with an
+ accented character.
+- Fixed a bug in the Text Helper character limiter where the provided
+ limit intersects the last word of the string.
+- Fixed a bug (#6342) with plural() in the Inflection helper with words
+ ending in "y".
+- Fixed bug (#6517) where Routed URI segments returned by
+ URI::rsegment() method were incorrect for the default controller.
+- Fixed a bug (#6706) in the Security Helper where xss_clean() was
+ using a deprecated second argument.
+- Fixed a bug in the URL helper url_title() function where trailing
+ periods were allowed at the end of a URL.
+- Fixed a bug (#6669) in the Email class when CRLF's are used for the
+ newline character with headers when used with the "mail" protocol.
+- Fixed a bug (#6500) where URI::A_filter_uri() was exit()ing an
+ error instead of using show_error().
+- Fixed a bug (#6592) in the File Helper where get_dir_file_info()
+ where recursion was not occurring properly.
+- Tweaked Typography::auto_typography() for some edge-cases.
+
+Version 1.7
+===========
+
+Release Date: October 23, 2008
+Hg Tag: 1.7.0
+
+- Libraries
+
+ - Added a new :doc:`Form Validation
+ Class <libraries/form_validation>`. 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 :doc:`Sessions class <libraries/sessions>` 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 :doc:`Loader class <libraries/loader>` for
+ more info.
+ - Added the ability to assign library objects to your own variable
+ names when you use $this->load->library(). Please see the :doc:`Loader
+ class <libraries/loader>` for more info.
+ - Added controller class/method info to :doc:`Profiler
+ class <general/profiling>` and support for multiple database
+ connections.
+ - Improved the "auto typography" feature and moved it out of the
+ helper into its own :doc:`Typography
+ Class <libraries/typography>`.
+ - Improved performance and accuracy of xss_clean(), including
+ reduction of false positives on image/file tests.
+ - Improved :doc:`Parser class <./libraries/parser>` 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
+ :doc:`File Upload Class <libraries/file_uploading>`.
+ - Added set_status_header() function to :doc:`Output
+ class <libraries/output>`.
+ - Modified :doc:`Pagination <libraries/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 :doc:`Form
+ Validation <libraries/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 :doc:`Form
+ helper <helpers/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 :doc:`Form Validation
+ Class <libraries/form_validation>`.
+ - Added current_url() and uri_segments() to :doc:`URL
+ helper <helpers/url_helper>`.
+ - Altered auto_link() in the :doc:`URL
+ helper <helpers/url_helper>` so that email addresses with
+ "+" included will be linked.
+ - Added meta() function to :doc:`HTML
+ helper <helpers/html_helper>`.
+ - Improved accuracy of calculations in :doc:`Number
+ helper <helpers/number_helper>`.
+ - Removed added newlines ("\\n") from most form and html helper
+ functions.
+ - Tightened up validation in the :doc:`Date
+ helper <helpers/date_helper>` function human_to_unix(),
+ and eliminated the POSIX regex.
+ - Updated :doc:`Date helper <helpers/date_helper>` to match the
+ world's current time zones and offsets.
+ - Modified url_title() in the :doc:`URL
+ helper <helpers/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
+ :doc:`URL helper <helpers/url_helper>`.
+
+- Other Changes
+
+ - Added :doc:`PHP Style Guide <./general/styleguide>` 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 :doc:`Email library <libraries/email>` 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
+ :doc:`Date helper. <helpers/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 :doc:`Text
+ helper <helpers/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 encountered.
+
+Version 1.6.3
+=============
+
+Release Date: June 26, 2008
+Hg Tag: v1.6.3
+
+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
+ :doc:`Forge class <database/forge>`
+ - Added ability to set additional database config values in :doc:`DSN
+ connections <database/connecting>` via the query string.
+
+- Libraries
+
+ - Set the mime type check in the :doc:`Upload
+ class <libraries/file_uploading>` to reference the global
+ mimes variable.
+ - Added support for query strings to the :doc:`Pagination
+ class <libraries/pagination>`, automatically detected or
+ explicitly declared.
+ - Added get_post() to the :doc:`Input class <libraries/input>`.
+ - Documented get() in the :doc:`Input class <libraries/input>`.
+ - Added the ability to automatically output language items as form
+ labels in the :doc:`Language class <libraries/language>`.
+
+- Helpers
+
+ - Added a :doc:`Language helper <helpers/language_helper>`.
+ - Added a :doc:`Number helper <helpers/number_helper>`.
+ - :doc:`Form helper <helpers/form_helper>` refactored to allow
+ form_open() and form_fieldset() to accept arrays or strings as
+ arguments.
+
+- Other changes
+
+ - Improved security in xss_clean().
+ - Removed an unused Router reference in _display_cache().
+ - Added ability to :doc:`use xss_clean() to test
+ images <libraries/input>` 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 :doc:`XMLRPC userguide page <libraries/xmlrpc>`.
+ - Removed maxlength and size as automatically added attributes of
+ form_input() in the :doc:`form helper <helpers/form_helper>`.
+ - Documented the language file use of byte_format() in the :doc:`number
+ helper <helpers/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
+Hg Tag: 1.6.2
+
+- Active Record
+
+ - Added the ability to prevent escaping in having() clauses.
+ - Added rename_table() into :doc:`DBForge <./database/forge>`.
+ - 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 :doc:`Strict Mode <./database/transactions>` 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
+ :doc:`Email <libraries/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
+ :doc:`Email <libraries/email>` class.
+ - :doc:`Unit Testing <libraries/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 :doc:`Zip class <libraries/zip>` now exits within download().
+ - The :doc:`Zip class <libraries/zip>` 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 :doc:`Form
+ helper <helpers/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 :doc:`URL
+ Helper <helpers/url_helper>`.
+ - Modified img() in the :doc:`HTML Helper <helpers/html_helper>` to
+ remove an unneeded space (#4208).
+ - Modified anchor() in the :doc:`URL helper <helpers/url_helper>`
+ to no longer add a default title= attribute (#4209).
+ - The :doc:`Download helper <helpers/download_helper>` now exits
+ within force_download().
+ - Added get_dir_file_info(), get_file_info(), and
+ get_mime_by_extension() to the :doc:`File
+ Helper <helpers/file_helper>`.
+ - Added symbolic_permissions() and octal_permissions() to the
+ :doc:`File helper <helpers/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 :doc:`xss_clean() <libraries/input>` 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 :doc:`Reserved Names <general/reserved_names>` page to
+ the userguide, and migrated reserved controller names into it.
+ - Added a :doc:`Common Functions <general/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 :doc:`xss_clean() <libraries/input>` 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 :doc:`URL
+ helper <helpers/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
+Hg Tag: 1.6.1
+
+- Active Record
+
+ - Added :ref:`Active Record
+ Caching <ar-caching>`.
+ - Made Active Record fully database-prefix aware.
+
+- 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 :doc:`Path Helper <./helpers/path_helper>`.
+ - Simplified _reindex_segments() in the URI class.
+ - Escaped the '-' in the default 'permitted_uri_chars' config
+ item, to prevent errors if developers just try to add additional
+ 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 :doc:`DBForge <./database/forge>` to the database tools.
+ - Moved create_database() and drop_database() into
+ :doc:`DBForge <./database/forge>`.
+ - Added add_field(), add_key(), create_table(), drop_table(),
+ add_column(), drop_column(), modify_column() into
+ :doc:`DBForge <./database/forge>`.
+
+- Active Record
+
+ - Added protect_identifiers() in :doc:`Active
+ Record <./database/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 :doc:`Active
+ Record <./database/active_record>`.
+ - Added support for limit() into update() and delete() statements in
+ :doc:`Active Record <./database/active_record>`.
+ - Added empty_table() and truncate_table() to :doc:`Active
+ Record <./database/active_record>`.
+ - Added the ability to pass an array of tables to the delete()
+ statement in :doc:`Active Record <./database/active_record>`.
+ - Added count_all_results() function to :doc:`Active
+ Record <./database/active_record>`.
+ - Added select_max(), select_min(), select_avg() and
+ select_sum() to :doc:`Active Record <./database/active_record>`.
+ - Added the ability to use aliases with joins in :doc:`Active
+ Record <./database/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 :doc:`Active
+ Record <./database/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 :doc:`auto-load <./general/autoloader>`
+ :doc:`Models <./general/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 :doc:`Session
+ class. <./libraries/sessions>`
+ - 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 :doc:`Image
+ Processing <../libraries/image_lib>` 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 :doc:`HTML
+ helper. <./helpers/html_helper>`
+ - Added img() to the :doc:`HTML helper. <./helpers/html_helper>`
+ - Added ability to :doc:`"extend" Helpers <./general/helpers>`.
+ - Added an :doc:`email helper <./helpers/email_helper>` into core
+ helpers.
+ - Added strip_quotes() function to :doc:`string
+ helper <./helpers/string_helper>`.
+ - Added reduce_multiples() function to :doc:`string
+ helper <./helpers/string_helper>`.
+ - Added quotes_to_entities() function to :doc:`string
+ helper <./helpers/string_helper>`.
+ - Added form_fieldset(), form_fieldset_close(), form_label(),
+ and form_reset() function to :doc:`form
+ helper <./helpers/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 <http://codeigniter.com/user_guide/libraries/zip>`_ to
+ the table of contents of the userguide.
+ - Moved part of the userguide menu javascript to an external file.
+ - Documented distinct() in :doc:`Active
+ Record <./database/active_record>`.
+ - Documented the timezones() function in the :doc:`Date
+ Helper <./helpers/date_helper>`.
+ - Documented unset_userdata in the :doc:`Session
+ class <./libraries/sessions>`.
+ - Documented 2 config options to the :doc:`Database
+ configuration <./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 :doc:`parser class <./libraries/parser>`
+ 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 :doc:`Session
+ library <./libraries/sessions>` 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 :doc:`File
+ Helper <helpers/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 :doc:`User Agent
+ library <./libraries/user_agent>` where more then 2 languages
+ where not reported with languages().
+- Fixed a bug (#3017) in the :doc:`Email <./libraries/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 :doc:`upload
+ library <./libraries/file_uploading>` 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 :doc:`User Agent
+ Library <./libraries/user_agent>`.
+- Fixed a typo in the docblock comments that had CodeIgniter spelled
+ CodeIgnitor.
+- Fixed a typo in the :doc:`String Helper <./helpers/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 :doc:`custom Language files <./libraries/language>` to the
+ :doc:`autoload <./general/autoloader>` options.
+- Added stripslashes() to the _clean_input_data() function in the
+ :doc:`Input class <./libraries/input>` when magic quotes is on so
+ that data will always be un-slashed within the framework.
+- Added array to string into the :doc:`profiler <general/profiling>`.
+- Added some additional mime types in application/config/mimes.php.
+- Added filename_security() method to :doc:`Input
+ library <./libraries/input>`.
+- Added some additional arguments to the :doc:`Inflection
+ helper <./helpers/inflector_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 :doc:`Calendar library <./libraries/calendar>`
+- Fixed a typo in rpcs.php library
+- Fixed a bug in the :doc:`Zip library <./libraries/zip>`, 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
+ :doc:`Profiler <./general/profiling>` output
+- Fixed a bug in display of queries with characters that would be
+ interpreted as HTML in the :doc:`Profiler <./general/profiling>`
+ 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 :doc:`String
+ helper <./helpers/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 :doc:`URL Helper <./helpers/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 :doc:`string
+ helper <./helpers/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 :doc:`url
+ helper <./helpers/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 :doc:`downloads <installation/downloads>` page.
+- Added support for captions in the :doc:`Table
+ Library <./libraries/table>`
+- Fixed a bug in the
+ :doc:`download_helper <helpers/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 :doc:`form helper <helpers/form_helper>` that
+ gave textarea a value attribute
+- Fixed a bug in the :doc:`Image Library <libraries/image_lib>` 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 :doc:`DB utility class <./database/utilities>`, permitting DB
+ backups, CVS or XML files from DB results, and various other
+ functions.
+- Added :doc:`Database Caching Class <./database/caching>`.
+- Added :doc:`transaction support <./database/transactions>` to the
+ database classes.
+- Added :doc:`Profiler Class <./general/profiling>` which generates a
+ report of Benchmark execution times, queries, and POST data at the
+ bottom of your pages.
+- Added :doc:`User Agent Library <./libraries/user_agent>` which
+ allows browsers, robots, and mobile devises to be identified.
+- Added :doc:`HTML Table Class <./libraries/table>` , enabling tables
+ to be generated from arrays or database results.
+- Added :doc:`Zip Encoding Library <./libraries/zip>`.
+- Added :doc:`FTP Library <./libraries/ftp>`.
+- Added the ability to :doc:`extend
+ libraries <./general/creating_libraries>` and :doc:`extend core
+ classes <./general/core_classes>`, in addition to being able to
+ replace them.
+- Added support for storing :doc:`models within
+ sub-folders <./general/models>`.
+- Added :doc:`Download Helper <./helpers/download_helper>`.
+- Added :doc:`simple_query() <./database/queries>` function to the
+ database classes
+- Added :doc:`standard_date() <./helpers/date_helper>` function to
+ the Date Helper.
+- Added :doc:`$query->free_result() <./database/results>` to database
+ class.
+- Added :doc:`$query->list_fields() <./database/fields>` function to
+ database class
+- Added :doc:`$this->db->platform() <./database/helpers>` function
+- Added new :doc:`File Helper <./helpers/file_helper>`:
+ get_filenames()
+- Added new helper: :doc:`Smiley Helper <./helpers/smiley_helper>`
+- Added support for <ul> and <ol> lists in the :doc:`HTML
+ Helper <./helpers/html_helper>`
+- Added the ability to rewrite :doc:`short
+ tags <./general/alternative_php>` 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 :doc:`rename or relocate the "application"
+ folder <./general/managing_apps>`.
+- 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 :doc:`Input
+ Class <./libraries/input>` 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
+ extended.
+- Changed _get_config() to get_config() since the function is not a
+ private one.
+- **Deprecated "init" folder**. Initialization happens automatically
+ now. :doc:`Please see documentation <./general/creating_libraries>`.
+- **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
+ :doc:`Controllers <general/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 :doc:`Controllers <general/controllers>`
+ page.
+- Added several new functions in the :doc:`URI
+ Class <./libraries/uri>` to let you retrieve and manipulate URI
+ segments that have been re-routed using the :doc:`URI
+ Routing <general/routing>` feature. Previously, the URI class did not
+ permit you to access any re-routed URI segments, but now it does.
+- Added :doc:`$this->output->set_header() <./libraries/output>`
+ 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 :doc:`Inflector helper <./helpers/inflector_helper>`.
+- Added element() function in the :doc:`array
+ helper <./helpers/array_helper>`.
+- Added RAND() to active record orderby() function.
+- Added delete_cookie() and get_cookie() to :doc:`Cookie
+ helper <./helpers/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
+ :doc:`libraries <./general/libraries>` or
+ :doc:`models <./general/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 :doc:`Hooks <./general/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 :doc:`into
+ sub-folders <general/controllers>`. Kudos to Marco for
+ `suggesting <http://codeigniter.com/forums/viewthread/627/>`_ this
+ (and the next two) feature.
+- Added regular expressions support for :doc:`routing
+ rules <./general/routing>`.
+- Added the ability to :doc:`remap function
+ calls <./general/controllers>` within your controllers.
+- Added the ability to :doc:`replace core system
+ classes <./general/core_classes>` with your own classes.
+- Added support for % character in URL.
+- Added the ability to supply full URLs using the
+ :doc:`anchor() <./helpers/url_helper>` helper function.
+- Added mode parameter to :doc:`file_write() <./helpers/file_helper>`
+ helper.
+- Added support for changing the port number in the :doc:`Postgres
+ driver <./database/configuration>`.
+- 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 :doc:`do_upload() <./libraries/file_uploading>`.
+- Updated the :doc:`Config Library <./libraries/config>` 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. :doc:`More info here <./general/models>`.
+- 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 :doc:`Unit Testing Library <./libraries/unit_testing>`.
+- Added the ability to pass objects to the **insert()** and
+ **update()** database functions. This feature enables you to (among
+ other things) use your :doc:`Model class <./general/models>`
+ variables to run queries with. See the Models page for details.
+- Added the ability to pass objects to the :doc:`view loading
+ function <./general/views>`: $this->load->view('my_view',
+ $object);
+- Added getwhere function to :doc:`Active Record
+ class <./database/active_record>`.
+- Added count_all function to :doc:`Active Record
+ class <./database/active_record>`.
+- Added language file for scaffolding and fixed a scaffolding bug that
+ occurs when there are no rows in the specified table.
+- Added :doc:`$this->db->last_query() <./database/queries>`, 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 :doc:`Models <general/models>`.
+- Redesigned the database libraries to support additional RDBMs
+ (Postgres, MySQLi, etc.).
+- Redesigned the :doc:`Active Record class <./database/active_record>`
+ 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 :doc:`custom
+ function calls <./database/call_function>`.
+- Added support for :doc:`private functions <general/controllers>` 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
+ :doc:`custom core libraries <general/creating_libraries>` when using
+ $this->load->library()
+- Added support for running standard :doc:`query string URLs <general/urls>`.
+ These can be optionally enabled in your config file.
+- Added the ability to :doc:`specify a "suffix" <general/urls>`, 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 :doc:`string
+ helpers <./helpers/string_helper>`.
+- 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
+ :doc:`found here <general/controllers>`.
+- 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 :doc:`Active Record <./database/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
+ :doc:`get_instance() <general/ancillary_classes>` allowing the main
+ CodeIgniter object to be accessible throughout your own classes.
+- Added new :doc:`File Helper <./helpers/file_helper>`:
+ delete_files()
+- Added new :doc:`URL Helpers <./helpers/url_helper>`: base_url(),
+ index_page()
+- Added the ability to create your own :doc:`core
+ libraries <general/creating_libraries>` and store them in your local
+ application directory.
+- Added an overwrite option to the :doc:`Upload
+ class <./libraries/file_uploading>`, 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 :doc:`Calendaring class <./libraries/calendar>`.
+- Added support for running :doc:`multiple
+ applications <general/managing_apps>` 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_src/source/conf.py b/user_guide_src/source/conf.py
new file mode 100644
index 000000000..593ceaf1c
--- /dev/null
+++ b/user_guide_src/source/conf.py
@@ -0,0 +1,257 @@
+# -*- coding: utf-8 -*-
+#
+# CodeIgniter documentation build configuration file, created by
+# sphinx-quickstart on Sun Aug 28 07:24:38 2011.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.ifconfig', 'sphinxcontrib.phpdomain']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'CodeIgniter'
+copyright = u'2012, EllisLab, Inc.'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '3.0'
+# The full version, including alpha/beta/rc tags.
+release = '3.0-dev'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = []
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'trac'
+highlight_language = 'ci'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = 'eldocs'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+html_theme_path = ["./_themes"]
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'CodeIgniterdoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+ ('index', 'CodeIgniter.tex', u'CodeIgniter Documentation',
+ u'EllisLab, Inc.', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ ('index', 'codeigniter', u'CodeIgniter Documentation',
+ [u'EllisLab, Inc.'], 1)
+]
+
+
+# -- Options for Epub output ---------------------------------------------------
+
+# Bibliographic Dublin Core info.
+epub_title = u'CodeIgniter'
+epub_author = u'EllisLab, Inc.'
+epub_publisher = u'EllisLab, Inc.'
+epub_copyright = u'2012, EllisLab, Inc.'
+
+# The language of the text. It defaults to the language option
+# or en if the language is not set.
+#epub_language = ''
+
+# The scheme of the identifier. Typical schemes are ISBN or URL.
+#epub_scheme = ''
+
+# The unique identifier of the text. This can be a ISBN number
+# or the project homepage.
+#epub_identifier = ''
+
+# A unique identification for the text.
+#epub_uid = ''
+
+# HTML files that should be inserted before the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#epub_pre_files = []
+
+# HTML files shat should be inserted after the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#epub_post_files = []
+
+# A list of files that should not be packed into the epub file.
+#epub_exclude_files = []
+
+# The depth of the table of contents in toc.ncx.
+#epub_tocdepth = 3
+
+# Allow duplicate toc entries.
+#epub_tocdup = True
diff --git a/user_guide_src/source/database/active_record.rst b/user_guide_src/source/database/active_record.rst
new file mode 100644
index 000000000..c04e67d2a
--- /dev/null
+++ b/user_guide_src/source/database/active_record.rst
@@ -0,0 +1,1008 @@
+###################
+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.
+
+.. contents:: Page Contents
+
+**************
+Selecting Data
+**************
+
+The following functions allow you to build SQL **SELECT** statements.
+
+$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 :doc:`result functions <results>` page for a full
+discussion regarding result generation.
+
+$this->db->get_compiled_select()
+================================
+
+Compiles the selection query just like `$this->db->get()`_ but does not *run*
+the query. This method simply returns the SQL query as a string.
+
+Example::
+
+ $sql = $this->db->get_compiled_select('mytable');
+ echo $sql;
+
+ // Produces string: SELECT * FROM mytable
+
+The second parameter enables you to set whether or not the active record query
+will be reset (by default it will be&mdash;just like `$this->db->get()`)::
+
+ echo $this->db->limit(10,20)->get_compiled_select('mytable', FALSE);
+ // Produces string: SELECT * FROM mytable LIMIT 20, 10
+ // (in MySQL. Other databases have slightly different syntax)
+
+ echo $this->db->select('title, content, date')->get_compiled_select();
+
+ // Produces string: SELECT title, content, date FROM mytable
+
+The key thing to notice in the above example is that the second query did not
+utilize `$this->db->from()`_ and did not pass a table name into the first
+parameter. The reason for this outcome is because the query has not been
+executed using `$this->db->get()`_ which resets values or reset directly
+using `$this->db->reset_query()`_.
+
+
+$this->db->get_where()
+======================
+
+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 removed
+
+$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 a specific type of 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.
+
+#. **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'
+
+#. **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
+
+#. **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);
+
+#. **Custom string:**
+ You can write your own clauses manually::
+
+ $where = "name='Joe' AND status='boss' OR status='active'";
+ $this->db->where($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->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
+ removed.
+
+$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.
+
+#. **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%'
+
+#. **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::
+
+ $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 removed.
+
+$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
+ removed.
+
+$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 syntaxes, 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
+ 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::
+
+ $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
+
+**************
+Query grouping
+**************
+
+Query grouping allows you to create groups of WHERE clauses by enclosing them in parentheses. This will allow
+you to create queries with complex WHERE clauses. Nested groups are supported. Example:
+
+ $this->db->select('*')->from('my_table')
+ ->group_start()
+ ->where('a', 'a')
+ ->or_group_start()
+ ->where('b', 'b')
+ ->where('c', 'c')
+ ->group_end()
+ ->group_end()
+ ->where('d', 'd')
+ ->get();
+
+ // Generates:
+ // SELECT * FROM (`my_table`) WHERE ( `a` = 'a' OR ( `b` = 'b' AND `c` = 'c' ) ) AND `d` = 'd'
+
+.. note:: groups need to be balanced, make sure every group_start() is matched by a group_end().
+
+$this->db->group_start()
+========================
+
+Starts a new group by adding an opening parenthesis to the WHERE clause of the query.
+
+$this->db->or_group_start()
+===========================
+
+Starts a new group by adding an opening parenthesis to the WHERE clause of the query, prefixing it with 'OR'.
+
+$this->db->not_group_start()
+============================
+
+Starts a new group by adding an opening parenthesis to the WHERE clause of the query, prefixing it with 'NOT'.
+
+$this->db->or_not_group_start()
+===============================
+
+Starts a new group by adding an opening parenthesis to the WHERE clause of the query, prefixing it with 'OR NOT'.
+
+$this->db->group_end()
+======================
+
+Ends the current group by adding an closing parenthesis to the WHERE clause of the query.
+
+**************
+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
+object.
+
+.. note:: All values are escaped automatically producing safer queries.
+
+$this->db->get_compiled_insert()
+================================
+Compiles the insertion query just like `$this->db->insert()`_ but does not
+*run* the query. This method simply returns the SQL query as a string.
+
+Example::
+
+ $data = array(
+ 'title' => 'My title',
+ 'name' => 'My Name',
+ 'date' => 'My date'
+ );
+
+ $sql = $this->db->set($data)->get_compiled_insert('mytable');
+ echo $sql;
+
+ // Produces string: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date')
+
+The second parameter enables you to set whether or not the active record query
+will be reset (by default it will be--just like `$this->db->insert()`_)::
+
+ echo $this->db->set('title', 'My Title')->get_compiled_insert('mytable', FALSE);
+
+ // Produces string: INSERT INTO mytable (title) VALUES ('My Title')
+
+ echo $this->db->set('content', 'My Content')->get_compiled_insert();
+
+ // Produces string: INSERT INTO mytable (title, content) VALUES ('My Title', 'My Content')
+
+The key thing to notice in the above example is that the second query did not
+utlize `$this->db->from()`_ nor did it pass a table name into the first
+parameter. The reason this worked is because the query has not been executed
+using `$this->db->insert()`_ which resets values or reset directly using
+`$this->db->reset_query()`_.
+
+$this->db->insert_batch()
+=========================
+
+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(
+ array(
+ 'title' => 'My title',
+ 'name' => 'My Name',
+ 'date' => 'My date'
+ ),
+ array(
+ 'title' => 'Another title',
+ 'name' => 'Another Name',
+ 'date' => 'Another date'
+ )
+ );
+
+ $this->db->insert_batch('mytable', $data);
+ // Produces: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date'), ('Another title', 'Another name', 'Another 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.
+
+$this->db->update_batch()
+=========================
+
+Generates an update 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(
+ array(
+ 'title' => 'My title' ,
+ 'name' => 'My Name 2' ,
+ 'date' => 'My date 2'
+ ),
+ array(
+ 'title' => 'Another title' ,
+ 'name' => 'Another Name 2' ,
+ 'date' => 'Another date 2'
+ )
+ );
+
+ $this->db->update_batch('mytable', $data, 'title');
+
+ // Produces:
+ // UPDATE `mytable` SET `name` = CASE
+ // WHEN `title` = 'My title' THEN 'My Name 2'
+ // WHEN `title` = 'Another title' THEN 'Another Name 2'
+ // ELSE `name` END,
+ // `date` = CASE
+ // WHEN `title` = 'My title' THEN 'My date 2'
+ // WHEN `title` = 'Another title' THEN 'Another date 2'
+ // ELSE `date` END
+ // WHERE `title` IN ('My title','Another title')
+
+The first parameter will contain the table name, the second is an associative
+array of values, the third parameter is the where key.
+
+.. note:: All values are escaped automatically producing safer queries.
+
+$this->db->get_compiled_update()
+================================
+
+This works exactly the same way as ``$this->db->get_compiled_insert()`` except
+that it produces an UPDATE SQL string instead of an INSERT SQL string.
+
+For more information view documentation for `$this->db->get_compiled_insert()`_.
+
+
+*************
+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 than 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".
+
+$this->db->get_compiled_delete()
+================================
+This works exactly the same way as ``$this->db->get_compiled_insert()`` except
+that it produces a DELETE SQL string instead of an INSERT SQL string.
+
+For more information view documentation for `$this->db->get_compiled_insert()`_.
+
+***************
+Method Chaining
+***************
+
+Method chaining allows you to simplify your syntax by connecting
+multiple functions. Consider this example::
+
+ $query = $this->db->select('title')
+ ->where('id', $id)
+ ->limit(10, 20)
+ ->get('mytable');
+
+.. _ar-caching:
+
+*********************
+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, group_by, having, order_by, set
+
+
+$this->db->reset_query()
+========================
+
+Resetting Active Record allows you to start fresh with your query without
+executing it first using a method like $this->db->get() or $this->db->insert().
+Just like the methods that execute a query, this will *not* reset items you've
+cached using `Active Record Caching`_.
+
+This is useful in situations where you are using Active Record to generate SQL
+(ex. ``$this->db->get_compiled_select()``) but then choose to, for instance,
+run the query::
+
+ // Note that the second parameter of the get_compiled_select method is FALSE
+ $sql = $this->db->select(array('field1','field2'))
+ ->where('field3',5)
+ ->get_compiled_select('mytable', FALSE);
+
+ // ...
+ // Do something crazy with the SQL code... like add it to a cron script for
+ // later execution or something...
+ // ...
+
+ $data = $this->db->get()->result_array();
+
+ // Would execute and return an array of results of the following query:
+ // SELECT field1, field1 from mytable where field3 = 5;
diff --git a/user_guide_src/source/database/caching.rst b/user_guide_src/source/database/caching.rst
new file mode 100644
index 000000000..d73120a93
--- /dev/null
+++ b/user_guide_src/source/database/caching.rst
@@ -0,0 +1,162 @@
+######################
+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.
+
+.. important:: 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();
+
diff --git a/user_guide_src/source/database/call_function.rst b/user_guide_src/source/database/call_function.rst
new file mode 100644
index 000000000..9890fc453
--- /dev/null
+++ b/user_guide_src/source/database/call_function.rst
@@ -0,0 +1,39 @@
+#####################
+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_src/source/database/configuration.rst b/user_guide_src/source/database/configuration.rst
new file mode 100644
index 000000000..040e7e33f
--- /dev/null
+++ b/user_guide_src/source/database/configuration.rst
@@ -0,0 +1,173 @@
+######################
+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. You can also set
+database connection values for specific
+:doc:`environments <../libraries/config>` by placing **database.php**
+it the respective environment config folder.
+
+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";
+ $db['default']['swap_pre'] = "";
+ $db['default']['autoinit'] = TRUE;
+ $db['default']['stricton'] = FALSE;
+
+If you use PDO as your dbdriver, you can specify the full DSN string describe a connection to the database like this::
+
+ $db['default']['dsn'] = 'pgsql:host=localhost;port=5432;dbname=database_name';
+
+You can also specify failovers for the situation when the main connection cannot connect for some reason.
+These failovers can be specified by setting the failover for a connection like this::
+
+ $db['default']['failover'] = array(
+ array(
+ 'hostname' => 'localhost1',
+ 'username' => '',
+ 'password' => '',
+ 'database' => '',
+ 'dbdriver' => 'mysql',
+ 'dbprefix' => '',
+ 'pconnect' => TRUE,
+ 'db_debug' => TRUE,
+ 'cache_on' => FALSE,
+ 'cachedir' => '',
+ 'char_set' => 'utf8',
+ 'dbcollat' => 'utf8_general_ci',
+ 'swap_pre' => '',
+ 'autoinit' => TRUE,
+ 'stricton' => FALSE
+ ),
+ array(
+ 'hostname' => 'localhost2',
+ 'username' => '',
+ 'password' => '',
+ 'database' => '',
+ 'dbdriver' => 'mysql',
+ 'dbprefix' => '',
+ 'pconnect' => TRUE,
+ 'db_debug' => TRUE,
+ 'cache_on' => FALSE,
+ 'cachedir' => '',
+ 'char_set' => 'utf8',
+ 'dbcollat' => 'utf8_general_ci',
+ 'swap_pre' => '',
+ 'autoinit' => TRUE,
+ 'stricton' => FALSE
+ )
+ );
+
+You can specify as many failovers as you like.
+
+The reason we use a multi-dimensional array rather than a more simple
+one is to permit you to optionally store multiple sets of connection
+values. If, for example, you run multiple environments (development,
+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";
+ $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::
+
+ $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 :doc:`Active Record Class <active_record>` 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:
+----------------------
+
+====================== ==================================================================================================
+ Name Config Description
+====================== ==================================================================================================
+**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 :doc:
+ `Active Record <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 :doc:`Database Caching Class <caching>`.
+**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
+
+ .. 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.
+
+**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.
+**port** The database port number. 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.
diff --git a/user_guide_src/source/database/connecting.rst b/user_guide_src/source/database/connecting.rst
new file mode 100644
index 000000000..fb4524116
--- /dev/null
+++ b/user_guide_src/source/database/connecting.rst
@@ -0,0 +1,153 @@
+###########################
+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
+--------------------
+
+#. The database connection values, passed either as an array or a DSN
+ string.
+#. TRUE/FALSE (boolean). Whether to return the connection ID (see
+ Connecting to Multiple Databases below).
+#. TRUE/FALSE (boolean). Whether to enable the Active Record class. Set
+ to TRUE by default.
+
+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. 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 :doc:`configuration
+page <configuration>`.
+
+.. note:: For the PDO driver, $config['hostname'] should look like
+ this: 'mysql:host=localhost'
+
+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.
+
+.. note:: 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...
+
+.. note:: You don't need to create separate database configurations if you
+ only need to use a different database on the same connection. You
+ can switch to a different database when you need to, like this:
+
+ | $this->db->db_select($database2_name);
+
+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();
+
+Manually closing the Connection
+===============================
+
+While CodeIgniter intelligently takes care of closing your database
+connections, you can explicitly close the connection.
+
+::
+
+ $this->db->close();
+
diff --git a/user_guide_src/source/database/examples.rst b/user_guide_src/source/database/examples.rst
new file mode 100644
index 000000000..d1cd48837
--- /dev/null
+++ b/user_guide_src/source/database/examples.rst
@@ -0,0 +1,136 @@
+##################################
+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 :doc:`configuration <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 :doc:`connecting <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 :doc:`Active Record Pattern <active_record>` 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 :doc:`Active Record <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}')
+
diff --git a/user_guide_src/source/database/fields.rst b/user_guide_src/source/database/fields.rst
new file mode 100644
index 000000000..b706ace7d
--- /dev/null
+++ b/user_guide_src/source/database/fields.rst
@@ -0,0 +1,80 @@
+##########
+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_src/source/database/forge.rst b/user_guide_src/source/database/forge.rst
new file mode 100644
index 000000000..bf17e2918
--- /dev/null
+++ b/user_guide_src/source/database/forge.rst
@@ -0,0 +1,268 @@
+####################
+Database Forge Class
+####################
+
+The Database Forge Class contains functions that help you manage your
+database.
+
+.. contents:: 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
+
+An optional third parameter can be used to specify which existing column
+to add the new column after.
+
+::
+
+ $this->dbforge->add_column('table_name', $fields, 'after_field');
+
+
+$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
+change the name you can 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_src/source/database/helpers.rst b/user_guide_src/source/database/helpers.rst
new file mode 100644
index 000000000..7ea19e9f6
--- /dev/null
+++ b/user_guide_src/source/database/helpers.rst
@@ -0,0 +1,98 @@
+######################
+Query Helper Functions
+######################
+
+$this->db->insert_id()
+=======================
+
+The insert ID number when performing database inserts.
+
+.. note:: If using the PDO driver with PostgreSQL, this function requires
+ a $name parameter, which specifies the appropriate sequence to check
+ for the insert id.
+
+$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.
diff --git a/user_guide_src/source/database/index.rst b/user_guide_src/source/database/index.rst
new file mode 100644
index 000000000..ab12b7cb7
--- /dev/null
+++ b/user_guide_src/source/database/index.rst
@@ -0,0 +1,25 @@
+##################
+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.
+
+.. toctree::
+ :titlesonly:
+
+ Quick Start: Usage Examples <examples>
+ Database Configuration <configuration>
+ Connecting to a Database <connecting>
+ Running Queries <queries>
+ Generating Query Results <results>
+ Query Helper Functions <helpers>
+ Active Record Class <active_record>
+ Transactions <transactions>
+ Table MetaData <table_data>
+ Field MetaData <fields>
+ Custom Function Calls <call_function>
+ Query Caching <caching>
+ Database Manipulation with Database Forge <forge>
+ Database Utilities Class <utilities> \ No newline at end of file
diff --git a/user_guide_src/source/database/queries.rst b/user_guide_src/source/database/queries.rst
new file mode 100644
index 000000000..971d5d61d
--- /dev/null
+++ b/user_guide_src/source/database/queries.rst
@@ -0,0 +1,114 @@
+#######
+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 :doc:`show your
+results <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.
+
+***************************************
+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::
+
+ $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 three methods that help you do
+this:
+
+#. **$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).")";
+
+#. **$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)."')";
+
+#. **$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)."%'";
+
+
+**************
+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.
diff --git a/user_guide_src/source/database/results.rst b/user_guide_src/source/database/results.rst
new file mode 100644
index 000000000..4f93c794d
--- /dev/null
+++ b/user_guide_src/source/database/results.rst
@@ -0,0 +1,186 @@
+########################
+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;
+ }
+ }
+
+You can also pass a string to result() which represents a class to
+instantiate for each result object (note: this class must be loaded)
+
+::
+
+ $query = $this->db->query("SELECT * FROM users;");
+
+ foreach ($query->result('User') as $user)
+ {
+ echo $user->name; // call attributes
+ echo $user->reverse_name(); // or methods defined on the 'User' class
+ }
+
+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);
+
+You can also add a second String parameter, which is the name of a class
+to instantiate the row with::
+
+ $query = $this->db->query("SELECT * FROM users LIMIT 1;");
+ $query->row(0, 'User');
+
+ echo $row->name; // call attributes
+ echo $row->reverse_name(); // or methods defined on the 'User' class
+
+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
+
diff --git a/user_guide_src/source/database/table_data.rst b/user_guide_src/source/database/table_data.rst
new file mode 100644
index 000000000..744a05154
--- /dev/null
+++ b/user_guide_src/source/database/table_data.rst
@@ -0,0 +1,31 @@
+##########
+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.
diff --git a/user_guide_src/source/database/transactions.rst b/user_guide_src/source/database/transactions.rst
new file mode 100644
index 000000000..e9190e59a
--- /dev/null
+++ b/user_guide_src/source/database/transactions.rst
@@ -0,0 +1,127 @@
+############
+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().
diff --git a/user_guide_src/source/database/utilities.rst b/user_guide_src/source/database/utilities.rst
new file mode 100644
index 000000000..b0920109f
--- /dev/null
+++ b/user_guide_src/source/database/utilities.rst
@@ -0,0 +1,224 @@
+######################
+Database Utility Class
+######################
+
+The Database Utility Class contains functions that help you manage your
+database.
+
+.. contents:: Table of Contents
+
+
+******************
+Function Reference
+******************
+
+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->database_exists();
+==================================
+
+Sometimes it's helpful to know whether a particular database exists.
+Returns a boolean TRUE/FALSE. Usage example::
+
+ if ($this->dbutil->database_exists('database_name'))
+ {
+ // some code...
+ }
+
+Note: Replace *database_name* with the name of the table you are
+looking for. This function is case sensitive.
+
+$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, third, and fourth parameters allow you to set the delimiter
+newline, and enclosure characters respectively. By default tabs are
+used as the delimiter, "\n" is used as a new line, and a double-quote
+is used as the enclosure. Example::
+
+ $delimiter = ",";
+ $newline = "\r\n";
+ $enclosure = '"';
+
+ echo $this->dbutil->csv_from_result($query, $delimiter, $newline, $enclosure);
+
+.. 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 :doc:`File Helper <../helpers/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 :doc:`File Helper <../helpers/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
+---------------------------------
+
+=============== ======================= ======================= ========================================================================
+Preference Default Value Options Description
+=============== ======================= ======================= ========================================================================
+**tables** empty array None An array of tables you want backed up. If left blank all tables will be
+ exported.
+**ignore** empty array None An array of tables you want the backup routine to ignore.
+**format** gzip gzip, zip, txt The file format of the export file.
+**filename** the current date/time None The name of the backed-up file. The name is needed only if you are using
+ zip compression.
+**add_drop** TRUE TRUE/FALSE Whether to include DROP TABLE statements in your SQL export file.
+**add_insert** TRUE TRUE/FALSE Whether 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_src/source/documentation/ELDocs.tmbundle.zip b/user_guide_src/source/documentation/ELDocs.tmbundle.zip
new file mode 100644
index 000000000..f7a11b364
--- /dev/null
+++ b/user_guide_src/source/documentation/ELDocs.tmbundle.zip
Binary files differ
diff --git a/user_guide_src/source/documentation/index.rst b/user_guide_src/source/documentation/index.rst
new file mode 100644
index 000000000..e977566d2
--- /dev/null
+++ b/user_guide_src/source/documentation/index.rst
@@ -0,0 +1,195 @@
+#################################
+Writing CodeIgniter Documentation
+#################################
+
+CodeIgniter uses Sphinx to generate its documentation in a variety of formats,
+using reStructuredText to handle the formatting. If you are familiar with
+Markdown or Textile, you will quickly grasp reStructuredText. The focus is
+on readability, user friendliness, and an "I've got your hand, baby" feel.
+While they can be quite technical, we always write for humans!
+
+A table of contents should always be included like the one below.
+It is created automatically by inserting the ``.. contents::``
+directive on a line by itself.
+
+.. contents:: Page Contents
+
+
+**************
+Tools Required
+**************
+
+To see the rendered HTML, ePub, PDF, etc., you will need to install Sphinx
+along with the PHP domain extension for Sphinx. The underlying requirement
+is to have Python installed. Lastly, you will install the CI Lexer for
+Pygments, so that code blocks can be properly highlighted.
+
+.. code-block:: bash
+
+ easy_install sphinx
+ easy_install sphinxcontrib-phpdomain
+
+Then follow the directions in the README file in the :samp:`cilexer` folder
+inside the documentation repository to install the CI Lexer.
+
+
+
+*****************************************
+Page and Section Headings and Subheadings
+*****************************************
+
+Headings not only provide order and sections within a page, but they also
+are used to automatically build both the page and document table of contents.
+Headings are formed by using certain characters as underlines for a bit of
+text. Major headings, like page titles and section headings also use
+overlines. Other headings just use underlines, with the following hierarchy::
+
+ # with overline for page titles
+ * with overline for major sections
+ = for subsections
+ - for subsubsections
+ ^ for subsubsubsections
+ " for subsubsubsubsections (!)
+
+The :download:`TextMate ELDocs Bundle <./ELDocs.tmbundle.zip>` can help you
+create these with the following tab triggers::
+
+ title->
+
+ ##########
+ Page Title
+ ##########
+
+ sec->
+
+ *************
+ Major Section
+ *************
+
+ sub->
+
+ Subsection
+ ==========
+
+ sss->
+
+ SubSubSection
+ -------------
+
+ ssss->
+
+ SubSubSubSection
+ ^^^^^^^^^^^^^^^^
+
+ sssss->
+
+ SubSubSubSubSection (!)
+ """""""""""""""""""""""
+
+
+
+
+********************
+Method Documentation
+********************
+
+When documenting class methods for third party developers, Sphinx provides
+directives to assist and keep things simple. For example, consider the following
+ReST:
+
+.. code-block:: rst
+
+ .. php:class:: Some_class
+
+ some_method()
+ =============
+
+ .. php:method:: some_method ( $foo [, $bar [, $bat]])
+
+ This function will perform some action. The ``$bar`` array must contain
+ a something and something else, and along with ``$bat`` is an optional
+ parameter.
+
+ :param int $foo: the foo id to do something in
+ :param mixed $bar: A data array that must contain aa something and something else
+ :param bool $bat: whether or not to do something
+ :returns: FALSE on failure, TRUE if successful
+ :rtype: Boolean
+
+ ::
+
+ $this->load->library('some_class');
+
+ $bar = array(
+ 'something' => 'Here is this parameter!',
+ 'something_else' => 42
+ );
+
+ $bat = $this->some_class->should_do_something();
+
+ if ($this->some_class->some_method(4, $bar, $bat) === FALSE)
+ {
+ show_error('An Error Occurred Doing Some Method');
+ }
+
+ .. note:: Here is something that you should be aware of when using some_method().
+ For real.
+
+ See also :php:meth:`Some_class::should_do_something`
+
+ should_do_something()
+ =====================
+
+ .. php:method:: should_do_something()
+
+ :returns: whether or something should be done or not
+ :rtype: Boolean
+
+
+It creates the following display:
+
+.. php:class:: Some_class
+
+some_method()
+=============
+
+ .. php:method:: some_method ( $foo [, $bar [, $bat]])
+
+ This function will perform some action. The ``$bar`` array must contain
+ a something and something else, and along with ``$bat`` is an optional
+ parameter.
+
+ :param int $foo: the foo id to do something in
+ :param mixed $bar: A data array that must contain aa something and something else
+ :param bool $bat: whether or not to do something
+ :returns: FALSE on failure, TRUE if successful
+ :rtype: Boolean
+
+ ::
+
+ $this->load->library('some_class');
+
+ $bar = array(
+ 'something' => 'Here is this parameter!',
+ 'something_else' => 42
+ );
+
+ $bat = $this->some_class->should_do_something();
+
+ if ($this->some_class->some_method(4, $bar, $bat) === FALSE)
+ {
+ show_error('An Error Occurred Doing Some Method');
+ }
+
+ .. note:: Here is something that you should be aware of when using some_method().
+ For real.
+
+ See also :php:meth:`Some_class::should_do_something`
+
+should_do_something()
+=====================
+
+ .. php:method:: should_do_something()
+
+ :returns: whether or something should be done or not
+ :rtype: Boolean
diff --git a/user_guide_src/source/general/alternative_php.rst b/user_guide_src/source/general/alternative_php.rst
new file mode 100644
index 000000000..4dc857a50
--- /dev/null
+++ b/user_guide_src/source/general/alternative_php.rst
@@ -0,0 +1,76 @@
+###################################
+Alternate PHP Syntax for View Files
+###################################
+
+If you do not utilize CodeIgniter's :doc:`template
+engine <../libraries/parser>`, 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; ?>
+
diff --git a/user_guide_src/source/general/ancillary_classes.rst b/user_guide_src/source/general/ancillary_classes.rst
new file mode 100644
index 000000000..f7c87011b
--- /dev/null
+++ b/user_guide_src/source/general/ancillary_classes.rst
@@ -0,0 +1,49 @@
+##########################
+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.
diff --git a/user_guide_src/source/general/autoloader.rst b/user_guide_src/source/general/autoloader.rst
new file mode 100644
index 000000000..259a4987e
--- /dev/null
+++ b/user_guide_src/source/general/autoloader.rst
@@ -0,0 +1,23 @@
+######################
+Auto-loading Resources
+######################
+
+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.
+
+The following items can be loaded automatically:
+
+- Core classes found in the "libraries" folder
+- Helper files found in the "helpers" 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.
diff --git a/user_guide_src/source/general/caching.rst b/user_guide_src/source/general/caching.rst
new file mode 100644
index 000000000..bf6ed50f6
--- /dev/null
+++ b/user_guide_src/source/general/caching.rst
@@ -0,0 +1,58 @@
+################
+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 application/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.
+
+.. important:: Because of the way CodeIgniter stores content for output,
+ caching will only work if you are generating display for your controller
+ with a :doc:`view <./views>`.
+
+.. note:: Before the cache files can be written you must set the file
+ permissions on your application/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.
diff --git a/user_guide_src/source/general/cli.rst b/user_guide_src/source/general/cli.rst
new file mode 100644
index 000000000..7dc1ca319
--- /dev/null
+++ b/user_guide_src/source/general/cli.rst
@@ -0,0 +1,78 @@
+###################
+Running via the CLI
+###################
+
+As well as calling an applications :doc:`Controllers <./controllers>`
+via the URL in a browser they can also be loaded via the command-line
+interface (CLI).
+
+.. contents:: Page Contents
+
+What is the CLI?
+================
+
+The command-line interface is a text-based method of interacting with
+computers. For more information, check the `Wikipedia
+article <http://en.wikipedia.org/wiki/Command-line_interface>`_.
+
+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 ``$this->input->is_cli_request()``
+- 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::
+
+ <?php
+ class Tools extends CI_Controller {
+
+ public function message($to = 'World')
+ {
+ echo "Hello {$to}!".PHP_EOL;
+ }
+ }
+ ?>
+
+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.
+
+.. code-block:: bash
+
+ $ cd /path/to/project;
+ $ php index.php tools message
+
+If you did it right, you should see Hello World!.
+
+.. code-block:: bash
+
+ $ 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.
diff --git a/user_guide_src/source/general/common_functions.rst b/user_guide_src/source/general/common_functions.rst
new file mode 100644
index 000000000..70563b8d2
--- /dev/null
+++ b/user_guide_src/source/general/common_functions.rst
@@ -0,0 +1,81 @@
+################
+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.
+
+::
+
+ 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 :doc:`Config library <../libraries/config>` 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 :doc:`Error Handling <errors>` 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 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html>`_ for
+a full list of headers.
+
+remove_invisible_characters($str)
+===================================
+
+This function prevents inserting null characters between ascii
+characters, like Java\\0script.
+
+html_escape($mixed)
+====================
+
+This function provides short cut for htmlspecialchars() function. It
+accepts string and array. To prevent Cross Site Scripting (XSS), it is
+very useful.
diff --git a/user_guide_src/source/general/controllers.rst b/user_guide_src/source/general/controllers.rst
new file mode 100644
index 000000000..6e5079419
--- /dev/null
+++ b/user_guide_src/source/general/controllers.rst
@@ -0,0 +1,324 @@
+###########
+Controllers
+###########
+
+Controllers are the heart of your application, as they determine how
+HTTP requests should be handled.
+
+.. contents:: Page Contents
+
+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::
+
+ <?php
+ class Blog extends CI_Controller {
+
+ public function index()
+ {
+ echo 'Hello World!';
+ }
+ }
+ ?>
+
+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 CI_Controller {
+
+ }
+ ?>
+
+
+This is **not** valid::
+
+ <?php
+ class blog extends CI_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::
+
+ <?php
+ class Blog extends CI_Controller {
+
+ public function index()
+ {
+ echo 'Hello World!';
+ }
+
+ public function comments()
+ {
+ echo 'Look at this!';
+ }
+ }
+ ?>
+
+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 CI_Controller {
+
+ public function shoes($sandals, $id)
+ {
+ echo $sandals;
+ echo $id;
+ }
+ }
+ ?>
+
+.. important:: If you are using the :doc:`URI Routing <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::
+
+ public 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 to the _remap() function::
+
+ public function _remap($method)
+ {
+ if ($method == 'some_method')
+ {
+ $this->$method();
+ }
+ else
+ {
+ $this->default_method();
+ }
+ }
+
+Any extra segments after the method name are passed into _remap() as an
+optional second parameter. This array can be used in combination with
+PHP's `call_user_func_array <http://php.net/call_user_func_array>`_
+to emulate CodeIgniter's default behavior.
+
+::
+
+ public function _remap($method, $params = array())
+ {
+ $method = 'process_'.$method;
+ if (method_exists($this, $method))
+ {
+ return call_user_func_array(array($this, $method), $params);
+ }
+ show_404();
+ }
+
+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 :doc:`Views <views>` and :doc:`Output class <../libraries/output>` 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::
+
+ public function _output($output)
+ {
+ echo $output;
+ }
+
+.. note:: 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 :doc:`feature <../libraries/output>`) before it is
+ handed off to the _output() function.
+ To have your controller's output cached properly, its _output() method
+ can use::
+
+ if ($this->output->cache_expiration > 0)
+ {
+ $this->output->_write_cache($output);
+ }
+
+ 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 :doc:`Output Class <../libraries/output>`.
+
+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::
+
+ private 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 :doc:`URI
+Routing <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::__construct();
+
+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.
+
+::
+
+ <?php
+ class Blog extends CI_Controller {
+
+ public function __construct()
+ {
+ parent::__construct();
+ // Your own constructor code
+ }
+ }
+ ?>
+
+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 :doc:`Reserved Names <reserved_names>` for a full
+list.
+
+That's it!
+==========
+
+That, in a nutshell, is all there is to know about controllers.
diff --git a/user_guide_src/source/general/core_classes.rst b/user_guide_src/source/general/core_classes.rst
new file mode 100644
index 000000000..ac41407f7
--- /dev/null
+++ b/user_guide_src/source/general/core_classes.rst
@@ -0,0 +1,120 @@
+############################
+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
+- Utf8
+
+Replacing Core Classes
+======================
+
+To use one of your own system classes instead of a default one simply
+place your version inside your local application/core directory::
+
+ application/core/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/core/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 __construct()
+ {
+ parent::__construct();
+ }
+ }
+
+**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 __construct()
+ {
+ parent::__construct();
+ }
+
+ 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.
diff --git a/user_guide_src/source/general/creating_drivers.rst b/user_guide_src/source/general/creating_drivers.rst
new file mode 100644
index 000000000..0e22e4f14
--- /dev/null
+++ b/user_guide_src/source/general/creating_drivers.rst
@@ -0,0 +1,20 @@
+################
+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()
diff --git a/user_guide_src/source/general/creating_libraries.rst b/user_guide_src/source/general/creating_libraries.rst
new file mode 100644
index 000000000..bc545b483
--- /dev/null
+++ b/user_guide_src/source/general/creating_libraries.rst
@@ -0,0 +1,226 @@
+##################
+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. 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 {
+
+ public function some_function()
+ {
+ }
+ }
+
+ /* End of file Someclass.php */
+
+Using Your Class
+================
+
+From within any of your :doc:`Controller <controllers>` 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 as an
+array 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 {
+
+ public function __construct($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.
+
+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 {
+
+ public function __construct()
+ {
+ parent::__construct();
+ }
+ }
+
+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.
diff --git a/user_guide_src/source/general/credits.rst b/user_guide_src/source/general/credits.rst
new file mode 100644
index 000000000..2c7459894
--- /dev/null
+++ b/user_guide_src/source/general/credits.rst
@@ -0,0 +1,19 @@
+#######
+Credits
+#######
+
+CodeIgniter was originally developed by `Rick
+Ellis <http://www.ellislab.com/>`_ (CEO of `EllisLab,
+Inc. <http://ellislab.com/>`_). 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 <http://www.expressionengine.com/>`_.
+
+It is currently developed and maintained by the ExpressionEngine
+Development Team.
+Bleeding edge development is spearheaded by the handpicked contributors
+of the Reactor 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.
diff --git a/user_guide_src/source/general/drivers.rst b/user_guide_src/source/general/drivers.rst
new file mode 100644
index 000000000..e2ded62e2
--- /dev/null
+++ b/user_guide_src/source/general/drivers.rst
@@ -0,0 +1,40 @@
+#########################
+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 :doc:`controllers <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 :doc:`create
+your own drivers <creating_drivers>`.
diff --git a/user_guide_src/source/general/environments.rst b/user_guide_src/source/general/environments.rst
new file mode 100644
index 000000000..40725feba
--- /dev/null
+++ b/user_guide_src/source/general/environments.rst
@@ -0,0 +1,46 @@
+##############################
+Handling Multiple Environments
+##############################
+
+Developers often desire different system behavior depending on whether
+an application is running in a development or production environment.
+For example, verbose error output is something that would be useful
+while developing an application, but it may also pose a security issue
+when "live".
+
+The ENVIRONMENT Constant
+========================
+
+By default, CodeIgniter comes with the environment constant set to
+'development'. At the top of index.php, you will see::
+
+ define('ENVIRONMENT', 'development');
+
+In addition to affecting some basic framework behavior (see the next
+section), you may use this constant in your own development to
+differentiate between which environment you are running in.
+
+Effects On Default Framework Behavior
+=====================================
+
+There are some places in the CodeIgniter system where the ENVIRONMENT
+constant is used. This section describes how default framework behavior
+is affected.
+
+Error Reporting
+---------------
+
+Setting the ENVIRONMENT constant to a value of 'development' will cause
+all PHP errors to be rendered to the browser when they occur.
+Conversely, setting the constant to 'production' will disable all error
+output. Disabling error reporting in production is a :doc:`good security
+practice <security>`.
+
+Configuration Files
+-------------------
+
+Optionally, you can have CodeIgniter load environment-specific
+configuration files. This may be useful for managing things like
+differing API keys across multiple environments. This is described in
+more detail in the environment section of the `Config
+Class <../libraries/config.html#environments>`_ documentation.
diff --git a/user_guide_src/source/general/errors.rst b/user_guide_src/source/general/errors.rst
new file mode 100644
index 000000000..91b59140f
--- /dev/null
+++ b/user_guide_src/source/general/errors.rst
@@ -0,0 +1,84 @@
+##############
+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' [, 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' [, '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')
+================================
+
+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:
+
+#. Error Messages. These are actual errors, such as PHP errors or user
+ errors.
+#. Debug Messages. These are messages that assist in debugging. For
+ example, if a class has been initialized, you could log this as
+ debugging info.
+#. 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.
+
+.. 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 in application/config/config.php. 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_src/source/general/helpers.rst b/user_guide_src/source/general/helpers.rst
new file mode 100644
index 000000000..3a98311a6
--- /dev/null
+++ b/user_guide_src/source/general/helpers.rst
@@ -0,0 +1,143 @@
+################
+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 :doc:`controller <../general/controllers>` and
+:doc:`views <../general/views>`.
+
+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.
+
+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.
diff --git a/user_guide_src/source/general/hooks.rst b/user_guide_src/source/general/hooks.rst
new file mode 100644
index 000000000..65696f6c7
--- /dev/null
+++ b/user_guide_src/source/general/hooks.rst
@@ -0,0 +1,118 @@
+####################################
+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 :doc:`Application Flow <../overview/appflow>` 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.
+- **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_src/source/general/index.rst b/user_guide_src/source/general/index.rst
new file mode 100644
index 000000000..2162b8140
--- /dev/null
+++ b/user_guide_src/source/general/index.rst
@@ -0,0 +1,32 @@
+##############
+General Topics
+##############
+
+.. toctree::
+ :titlesonly:
+
+ urls
+ controllers
+ reserved_names
+ views
+ models
+ Helpers <helpers>
+ libraries
+ creating_libraries
+ drivers
+ creating_drivers
+ core_classes
+ ancillary_classes
+ hooks
+ autoloader
+ common_functions
+ routing
+ errors
+ Caching <caching>
+ profiling
+ cli
+ managing_apps
+ environments
+ alternative_php
+ security
+ PHP Style Guide <styleguide>
diff --git a/user_guide_src/source/general/libraries.rst b/user_guide_src/source/general/libraries.rst
new file mode 100644
index 000000000..954a5b8f8
--- /dev/null
+++ b/user_guide_src/source/general/libraries.rst
@@ -0,0 +1,31 @@
+###########################
+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 :doc:`controller <controllers>` 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 form validation class you would do this::
+
+ $this->load->library('form_validation');
+
+Once initialized you can use it as indicated in the user guide page
+corresponding to that class.
+
+Additionally, multiple libraries can be loaded at the same time by
+passing an array of libraries to the load function.
+
+::
+
+ $this->load->library(array('email', 'table'));
+
+Creating Your Own Libraries
+===========================
+
+Please read the section of the user guide that discusses how to :doc:`create
+your own libraries <creating_libraries>`
diff --git a/user_guide_src/source/general/managing_apps.rst b/user_guide_src/source/general/managing_apps.rst
new file mode 100644
index 000000000..996481354
--- /dev/null
+++ b/user_guide_src/source/general/managing_apps.rst
@@ -0,0 +1,65 @@
+##########################
+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 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 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 = "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_src/source/general/models.rst b/user_guide_src/source/general/models.rst
new file mode 100644
index 000000000..b816f958a
--- /dev/null
+++ b/user_guide_src/source/general/models.rst
@@ -0,0 +1,184 @@
+######
+Models
+######
+
+Models are **optionally** available for those who want to use a more
+traditional MVC approach.
+
+.. contents:: Page Contents
+
+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 CI_Model {
+
+ var $title = '';
+ var $content = '';
+ var $date = '';
+
+ function __construct()
+ {
+ // Call the Model constructor
+ parent::__construct();
+ }
+
+ 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 :doc:`Active
+ Record <../database/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 :doc:`Input Class <../libraries/input>`
+ $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 CI_Model {
+
+ function __construct()
+ {
+ parent::__construct();
+ }
+ }
+
+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 CI_Model {
+
+ function __construct()
+ {
+ parent::__construct();
+ }
+ }
+
+Your file will be this::
+
+ application/models/user_model.php
+
+Loading a Model
+===============
+
+Your models will typically be loaded and called from within your
+:doc:`controller <controllers>` functions. To load a model you will use
+the following function::
+
+ $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');
+
+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 CI_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 :doc:`described
+ here <../database/connecting>`, 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);
+
+
diff --git a/user_guide_src/source/general/profiling.rst b/user_guide_src/source/general/profiling.rst
new file mode 100644
index 000000000..437635289
--- /dev/null
+++ b/user_guide_src/source/general/profiling.rst
@@ -0,0 +1,83 @@
+##########################
+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 :doc:`Output Class <../libraries/output>` if
+ profiling is enabled as shown below.
+
+Enabling the Profiler
+=====================
+
+To enable the profiler place the following function anywhere within your
+:doc:`Controller <controllers>` 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 :doc:`Benchmark
+Class <../libraries/benchmark>` 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
+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 :doc:`Output
+class <../libraries/output>`::
+
+ $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.
+
+======================= =================================================================== ========
+Key Description Default
+======================= =================================================================== ========
+**benchmarks** Elapsed time of Benchmark points and total execution time TRUE
+**config** CodeIgniter Config variables TRUE
+**controller_info** The Controller class and method requested TRUE
+**get** Any GET data passed in the request TRUE
+**http_headers** The HTTP headers for the current request TRUE
+**memory_usage** Amount of memory consumed by the current request, in bytes TRUE
+**post** Any POST data passed in the request TRUE
+**queries** Listing of all database queries executed, including execution time TRUE
+**uri_string** The URI of the current request TRUE
+**session_data** Data stored in the current session TRUE
+**query_toggle_count** The number of queries after which the query block will default to 25
+ hidden.
+======================= =================================================================== ======== \ No newline at end of file
diff --git a/user_guide_src/source/general/quick_reference.rst b/user_guide_src/source/general/quick_reference.rst
new file mode 100644
index 000000000..b9108a528
--- /dev/null
+++ b/user_guide_src/source/general/quick_reference.rst
@@ -0,0 +1,11 @@
+#####################
+Quick Reference Chart
+#####################
+
+For a PDF version of this chart, `click
+here <http://codeigniter.com/download_files/ci_quick_ref.pdf>`_.
+
+.. figure:: ../images/ci_quick_ref.png
+ :align: center
+ :alt:
+
diff --git a/user_guide_src/source/general/requirements.rst b/user_guide_src/source/general/requirements.rst
new file mode 100644
index 000000000..38623557d
--- /dev/null
+++ b/user_guide_src/source/general/requirements.rst
@@ -0,0 +1,8 @@
+###################
+Server Requirements
+###################
+
+- `PHP <http://www.php.net/>`_ version 5.1.6 or newer.
+- A Database is required for most web application programming. Current
+ supported databases are MySQL (4.1+), MySQLi, MS SQL, Postgres, Oracle,
+ SQLite, ODBC and CUBRID. \ No newline at end of file
diff --git a/user_guide_src/source/general/reserved_names.rst b/user_guide_src/source/general/reserved_names.rst
new file mode 100644
index 000000000..5ce7fc2ff
--- /dev/null
+++ b/user_guide_src/source/general/reserved_names.rst
@@ -0,0 +1,66 @@
+##############
+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 any of these:
+
+- Controller
+- CI_Base
+- _ci_initialize
+- Default
+- index
+
+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
+---------
+
+- ENVIRONMENT
+- 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
+
diff --git a/user_guide_src/source/general/routing.rst b/user_guide_src/source/general/routing.rst
new file mode 100644
index 000000000..45950fc11
--- /dev/null
+++ b/user_guide_src/source/general/routing.rst
@@ -0,0 +1,133 @@
+###########
+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)** 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 a number 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['404_override'] = '';
+
+This route indicates which controller class should be loaded if the
+requested controller is not found. It will override the default 404
+error page. It won't affect to the show_404() function, which will
+continue loading the default error_404.php file at
+application/errors/error_404.php.
+
+.. important:: The reserved routes must come before any wildcard or
+ regular expression routes.
diff --git a/user_guide_src/source/general/security.rst b/user_guide_src/source/general/security.rst
new file mode 100644
index 000000000..4d7a213d1
--- /dev/null
+++ b/user_guide_src/source/general/security.rst
@@ -0,0 +1,90 @@
+########
+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: -
+
+Register_globals
+=================
+
+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.
+
+error_reporting
+================
+
+In production environments, it is typically desirable to disable PHP's
+error reporting by setting the internal error_reporting flag to a value
+of 0. This disables native PHP errors from being rendered as output,
+which may potentially contain sensitive information.
+
+Setting CodeIgniter's **ENVIRONMENT** constant in index.php to a value of
+**\'production\'** will turn off these errors. In development mode, it is
+recommended that a value of 'development' is used. More information
+about differentiating between environments can be found on the :doc:`Handling
+Environments <environments>` page.
+
+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:
+
+#. Filter the data as if it were tainted.
+#. Validate the data to ensure it conforms to the correct type, length,
+ size, etc. (sometimes this step can replace step one)
+#. Escape the data before submitting it into your database.
+
+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
+:doc:`here <../libraries/security>`.
+
+Validate the data
+=================
+
+CodeIgniter has a :doc:`Form Validation
+Class <../libraries/form_validation>` 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
+:doc:`queries <../database/queries>` for more information.
+
+
diff --git a/user_guide_src/source/general/styleguide.rst b/user_guide_src/source/general/styleguide.rst
new file mode 100644
index 000000000..d8bdd0531
--- /dev/null
+++ b/user_guide_src/source/general/styleguide.rst
@@ -0,0 +1,668 @@
+###############
+PHP Style Guide
+###############
+
+
+The following page describes the use of coding rules adhered to when
+developing CodeIgniter.
+
+.. contents:: 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
+''''''''
+
+#. Open the Application Preferences
+#. Click Advanced, and then the "Saving" tab
+#. In "File Encoding", select "UTF-8 (recommended)"
+#. In "Line Endings", select "LF (recommended)"
+#. *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
+''''''
+
+#. Open the Application Preferences
+#. Select "Text Encodings" on the left.
+#. In "Default text encoding for new documents", select "Unicode (UTF-8,
+ no BOM)"
+#. *Optional:* In "If file's encoding can't be guessed, use", select
+ "Unicode (UTF-8, no BOM)"
+#. Select "Text Files" on the left.
+#. In "Default line breaks", select "Mac OS X and Unix (LF)"
+
+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 start with an uppercase letter. 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
+
+::
+
+ class Super_class {
+
+ function __construct()
+ {
+
+ }
+ }
+
+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 <http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#basics.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 CodeIgniter 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 <http://us3.php.net/manual/en/language.types.type-juggling.php#language.types.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. 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.
+
+
+Compatibility
+=============
+
+Unless specifically mentioned in your add-on's documentation, all code
+must be compatible with PHP version 5.1+. 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 CodeIgniter'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 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.
+
+**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++)
+ {
+ // ...
+ }
+ }
+
+ try {
+ // ...
+ }
+ catch() {
+ // ...
+ }
+
+**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++)
+ {
+ // ...
+ }
+ }
+
+ try
+ {
+ // ...
+ }
+ catch()
+ {
+ // ...
+ }
+
+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
+==============
+
+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 $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.
+
+::
+
+ 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 <http://us.php.net/manual/en/ref.errorfunc.php#ini.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)
+
diff --git a/user_guide_src/source/general/urls.rst b/user_guide_src/source/general/urls.rst
new file mode 100644
index 000000000..6b390b559
--- /dev/null
+++ b/user_guide_src/source/general/urls.rst
@@ -0,0 +1,97 @@
+################
+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
+
+
+#. The first segment represents the controller **class** that should be
+ invoked.
+#. The second segment represents the class **function**, or method, that
+ should be called.
+#. The third, and any additional segments, represent the ID and any
+ variables that will be passed to the controller.
+
+The :doc:`URI Class <../libraries/uri>` and the :doc:`URL Helper <../helpers/url_helper>` contain functions that make it
+easy to work with your URI data. In addition, your URLs can be remapped
+using the :doc:`URI Routing <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
+
+If your Apache server has mod_rewrite enabled, 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 %{REQUEST_FILENAME} !-f
+ RewriteCond %{REQUEST_FILENAME} !-d
+ RewriteRule ^(.*)$ index.php/$1 [L]
+
+In the above example, any HTTP request other than those for existing
+directories and existing files is treated as a request for your index.php file.
+
+.. note:: Note: These specific rules might not work for all server configurations.
+
+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
+
+.. 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.
diff --git a/user_guide_src/source/general/views.rst b/user_guide_src/source/general/views.rst
new file mode 100644
index 000000000..dc65f6c4f
--- /dev/null
+++ b/user_guide_src/source/general/views.rst
@@ -0,0 +1,216 @@
+#####
+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
+:doc:`controller <controllers>`. 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
+:doc:`Controllers <controllers>` page you should do so before
+continuing.
+
+Using the example controller you created in the
+:doc:`controller <controllers>` 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::
+
+ <html>
+ <head>
+ <title>My Blog</title>
+ </head>
+ <body>
+ <h1>Welcome to my Blog!</h1>
+ </body>
+ </html>
+
+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::
+
+ <?php
+ class Blog extends CI_Controller {
+
+ function index()
+ {
+ $this->load->view('blogview');
+ }
+ }
+ ?>
+
+If you visit 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 than 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 CI_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::
+
+ <?php
+ class Blog extends CI_Controller {
+
+ function index()
+ {
+ $data['title'] = "My Real Title";
+ $data['heading'] = "My Real Heading";
+
+ $this->load->view('blogview', $data);
+ }
+ }
+ ?>
+
+Now open your view file and change the text to variables that correspond
+to the array keys in your data::
+
+ <html>
+ <head>
+ <title><?php echo $title;?></title>
+ </head>
+ <body>
+ <h1><?php echo $heading;?></h1>
+ </body>
+ </html>
+
+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::
+
+ <?php
+ class Blog extends CI_Controller {
+
+ function index()
+ {
+ $data['todo_list'] = array('Clean House', 'Call Mom', 'Run Errands');
+
+ $data['title'] = "My Real Title";
+ $data['heading'] = "My Real Heading";
+
+ $this->load->view('blogview', $data);
+ }
+ }
+ ?>
+
+Now open your view file and create a loop::
+
+ <html>
+ <head>
+ <title><?php echo $title;?></title>
+ </head>
+ <body>
+ <h1><?php echo $heading;?></h1>
+
+ <h3>My Todo List</h3>
+
+ <ul>
+ <?php foreach ($todo_list as $item):?>
+
+ <li><?php echo $item;?></li>
+
+ <?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 :doc:`here </general/alternative_php>`.
+
+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);
+
diff --git a/user_guide_src/source/helpers/array_helper.rst b/user_guide_src/source/helpers/array_helper.rst
new file mode 100644
index 000000000..4308753bb
--- /dev/null
+++ b/user_guide_src/source/helpers/array_helper.rst
@@ -0,0 +1,139 @@
+############
+Array Helper
+############
+
+The Array Helper file contains functions that assist in working with
+arrays.
+
+.. contents:: Page Contents
+
+Loading this Helper
+===================
+
+This helper is loaded using the following code
+
+::
+
+ $this->load->helper('array');
+
+The following functions are available:
+
+element()
+=========
+
+.. php:method:: element($item, $array, $default = FALSE)
+
+ :param string $item: Item to fetch from the array
+ :param array $array: Input array
+ :param boolean $default: What to return if the array isn't valid
+ :returns: FALSE on failure or the array item.
+
+
+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' => ''
+ );
+
+ echo element('color', $array); // returns "red"
+ echo element('size', $array, NULL); // returns NULL
+
+elements()
+==========
+
+Lets you fetch a number of items from an array. The function tests
+whether each of the array indices is set. If an index does not exist it
+is set to FALSE, or whatever you've specified as the default value via
+the third parameter.
+
+.. php:method:: elements($items, $array, $default = FALSE)
+
+ :param string $item: Item to fetch from the array
+ :param array $array: Input array
+ :param boolean $default: What to return if the array isn't valid
+ :returns: FALSE on failure or the array item.
+
+Example
+
+::
+
+ $array = array(
+ 'color' => 'red',  
+ 'shape' => 'round',     
+ 'radius' => '10',     
+ 'diameter' => '20'
+ );
+
+ $my_shape = elements(array('color', 'shape', 'height'), $array);
+
+The above will return the following array
+
+::
+
+ array(
+ 'color' => 'red',     
+ 'shape' => 'round',     
+ 'height' => FALSE
+ );
+
+You can set the third parameter to any default value you like
+
+::
+
+ $my_shape = elements(array('color', 'shape', 'height'), $array, NULL);
+
+The above will return the following array
+
+::
+
+ array(     
+ 'color' => 'red',     
+ 'shape' => 'round',     
+ 'height' => NULL
+ );
+
+This is useful when sending the $_POST array to one of your Models.
+This prevents users from sending additional POST data to be entered into
+your tables
+
+::
+
+ $this->load->model('post_model');
+ $this->post_model->update(
+ elements(array('id', 'title', 'content'), $_POST)
+ );
+
+This ensures that only the id, title and content fields are sent to be
+updated.
+
+random_element()
+================
+
+Takes an array as input and returns a random element from it. Usage
+example
+
+.. php:method:: random_element($array)
+
+ :param array $array: Input array
+ :returns: String - Random element from the array.
+
+::
+
+ $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);
+
diff --git a/user_guide_src/source/helpers/captcha_helper.rst b/user_guide_src/source/helpers/captcha_helper.rst
new file mode 100644
index 000000000..48095a11d
--- /dev/null
+++ b/user_guide_src/source/helpers/captcha_helper.rst
@@ -0,0 +1,156 @@
+##############
+CAPTCHA Helper
+##############
+
+The CAPTCHA Helper file contains functions that assist in creating
+CAPTCHA images.
+
+.. contents:: Page Contents
+
+Loading this Helper
+===================
+
+This helper is loaded using the following code
+
+::
+
+ $this->load->helper('captcha');
+
+The following functions are available:
+
+create_captcha($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.
+
+.. php:method:: function create_captcha($data = '', $img_path = '', $img_url = '', $font_path = '')
+
+ :param array $data: array of data for the CAPTCHA
+ :param string $img_path: path to create the image in
+ :param string $img_url: URL to the CAPTCHA image folder
+ :param string $font_path: server path to font
+ :returns: array('word' => $word, 'time' => $now, 'image' => $img)
+
+
+::
+
+ [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 helper
+------------------------
+
+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->helper('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->where('captcha_time < ', $expiration)
+ ->delete('captcha');
+
+ // Then see if a captcha exists:
+ $sql = "SELECT COUNT(*) AS count FROM captcha WHERE word = ? AND ip_address = ? AND captcha_time > ?";
+ $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";
+ }
+
diff --git a/user_guide_src/source/helpers/cookie_helper.rst b/user_guide_src/source/helpers/cookie_helper.rst
new file mode 100644
index 000000000..30e601c32
--- /dev/null
+++ b/user_guide_src/source/helpers/cookie_helper.rst
@@ -0,0 +1,78 @@
+#############
+Cookie Helper
+#############
+
+The Cookie Helper file contains functions that assist in working with
+cookies.
+
+.. contents:: Page Contents
+
+Loading this Helper
+===================
+
+This helper is loaded using the following code
+
+::
+
+ $this->load->helper('cookie');
+
+The following functions are available:
+
+set_cookie()
+============
+
+This helper function gives you view file friendly syntax to set browser
+cookies. Refer to the :doc:`Input class <../libraries/input>` for a
+description of use, as this function is an alias to
+`$this->input->set_cookie()`.
+
+.. php:method:: set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE)
+
+ :param string $name: the name of the cookie
+ :param string $value: the value of the cookie
+ :param string $expire: the number of seconds until expiration
+ :param string $domain: the cookie domain. Usually: .yourdomain.com
+ :param string $path: the cookie path
+ :param string $prefix: the cookie prefix
+ :param boolean $secure: secure cookie or not.
+ :returns: void
+
+get_cookie()
+============
+
+This helper function gives you view file friendly syntax to get browser
+cookies. Refer to the :doc:`Input class <../libraries/input>` for a
+description of use, as this function is an alias to `$this->input->cookie()`.
+
+.. php:method:: get_cookie($index = '', $xss_clean = FALSE)
+
+ :param string $index: the name of the cookie
+ :param boolean $xss_clean: If the resulting value should be xss_cleaned or not
+ :returns: mixed
+
+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
+
+.. php:method:: delete_cookie($name = '', $domain = '', $path = '/', $prefix = '')
+
+ :param string $name: the name of the cookie
+ :param string $domain: cookie domain (ususally .example.com)
+ :param string $path: cookie path
+ :param string $prefix: cookie prefix
+ :returns: void
+
+::
+
+ 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_src/source/helpers/date_helper.rst b/user_guide_src/source/helpers/date_helper.rst
new file mode 100644
index 000000000..ad06dd628
--- /dev/null
+++ b/user_guide_src/source/helpers/date_helper.rst
@@ -0,0 +1,458 @@
+###########
+Date Helper
+###########
+
+The Date Helper file contains functions that help you work with dates.
+
+.. contents:: Page Contents
+
+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.
+
+.. php:method:: now()
+
+mdate()
+=======
+
+This function is identical to PHPs `date() <http://www.php.net/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
+
+.. php:method:: mdate($datestr = '', $time = '')
+
+ :param string $datestr: Date String
+ :param integer $time: time
+ :returns: integer
+
+
+::
+
+ $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
+
+.. php:method:: standard_date($fmt = 'DATE_RFC822', $time = '')
+
+ :param string $fmt: the chosen format
+ :param string $time: Unix timestamp
+ :returns: string
+
+::
+
+ $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:
+
++----------------+------------------------+-----------------------------------+
+| Constant | Description | Example |
++================+========================+===================================+
+| DATE_ATOM | Atom | 2005-08-15T16:13:03+0000 |
++----------------+------------------------+-----------------------------------+
+| DATE_COOKIE | HTTP Cookies | Sun, 14 Aug 2005 16:13:03 UTC |
++----------------+------------------------+-----------------------------------+
+| DATE_ISO8601 | ISO-8601 | 2005-08-14T16:13:03+00:00 |
++----------------+------------------------+-----------------------------------+
+| DATE_RFC822 | RFC 822 | Sun, 14 Aug 05 16:13:03 UTC |
++----------------+------------------------+-----------------------------------+
+| DATE_RFC850 | RFC 850 | Sunday, 14-Aug-05 16:13:03 UTC |
++----------------+------------------------+-----------------------------------+
+| DATE_RFC1036 | RFC 1036 | Sunday, 14-Aug-05 16:13:03 UTC |
++----------------+------------------------+-----------------------------------+
+| DATE_RFC1123 | RFC 1123 | Sun, 14 Aug 2005 16:13:03 UTC |
++----------------+------------------------+-----------------------------------+
+| DATE_RFC2822 | RFC 2822 | Sun, 14 Aug 2005 16:13:03 +0000 |
++----------------+------------------------+-----------------------------------+
+| DATE_RSS | RSS | Sun, 14 Aug 2005 16:13:03 UTC |
++----------------+------------------------+-----------------------------------+
+| DATE_W3C | W3C | 2005-08-14T16:13:03+0000 |
++----------------+------------------------+-----------------------------------+
+
+
+local_to_gmt()
+==============
+
+Takes a Unix timestamp as input and returns it as GMT.
+
+.. php:method:: local_to_gmt($time = '')
+
+ :param integer $time: Unix timestamp
+ :returns: string
+
+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.
+
+.. php:method:: gmt_to_local($time = '', $timezone = 'UTC', $dst = FALSE)
+
+ :param integer $time: Unix timestamp
+ :param string $timezone: timezone
+ :param boolean $dst: whether DST is active
+ :returns: integer
+
+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.
+
+.. php:method:: mysql_to_unix($time = '')
+
+ :param integer $time: Unix timestamp
+ :returns: integer
+
+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
+
+.. php:method:: unix_to_human($time = '', $seconds = FALSE, $fmt = 'us')
+
+ :param integer $time: Unix timestamp
+ :param boolean $seconds: whether to show seconds
+ :param string $fmt: format: us or euro
+ :returns: integer
+
+Example
+
+::
+
+ 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.
+
+.. php:method:: human_to_unix($datestr = '')
+
+ :param integer $datestr: Date String
+ :returns: integer
+
+Example:
+
+::
+
+ $now = time();
+ $human = unix_to_human($now);
+ $unix = human_to_unix($human);
+
+nice_date()
+===========
+
+This function can take a number poorly-formed date formats and convert
+them into something useful. It also accepts well-formed dates.
+
+The function will return a Unix timestamp by default. You can,
+optionally, pass a format string (the same type as the PHP date function
+accepts) as the second parameter.
+
+.. php:method:: nice_date($bad_date = '', $format = FALSE)
+
+ :param integer $bad_date: The terribly formatted date-like string
+ :param string $format: Date format to return (same as php date function)
+ :returns: string
+
+Example
+
+::
+
+ $bad_time = 199605 // Should Produce: 1996-05-01
+ $better_time = nice_date($bad_time,'Y-m-d');
+ $bad_time = 9-11-2001 // Should Produce: 2001-09-11
+ $better_time = nice_date($human,'Y-m-d');
+
+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.
+
+.. php:method:: timespan($seconds = 1, $time = '')
+
+ :param integer $seconds: a number of seconds
+ :param string $time: Unix timestamp
+ :returns: string
+
+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.
+
+.. php:method:: days_in_month($month = 0, $year = '')
+
+ :param integer $month: a numeric month
+ :param integer $year: a numeric year
+ :returns: integer
+
+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.
+
+.. php:method:: timezones($tz = '')
+
+ :param string $tz: a numeric timezone
+ :returns: string
+
+Example
+
+::
+
+ echo timezones('UM5');
+
+
+This function is useful when used with `timezone_menu()`.
+
+timezone_menu()
+===============
+
+Generates a pull-down menu of timezones, like this one:
+
+
+.. raw:: html
+
+ <form action="#">
+ <select name="timezones">
+ <option value='UM12'>(UTC - 12:00) Enitwetok, Kwajalien</option>
+ <option value='UM11'>(UTC - 11:00) Nome, Midway Island, Samoa</option>
+ <option value='UM10'>(UTC - 10:00) Hawaii</option>
+ <option value='UM9'>(UTC - 9:00) Alaska</option>
+ <option value='UM8'>(UTC - 8:00) Pacific Time</option>
+ <option value='UM7'>(UTC - 7:00) Mountain Time</option>
+ <option value='UM6'>(UTC - 6:00) Central Time, Mexico City</option>
+ <option value='UM5'>(UTC - 5:00) Eastern Time, Bogota, Lima, Quito</option>
+ <option value='UM4'>(UTC - 4:00) Atlantic Time, Caracas, La Paz</option>
+ <option value='UM25'>(UTC - 3:30) Newfoundland</option>
+ <option value='UM3'>(UTC - 3:00) Brazil, Buenos Aires, Georgetown, Falkland Is.</option>
+ <option value='UM2'>(UTC - 2:00) Mid-Atlantic, Ascention Is., St Helena</option>
+ <option value='UM1'>(UTC - 1:00) Azores, Cape Verde Islands</option>
+ <option value='UTC' selected='selected'>(UTC) Casablanca, Dublin, Edinburgh, London, Lisbon, Monrovia</option>
+ <option value='UP1'>(UTC + 1:00) Berlin, Brussels, Copenhagen, Madrid, Paris, Rome</option>
+ <option value='UP2'>(UTC + 2:00) Kaliningrad, South Africa, Warsaw</option>
+ <option value='UP3'>(UTC + 3:00) Baghdad, Riyadh, Moscow, Nairobi</option>
+ <option value='UP25'>(UTC + 3:30) Tehran</option>
+ <option value='UP4'>(UTC + 4:00) Adu Dhabi, Baku, Muscat, Tbilisi</option>
+ <option value='UP35'>(UTC + 4:30) Kabul</option>
+ <option value='UP5'>(UTC + 5:00) Islamabad, Karachi, Tashkent</option>
+ <option value='UP45'>(UTC + 5:30) Bombay, Calcutta, Madras, New Delhi</option>
+ <option value='UP6'>(UTC + 6:00) Almaty, Colomba, Dhaka</option>
+ <option value='UP7'>(UTC + 7:00) Bangkok, Hanoi, Jakarta</option>
+ <option value='UP8'>(UTC + 8:00) Beijing, Hong Kong, Perth, Singapore, Taipei</option>
+ <option value='UP9'>(UTC + 9:00) Osaka, Sapporo, Seoul, Tokyo, Yakutsk</option>
+ <option value='UP85'>(UTC + 9:30) Adelaide, Darwin</option>
+ <option value='UP10'>(UTC + 10:00) Melbourne, Papua New Guinea, Sydney, Vladivostok</option>
+ <option value='UP11'>(UTC + 11:00) Magadan, New Caledonia, Solomon Islands</option>
+ <option value='UP12'>(UTC + 12:00) Auckland, Wellington, Fiji, Marshall Island</option>
+ </select>
+ </form>
+
+
+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
+
+.. php:method:: timezone_menu($default = 'UTC', $class = "", $name = 'timezones')
+
+ :param string $default: timezone
+ :param string $class: classname
+ :param string $name: menu name
+ :returns: string
+
+Example:
+
+::
+
+ 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 Zone | Location |
++============+================================================================+
+| 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 |
++------------+----------------------------------------------------------------+
diff --git a/user_guide_src/source/helpers/directory_helper.rst b/user_guide_src/source/helpers/directory_helper.rst
new file mode 100644
index 000000000..fd169886c
--- /dev/null
+++ b/user_guide_src/source/helpers/directory_helper.rst
@@ -0,0 +1,80 @@
+################
+Directory Helper
+################
+
+The Directory Helper file contains functions that assist in working with
+directories.
+
+.. contents:: Page Contents
+
+Loading this Helper
+===================
+
+This helper is loaded using the following code
+
+::
+
+ $this->load->helper('directory');
+
+The following functions are available:
+
+directory_map()
+===============
+
+This function reads the directory path specified in the first parameter
+and builds an array representation of it and all its contained files.
+
+.. php:method:: directory_map($source_dir[, $directory_depth = 0[, $hidden = FALSE]])
+
+ :param string $source_dir: path to the ource directory
+ :param integer $directory_depth: depth of directories to traverse (0 =
+ fully recursive, 1 = current dir, etc)
+ :param boolean $hidden: whether to include hidden directories
+
+Examples::
+
+ $map = directory_map('./mydirectory/');
+
+.. 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 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/', 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)::
+
+ $map = directory_map('./mydirectory/', FALSE, TRUE);
+
+Each folder name will be an array index, while its contained files will
+be numerically indexed. Here is an example of a typical array::
+
+ 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
+ )
+
diff --git a/user_guide_src/source/helpers/download_helper.rst b/user_guide_src/source/helpers/download_helper.rst
new file mode 100644
index 000000000..e6094dc6b
--- /dev/null
+++ b/user_guide_src/source/helpers/download_helper.rst
@@ -0,0 +1,42 @@
+###############
+Download Helper
+###############
+
+The Download Helper lets you download data to your desktop.
+
+.. contents:: Page Contents
+
+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);
+
diff --git a/user_guide_src/source/helpers/email_helper.rst b/user_guide_src/source/helpers/email_helper.rst
new file mode 100644
index 000000000..d4e94b1ed
--- /dev/null
+++ b/user_guide_src/source/helpers/email_helper.rst
@@ -0,0 +1,49 @@
+############
+Email Helper
+############
+
+The Email Helper provides some assistive functions for working with
+Email. For a more robust email solution, see CodeIgniter's :doc:`Email
+Class <../libraries/email>`.
+
+.. contents:: Page Contents
+
+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() <http://www.php.net/function.mail>`_ function. For a more robust
+email solution, see CodeIgniter's :doc:`Email
+Class <../libraries/email>`.
diff --git a/user_guide_src/source/helpers/file_helper.rst b/user_guide_src/source/helpers/file_helper.rst
new file mode 100644
index 000000000..bfc271eb3
--- /dev/null
+++ b/user_guide_src/source/helpers/file_helper.rst
@@ -0,0 +1,135 @@
+###########
+File Helper
+###########
+
+The File Helper file contains functions that assist in working with files.
+
+.. contents:: Page Contents
+
+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 <http://php.net/fopen>`_ 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/', $top_level_only = TRUE)
+===============================================================
+
+Reads the specified directory and builds an array containing the filenames, filesize, dates, and permissions. Sub-folders contained within the specified path are only read if forced by sending the second parameter, $top_level_only to FALSE, as this can be an intensive operation.
+
+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
+
diff --git a/user_guide_src/source/helpers/form_helper.rst b/user_guide_src/source/helpers/form_helper.rst
new file mode 100644
index 000000000..3794e0835
--- /dev/null
+++ b/user_guide_src/source/helpers/form_helper.rst
@@ -0,0 +1,506 @@
+###########
+Form Helper
+###########
+
+The Form Helper file contains functions that assist in working with
+forms.
+
+.. contents:: Page Contents
+
+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, and will always add the attribute accept-charset based on the charset value in your config file.
+
+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" accept-charset="utf-8" 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" accept-charset="utf-8" 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" accept-charset="utf-8" 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 it uses the "password" input type.
+
+form_upload()
+=============
+
+This function is identical in all respects to the `form_input()` function above except that it uses the "file" input 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 of multiple
+items 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
+an id attribute or JavaScript, you can pass it as a string in the fourth
+parameter
+
+::
+
+ $js = 'id="shirts" onChange="some_function();"';
+ echo form_dropdown('shirts', $options, 'large', $js);
+
+If the array passed as $options is a multidimensional array,
+`form_dropdown()` will produce an <optgroup> with the array key as the
+label.
+
+form_multiselect()
+==================
+
+Lets you create a standard multiselect 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 or values you wish to be selected. The parameter usage is
+identical to using form_dropdown() above, except of course that the
+name of the field will need to use POST array syntax, e.g. foo[].
+
+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 form_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 it uses the "radio" input 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="button">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'); ?> />
+
diff --git a/user_guide_src/source/helpers/html_helper.rst b/user_guide_src/source/helpers/html_helper.rst
new file mode 100644
index 000000000..2e217898e
--- /dev/null
+++ b/user_guide_src/source/helpers/html_helper.rst
@@ -0,0 +1,348 @@
+###########
+HTML Helper
+###########
+
+The HTML Helper file contains functions that assist in working with
+HTML.
+
+.. contents:: Page Contents
+
+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>
+
+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'); // 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" alt="" />
+
+
+Additionally, an associative array can be passed to the img() function
+for complete control over all attributes and values. If an alt attribute
+is not provided, CodeIgniter will generate an empty string.
+
+::
+
+ $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_tag('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');
+
+ $attributes = array(                     
+ 'class' => 'boldlist',                     
+ 'id'    => 'mylist'                     
+ );
+
+ $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, $attributes);
+
+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 doctype(); // <!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
+
++------------------------+--------------------------+---------------------------------------------------------------------------------------------------------------------------+
+| Doctype | Option | Result |
++========================+==========================+===========================================================================================================================+
+| XHTML 1.1 | doctype('xhtml11') | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
++------------------------+--------------------------+---------------------------------------------------------------------------------------------------------------------------+
+| XHTML 1.0 Strict | doctype('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 Transitional | doctype('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 Frameset | doctype('xhtml1-frame') | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> |
++------------------------+--------------------------+---------------------------------------------------------------------------------------------------------------------------+
+| XHTML Basic 1.1 | doctype('xhtml-basic11') | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd"> |
++------------------------+--------------------------+---------------------------------------------------------------------------------------------------------------------------+
+| HTML 5 | doctype('html5') | <!DOCTYPE html> |
++------------------------+--------------------------+---------------------------------------------------------------------------------------------------------------------------+
+| HTML 4 Strict | doctype('html4-strict') | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
++------------------------+--------------------------+---------------------------------------------------------------------------------------------------------------------------+
+| HTML 4 Transitional | doctype('html4-trans') | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
++------------------------+--------------------------+---------------------------------------------------------------------------------------------------------------------------+
+| HTML 4 Frameset | doctype('html4-frame') | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> |
++------------------------+--------------------------+---------------------------------------------------------------------------------------------------------------------------+
diff --git a/user_guide_src/source/helpers/index.rst b/user_guide_src/source/helpers/index.rst
new file mode 100644
index 000000000..f28c8e164
--- /dev/null
+++ b/user_guide_src/source/helpers/index.rst
@@ -0,0 +1,9 @@
+#######
+Helpers
+#######
+
+.. toctree::
+ :glob:
+ :titlesonly:
+
+ * \ No newline at end of file
diff --git a/user_guide_src/source/helpers/inflector_helper.rst b/user_guide_src/source/helpers/inflector_helper.rst
new file mode 100644
index 000000000..cc46a1851
--- /dev/null
+++ b/user_guide_src/source/helpers/inflector_helper.rst
@@ -0,0 +1,85 @@
+################
+Inflector Helper
+################
+
+The Inflector Helper file contains functions that permits you to change
+words to plural, singular, camel case, etc.
+
+.. contents:: Page Contents
+
+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"
+
+To use dashes instead of underscores
+
+::
+
+ $word = "my-dog-spot";
+ echo humanize($word, '-'); // Returns "My Dog Spot" \ No newline at end of file
diff --git a/user_guide_src/source/helpers/language_helper.rst b/user_guide_src/source/helpers/language_helper.rst
new file mode 100644
index 000000000..b7b23d149
--- /dev/null
+++ b/user_guide_src/source/helpers/language_helper.rst
@@ -0,0 +1,33 @@
+###############
+Language Helper
+###############
+
+The Language Helper file contains functions that assist in working with
+language files.
+
+.. contents:: Page Contents
+
+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>
+
diff --git a/user_guide_src/source/helpers/number_helper.rst b/user_guide_src/source/helpers/number_helper.rst
new file mode 100644
index 000000000..af6cdad57
--- /dev/null
+++ b/user_guide_src/source/helpers/number_helper.rst
@@ -0,0 +1,45 @@
+#############
+Number Helper
+#############
+
+The Number Helper file contains functions that help you work with
+numeric data.
+
+.. contents:: Page Contents
+
+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.6 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
+
+An optional second parameter allows you to set the precision of the
+result.
+
+::
+
+ echo byte_format(45678, 2); // Returns 44.61 KB
+
+.. note:: The text generated by this function is found in the following
+ language file: language/<your_lang>/number_lang.php
diff --git a/user_guide_src/source/helpers/path_helper.rst b/user_guide_src/source/helpers/path_helper.rst
new file mode 100644
index 000000000..1a70af458
--- /dev/null
+++ b/user_guide_src/source/helpers/path_helper.rst
@@ -0,0 +1,37 @@
+###########
+Path Helper
+###########
+
+The Path Helper file contains functions that permits you to work with
+file paths on the server.
+
+.. contents:: Page Contents
+
+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"
+
+
diff --git a/user_guide_src/source/helpers/security_helper.rst b/user_guide_src/source/helpers/security_helper.rst
new file mode 100644
index 000000000..01018c61a
--- /dev/null
+++ b/user_guide_src/source/helpers/security_helper.rst
@@ -0,0 +1,67 @@
+###############
+Security Helper
+###############
+
+The Security Helper file contains security related functions.
+
+.. contents:: Page Contents
+
+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 :doc:`Input class <../libraries/input>`. More info can
+be found there.
+
+sanitize_filename()
+===================
+
+Provides protection against directory traversal. This function is an
+alias to the one in the :doc:`Security class <../libraries/security>`.
+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
+
+::
+
+ $str = do_hash($str); // SHA1
+ $str = do_hash($str, 'md5'); // MD5
+
+.. note:: This function was formerly named dohash(), which has been
+ deprecated in favor of `do_hash()`.
+
+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);
+
diff --git a/user_guide_src/source/helpers/smiley_helper.rst b/user_guide_src/source/helpers/smiley_helper.rst
new file mode 100644
index 000000000..941ba11e3
--- /dev/null
+++ b/user_guide_src/source/helpers/smiley_helper.rst
@@ -0,0 +1,160 @@
+#############
+Smiley Helper
+#############
+
+The Smiley Helper file contains functions that let you manage smileys
+(emoticons).
+
+.. contents:: Page Contents
+
+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 <http://codeigniter.com/download_files/smileys.zip>`_
+ 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 :doc:`Table Class <../libraries/table>`.
+
+::
+
+ <?php
+
+ class Smileys extends CI_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);
+ }
+ }
+
+In your `application/views/` folder, create a file called `smiley_view.php`
+and place this code in it:
+
+::
+
+ <html>
+ <head>
+ <title>Smileys</title>
+ <?php echo smiley_js(); ?>
+ </head>
+ <body>
+ <form name="blog">
+ <textarea name="comments" id="comments" cols="40" rows="4"></textarea>
+ </form>
+ <p>Click to insert a smiley!</p>
+ <?php echo $smiley_table; ?> </body> </html>
+ When you have created the above controller and view, load it by visiting http://www.example.com/index.php/smileys/
+ </body>
+ </html>
+
+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 and a field id or
+field alias.
+
+::
+
+ $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.
+
+smiley_js()
+===========
+
+Generates the JavaScript that allows the images to be clicked and
+inserted into a form field. 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 smiley_js(); ?>
+
+Note: This function replaces `js_insert_smiley`, which has been
+deprecated.
+
+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;
+
+
+.. |smile!| image:: ../images/smile.gif
diff --git a/user_guide_src/source/helpers/string_helper.rst b/user_guide_src/source/helpers/string_helper.rst
new file mode 100644
index 000000000..dc70e461a
--- /dev/null
+++ b/user_guide_src/source/helpers/string_helper.rst
@@ -0,0 +1,167 @@
+#############
+String Helper
+#############
+
+The String Helper file contains functions that assist in working with
+strings.
+
+.. contents:: Page Contents
+
+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:
+
+alpha, alunum, numeric, nozero, unique, md5, encrypt and sha1
+
+- **alpha**: A string with lower and uppercase letters only.
+- **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.
+- **sha1**: An encrypted random number based on do_hash() from the
+ :doc:`security helper <security_helper>`.
+
+Usage example
+
+::
+
+ echo random_string('alnum', 16);
+
+increment_string()
+==================
+
+Increments a string by appending a number to it or increasing the
+number. Useful for creating "copies" or a file or duplicating database
+content which has unique titles or slugs.
+
+Usage example
+
+::
+
+ echo increment_string('file', '_'); // "file_1"
+ echo increment_string('file', '-', 2); // "file-2"
+ echo increment_string('file_4'); // "file_5"
+
+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"
+
diff --git a/user_guide_src/source/helpers/text_helper.rst b/user_guide_src/source/helpers/text_helper.rst
new file mode 100644
index 000000000..8cb2d6f96
--- /dev/null
+++ b/user_guide_src/source/helpers/text_helper.rst
@@ -0,0 +1,169 @@
+###########
+Text Helper
+###########
+
+The Text Helper file contains functions that assist in working with
+text.
+
+.. contents:: Page Contents
+
+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.
+
+**Note:** If you need to truncate to an exact number of characters please see
+the :ref:`ellipsize` function below.
+
+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.
+
+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()
+=============
+
+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
+
+.. _ellipsize:
+
+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&hellip;ak_my_design.jpg
+
diff --git a/user_guide_src/source/helpers/typography_helper.rst b/user_guide_src/source/helpers/typography_helper.rst
new file mode 100644
index 000000000..f3202603a
--- /dev/null
+++ b/user_guide_src/source/helpers/typography_helper.rst
@@ -0,0 +1,48 @@
+#################
+Typography Helper
+#################
+
+The Typography Helper file contains functions that help your format text
+in semantically relevant ways.
+
+.. contents:: Page Contents
+
+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 :doc:`Typography Class <../libraries/typography>`
+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 </general/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);
+
diff --git a/user_guide_src/source/helpers/url_helper.rst b/user_guide_src/source/helpers/url_helper.rst
new file mode 100644
index 000000000..e6d51b22b
--- /dev/null
+++ b/user_guide_src/source/helpers/url_helper.rst
@@ -0,0 +1,314 @@
+##########
+URL Helper
+##########
+
+The URL Helper file contains functions that assist in working with URLs.
+
+.. contents:: Page Contents
+
+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, and the url_suffix as set in your config file.
+
+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();
+
+This function returns the same thing as `site_url`, without the
+index_page or url_suffix being appended.
+
+Also like site_url, you can supply segments as a string or an array.
+Here is a string example
+
+::
+
+ echo base_url("blog/post/123");
+
+The above example would return something like:
+http://example.com/blog/post/123
+
+This is useful because unlike `site_url()`, you can supply a string to a
+file, such as an image or stylesheet. For example
+
+::
+
+ echo base_url("images/icons/edit.png");
+
+This would give you something like:
+http://example.com/images/icons/edit.png
+
+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', 'title="News title"');
+
+Would produce: <a href="http://example.com/index.php/news/local/123"
+title="News title">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
+
+The third parameter determines whether or not lowercase characters are
+forced. By default they are not. Options are boolean TRUE/FALSE
+
+::
+
+ $title = "What's wrong with CSS?";
+ $url_title = url_title($title, 'underscore', TRUE); // Produces: whats_wrong_with_css
+
+prep_url()
+----------
+
+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);
+
+redirect()
+==========
+
+Does a "header redirect" to the URI specified. If you specify the full
+site URL that link will be built, but for local links simply providing
+the URI segments to the controller you want to direct to will create the
+link. The function will build the URL based on your config file values.
+
+The optional second parameter allows you to force a particular redirection
+method. The available methods are "location" or "refresh", with location
+being faster but less reliable on Windows servers. The default is "auto",
+which will attempt to intelligently choose the method based on the server
+environment.
+
+The optional third parameter allows you to send a specific HTTP Response
+Code - this could be used for example to create 301 redirects for search
+engine purposes. The default Response Code is 302. The third parameter is
+*only* available with 'location' redirects, and not 'refresh'. Examples::
+
+ if ($logged_in == FALSE)
+ {      
+ redirect('/login/form/');
+ }
+
+ // 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 </libraries/output>` set_header() function.
diff --git a/user_guide_src/source/helpers/xml_helper.rst b/user_guide_src/source/helpers/xml_helper.rst
new file mode 100644
index 000000000..be848bcd1
--- /dev/null
+++ b/user_guide_src/source/helpers/xml_helper.rst
@@ -0,0 +1,38 @@
+##########
+XML Helper
+##########
+
+The XML Helper file contains functions that assist in working with XML
+data.
+
+.. contents:: Page Contents
+
+Loading this Helper
+===================
+
+This helper is loaded using the following code
+
+::
+
+ $this->load->helper('xml');
+
+The following functions are available:
+
+xml_convert()
+=====================
+
+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);
+
diff --git a/user_guide_src/source/images/appflowchart.gif b/user_guide_src/source/images/appflowchart.gif
new file mode 100644
index 000000000..422332c9e
--- /dev/null
+++ b/user_guide_src/source/images/appflowchart.gif
Binary files differ
diff --git a/user_guide/images/arrow.gif b/user_guide_src/source/images/arrow.gif
index 9e9c79a79..9e9c79a79 100644
--- a/user_guide/images/arrow.gif
+++ b/user_guide_src/source/images/arrow.gif
Binary files differ
diff --git a/user_guide/images/ci_logo.jpg b/user_guide_src/source/images/ci_logo.jpg
index 3ae0eee07..3ae0eee07 100644
--- a/user_guide/images/ci_logo.jpg
+++ b/user_guide_src/source/images/ci_logo.jpg
Binary files differ
diff --git a/user_guide/images/ci_logo_flame.jpg b/user_guide_src/source/images/ci_logo_flame.jpg
index 17e9c586b..17e9c586b 100644
--- a/user_guide/images/ci_logo_flame.jpg
+++ b/user_guide_src/source/images/ci_logo_flame.jpg
Binary files differ
diff --git a/user_guide/images/ci_quick_ref.png b/user_guide_src/source/images/ci_quick_ref.png
index c07d6b469..c07d6b469 100644
--- a/user_guide/images/ci_quick_ref.png
+++ b/user_guide_src/source/images/ci_quick_ref.png
Binary files differ
diff --git a/user_guide_src/source/images/codeigniter_1.7.1_helper_reference.pdf b/user_guide_src/source/images/codeigniter_1.7.1_helper_reference.pdf
new file mode 100644
index 000000000..baec6bcfb
--- /dev/null
+++ b/user_guide_src/source/images/codeigniter_1.7.1_helper_reference.pdf
Binary files differ
diff --git a/user_guide/images/codeigniter_1.7.1_helper_reference.png b/user_guide_src/source/images/codeigniter_1.7.1_helper_reference.png
index 15a7c1576..15a7c1576 100644
--- a/user_guide/images/codeigniter_1.7.1_helper_reference.png
+++ b/user_guide_src/source/images/codeigniter_1.7.1_helper_reference.png
Binary files differ
diff --git a/user_guide/images/codeigniter_1.7.1_library_reference.pdf b/user_guide_src/source/images/codeigniter_1.7.1_library_reference.pdf
index 13cb36097..312d020eb 100644
--- a/user_guide/images/codeigniter_1.7.1_library_reference.pdf
+++ b/user_guide_src/source/images/codeigniter_1.7.1_library_reference.pdf
Binary files differ
diff --git a/user_guide_src/source/images/codeigniter_1.7.1_library_reference.png b/user_guide_src/source/images/codeigniter_1.7.1_library_reference.png
new file mode 100644
index 000000000..554ae2eed
--- /dev/null
+++ b/user_guide_src/source/images/codeigniter_1.7.1_library_reference.png
Binary files differ
diff --git a/user_guide/images/file.gif b/user_guide_src/source/images/file.gif
index 8141e0357..8141e0357 100644
--- a/user_guide/images/file.gif
+++ b/user_guide_src/source/images/file.gif
Binary files differ
diff --git a/user_guide/images/folder.gif b/user_guide_src/source/images/folder.gif
index fef31a60b..fef31a60b 100644
--- a/user_guide/images/folder.gif
+++ b/user_guide_src/source/images/folder.gif
Binary files differ
diff --git a/user_guide/images/smile.gif b/user_guide_src/source/images/smile.gif
index bf0922504..bf0922504 100644
--- a/user_guide/images/smile.gif
+++ b/user_guide_src/source/images/smile.gif
Binary files differ
diff --git a/user_guide_src/source/index.rst b/user_guide_src/source/index.rst
new file mode 100644
index 000000000..6cdeb2442
--- /dev/null
+++ b/user_guide_src/source/index.rst
@@ -0,0 +1,49 @@
+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.
+
+
+.. toctree::
+ :glob:
+ :titlesonly:
+ :hidden:
+
+ *
+ overview/index
+ general/requirements
+ installation/index
+ general/index
+ libraries/index
+ helpers/index
+ database/index
+ documentation/index
+ tutorial/index
+ general/quick_reference
+ general/credits \ No newline at end of file
diff --git a/user_guide_src/source/installation/downloads.rst b/user_guide_src/source/installation/downloads.rst
new file mode 100644
index 000000000..a4a6b7fbe
--- /dev/null
+++ b/user_guide_src/source/installation/downloads.rst
@@ -0,0 +1,69 @@
+#######################
+Downloading CodeIgniter
+#######################
+
+- `CodeIgniter V 2.1.0 (Current
+ version) <http://codeigniter.com/downloads/>`_
+- `CodeIgniter V
+ 2.0.3 <http://codeigniter.com/download_files/reactor/CodeIgniter_2.0.3.zip>`_
+- `CodeIgniter V
+ 2.0.2 <http://codeigniter.com/download_files/reactor/CodeIgniter_2.0.2.zip>`_
+- `CodeIgniter V
+ 2.0.1 <http://codeigniter.com/download_files/reactor/CodeIgniter_2.0.1.zip>`_
+- `CodeIgniter V
+ 2.0.0 <http://codeigniter.com/download_files/reactor/CodeIgniter_2.0.0.zip>`_
+- `CodeIgniter V
+ 1.7.3 <http://codeigniter.com/download_files/CodeIgniter_1.7.3.zip>`_
+- `CodeIgniter V
+ 1.7.2 <http://codeigniter.com/download_files/CodeIgniter_1.7.2.zip>`_
+- `CodeIgniter V
+ 1.7.1 <http://codeigniter.com/download_files/CodeIgniter_1.7.1.zip>`_
+- `CodeIgniter V
+ 1.7.0 <http://codeigniter.com/download_files/CodeIgniter_1.7.0.zip>`_
+- `CodeIgniter V
+ 1.6.3 <http://codeigniter.com/download_files/CodeIgniter_1.6.3.zip>`_
+- `CodeIgniter V
+ 1.6.2 <http://codeigniter.com/download_files/CodeIgniter_1.6.2.zip>`_
+- `CodeIgniter V
+ 1.6.1 <http://codeigniter.com/download_files/CodeIgniter_1.6.1.zip>`_
+- `CodeIgniter V
+ 1.6.0 <http://codeigniter.com/download_files/CodeIgniter_1.6.0.zip>`_
+- `CodeIgniter V
+ 1.5.4 <http://codeigniter.com/download_files/CodeIgniter_1.5.4.zip>`_
+- `CodeIgniter V
+ 1.5.3 <http://codeigniter.com/download_files/CodeIgniter_1.5.3.zip>`_
+- `CodeIgniter V
+ 1.5.2 <http://codeigniter.com/download_files/CodeIgniter_1.5.2.zip>`_
+- `CodeIgniter V
+ 1.5.1 <http://codeigniter.com/download_files/CodeIgniter_1.5.1.zip>`_
+- `CodeIgniter V
+ 1.4.1 <http://codeigniter.com/download_files/CodeIgniter_1.4.1.zip>`_
+- `CodeIgniter V
+ 1.3.3 <http://codeigniter.com/download_files/CodeIgniter_1.3.3.zip>`_
+- `CodeIgniter V
+ 1.3.2 <http://codeigniter.com/download_files/CodeIgniter_1.3.2.zip>`_
+- `CodeIgniter V
+ 1.3.1 <http://codeigniter.com/download_files/CodeIgniter_1.3.1.zip>`_
+- `CodeIgniter V
+ 1.3 <http://codeigniter.com/download_files/CodeIgniter_1.3.zip>`_
+- `CodeIgniter V
+ 1.2 <http://codeigniter.com/download_files/CodeIgniter_1.2.zip>`_
+- `CodeIgniter V
+ 1.1 <http://codeigniter.com/download_files/CodeIgniter_1.1b.zip>`_
+- `CodeIgniter V
+ 1.0 <http://codeigniter.com/download_files/CodeIgniter_1.0b.zip>`_
+
+
+******
+GitHub
+******
+
+`Git <http://git-scm.com/about>`_ is a distributed version control system.
+
+Public Git access is available at `GitHub <https://github.com/EllisLab/CodeIgniter>`_.
+Please note that while every effort is made to keep this code base
+functional, we cannot guarantee the functionality of code taken from
+the develop branch.
+
+Beginning with version 2.0.3, stable tags are also available via GitHub,
+simply select the version from the Tags dropdown. \ No newline at end of file
diff --git a/user_guide_src/source/installation/index.rst b/user_guide_src/source/installation/index.rst
new file mode 100644
index 000000000..7f75f7867
--- /dev/null
+++ b/user_guide_src/source/installation/index.rst
@@ -0,0 +1,54 @@
+#########################
+Installation Instructions
+#########################
+
+CodeIgniter is installed in four steps:
+
+#. Unzip the package.
+#. Upload the CodeIgniter folders and files to your server. Normally the
+ index.php file will be at your root.
+#. 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.
+#. 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 and application folders to
+something more private. If you do rename them, you must open your main
+index.php file and set the $system_path 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.
+
+If you would like to keep your views public it is also possible to move
+the views folder out of your application folder.
+
+After moving them, open your main index.php file and set the
+$system_path, $application_folder and $view_folder variables,
+preferably with a full path, e.g. '/www/MyUser/system'.
+
+One additional measure to take in production environments is to disable
+PHP error reporting and any other development-only functionality. In
+CodeIgniter, this can be done by setting the ENVIRONMENT constant, which
+is more fully described on the :doc:`security
+page <../general/security>`.
+
+That's it!
+
+If you're new to CodeIgniter, please read the :doc:`Getting
+Started <../overview/getting_started>` section of the User Guide
+to begin learning how to build dynamic PHP applications. Enjoy!
+
+.. toctree::
+ :glob:
+ :hidden:
+ :titlesonly:
+
+ * \ No newline at end of file
diff --git a/user_guide_src/source/installation/troubleshooting.rst b/user_guide_src/source/installation/troubleshooting.rst
new file mode 100644
index 000000000..0dfd4083f
--- /dev/null
+++ b/user_guide_src/source/installation/troubleshooting.rst
@@ -0,0 +1,19 @@
+###############
+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?";
+
diff --git a/user_guide_src/source/installation/upgrade_120.rst b/user_guide_src/source/installation/upgrade_120.rst
new file mode 100644
index 000000000..76c510d66
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_120.rst
@@ -0,0 +1,20 @@
+####################################
+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.
diff --git a/user_guide_src/source/installation/upgrade_130.rst b/user_guide_src/source/installation/upgrade_130.rst
new file mode 100644
index 000000000..6d6d4b9ac
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_130.rst
@@ -0,0 +1,125 @@
+#########################
+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.
diff --git a/user_guide_src/source/installation/upgrade_131.rst b/user_guide_src/source/installation/upgrade_131.rst
new file mode 100644
index 000000000..8927c1b12
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_131.rst
@@ -0,0 +1,30 @@
+###########################
+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.
diff --git a/user_guide_src/source/installation/upgrade_132.rst b/user_guide_src/source/installation/upgrade_132.rst
new file mode 100644
index 000000000..84b7cb4f7
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_132.rst
@@ -0,0 +1,28 @@
+#############################
+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.
diff --git a/user_guide_src/source/installation/upgrade_133.rst b/user_guide_src/source/installation/upgrade_133.rst
new file mode 100644
index 000000000..4212e4588
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_133.rst
@@ -0,0 +1,44 @@
+#############################
+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
+:doc:`Models <../general/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, :doc:`as described
+here <../general/models>`.
+
+Step 3: Update your user guide
+==============================
+
+Please also replace your local copy of the user guide with the new
+version.
diff --git a/user_guide_src/source/installation/upgrade_140.rst b/user_guide_src/source/installation/upgrade_140.rst
new file mode 100644
index 000000000..987281fe1
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_140.rst
@@ -0,0 +1,72 @@
+#############################
+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.
diff --git a/user_guide_src/source/installation/upgrade_141.rst b/user_guide_src/source/installation/upgrade_141.rst
new file mode 100644
index 000000000..c9c2ca461
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_141.rst
@@ -0,0 +1,71 @@
+#############################
+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.
diff --git a/user_guide_src/source/installation/upgrade_150.rst b/user_guide_src/source/installation/upgrade_150.rst
new file mode 100644
index 000000000..bfe01ebba
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_150.rst
@@ -0,0 +1,100 @@
+#############################
+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.
diff --git a/user_guide_src/source/installation/upgrade_152.rst b/user_guide_src/source/installation/upgrade_152.rst
new file mode 100644
index 000000000..781c907e1
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_152.rst
@@ -0,0 +1,39 @@
+#############################
+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.
diff --git a/user_guide_src/source/installation/upgrade_153.rst b/user_guide_src/source/installation/upgrade_153.rst
new file mode 100644
index 000000000..e3d487be1
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_153.rst
@@ -0,0 +1,28 @@
+#############################
+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.
diff --git a/user_guide_src/source/installation/upgrade_154.rst b/user_guide_src/source/installation/upgrade_154.rst
new file mode 100644
index 000000000..1d2c51d4a
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_154.rst
@@ -0,0 +1,56 @@
+#############################
+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:
+
+- 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 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
+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.
diff --git a/user_guide_src/source/installation/upgrade_160.rst b/user_guide_src/source/installation/upgrade_160.rst
new file mode 100644
index 000000000..e5d26611b
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_160.rst
@@ -0,0 +1,87 @@
+#############################
+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 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 application/config/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 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.
diff --git a/user_guide_src/source/installation/upgrade_161.rst b/user_guide_src/source/installation/upgrade_161.rst
new file mode 100644
index 000000000..43869223f
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_161.rst
@@ -0,0 +1,27 @@
+#############################
+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.
diff --git a/user_guide_src/source/installation/upgrade_162.rst b/user_guide_src/source/installation/upgrade_162.rst
new file mode 100644
index 000000000..6a618e4ad
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_162.rst
@@ -0,0 +1,45 @@
+#############################
+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 application/config/config.php and
+verify you've set an encryption key.
+
+Step 3: Constants File
+======================
+
+Copy /application/config/constants.php to your installation, and modify
+if necessary.
+
+Step 4: Mimes File
+==================
+
+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_src/source/installation/upgrade_163.rst b/user_guide_src/source/installation/upgrade_163.rst
new file mode 100644
index 000000000..e24e20357
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_163.rst
@@ -0,0 +1,27 @@
+#############################
+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.
diff --git a/user_guide_src/source/installation/upgrade_170.rst b/user_guide_src/source/installation/upgrade_170.rst
new file mode 100644
index 000000000..fefb2ea51
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_170.rst
@@ -0,0 +1,56 @@
+#############################
+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 :doc:`Session class <../libraries/sessions>` 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 :doc:`Form Validation
+class <../libraries/form_validation>`, 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.
diff --git a/user_guide_src/source/installation/upgrade_171.rst b/user_guide_src/source/installation/upgrade_171.rst
new file mode 100644
index 000000000..e791b4eba
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_171.rst
@@ -0,0 +1,27 @@
+#############################
+Upgrading from 1.7.0 to 1.7.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 replace your local copy of the user guide with the new version,
+including the image files.
diff --git a/user_guide_src/source/installation/upgrade_172.rst b/user_guide_src/source/installation/upgrade_172.rst
new file mode 100644
index 000000000..16f6dec1f
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_172.rst
@@ -0,0 +1,48 @@
+#############################
+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
+- index.php
+
+.. 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 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.
diff --git a/user_guide_src/source/installation/upgrade_200.rst b/user_guide_src/source/installation/upgrade_200.rst
new file mode 100644
index 000000000..0bcbd5c99
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_200.rst
@@ -0,0 +1,142 @@
+#############################
+Upgrading from 1.7.2 to 2.0.0
+#############################
+
+Before performing an update you should take your site offline by
+replacing the index.php file with a static one.
+
+*******************
+Update Instructions
+*******************
+
+Step 1: Update your CodeIgniter files
+=====================================
+
+Replace all files and directories in your "system" folder **except**
+your application folder.
+
+.. note:: If you have any custom developed files in these folders please
+ make copies of them first.
+
+Step 2: Adjust get_dir_file_info() where necessary
+=====================================================
+
+Version 2.0.0 brings a non-backwards compatible change to
+get_dir_file_info() in the :doc:`File
+Helper <../helpers/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::
+
+ get_dir_file_info('/path/to/directory', FALSE);
+
+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');
+
+
+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 <../libraries/encryption.html#legacy>`_ in the Encryption library
+documentation.
+
+Step 5: Remove loading calls for the compatibility helper.
+==========================================================
+
+The compatibility helper has been removed from the CodeIgniter core. All
+methods in it should be natively available in supported PHP versions.
+
+Step 6: Update Class extension
+==============================
+
+All core classes are now prefixed with CI\_. Update Models and
+Controllers to extend CI_Model and CI_Controller, respectively.
+
+Step 7: Update Parent Constructor calls
+=======================================
+
+All native CodeIgniter classes now use the PHP 5 \__construct()
+convention. Please update extended libraries to call
+parent::\__construct().
+
+Step 8: Update your user guide
+==============================
+
+Please replace your local copy of the user guide with the new version,
+including the image files.
+
+
+************
+Update Notes
+************
+
+Please refer to the :ref:`2.0.0 Change Log <2.0.0-changelog>` for full
+details, but here are some of the larger changes that are more likely to
+impact your code:
+
+- CodeIgniter now requires PHP 5.1.6.
+- Scaffolding has been removed.
+- The CAPTCHA plugin in now a :doc:`helper </helpers/captcha_helper>`.
+- The JavaScript calendar plugin was removed.
+- The *system/cache* and *system/logs* directories are now in the application
+ directory.
+- The Validation class has been removed. Please see the
+ :doc:`Form Validation library </libraries/form_validation>`
+- "default" is now a reserved name.
+- The xss_clean() function has moved to the :doc:`Security Class
+ </libraries/security>`.
+- do_xss_clean() now returns FALSE if the uploaded file fails XSS checks.
+- The :doc:`Session Class </libraries/sessions>` requires now the use of an
+ encryption key set in the config file.
+- The following deprecated Active Record functions have been removed:
+ ``orwhere``, ``orlike``, ``groupby``, ``orhaving``, ``orderby``,
+ ``getwhere``.
+- ``_drop_database()`` and ``_create_database()`` functions have been removed
+ from the db utility drivers.
+- The ``dohash()`` function of the :doc:`Security helper
+ </helpers/security_helper>`
+ has been renamed to ``do_hash()`` for naming consistency.
+
+The config folder
+=================
+
+The following files have been changed:
+
+- config.php
+- database.php
+- mimes.php
+- routes.php
+- user_agents.php
+
+The following files have been added:
+
+- foreign_chars.php
+- profiler.php
diff --git a/user_guide_src/source/installation/upgrade_201.rst b/user_guide_src/source/installation/upgrade_201.rst
new file mode 100644
index 000000000..93e1aa68d
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_201.rst
@@ -0,0 +1,39 @@
+#############################
+Upgrading from 2.0.0 to 2.0.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 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: 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: 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. If
+submitting to the default controller was the expected behavior it will
+need to be changed from::
+
+ echo form_open(); //<form action="" method="post" accept-charset="utf-8">
+
+to use either a / or base_url()::
+
+ echo form_open('/'); //<form action="http://example.com/index.php/" method="post" accept-charset="utf-8">
+ echo form_open(base_url()); //<form action="http://example.com/" method="post" accept-charset="utf-8">
+
diff --git a/user_guide_src/source/installation/upgrade_202.rst b/user_guide_src/source/installation/upgrade_202.rst
new file mode 100644
index 000000000..8dbd38aff
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_202.rst
@@ -0,0 +1,33 @@
+#############################
+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.
+
+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.
diff --git a/user_guide_src/source/installation/upgrade_203.rst b/user_guide_src/source/installation/upgrade_203.rst
new file mode 100644
index 000000000..717aa3e50
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_203.rst
@@ -0,0 +1,63 @@
+#############################
+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 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 3: 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 4: 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 5: Remove APPPATH.'third_party' from autoload.php
+=======================================================
+
+Open application/config/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.
+
+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_src/source/installation/upgrade_210.rst b/user_guide_src/source/installation/upgrade_210.rst
new file mode 100644
index 000000000..9d7e1a265
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_210.rst
@@ -0,0 +1,22 @@
+#############################
+Upgrading from 2.0.3 to 2.1.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 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.
+
+Step 2: 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.
+
+.. note:: If you have any custom developed files in these folders please
+ make copies of them first. \ No newline at end of file
diff --git a/user_guide_src/source/installation/upgrade_300.rst b/user_guide_src/source/installation/upgrade_300.rst
new file mode 100644
index 000000000..4c594ab17
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_300.rst
@@ -0,0 +1,33 @@
+#############################
+Upgrading from 2.1.0 to 3.0.0
+#############################
+
+.. note:: These upgrade notes are for a version that is yet to be released.
+
+
+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: Change References to the SHA Library
+============================================
+
+The previously deprecated SHA library has been removed in CodeIgniter 3.0.
+Alter your code to use the native `sha1()` PHP function to generate a sha1 hash.
+
+Additionally, the `sha1()` method in the :doc:`Encryption Library <../libraries/encryption>` has been removed.
+
+Step 3: Remove $autoload['core'] from your config/autoload.php
+==============================================================
+
+Use of the `$autoload['core']` config array has been deprecated as of CodeIgniter 1.4.1 and is now removed.
+Move any entries that you might have listed there to `$autoload['libraries']` instead.
diff --git a/user_guide_src/source/installation/upgrade_b11.rst b/user_guide_src/source/installation/upgrade_b11.rst
new file mode 100644
index 000000000..e70759be6
--- /dev/null
+++ b/user_guide_src/source/installation/upgrade_b11.rst
@@ -0,0 +1,78 @@
+###################################
+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";
+
diff --git a/user_guide_src/source/installation/upgrading.rst b/user_guide_src/source/installation/upgrading.rst
new file mode 100644
index 000000000..2badffc93
--- /dev/null
+++ b/user_guide_src/source/installation/upgrading.rst
@@ -0,0 +1,32 @@
+#################################
+Upgrading From a Previous Version
+#################################
+
+Please read the upgrade notes corresponding to the version you are
+upgrading from.
+
+- :doc:`Upgrading from 2.0.3 to 2.1.0 <upgrade_210>`
+- :doc:`Upgrading from 2.0.2 to 2.0.3 <upgrade_203>`
+- :doc:`Upgrading from 2.0.1 to 2.0.2 <upgrade_202>`
+- :doc:`Upgrading from 2.0 to 2.0.1 <upgrade_201>`
+- :doc:`Upgrading from 1.7.2 to 2.0 <upgrade_200>`
+- :doc:`Upgrading from 1.7.1 to 1.7.2 <upgrade_172>`
+- :doc:`Upgrading from 1.7.0 to 1.7.1 <upgrade_171>`
+- :doc:`Upgrading from 1.6.3 to 1.7.0 <upgrade_170>`
+- :doc:`Upgrading from 1.6.2 to 1.6.3 <upgrade_163>`
+- :doc:`Upgrading from 1.6.1 to 1.6.2 <upgrade_162>`
+- :doc:`Upgrading from 1.6.0 to 1.6.1 <upgrade_161>`
+- :doc:`Upgrading from 1.5.4 to 1.6.0 <upgrade_160>`
+- :doc:`Upgrading from 1.5.3 to 1.5.4 <upgrade_154>`
+- :doc:`Upgrading from 1.5.2 to 1.5.3 <upgrade_153>`
+- :doc:`Upgrading from 1.5.0 or 1.5.1 to 1.5.2 <upgrade_152>`
+- :doc:`Upgrading from 1.4.1 to 1.5.0 <upgrade_150>`
+- :doc:`Upgrading from 1.4.0 to 1.4.1 <upgrade_141>`
+- :doc:`Upgrading from 1.3.3 to 1.4.0 <upgrade_140>`
+- :doc:`Upgrading from 1.3.2 to 1.3.3 <upgrade_133>`
+- :doc:`Upgrading from 1.3.1 to 1.3.2 <upgrade_132>`
+- :doc:`Upgrading from 1.3 to 1.3.1 <upgrade_131>`
+- :doc:`Upgrading from 1.2 to 1.3 <upgrade_130>`
+- :doc:`Upgrading from 1.1 to 1.2 <upgrade_120>`
+- :doc:`Upgrading from Beta 1.0 to Beta 1.1 <upgrade_b11>`
+
diff --git a/user_guide_src/source/libraries/benchmark.rst b/user_guide_src/source/libraries/benchmark.rst
new file mode 100644
index 000000000..5b86142dd
--- /dev/null
+++ b/user_guide_src/source/libraries/benchmark.rst
@@ -0,0 +1,122 @@
+##################
+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.
+
+.. contents:: Table of Contents
+
+Using the Benchmark Class
+=========================
+
+The Benchmark class can be used within your
+:doc:`controllers </general/controllers>`,
+:doc:`views </general/views>`, or your :doc:`models </general/models>`.
+The process for usage is this:
+
+#. Mark a start point
+#. Mark an end point
+#. Run the "elapsed time" function to view the results
+
+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
+:doc:`Profiler </general/profiling>` 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 :doc:`Profiler page </general/profiling>` 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}
+
diff --git a/user_guide_src/source/libraries/caching.rst b/user_guide_src/source/libraries/caching.rst
new file mode 100644
index 000000000..2f06d29f9
--- /dev/null
+++ b/user_guide_src/source/libraries/caching.rst
@@ -0,0 +1,220 @@
+##############
+Caching Driver
+##############
+
+CodeIgniter features wrappers around some of the most popular forms of
+fast and dynamic caching. All but file-based caching require specific
+server requirements, and a Fatal Exception will be thrown if server
+requirements are not met.
+
+.. contents:: Table of Contents
+
+*************
+Example Usage
+*************
+
+The following example will load the cache driver, specify `APC <#apc>`_
+as the driver to use, and fall back to file-based caching if APC is not
+available in the hosting environment.
+
+::
+
+ $this->load->driver('cache', array('adapter' => 'apc', 'backup' => 'file'));
+
+ if ( ! $foo = $this->cache->get('foo'))
+ {
+ echo 'Saving to the cache!<br />';
+ $foo = 'foobarbaz!';
+
+ // Save into the cache for 5 minutes
+ $this->cache->save('foo', $foo, 300);
+ }
+
+ echo $foo;
+
+******************
+Function Reference
+******************
+
+.. php:class:: CI_Cache
+
+is_supported()
+===============
+
+ .. php:method:: is_supported ( $driver )
+
+ This function is automatically called when accessing drivers via
+ $this->cache->get(). However, if the individual drivers are used, make
+ sure to call this function to ensure the driver is supported in the
+ hosting environment.
+
+ :param string $driver: the name of the caching driver
+ :returns: TRUE if supported, FALSE if not
+ :rtype: Boolean
+
+ ::
+
+ if ($this->cache->apc->is_supported()
+ {
+ if ($data = $this->cache->apc->get('my_cache'))
+ {
+ // do things.
+ }
+ }
+
+
+get()
+=====
+
+ .. php:method:: get ( $id )
+
+ This function will attempt to fetch an item from the cache store. If the
+ item does not exist, the function will return FALSE.
+
+ :param string $id: name of cached item
+ :returns: The item if it exists, FALSE if it does not
+ :rtype: Mixed
+
+ ::
+
+ $foo = $this->cache->get('my_cached_item');
+
+
+save()
+======
+
+ .. php:method:: save ( $id , $data [, $ttl])
+
+ This function will save an item to the cache store. If saving fails, the
+ function will return FALSE.
+
+ :param string $id: name of the cached item
+ :param mixed $data: the data to save
+ :param int $ttl: Time To Live, in seconds (default 60)
+ :returns: TRUE on success, FALSE on failure
+ :rtype: Boolean
+
+ ::
+
+ $this->cache->save('cache_item_id', 'data_to_cache');
+
+delete()
+========
+
+ .. php:method:: delete ( $id )
+
+ This function will delete a specific item from the cache store. If item
+ deletion fails, the function will return FALSE.
+
+ :param string $id: name of cached item
+ :returns: TRUE if deleted, FALSE if the deletion fails
+ :rtype: Boolean
+
+ ::
+
+ $this->cache->delete('cache_item_id');
+
+clean()
+=======
+
+ .. php:method:: clean ( )
+
+ This function will 'clean' the entire cache. If the deletion of the
+ cache files fails, the function will return FALSE.
+
+ :returns: TRUE if deleted, FALSE if the deletion fails
+ :rtype: Boolean
+
+ ::
+
+ $this->cache->clean();
+
+cache_info()
+=============
+
+ .. php:method:: cache_info ( )
+
+ This function will return information on the entire cache.
+
+ :returns: information on the entire cache
+ :rtype: Mixed
+
+ ::
+
+ var_dump($this->cache->cache_info());
+
+ .. note:: The information returned and the structure of the data is dependent
+ on which adapter is being used.
+
+
+get_metadata()
+===============
+
+ .. php:method:: get_metadata ( $id )
+
+ This function will return detailed information on a specific item in the
+ cache.
+
+ :param string $id: name of cached item
+ :returns: metadadta for the cached item
+ :rtype: Mixed
+
+ ::
+
+ var_dump($this->cache->get_metadata('my_cached_item'));
+
+ .. note:: The information returned and the structure of the data is dependent
+ on which adapter is being used.
+
+
+*******
+Drivers
+*******
+
+Alternative PHP Cache (APC) Caching
+===================================
+
+All of the functions listed above can be accessed without passing a
+specific adapter to the driver loader as follows::
+
+ $this->load->driver('cache');
+ $this->cache->apc->save('foo', 'bar', 10);
+
+For more information on APC, please see
+`http://php.net/apc <http://php.net/apc>`_
+
+File-based Caching
+==================
+
+Unlike caching from the Output Class, the driver file-based caching
+allows for pieces of view files to be cached. Use this with care, and
+make sure to benchmark your application, as a point can come where disk
+I/O will negate positive gains by caching.
+
+All of the functions listed above can be accessed without passing a
+specific adapter to the driver loader as follows::
+
+ $this->load->driver('cache');
+ $this->cache->file->save('foo', 'bar', 10);
+
+Memcached Caching
+=================
+
+Multiple Memcached servers can be specified in the memcached.php
+configuration file, located in the application/config/ directory.
+
+All of the functions listed above can be accessed without passing a
+specific adapter to the driver loader as follows::
+
+ $this->load->driver('cache');
+ $this->cache->memcached->save('foo', 'bar', 10);
+
+For more information on Memcached, please see
+`http://php.net/memcached <http://php.net/memcached>`_
+
+Dummy Cache
+===========
+
+This is a caching backend that will always 'miss.' It stores no data,
+but lets you keep your caching code in place in environments that don't
+support your chosen cache.
diff --git a/user_guide_src/source/libraries/calendar.rst b/user_guide_src/source/libraries/calendar.rst
new file mode 100644
index 000000000..3964db25e
--- /dev/null
+++ b/user_guide_src/source/libraries/calendar.rst
@@ -0,0 +1,174 @@
+#################
+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.
+
+====================== =========== =============================================== ===================================================================
+Preference Default Options Description
+====================== =========== =============================================== ===================================================================
+**template** None None A string containing your calendar template.
+ See the template section below.
+**local_time** time() None A Unix timestamp corresponding to the current time.
+**start_day** sunday Any week day (sunday, monday, tuesday, etc.) Sets the day of the week the calendar should start on.
+**month_type** long long, short Determines what version of the month name to use in the header.
+ long = January, short = Jan.
+**day_type** abr long, short, abr Determines what version of the weekday names to use in
+ the column headers. long = Sunday, short = Sun, abr = Su.
+**show_next_prev** FALSE TRUE/FALSE (boolean) Determines whether to display links allowing you to toggle
+ to next/previous months. See information on this feature below.
+**next_prev_url** None A URL Sets 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_src/source/libraries/cart.rst b/user_guide_src/source/libraries/cart.rst
new file mode 100644
index 000000000..6594b3b9a
--- /dev/null
+++ b/user_guide_src/source/libraries/cart.rst
@@ -0,0 +1,302 @@
+###################
+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.
+
+.. contents:: Page Contents
+
+Initializing the Shopping Cart Class
+====================================
+
+.. important:: The Cart class utilizes CodeIgniter's :doc:`Session
+ Class <sessions>` 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 :doc:`Session Documentation <sessions>`, 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::
+
+ $this->load->library('cart');
+
+Once loaded, the Cart object will be available using::
+
+ $this->cart
+
+.. note:: The Cart Class will load and initialize the Session Class
+ automatically, so unless you are using sessions elsewhere in your
+ application, you do not need to load the Session class.
+
+Adding an Item to The Cart
+==========================
+
+To add an item to the shopping cart, simply pass an array with the
+product information to the $this->cart->insert() function, as shown
+below::
+
+ $data = array(
+ 'id' => 'sku_123ABC',
+ 'qty' => 1,
+ 'price' => 39.95,
+ 'name' => 'T-Shirt',
+ 'options' => array('Size' => 'L', 'Color' => 'Red')
+ );
+
+ $this->cart->insert($data);
+
+.. important:: The first four array indexes above (id, qty, price, and
+ name) are **required**. If you omit any of them the data will not be
+ saved to the cart. The fifth index (options) is optional. It is intended
+ to be used in cases where your product has options associated with it.
+ Use an array for options, as shown above.
+
+The five reserved indexes are:
+
+- **id** - Each product in your store must have a unique identifier.
+ Typically this will be an "sku" or other such identifier.
+- **qty** - The quantity being purchased.
+- **price** - The price of the item.
+- **name** - The name of the item.
+- **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.
+
+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.
+
+::
+
+ $data = array(
+ array(
+ 'id' => 'sku_123ABC',
+ 'qty' => 1,
+ 'price' => 39.95,
+ 'name' => 'T-Shirt',
+ 'options' => array('Size' => 'L', 'Color' => 'Red')
+ ),
+ array(
+ 'id' => 'sku_567ZYX',
+ 'qty' => 1,
+ 'price' => 9.95,
+ 'name' => 'Coffee Mug'
+ ),
+ array(
+ 'id' => 'sku_965QRS',
+ 'qty' => 1,
+ 'price' => 29.95,
+ 'name' => 'Shot Glass'
+ )
+ );
+
+ $this->cart->insert($data);
+
+Displaying the Cart
+===================
+
+To display the cart you will create a :doc:`view
+file </general/views>` with code similar to the one shown below.
+
+Please note that this example uses the :doc:`form
+helper </helpers/form_helper>`.
+
+::
+
+ <?php echo form_open('path/to/controller/update/function'); ?>
+
+ <table cellpadding="6" cellspacing="1" style="width:100%" border="0">
+
+ <tr>
+ <th>QTY</th>
+ <th>Item Description</th>
+ <th style="text-align:right">Item Price</th>
+ <th style="text-align:right">Sub-Total</th>
+ </tr>
+
+ <?php $i = 1; ?>
+
+ <?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>
+ </tr>
+
+ <?php $i++; ?>
+
+ <?php endforeach; ?>
+
+ <tr>
+ <td colspan="2"> </td>
+ <td class="right"><strong>Total</strong></td>
+ <td class="right">$<?php echo $this->cart->format_number($this->cart->total()); ?></td>
+ </tr>
+
+ </table>
+
+ <p><?php echo form_submit('', 'Update your Cart'); ?></p>
+
+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.
+
+
+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->remove(rowid);
+***************************
+
+Allows you to remove an item from the shopping cart by passing it the rowid.
+
+$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(boolean);
+*******************************
+
+Returns an array containing everything in the cart. You can sort the order,
+by which this is returned by passing it "true" where the contents will be sorted
+from newest to oldest, by leaving this function blank, you'll automatically just get
+first added to the basket to last added to the basket.
+
+$this->cart->has_options(rowid);
+********************************
+
+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);
+************************************
+
+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.
diff --git a/user_guide_src/source/libraries/config.rst b/user_guide_src/source/libraries/config.rst
new file mode 100644
index 000000000..c81cad7b3
--- /dev/null
+++ b/user_guide_src/source/libraries/config.rst
@@ -0,0 +1,181 @@
+############
+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.
+
+.. contents:: Page Contents
+
+Anatomy of a Config File
+========================
+
+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 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:
+
+Manual Loading
+**************
+
+To load one of your custom config files you will use the following
+function within the :doc:`controller </general/controllers>` 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);
+
+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.
+
+
+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 do 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.
+
+.. _config-environments:
+
+Environments
+============
+
+You may load different configuration files depending on the current
+environment. The ENVIRONMENT constant is defined in index.php, and is
+described in detail in the :doc:`Handling
+Environments </general/environments>` section.
+
+To create an environment-specific configuration file, create or copy a
+configuration file in application/config/{ENVIRONMENT}/{FILENAME}.php
+
+For example, to create a production-only config.php, you would:
+
+#. Create the directory application/config/production/
+#. Copy your existing config.php into the above directory
+#. Edit application/config/production/config.php so it contains your
+ production settings
+
+When you set the ENVIRONMENT constant to 'production', the settings for
+your new production-only config.php will be loaded.
+
+You can place the following configuration files in environment-specific
+folders:
+
+- Default CodeIgniter configuration files
+- Your own custom configuration files
+
+.. note::
+ CodeIgniter always tries to load the configuration files for
+ the current environment first. If the file does not exist, the global
+ config file (i.e., the one in application/config/) is loaded. This means
+ you are not obligated to place **all** of your configuration files in an
+ environment folder − only the files that change per environment.
+
+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->base_url();
+***************************
+
+This function retrieves the URL to your site, plus an optional path such
+as to a stylesheet or image.
+
+The two functions above are normally accessed via the corresponding
+functions in the :doc:`URL Helper </helpers/url_helper>`.
+
+$this->config->system_url();
+*****************************
+
+This function retrieves the URL to your system folder.
diff --git a/user_guide_src/source/libraries/email.rst b/user_guide_src/source/libraries/email.rst
new file mode 100644
index 000000000..27b704dae
--- /dev/null
+++ b/user_guide_src/source/libraries/email.rst
@@ -0,0 +1,261 @@
+###########
+Email Class
+###########
+
+CodeIgniter's robust Email Class supports the following features:
+
+- Multiple Protocols: Mail, Sendmail, and SMTP
+- TLS and SSL Encryption for 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
+:doc:`controllers <../general/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.
+
+=================== ====================== ============================ =======================================================================
+Preference Default Value Options Description
+=================== ====================== ============================ =======================================================================
+**useragent** CodeIgniter None The "user agent".
+**protocol** mail mail, sendmail, or smtp The mail sending protocol.
+**mailpath** /usr/sbin/sendmail None The server path to Sendmail.
+**smtp_host** No Default None SMTP Server Address.
+**smtp_user** No Default None SMTP Username.
+**smtp_pass** No Default None SMTP Password.
+**smtp_port** 25 None SMTP Port.
+**smtp_timeout** 5 None SMTP Timeout (in seconds).
+**smtp_crypto** No Default tls or ssl SMTP Encryption
+**wordwrap** TRUE TRUE or FALSE (boolean) Enable word-wrap.
+**wrapchars** 76 Character count to wrap at.
+**mailtype** text text or html Type 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.
+**charset** utf-8 Character set (utf-8, iso-8859-1, etc.).
+**validate** FALSE TRUE or FALSE (boolean) Whether to validate the email address.
+**priority** 3 1, 2, 3, 4, 5 Email 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_mode** FALSE TRUE or FALSE (boolean) Enable BCC Batch Mode.
+**bcc_batch_size** 200 None Number 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');
+
+If you'd like to change the disposition or add a custom file name, you can use the second and third paramaters. To use the default disposition (attachment), leave the second parameter blank. Here's an example::
+
+ $this->email->attach('/path/to/photo1.jpg', 'inline');
+ $this->email->attach('/path/to/photo1.jpg', '', 'birthday.jpg');
+
+
+$this->email->print_debugger()
+-------------------------------
+
+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}
diff --git a/user_guide_src/source/libraries/encryption.rst b/user_guide_src/source/libraries/encryption.rst
new file mode 100644
index 000000000..28bdca203
--- /dev/null
+++ b/user_guide_src/source/libraries/encryption.rst
@@ -0,0 +1,164 @@
+################
+Encryption Class
+################
+
+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 be provided with a high
+degree of security appropriate for storage.
+
+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);
+
+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->decode($msg, $key);
+
+$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 <http://php.net/mcrypt>`_.
+
+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_CBC**.
+Example::
+
+ $this->encrypt->set_mode(MCRYPT_MODE_CFB);
+
+Please visit php.net for a list of `available
+modes <http://php.net/mcrypt>`_.
+
+$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.
+
+.. important::
+ **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);
+
+====================== =============== =======================================================================
+Parameter Default Description
+====================== =============== =======================================================================
+**$orig_data** n/a The original encrypted data from CodeIgniter 1.x's Encryption library
+**$legacy_mode** MCRYPT_MODE_ECB The 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.
+**$key** n/a The encryption key. This it typically specified in your config file as
+ outlined above.
+====================== =============== ======================================================================= \ No newline at end of file
diff --git a/user_guide_src/source/libraries/file_uploading.rst b/user_guide_src/source/libraries/file_uploading.rst
new file mode 100644
index 000000000..90efca95d
--- /dev/null
+++ b/user_guide_src/source/libraries/file_uploading.rst
@@ -0,0 +1,327 @@
+####################
+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::
+
+ <html>
+ <head>
+ <title>Upload Form</title>
+ </head>
+ <body>
+
+ <?php echo $error;?>
+
+ <?php echo form_open_multipart('upload/do_upload');?>
+
+ <input type="file" name="userfile" size="20" />
+
+ <br /><br />
+
+ <input type="submit" value="upload" />
+
+ </form>
+
+ </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 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::
+
+ <html>
+ <head>
+ <title>Upload Form</title>
+ </head>
+ <body>
+
+ <h3>Your file was successfully uploaded!</h3>
+
+ <ul>
+ <?php foreach ($upload_data as $item => $value):?>
+ <li><?php echo $item;?>: <?php echo $value;?></li>
+ <?php endforeach; ?>
+ </ul>
+
+ <p><?php echo anchor('upload', 'Upload Another File!'); ?></p>
+
+ </body>
+ </html>
+
+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::
+
+ <?php
+
+ class Upload extends CI_Controller {
+
+ function __construct()
+ {
+ parent::__construct();
+ $this->load->helper(array('form', 'url'));
+ }
+
+ function index()
+ {
+ $this->load->view('upload_form', array('error' => ' ' ));
+ }
+
+ function do_upload()
+ {
+ $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);
+
+ if ( ! $this->upload->do_upload())
+ {
+ $error = array('error' => $this->upload->display_errors());
+
+ $this->load->view('upload_form', $error);
+ }
+ else
+ {
+ $data = array('upload_data' => $this->upload->data());
+
+ $this->load->view('upload_success', $data);
+ }
+ }
+ }
+ ?>
+
+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.
+
+============================ ================= ======================= ======================================================================
+Preference Default Value Options Description
+============================ ================= ======================= ======================================================================
+**upload_path** None None The path to the folder where the upload should be placed. The folder
+ must be writable and the path can be absolute or relative.
+**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.
+**file_name** None Desired file name 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.
+**overwrite** FALSE TRUE/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_size** 0 None The 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_width** 0 None The maximum width (in pixels) that the file can be. Set to zero for no
+ limit.
+**max_height** 0 None 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.
+**max_filename_increment** 100 None When overwrite is set to FALSE, use this to set the maximum filename
+ increment for CodeIgniter to append to the filename.
+**encrypt_name** FALSE TRUE/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_spaces** TRUE TRUE/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
+ [client_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.
+
+Item
+Description
+**file_name**
+The name of the file that was uploaded including the file extension.
+**file_type**
+The file's Mime type
+**file_path**
+The absolute server path to the file
+**full_path**
+The absolute server path including the file name
+**raw_name**
+The file name without the extension
+**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
+**file_size**
+The file size in kilobytes
+**is_image**
+Whether the file is an image or not. 1 = image. 0 = not.
+**image_width**
+Image width.
+**image_height**
+Image height
+**image_type**
+Image type. Typically the file extension without the period.
+**image_size_str**
+A string containing the width and height. Useful to put into an image
+tag.
diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst
new file mode 100644
index 000000000..e7875bc22
--- /dev/null
+++ b/user_guide_src/source/libraries/form_validation.rst
@@ -0,0 +1,1014 @@
+###############
+Form Validation
+###############
+
+CodeIgniter provides a comprehensive form validation and data prepping
+class that helps minimize the amount of code you'll write.
+
+.. contents:: Page Contents
+
+********
+Overview
+********
+
+Before explaining CodeIgniter's approach to data validation, let's
+describe the ideal scenario:
+
+#. A form is displayed.
+#. You fill it in and submit it.
+#. 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.
+#. This process continues until you have submitted a valid form.
+
+On the receiving end, the script must:
+
+#. 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.
+#. 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.
+
+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:
+
+#. A :doc:`View <../general/views>` file containing a form.
+#. A View file containing a "success" message to be displayed upon
+ successful submission.
+#. A :doc:`controller <../general/controllers>` function to receive and
+ process the submitted data.
+
+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::
+
+ <html>
+ <head>
+ <title>My Form</title>
+ </head>
+ <body>
+
+ <?php echo validation_errors(); ?>
+
+ <?php echo form_open('form'); ?>
+
+ <h5>Username</h5>
+ <input type="text" name="username" value="" size="50" />
+
+ <h5>Password</h5>
+ <input type="text" name="password" value="" size="50" />
+
+ <h5>Password Confirm</h5>
+ <input type="text" name="passconf" value="" size="50" />
+
+ <h5>Email Address</h5>
+ <input type="text" name="email" value="" size="50" />
+
+ <div><input type="submit" value="Submit" /></div>
+
+ </form>
+
+ </body>
+ </html>
+
+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::
+
+ <html>
+ <head>
+ <title>My Form</title>
+ </head>
+ <body>
+
+ <h3>Your form was successfully submitted!</h3>
+
+ <p><?php echo anchor('form', 'Try it again!'); ?></p>
+
+ </body>
+ </html>
+
+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::
+
+ <?php
+
+ class Form extends CI_Controller {
+
+ function index()
+ {
+ $this->load->helper(array('form', 'url'));
+
+ $this->load->library('form_validation');
+
+ if ($this->form_validation->run() == FALSE)
+ {
+ $this->load->view('myform');
+ }
+ else
+ {
+ $this->load->view('formsuccess');
+ }
+ }
+ }
+ ?>
+
+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:
+
+#. 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.
+#. 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.
+
+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:
+
+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:
+
+#. The field name - the exact name you've given the form field.
+#. 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".
+#. The validation rules for this form field.
+
+.. note:: If you would like the field
+ name to be stored in a language file, please see :ref:`translating-field-names`.
+
+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::
+
+ <?php
+
+ class Form extends CI_Controller {
+
+ function index()
+ {
+ $this->load->helper(array('form', 'url'));
+
+ $this->load->library('form_validation');
+
+ $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');
+
+ if ($this->form_validation->run() == FALSE)
+ {
+ $this->load->view('myform');
+ }
+ else
+ {
+ $this->load->view('formsuccess');
+ }
+ }
+ }
+ ?>
+
+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]|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|is_unique[users.email]');
+
+
+The above code sets the following rules:
+
+#. The username field be no shorter than 5 characters and no longer than
+ 12.
+#. The password field must match the password confirmation field.
+#. The email field must contain a valid email address.
+
+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!**
+
+::
+
+ <html>
+ <head>
+ <title>My Form</title>
+ </head>
+ <body>
+
+ <?php echo validation_errors(); ?>
+
+ <?php echo form_open('form'); ?>
+
+ <h5>Username</h5>
+ <input type="text" name="username" value="<?php echo set_value('username'); ?>" size="50" />
+
+ <h5>Password</h5>
+ <input type="text" name="password" value="<?php echo set_value('password'); ?>" size="50" />
+
+ <h5>Password Confirm</h5>
+ <input type="text" name="passconf" value="<?php echo set_value('passconf'); ?>" size="50" />
+
+ <h5>Email Address</h5>
+ <input type="text" name="email" value="<?php echo set_value('email'); ?>" size="50" />
+
+ <div><input type="submit" value="Submit" /></div>
+
+ </form>
+
+ </body>
+ </html>
+
+Now reload your page and submit the form so that it triggers an error.
+Your form fields should now be re-populated
+
+.. note:: The :ref:`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 :ref:`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::
+
+ <?php
+
+ class Form extends CI_Controller {
+
+ public function index()
+ {
+ $this->load->helper(array('form', 'url'));
+
+ $this->load->library('form_validation');
+
+ $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|is_unique[users.email]');
+
+ if ($this->form_validation->run() == FALSE)
+ {
+ $this->load->view('myform');
+ }
+ else
+ {
+ $this->load->view('formsuccess');
+ }
+ }
+
+ public function username_check($str)
+ {
+ if ($str == 'test')
+ {
+ $this->form_validation->set_message('username_check', 'The %s field can not be the word "test"');
+ return FALSE;
+ }
+ else
+ {
+ return TRUE;
+ }
+ }
+
+ }
+ ?>
+
+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**. If you need to receive an extra
+parameter in your callback function, just add it normally after the
+function name between square brackets, as in: "callback_foo**[bar]**",
+then it will be passed as the second argument of your callback function.
+
+.. note:: 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:
+
+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:
+
+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 :doc:`Language Class <language>` page for more info regarding
+language files.
+
+.. _changing-delimiters:
+
+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.
+
+#. **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.
+
+#. **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>'); ?>
+
+
+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::
+
+ <h5>Username</h5>
+ <?php echo form_error('username'); ?>
+ <input type="text" name="username" value="<?php echo set_value('username'); ?>" size="50" />
+
+ <h5>Password</h5>
+ <?php echo form_error('password'); ?>
+ <input type="text" name="password" value="<?php echo set_value('password'); ?>" size="50" />
+
+ <h5>Password Confirm</h5>
+ <?php echo form_error('passconf'); ?>
+ <input type="text" name="passconf" value="<?php echo set_value('passconf'); ?>" size="50" />
+
+ <h5>Email Address</h5>
+ <?php echo form_error('email'); ?>
+ <input type="text" name="email" value="<?php echo set_value('email'); ?>" size="50" />
+
+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 :ref:`using-arrays-as-field-names` section below.
+
+.. _saving-groups:
+
+************************************************
+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 CI_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:
+
+***************************
+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 :ref:`Helper Functions <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:
+
+======================= ========== ============================================================================================= =======================
+Rule Parameter Description Example
+======================= ========== ============================================================================================= =======================
+**required** No Returns FALSE if the form element is empty.
+**matches** Yes Returns FALSE if the form element does not match the one in the parameter. matches[form_item]
+**is_unique** Yes Returns FALSE if the form element is not unique to the is_unique[table.field]
+ table and field name in the parameter. is_unique[table.field]
+**max_length** Yes Returns FALSE if the form element is longer then the parameter value. max_length[12]
+**exact_length** Yes Returns FALSE if the form element is not exactly the parameter value. exact_length[8]
+**greater_than** Yes Returns FALSE if the form element is less than the parameter value or not numeric. greater_than[8]
+**less_than** Yes Returns FALSE if the form element is greater than the parameter value or not numeric. less_than[8]
+**alpha** No Returns FALSE if the form element contains anything other than alphabetical characters.
+**alpha_numeric** No Returns FALSE if the form element contains anything other than alpha-numeric characters.
+**alpha_dash** No 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.
+**integer** No Returns FALSE if the form element contains anything other than an integer.
+**decimal** Yes Returns FALSE if the form element is not exactly the parameter value.
+**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.
+**is_unique** Yes Returns FALSE if the form element is not unique in a database table. is_unique[table.field]
+**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_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.
+======================= ========== ============================================================================================= =======================
+
+.. 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:
+
+==================== ========= ===================================================================================================
+Name Parameter Description
+==================== ========= ===================================================================================================
+**xss_clean** No Runs the data through the XSS filtering function, described in the :doc:`Input Class <input>` page.
+**prep_for_form** No Converts special characters so that HTML data can be shown in a form field without breaking it.
+**prep_url** No Adds "\http://" to URLs if missing.
+**strip_image_tags** No Strips the HTML from image tags leaving the raw URL.
+**encode_php_tags** No Converts PHP tags to entities.
+==================== ========= ===================================================================================================
+
+.. note:: You can also use any native PHP functions that permit one
+ parameter, like trim, htmlspecialchars, urldecode, etc.
+
+.. _function-reference:
+
+******************
+Function Reference
+******************
+
+.. php:class:: Form_validation
+
+The following functions are intended for use in your controller
+functions.
+
+$this->form_validation->set_rules();
+======================================
+
+ .. php:method:: set_rules ($field, $label = '', $rules = '')
+
+ :param string $field: The field name
+ :param string $label: The field label
+ :param string $rules: The rules, seperated by a pipe "|"
+ :rtype: Object
+
+ Permits you to set validation rules, as described in the tutorial
+ sections above:
+
+ - :ref:`setting-validation-rules`
+ - :ref:`saving-groups`
+
+$this->form_validation->run();
+===============================
+
+ .. php:method:: run ($group = '')
+
+ :param string $group: The name of the validation group to run
+ :rtype: Boolean
+
+ 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: :ref:`saving-groups`
+
+$this->form_validation->set_message();
+========================================
+
+ .. php:method:: set_message ($lang, $val = '')
+
+ :param string $lang: The rule the message is for
+ :param string $val: The message
+ :rtype: Object
+
+ Permits you to set custom error messages. See :ref:`setting-error-messages`
+
+.. _helper-functions:
+
+****************
+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
+:ref:`changing-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
+:ref:`changing-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'); ?> />
+
diff --git a/user_guide_src/source/libraries/ftp.rst b/user_guide_src/source/libraries/ftp.rst
new file mode 100644
index 000000000..20b11a5c8
--- /dev/null
+++ b/user_guide_src/source/libraries/ftp.rst
@@ -0,0 +1,250 @@
+#########
+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->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.
+
+::
+
+ // 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.
diff --git a/user_guide_src/source/libraries/image_lib.rst b/user_guide_src/source/libraries/image_lib.rst
new file mode 100644
index 000000000..ed6575c62
--- /dev/null
+++ b/user_guide_src/source/libraries/image_lib.rst
@@ -0,0 +1,426 @@
+########################
+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.
+
+.. note:: Image processing can require a considerable amount of server
+ memory for some operations. If you are experiencing out of memory errors
+ while processing images you may need to limit their maximum size, and/or
+ adjust PHP memory limits.
+
+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
+
+======================= ======================= =============================== =========================================================================== =============
+Preference Default Value Options Description Availability
+======================= ======================= =============================== =========================================================================== =============
+**image_library** GD2 GD, GD2, ImageMagick, NetPBM Sets the image library to be used. R, C, X, W
+**library_path** None None Sets the server path to your ImageMagick or NetPBM library. If you use R, C, X
+ either of those libraries you must supply the path. R, C, S, W
+**source_image** None None 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 R, C, X, W
+ 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.
+**quality** 90% 1 - 100% Sets the quality of the image. The higher the quality the larger the R, C, X, W
+ file size.
+**new_image** None None Sets the destination image name/path. You'll use this preference when R, C, X, W
+ creating an image copy. The path must be a relative or absolute server
+ path, not a URL.
+**width** None None Sets the width you would like the image set to. R, C
+**height** None None Sets the height you would like the image set to. R, C
+**create_thumb** FALSE TRUE/FALSE (boolean) Tells the image processing function to create a thumb. R
+**thumb_marker** _thumb None Specifies the thumbnail indicator. It will be inserted just before the R
+ file extension, so mypic.jpg would become mypic_thumb.jpg
+**maintain_ratio** TRUE TRUE/FALSE (boolean) Specifies whether to maintain the original aspect ratio when resizing or R, C
+ use hard values.
+**master_dim** auto auto, width, height Specifies what to use as the master axis when resizing or creating R
+ 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.
+**rotation_angle** None 90, 180, 270, vrt, hor Specifies the angle of rotation when rotating images. Note that PHP X
+ rotates counter-clockwise, so a 90 degree rotation to the right must be
+ specified as 270.
+**x_axis** None None Sets the X coordinate in pixels for image cropping. For example, a C
+ setting of 30 will crop an image 30 pixels from the left.
+**y_axis** None None Sets the Y coordinate in pixels for image cropping. For example, a C
+ setting of 30 will crop an image 30 pixels from the top.
+======================= ======================= =============================== =========================================================================== =============
+
+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:
+
+#. 90 - rotates counter-clockwise by 90 degrees.
+#. 180 - rotates counter-clockwise by 180 degrees.
+#. 270 - rotates counter-clockwise by 270 degrees.
+#. hor - flips the image horizontally.
+#. vrt - flips the image vertically.
+
+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)
+
+======================= =================== ======================= ==========================================================================
+Preference Default Value Options Description
+======================= =================== ======================= ==========================================================================
+**wm_type** text text, overlay Sets the type of watermarking that should be used.
+**source_image** None None 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.
+**quality** 90% 1 - 100% Sets the quality of the image. The higher the quality the larger the
+ file size.
+**wm_padding** None A number The amount of padding, set in pixels, that will be applied to the
+ watermark to set it away from the edge of your images.
+**wm_vrt_alignment** bottom top, middle, bottom Sets the vertical alignment for the watermark image.
+**wm_hor_alignment** center left, center, right Sets the horizontal alignment for the watermark image.
+**wm_hor_offset** None None You 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_offset** None None You 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.
+
+======================= =================== =================== ==========================================================================
+Preference Default Value Options Description
+======================= =================== =================== ==========================================================================
+**wm_text** None None 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.
+**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.
+**wm_font_color** ffffff None The font color, specified in hex. Both the full 6-length (ie, 993300) and
+ the short three character abbreviated version (ie, fff) are supported.
+**wm_shadow_color** None None The color of the drop shadow, specified in hex. If you leave this blank
+ a drop shadow will not be used. Both the full 6-length (ie, 993300) and
+ the short three character abbreviated version (ie, fff) are supported.
+**wm_shadow_distance** 3 None The 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.
+
+======================= =================== =================== ==========================================================================
+Preference Default Value Options Description
+======================= =================== =================== ==========================================================================
+**wm_overlay_path** None None The server path to the image you wish to use as your watermark. Required
+ only if you are using the overlay method.
+**wm_opacity** 50 1 - 100 Image 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_transp** 4 A number If 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_transp** 4 A number Along with the previous setting, this allows you to specify the
+ coordinate to a pixel representative of the color you want to be
+ transparent.
+======================= =================== =================== ==========================================================================
diff --git a/user_guide_src/source/libraries/index.rst b/user_guide_src/source/libraries/index.rst
new file mode 100644
index 000000000..678b633dd
--- /dev/null
+++ b/user_guide_src/source/libraries/index.rst
@@ -0,0 +1,9 @@
+#########
+Libraries
+#########
+
+.. toctree::
+ :glob:
+ :titlesonly:
+
+ * \ No newline at end of file
diff --git a/user_guide_src/source/libraries/input.rst b/user_guide_src/source/libraries/input.rst
new file mode 100644
index 000000000..bcf117358
--- /dev/null
+++ b/user_guide_src/source/libraries/input.rst
@@ -0,0 +1,300 @@
+###########
+Input Class
+###########
+
+The Input Class serves two purposes:
+
+#. It pre-processes global input data for security.
+#. It provides some helper functions for fetching input data and
+ pre-processing it.
+
+.. 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
+:doc:`controller <../general/controllers>` is invoked. It does the
+following:
+
+- If $config['allow_get_array'] is FALSE(default is TRUE), destroys
+ the global GET array.
+- Destroys all global variables in the event register_globals is
+ turned on.
+- Filters the GET/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(In Windows \\r\\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 application/config/config.php file and setting
+this::
+
+ $config['global_xss_filtering'] = TRUE;
+
+Please refer to the :doc:`Security class <security>` documentation for
+information on using XSS Filtering in your application.
+
+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);
+
+To return an array of all POST items call without any parameters.
+
+To return all POST items and pass them through the XSS filter set the
+first parameter NULL while setting the second parameter to boolean;
+
+The function returns FALSE (boolean) if there are no items in the POST.
+
+::
+
+ $this->input->post(NULL, TRUE); // returns all POST items with XSS filter
+ $this->input->post(); // returns all POST items without XSS filter
+
+$this->input->get()
+===================
+
+This function is identical to the post function, only it fetches get
+data::
+
+ $this->input->get('some_data', TRUE);
+
+To return an array of all GET items call without any parameters.
+
+To return all GET items and pass them through the XSS filter set the
+first parameter NULL while setting the second parameter to boolean;
+
+The function returns FALSE (boolean) if there are no items in the GET.
+
+::
+
+ $this->input->get(NULL, TRUE); // returns all GET items with XSS filter
+ $this->input->get(); // returns all GET items without XSS filtering
+
+
+$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->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_',
+ 'secure' => TRUE
+ );
+
+ $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.
+
+The secure boolean is only needed if you want to make it a secure cookie
+by setting it to TRUE.
+
+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, $secure);
+
+$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)::
+
+ 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;
+
+::
+
+ 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
+
+::
+
+ 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();
+
+See the :doc:`User Agent Class <user_agent>` 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() <http://php.net/apache_request_headers>`_
+will not be supported. Returns an array of headers.
+
+::
+
+ $headers = $this->input->request_headers();
+
+$this->input->get_request_header();
+=====================================
+
+Returns a single member of the request headers array.
+
+::
+
+ $this->input->get_request_header('some-header', TRUE);
+
+$this->input->is_ajax_request()
+=================================
+
+Checks to see if the HTTP_X_REQUESTED_WITH server header has been
+set, and returns a boolean response.
+
+$this->input->is_cli_request()
+================================
+
+Checks to see if the STDIN constant is set, which is a failsafe way to
+see if PHP is being run on the command line.
+
+::
+
+ $this->input->is_cli_request()
+
diff --git a/user_guide_src/source/libraries/javascript.rst b/user_guide_src/source/libraries/javascript.rst
new file mode 100644
index 000000000..5e80fb998
--- /dev/null
+++ b/user_guide_src/source/libraries/javascript.rst
@@ -0,0 +1,301 @@
+.. note:: This driver is experimental. Its feature set and
+ implementation may change in future releases.
+
+################
+Javascript Class
+################
+
+CodeIgniter provides a library to help you with certain common functions
+that you may want to use with Javascript. 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 Javascript 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.
+
+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 application/config.php, within its own
+config/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.
+
+The jQuery 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
+
+jQuery 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 <http://docs.jquery.com/Selectors>`_. 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 <http://docs.jquery.com/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.
+- "parameters" 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 <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/ <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
diff --git a/user_guide_src/source/libraries/language.rst b/user_guide_src/source/libraries/language.rst
new file mode 100644
index 000000000..ec678cd21
--- /dev/null
+++ b/user_guide_src/source/libraries/language.rst
@@ -0,0 +1,90 @@
+##############
+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 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 :doc:`Language
+helper <../helpers/language_helper>`.
+
+Auto-loading Languages
+======================
+
+If you find that you need a particular language globally throughout your
+application, you can tell CodeIgniter to
+:doc:`auto-load <../general/autoloader>` it during system
+initialization. This is done by opening the
+application/config/autoload.php file and adding the language(s) to the
+autoload array.
+
+
diff --git a/user_guide_src/source/libraries/loader.rst b/user_guide_src/source/libraries/loader.rst
new file mode 100644
index 000000000..2090404bf
--- /dev/null
+++ b/user_guide_src/source/libraries/loader.rst
@@ -0,0 +1,284 @@
+############
+Loader Class
+############
+
+Loader, as the name suggests, is used to load elements. These elements
+can be libraries (classes) :doc:`View files <../general/views>`,
+:doc:`Helpers <../general/helpers>`,
+:doc:`Models <../general/models>`, 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.
+
+Additionally, multiple libraries can be loaded at the same time by
+passing an array of libraries to the load function.
+
+::
+
+ $this->load->library(array('email', 'table'));
+
+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.
+
+Please take note, when multiple libraries are supplied in an array for
+the first parameter, each will receive the same parameter information.
+
+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
+
+Please take note, when multiple libraries are supplied in an array for
+the first parameter, this parameter is discarded.
+
+$this->load->view('file_name', $data, true/false)
+==================================================
+
+This function is used to load your View files. If you haven't read the
+:doc:`Views <../general/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 <http://www.php.net/extract>`_ function to convert to variables
+that can be used in your view files. Again, read the
+:doc:`Views <../general/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 :doc:`database <../database/index>`
+section for more info.
+
+$this->load->vars($array)
+=========================
+
+This function takes an associative array as input and generates
+variables using the PHP `extract <http://www.php.net/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->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->get_vars()
+===========================
+
+This function retrieves all variables available to
+your views.
+
+$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->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->language('file_name')
+===================================
+
+This function is an alias of the :doc:`language loading
+function <language>`: $this->lang->load()
+
+$this->load->config('file_name')
+=================================
+
+This function is an alias of the :doc:`config file loading
+function <config>`: $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 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".
+
+::
+
+ /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
+------------------
+
+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', FALSE);
+ $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 FALSE
+
+ // 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 \ No newline at end of file
diff --git a/user_guide_src/source/libraries/migration.rst b/user_guide_src/source/libraries/migration.rst
new file mode 100644
index 000000000..5192f1f29
--- /dev/null
+++ b/user_guide_src/source/libraries/migration.rst
@@ -0,0 +1,5 @@
+################
+Migrations Class
+################
+
+Coming soon. \ No newline at end of file
diff --git a/user_guide_src/source/libraries/output.rst b/user_guide_src/source/libraries/output.rst
new file mode 100644
index 000000000..2cf7c0854
--- /dev/null
+++ b/user_guide_src/source/libraries/output.rst
@@ -0,0 +1,138 @@
+############
+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
+:doc:`caching <../general/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 :doc:`Loader <../libraries/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->set_content_type();
+====================================
+
+Permits you to set the mime-type of your page so you can serve JSON
+data, JPEG's, XML, etc easily.
+
+::
+
+ $this->output
+ ->set_content_type('application/json')
+ ->set_output(json_encode(array('foo' => 'bar')));
+
+ $this->output
+ ->set_content_type('jpeg') // You could also use ".jpeg" which will have the full stop removed before looking in config/mimes.php
+ ->set_output(file_get_contents('files/something.jpg'));
+
+.. important:: Make sure any non-mime string you pass to this method
+ exists in config/mimes.php or it will have no effect.
+
+$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->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::
+
+ $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(code, 'text');
+=================================================
+
+Permits you to manually set a server status header. Example::
+
+ $this->output->set_status_header('401');
+ // Sets the header as: Unauthorized
+
+`See here <http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html>`_ for
+a full list of headers.
+
+$this->output->enable_profiler();
+==================================
+
+Permits you to enable/disable the
+:doc:`Profiler <../general/profiling>`, 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
+:doc:`Controller <../general/controllers>` 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->set_profiler_sections();
+=========================================
+
+Permits you to enable/disable specific sections of the Profiler when
+enabled. Please refer to the :doc:`Profiler <../general/profiling>`
+documentation for further information.
+
+$this->output->cache();
+=======================
+
+The CodeIgniter output library also controls caching. For more
+information, please see the :doc:`caching
+documentation <../general/caching>`.
+
+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_src/source/libraries/pagination.rst b/user_guide_src/source/libraries/pagination.rst
new file mode 100644
index 000000000..f1653c913
--- /dev/null
+++ b/user_guide_src/source/libraries/pagination.rst
@@ -0,0 +1,256 @@
+################
+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
+:doc:`controller <../general/controllers>` 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 :doc:`re-route your URI <../general/routing>` 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['use_page_number'] = TRUE;
+==================================
+
+By default, the URI segment will use the starting index for the items
+you are paginating. If you prefer to show the the actual page number,
+set this to TRUE.
+
+$config['page_query_string'] = TRUE;
+====================================
+
+By default, the pagination library assume you are using :doc:`URI
+Segments <../general/urls>`, 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. If you do
+not want this link rendered, you can set its value to FALSE.
+
+$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. If you do
+not want this link rendered, you can set its value to FALSE.
+
+$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. If you do not
+want this link rendered, you can set its value to FALSE.
+
+$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. If you do not
+want this link rendered, you can set its value to FALSE.
+
+$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.
+
+****************
+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.
diff --git a/user_guide_src/source/libraries/parser.rst b/user_guide_src/source/libraries/parser.rst
new file mode 100644
index 000000000..0b77ae4b9
--- /dev/null
+++ b/user_guide_src/source/libraries/parser.rst
@@ -0,0 +1,149 @@
+#####################
+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.
+
+.. important:: 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 :doc:`view
+file <../general/views>` (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);
+
+$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
+==============
+
+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);
+
diff --git a/user_guide_src/source/libraries/security.rst b/user_guide_src/source/libraries/security.rst
new file mode 100644
index 000000000..e7d25555f
--- /dev/null
+++ b/user_guide_src/source/libraries/security.rst
@@ -0,0 +1,97 @@
+##############
+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'));
+
+If it is acceptable for the user input to include relative paths, e.g.
+file/in/some/approved/folder.txt, you can set the second optional
+parameter, $relative_path to TRUE.
+
+::
+
+ $filename = $this->security->sanitize_filename($this->input->post('filename'), TRUE);
+
+Cross-site request forgery (CSRF)
+=================================
+
+You can enable csrf protection by opening your
+application/config/config.php file and setting this::
+
+ $config['csrf_protection'] = TRUE;
+
+If you use the :doc:`form helper <../helpers/form_helper>` the
+form_open() function will automatically insert a hidden csrf field in
+your forms.
+
+Tokens may be either regenerated on every submission (default) or kept the same throughout the life of the CSRF cookie. The default regeneration of tokens provides stricter security but may result in usability concerns as other tokens become invalid (back/forward navigation, multiple tabs/windows, asynchronous actions, etc). You may alter this behavior by editing the following config parameter::
+
+ $config['csrf_regeneration'] = TRUE;
+
+Select URIs can be whitelisted from csrf protection (for example API
+endpoints expecting externally POSTed content). You can add these URIs
+by editing the 'csrf_exclude_uris' config parameter::
+
+ $config['csrf_exclude_uris'] = array('api/person/add');
+
diff --git a/user_guide_src/source/libraries/sessions.rst b/user_guide_src/source/libraries/sessions.rst
new file mode 100644
index 000000000..ef32f5d71
--- /dev/null
+++ b/user_guide_src/source/libraries/sessions.rst
@@ -0,0 +1,306 @@
+#############
+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.
+
+.. note:: Even if you are not using encrypted sessions, you must set
+ an :doc:`encryption key <./encryption>` 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 :doc:`initialized <../general/libraries>` in your
+:doc:`controller <../general/controllers>` constructors, or it can be
+:doc:`auto-loaded <../general/autoloader>` 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 120 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 :doc:`found here <encryption>`, 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['sess_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.
+
+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');
+
+
+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. 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::
+
+ 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(120) 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. 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:
+
+=========================== =============== =========================== ==========================================================================
+Preference Default Options Description
+=========================== =============== =========================== ==========================================================================
+**sess_cookie_name** ci_session None The name you want the session cookie saved as.
+**sess_expiration** 7200 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 TRUE/FALSE (boolean) Whether to encrypt the session data.
+**sess_use_database** FALSE TRUE/FALSE (boolean) Whether to save the session data to a database. You must create the
+ table before enabling this option.
+**sess_table_name** ci_sessions Any valid SQL table name The name of the session database table.
+**sess_time_to_update** 300 Time in seconds This options controls how often the session class will regenerate itself
+ and create a new session id.
+**sess_match_ip** FALSE TRUE/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_useragent** TRUE TRUE/FALSE (boolean) Whether to match the User Agent when reading the session data.
+=========================== =============== =========================== ========================================================================== \ No newline at end of file
diff --git a/user_guide_src/source/libraries/table.rst b/user_guide_src/source/libraries/table.rst
new file mode 100644
index 000000000..9bc3f3423
--- /dev/null
+++ b/user_guide_src/source/libraries/table.rst
@@ -0,0 +1,267 @@
+################
+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'));
+
+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()
+=============================
+
+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();
+
+$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>
+
diff --git a/user_guide_src/source/libraries/trackback.rst b/user_guide_src/source/libraries/trackback.rst
new file mode 100644
index 000000000..07b2b2177
--- /dev/null
+++ b/user_guide_src/source/libraries/trackback.rst
@@ -0,0 +1,201 @@
+###############
+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 <http://en.wikipedia.org/wiki/Trackback>`_.
+
+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::
+
+ CREATE TABLE trackbacks (
+ tb_id int(10) unsigned NOT NULL auto_increment,
+ entry_id int(10) unsigned NOT NULL default 0,
+ url varchar(200) NOT NULL,
+ title varchar(100) NOT NULL,
+ excerpt text NOT NULL,
+ blog_name varchar(100) NOT NULL,
+ tb_date int(10) NOT NULL,
+ ip_address varchar(16) NOT NULL,
+ PRIMARY KEY `tb_id` (`tb_id`),
+ KEY `entry_id` (`entry_id`)
+ );
+
+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.
diff --git a/user_guide_src/source/libraries/typography.rst b/user_guide_src/source/libraries/typography.rst
new file mode 100644
index 000000000..db3f227be
--- /dev/null
+++ b/user_guide_src/source/libraries/typography.rst
@@ -0,0 +1,105 @@
+################
+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 apostrophe 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 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::
+
+ $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 :doc:`caching <../general/caching>`
+ your pages.
+
+format_characters()
+====================
+
+This function is similar 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 apostrophe 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->format_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;
+
diff --git a/user_guide_src/source/libraries/unit_testing.rst b/user_guide_src/source/libraries/unit_testing.rst
new file mode 100644
index 000000000..03819b27c
--- /dev/null
+++ b/user_guide_src/source/libraries/unit_testing.rst
@@ -0,0 +1,164 @@
+##################
+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', 'notes');
+===============================================================
+
+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;
+
+ $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_object
+- 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)
+
+Unit Test Display
+=================
+
+When your unit test results display, the following items show by
+default:
+
+- Test Name (test_name)
+- Test Datatype (test_datatype)
+- Expected Datatype (res_datatype)
+- Result (result)
+- File Name (file)
+- Line Number (line)
+- Any notes you entered for the test (notes)
+
+You can customize which of these items get displayed by using
+$this->unit->set_items(). For example, if you only wanted the test name
+and the result displayed:
+
+Customizing displayed tests
+---------------------------
+
+::
+
+ $this->unit->set_test_items(array('test_name', 'result'));
+
+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.
diff --git a/user_guide_src/source/libraries/uri.rst b/user_guide_src/source/libraries/uri.rst
new file mode 100644
index 000000000..ee60b77d7
--- /dev/null
+++ b/user_guide_src/source/libraries/uri.rst
@@ -0,0 +1,188 @@
+#########
+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:
+
+#. news
+#. local
+#. metro
+#. 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 :doc:`URI Routing <../general/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:
+
+#. segment/
+#. /segment
+#. /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 :doc:`URI Routing <../general/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 :doc:`URI Routing <../general/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()
+==========================
+
+This function is identical to the previous one, except that it returns
+the re-routed URI in the event you are using CodeIgniter's :doc:`URI
+Routing <../general/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 :doc:`URI Routing <../general/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 :doc:`URI Routing <../general/routing>` feature.
diff --git a/user_guide_src/source/libraries/user_agent.rst b/user_guide_src/source/libraries/user_agent.rst
new file mode 100644
index 000000000..855ece29d
--- /dev/null
+++ b/user_guide_src/source/libraries/user_agent.rst
@@ -0,0 +1,200 @@
+################
+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.
+
+::
+
+ if ($this->agent->is_browser('Safari'))
+ {
+ echo 'You are using Safari.';
+ }
+ else if ($this->agent->is_browser())
+ {
+ echo 'You are using a browser.';
+ }
+
+
+.. note:: The string "Safari" in this example is an array key in the
+ list of browser definitions. You can find this list in
+ application/config/user_agents.php if you want to add new browsers or
+ change the stings.
+
+$this->agent->is_mobile()
+==========================
+
+Returns TRUE/FALSE (boolean) if the user agent is a known mobile device.
+
+::
+
+ if ($this->agent->is_mobile('iphone'))
+ {
+ $this->load->view('iphone/home');
+ }
+ else if ($this->agent->is_mobile())
+ {
+ $this->load->view('mobile/home');
+ }
+ else
+ {
+ $this->load->view('web/home');
+ }
+
+
+$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.
diff --git a/user_guide_src/source/libraries/xmlrpc.rst b/user_guide_src/source/libraries/xmlrpc.rst
new file mode 100644
index 000000000..3b945769f
--- /dev/null
+++ b/user_guide_src/source/libraries/xmlrpc.rst
@@ -0,0 +1,536 @@
+##################################
+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 <http://www.xmlrpc.com/>`_ 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 <http://pingomatic.com/>`_
+
+::
+
+ $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 <#datatypes>`_ 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.
+
+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 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 CI_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 CI_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 <#datatypes>`_ 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::
+
+ <?php
+
+ class Xmlrpc_client extends CI_Controller {
+
+ function index()
+ {
+ $this->load->helper('url');
+ $server_url = site_url('xmlrpc_server');
+
+ $this->load->library('xmlrpc');
+
+ $this->xmlrpc->server($server_url, 80);
+ $this->xmlrpc->method('Greetings');
+
+ $request = array('How is it going?');
+ $this->xmlrpc->request($request);
+
+ if ( ! $this->xmlrpc->send_request())
+ {
+ echo $this->xmlrpc->display_error();
+ }
+ else
+ {
+ echo '<pre>';
+ print_r($this->xmlrpc->display_response());
+ echo '</pre>';
+ }
+ }
+ }
+ ?>
+
+.. note:: In the above code we are using a "url helper". You can find more
+ information in the :doc:`Helpers Functions <../general/helpers>` 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::
+
+ <?php
+
+ class Xmlrpc_server extends CI_Controller {
+
+ function index()
+ {
+ $this->load->library('xmlrpc');
+ $this->load->library('xmlrpcs');
+
+ $config['functions']['Greetings'] = array('function' => 'Xmlrpc_server.process');
+
+ $this->xmlrpcs->initialize($config);
+ $this->xmlrpcs->serve();
+ }
+
+
+ function process($request)
+ {
+ $parameters = $request->output_parameters();
+
+ $response = array(
+ array(
+ 'you_said' => $parameters['0'],
+ 'i_respond' => 'Not bad at all.'),
+ 'struct');
+
+ return $this->xmlrpc->send_response($response);
+ }
+ }
+ ?>
+
+
+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 <http://www.xmlrpc.com/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)
+
diff --git a/user_guide_src/source/libraries/zip.rst b/user_guide_src/source/libraries/zip.rst
new file mode 100644
index 000000000..c27718273
--- /dev/null
+++ b/user_guide_src/source/libraries/zip.rst
@@ -0,0 +1,208 @@
+##################
+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');
+
+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::
+
+ $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, but will not include the
+folders /path/to/your.
+
+$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');
+
diff --git a/user_guide_src/source/license.rst b/user_guide_src/source/license.rst
new file mode 100644
index 000000000..17179a95c
--- /dev/null
+++ b/user_guide_src/source/license.rst
@@ -0,0 +1,245 @@
+###################################
+Open Software License ("OSL") v 3.0
+###################################
+
+This Open Software License (the "License") applies to any original work of
+authorship (the "Original Work") whose owner (the "Licensor") has placed the
+following licensing notice adjacent to the copyright notice for the Original
+Work:
+
+*Licensed under the Open Software License version 3.0*
+
+
+*****************************
+1) Grant of Copyright License
+*****************************
+
+Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable
+license, for the duration of the copyright, to do the following:
+
+ *a)* to reproduce the Original Work in copies, either alone or as part of
+ a collective work;
+
+ *b)* to translate, adapt, alter, transform, modify, or arrange the
+ Original Work, thereby creating derivative works ("Derivative Works")
+ based upon the Original Work;
+
+ *c)* to distribute or communicate copies of the Original Work and
+ Derivative Works to the public, *with the proviso that copies of Original
+ Work or Derivative Works that You distribute or communicate shall be
+ licensed under this Open Software License*;
+
+ *d)* to perform the Original Work publicly; and
+
+ *e)* to display the Original Work publicly.
+
+
+**************************
+2) Grant of Patent License
+**************************
+
+Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable
+license, under patent claims owned or controlled by the Licensor that are
+embodied in the Original Work as furnished by the Licensor, for the duration
+of the patents, to make, use, sell, offer for sale, have made, and import the
+Original Work and Derivative Works.
+
+
+*******************************
+3) Grant of Source Code License
+*******************************
+
+The term "Source Code" means the preferred form of the Original Work for
+making modifications to it and all available documentation describing how to
+modify the Original Work. Licensor agrees to provide a machine-readable copy
+of the Source Code of the Original Work along with each copy of the Original
+Work that Licensor distributes. Licensor reserves the right to satisfy this
+obligation by placing a machine-readable copy of the Source Code in an
+information repository reasonably calculated to permit inexpensive and
+convenient access by You for as long as Licensor continues to distribute the
+Original Work.
+
+
+********************************
+4) Exclusions From License Grant
+********************************
+
+Neither the names of Licensor, nor the names of any contributors to the
+Original Work, nor any of their trademarks or service marks, may be used to
+endorse or promote products derived from this Original Work without express
+prior permission of the Licensor. Except as expressly stated herein, nothing
+in this License grants any license to Licensor's trademarks, copyrights,
+patents, trade secrets or any other intellectual property. No patent license
+is granted to make, use, sell, offer for sale, have made, or import
+embodiments of any patent claims other than the licensed claims defined in
+Section 2) No license is granted to the trademarks of Licensor even if such
+marks are included in the Original Work. Nothing in this License shall be
+interpreted to prohibit Licensor from licensing under terms different from
+this License any Original Work that Licensor otherwise would have a right to
+license.
+
+
+**********************
+5) External Deployment
+**********************
+
+The term "External Deployment" means the use, distribution, or communication
+of the Original Work or Derivative Works in any way such that the Original
+Work or Derivative Works may be used by anyone other than You, whether those
+works are distributed or communicated to those persons or made available as an
+application intended for use over a network. As an express condition for the
+grants of license hereunder, You must treat any External Deployment by You of
+the Original Work or a Derivative Work as a distribution under section 1(c).
+
+
+*********************
+6) Attribution Rights
+*********************
+
+You must retain, in the Source Code of any Derivative Works that You create,
+all copyright, patent, or trademark notices from the Source Code of the
+Original Work, as well as any notices of licensing and any descriptive text
+identified therein as an "Attribution Notice." You must cause the Source Code
+for any Derivative Works that You create to carry a prominent Attribution
+Notice reasonably calculated to inform recipients that You have modified the
+Original Work.
+
+
+****************************************************
+7) Warranty of Provenance and Disclaimer of Warranty
+****************************************************
+
+Licensor warrants that the copyright in and to the Original Work and the
+patent rights granted herein by Licensor are owned by the Licensor or are
+sublicensed to You under the terms of this License with the permission of the
+contributor(s) of those copyrights and patent rights. Except as expressly
+stated in the immediately preceding sentence, the Original Work is provided
+under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or
+implied, including, without limitation, the warranties of non-infringement,
+merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE
+QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY
+constitutes an essential part of this License. No license to the Original Work
+is granted by this License except under this disclaimer.
+
+
+**************************
+8) Limitation of Liability
+**************************
+
+Under no circumstances and under no legal theory, whether in tort (including
+negligence), contract, or otherwise, shall the Licensor be liable to anyone
+for any indirect, special, incidental, or consequential damages of any
+character arising as a result of this License or the use of the Original Work
+including, without limitation, damages for loss of goodwill, work stoppage,
+computer failure or malfunction, or any and all other commercial damages or
+losses. This limitation of liability shall not apply to the extent applicable
+law prohibits such limitation.
+
+
+*****************************
+9) Acceptance and Termination
+*****************************
+
+If, at any time, You expressly assented to this License, that assent indicates
+your clear and irrevocable acceptance of this License and all of its terms and
+conditions. If You distribute or communicate copies of the Original Work or a
+Derivative Work, You must make a reasonable effort under the circumstances to
+obtain the express assent of recipients to the terms of this License. This
+License conditions your rights to undertake the activities listed in Section
+1, including your right to create Derivative Works based upon the Original
+Work, and doing so without honoring these terms and conditions is prohibited
+by copyright law and international treaty. Nothing in this License is intended
+to affect copyright exceptions and limitations (including "fair use" or "fair
+dealing"). This License shall terminate immediately and You may no longer
+exercise any of the rights granted to You by this License upon your failure to
+honor the conditions in Section 1(c).
+
+
+*********************************
+10) Termination for Patent Action
+*********************************
+
+This License shall terminate automatically and You may no longer exercise any
+of the rights granted to You by this License as of the date You commence an
+action, including a cross-claim or counterclaim, against Licensor or any
+licensee alleging that the Original Work infringes a patent. This termination
+provision shall not apply for an action alleging patent infringement by
+combinations of the Original Work with other software or hardware.
+
+
+*****************************************
+11) Jurisdiction, Venue and Governing Law
+*****************************************
+
+Any action or suit relating to this License may be brought only in the courts
+of a jurisdiction wherein the Licensor resides or in which Licensor conducts
+its primary business, and under the laws of that jurisdiction excluding its
+conflict-of-law provisions. The application of the United Nations Convention
+on Contracts for the International Sale of Goods is expressly excluded. Any
+use of the Original Work outside the scope of this License or after its
+termination shall be subject to the requirements and penalties of copyright or
+patent law in the appropriate jurisdiction. This section shall survive the
+termination of this License.
+
+
+*******************
+12) Attorneys' Fees
+*******************
+
+In any action to enforce the terms of this License or seeking damages relating
+thereto, the prevailing party shall be entitled to recover its costs and
+expenses, including, without limitation, reasonable attorneys' fees and costs
+incurred in connection with such action, including any appeal of such action.
+This section shall survive the termination of this License.
+
+
+*****************
+13) Miscellaneous
+*****************
+
+If any provision of this License is held to be unenforceable, such provision
+shall be reformed only to the extent necessary to make it enforceable.
+
+
+***************************************
+14) Definition of "You" in This License
+***************************************
+
+"You" throughout this License, whether in upper or lower case, means an
+individual or a legal entity exercising rights under, and complying with all
+of the terms of, this License. For legal entities, "You" includes any entity
+that controls, is controlled by, or is under common control with you. For
+purposes of this definition, "control" means (i) the power, direct or
+indirect, to cause the direction or management of such entity, whether by
+contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
+outstanding shares, or (iii) beneficial ownership of such entity.
+
+
+****************
+15) Right to Use
+****************
+
+You may use the Original Work in all ways not otherwise restricted or
+conditioned by this License or by law, and Licensor promises not to interfere
+with or be responsible for such uses by You.
+
+
+********************************
+16) Modification of This License
+********************************
+
+This License is Copyright © 2005 Lawrence Rosen. Permission is granted to
+copy, distribute, or communicate this License without modification. Nothing in
+this License permits You to modify this License as applied to the Original
+Work or to Derivative Works. However, You may modify the text of this License
+and copy, distribute or communicate your modified version (the "Modified
+License") and apply it to other original works of authorship subject to the
+following conditions: (i) You may not indicate in any way that your Modified
+License is the "Open Software License" or "OSL" and you may not use those
+names in the name of your Modified License; (ii) You must replace the notice
+specified in the first paragraph above with the notice "Licensed under <insert
+your license name here>" or with a notice of your own that is not confusingly
+similar to the notice in this License; and (iii) You may not claim that your
+original works are open source software unless your Modified License has been
+approved by Open Source Initiative (OSI) and You comply with its license
+review and certification process. \ No newline at end of file
diff --git a/user_guide_src/source/overview/appflow.rst b/user_guide_src/source/overview/appflow.rst
new file mode 100644
index 000000000..bb15130d2
--- /dev/null
+++ b/user_guide_src/source/overview/appflow.rst
@@ -0,0 +1,23 @@
+######################
+Application Flow Chart
+######################
+
+The following graphic illustrates how data flows throughout the system:
+
+|CodeIgniter application flow|
+
+#. 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.
+#. 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.
+
+.. |CodeIgniter application flow| image:: ../images/appflowchart.gif
diff --git a/user_guide_src/source/overview/at_a_glance.rst b/user_guide_src/source/overview/at_a_glance.rst
new file mode 100644
index 000000000..31f0b4dd9
--- /dev/null
+++ b/user_guide_src/source/overview/at_a_glance.rst
@@ -0,0 +1,114 @@
+#######################
+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 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
+:doc:`license agreement <../license>`.
+
+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 your own libraries,
+helpers, 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 <http://codeigniter.com/forums/>`_.
diff --git a/user_guide_src/source/overview/cheatsheets.rst b/user_guide_src/source/overview/cheatsheets.rst
new file mode 100644
index 000000000..2e277aa9a
--- /dev/null
+++ b/user_guide_src/source/overview/cheatsheets.rst
@@ -0,0 +1,16 @@
+#######################
+CodeIgniter Cheatsheets
+#######################
+
+Library Reference
+=================
+
+`|CodeIgniter Library
+Reference| <../images/codeigniter_1.7.1_library_reference.pdf>`_
+Helpers Reference
+=================
+
+`|image1| <../images/codeigniter_1.7.1_helper_reference.pdf>`_
+
+.. |CodeIgniter Library Reference| image:: ../images/codeigniter_1.7.1_library_reference.png
+.. |image1| image:: ../images/codeigniter_1.7.1_helper_reference.png
diff --git a/user_guide_src/source/overview/features.rst b/user_guide_src/source/overview/features.rst
new file mode 100644
index 000000000..44db08a94
--- /dev/null
+++ b/user_guide_src/source/overview/features.rst
@@ -0,0 +1,46 @@
+####################
+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 <../installation/>`_ 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
+- 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
+- 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 and Class Extensions
+- Large library of "helper" functions
+
diff --git a/user_guide_src/source/overview/getting_started.rst b/user_guide_src/source/overview/getting_started.rst
new file mode 100644
index 000000000..5157d4860
--- /dev/null
+++ b/user_guide_src/source/overview/getting_started.rst
@@ -0,0 +1,24 @@
+################################
+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 :doc:`install <../installation/index>`
+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 <http://codeigniter.com/forums/>`_ if you have questions or
+problems, and our `Wiki <http://codeigniter.com/wiki/>`_ to see code
+examples posted by other users.
diff --git a/user_guide_src/source/overview/goals.rst b/user_guide_src/source/overview/goals.rst
new file mode 100644
index 000000000..ac581807f
--- /dev/null
+++ b/user_guide_src/source/overview/goals.rst
@@ -0,0 +1,32 @@
+##############################
+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.
diff --git a/user_guide_src/source/overview/index.rst b/user_guide_src/source/overview/index.rst
new file mode 100644
index 000000000..dc91f78c4
--- /dev/null
+++ b/user_guide_src/source/overview/index.rst
@@ -0,0 +1,16 @@
+####################
+CodeIgniter Overview
+####################
+
+The following pages describe the broad concepts behind CodeIgniter:
+
+.. toctree::
+ :titlesonly:
+
+ Getting Started <getting_started>
+ CodeIgniter at a Glance <at_a_glance>
+ CodeIgniter Cheatsheets <cheatsheets>
+ Supported Features <features>
+ Application Flow Chart <appflow>
+ Model-View-Controller <mvc>
+ Architectural Goals <goals> \ No newline at end of file
diff --git a/user_guide_src/source/overview/mvc.rst b/user_guide_src/source/overview/mvc.rst
new file mode 100644
index 000000000..996745d65
--- /dev/null
+++ b/user_guide_src/source/overview/mvc.rst
@@ -0,0 +1,27 @@
+#####################
+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.
diff --git a/user_guide_src/source/tutorial/conclusion.rst b/user_guide_src/source/tutorial/conclusion.rst
new file mode 100644
index 000000000..48fbdcc8a
--- /dev/null
+++ b/user_guide_src/source/tutorial/conclusion.rst
@@ -0,0 +1,26 @@
+##########
+Conclusion
+##########
+
+This tutorial did not cover all of the things you might expect of a
+full-fledged content management system, but it introduced you to the
+more important topics of routing, writing controllers, and models. We
+hope this tutorial gave you an insight into some of CodeIgniter's basic
+design patterns, which you can expand upon.
+
+Now that you've completed this tutorial, we recommend you check out the
+rest of the documentation. CodeIgniter is often praised because of its
+comprehensive documentation. Use this to your advantage and read the
+"Introduction" and "General Topics" sections thoroughly. You should read
+the class and helper references when needed.
+
+Every intermediate PHP programmer should be able to get the hang of
+CodeIgniter within a few days.
+
+If you still have questions about the framework or your own CodeIgniter
+code, you can:
+
+- Check out our `forums <http://codeigniter.com/forums>`_
+- Visit our `IRC chatroom <http://codeigniter.com/wiki/IRC>`_
+- Explore the `Wiki <http://codeigniter.com/wiki/>`_
+
diff --git a/user_guide_src/source/tutorial/create_news_items.rst b/user_guide_src/source/tutorial/create_news_items.rst
new file mode 100644
index 000000000..794b67eed
--- /dev/null
+++ b/user_guide_src/source/tutorial/create_news_items.rst
@@ -0,0 +1,153 @@
+#################
+Create news items
+#################
+
+You now know how you can read data from a database using CodeIgniter, but
+you haven't written any information to the database yet. In this section
+you'll expand your news controller and model created earlier to include
+this functionality.
+
+Create a form
+-------------
+
+To input data into the database you need to create a form where you can
+input the information to be stored. This means you'll be needing a form
+with two fields, one for the title and one for the text. You'll derive
+the slug from our title in the model. Create the new view at
+application/views/news/create.php.
+
+::
+
+ <h2>Create a news item</h2>
+
+ <?php echo validation_errors(); ?>
+
+ <?php echo form_open('news/create') ?>
+
+ <label for="title">Title</label>
+ <input type="input" name="title" /><br />
+
+ <label for="text">Text</label>
+ <textarea name="text"></textarea><br />
+
+ <input type="submit" name="submit" value="Create news item" />
+
+ </form>
+
+There are only two things here that probably look unfamiliar to you: the
+form_open() function and the validation_errors() function.
+
+The first function is provided by the `form
+helper <../helpers/form_helper.html>`_ and renders the form element and
+adds extra functionality, like adding a hidden `CSFR prevention
+field <../libraries/security.html>`_. The latter is used to report
+errors related to form validation.
+
+Go back to your news controller. You're going to do two things here,
+check whether the form was submitted and whether the submitted data
+passed the validation rules. You'll use the `form
+validation <../libraries/form_validation.html>`_ library to do this.
+
+::
+
+ public function create()
+ {
+ $this->load->helper('form');
+ $this->load->library('form_validation');
+
+ $data['title'] = 'Create a news item';
+
+ $this->form_validation->set_rules('title', 'Title', 'required');
+ $this->form_validation->set_rules('text', 'text', 'required');
+
+ if ($this->form_validation->run() === FALSE)
+ {
+ $this->load->view('templates/header', $data);
+ $this->load->view('news/create');
+ $this->load->view('templates/footer');
+
+ }
+ else
+ {
+ $this->news_model->set_news();
+ $this->load->view('news/success');
+ }
+ }
+
+The code above adds a lot of functionality. The first few lines load the
+form helper and the form validation library. After that, rules for the
+form validation are set. The set\_rules() method takes three arguments;
+the name of the input field, the name to be used in error messages, and
+the rule. In this case the title and text fields are required.
+
+CodeIgniter has a powerful form validation library as demonstrated
+above. You can read `more about this library
+here <../libraries/form_validation.html>`_.
+
+Continuing down, you can see a condition that checks whether the form
+validation ran successfully. If it did not, the form is displayed, if it
+was submitted **and** passed all the rules, the model is called. After
+this, a view is loaded to display a success message. Create a view at
+application/view/news/success.php and write a success message.
+
+Model
+-----
+
+The only thing that remains is writing a method that writes the data to
+the database. You'll use the Active Record class to insert the
+information and use the input library to get the posted data. Open up
+the model created earlier and add the following:
+
+::
+
+ public function set_news()
+ {
+ $this->load->helper('url');
+
+ $slug = url_title($this->input->post('title'), 'dash', TRUE);
+
+ $data = array(
+ 'title' => $this->input->post('title'),
+ 'slug' => $slug,
+ 'text' => $this->input->post('text')
+ );
+
+ return $this->db->insert('news', $data);
+ }
+
+This new method takes care of inserting the news item into the database.
+The third line contains a new function, url\_title(). This function -
+provided by the `URL helper <../helpers/url_helper.html>`_ - strips down
+the string you pass it, replacing all spaces by dashes (-) and makes
+sure everything is in lowercase characters. This leaves you with a nice
+slug, perfect for creating URIs.
+
+Let's continue with preparing the record that is going to be inserted
+later, inside the $data array. Each element corresponds with a column in
+the database table created earlier. You might notice a new method here,
+namely the post() method from the `input
+library <../libraries/input.html>`_. This method makes sure the data is
+sanitized, protecting you from nasty attacks from others. The input
+library is loaded by default. At last, you insert our $data array into
+our database.
+
+Routing
+-------
+
+Before you can start adding news items into your CodeIgniter application
+you have to add an extra rule to config/routes.php file. Make sure your
+file contains the following. This makes sure CodeIgniter sees 'create'
+as a method instead of a news item's slug.
+
+::
+
+ $route['news/create'] = 'news/create';
+ $route['news/(:any)'] = 'news/view/$1';
+ $route['news'] = 'news';
+ $route['(:any)'] = 'pages/view/$1';
+ $route['default_controller'] = 'pages/view';
+
+Now point your browser to your local development environment where you
+installed CodeIgniter and add index.php/news/create to the URL.
+Congratulations, you just created your first CodeIgniter application!
+Add some news and check out the different pages you made.
diff --git a/user_guide_src/source/tutorial/index.rst b/user_guide_src/source/tutorial/index.rst
new file mode 100644
index 000000000..c959d04d2
--- /dev/null
+++ b/user_guide_src/source/tutorial/index.rst
@@ -0,0 +1,46 @@
+########
+Tutorial
+########
+
+This tutorial is intended to introduce you to the CodeIgniter framework
+and the basic principles of MVC architecture. It will show you how a
+basic CodeIgniter application is constructed in step-by-step fashion.
+
+In this tutorial, you will be creating a **basic news application**. You
+will begin by writing the code that can load static pages. Next, you
+will create a news section that reads news items from a database.
+Finally, you'll add a form to create news items in the database.
+
+This tutorial will primarily focus on:
+
+- Model-View-Controller basics
+- Routing basics
+- Form validation
+- Performing basic database queries using "Active Record"
+
+The entire tutorial is split up over several pages, each explaining a
+small part of the functionality of the CodeIgniter framework. You'll go
+through the following pages:
+
+- Introduction, this page, which gives you an overview of what to
+ expect.
+- `Static pages <static_pages.html>`_, which will teach you the basics
+ of controllers, views and routing.
+- `News section <news_section.html>`_, where you'll start using models
+ and will be doing some basic database operations.
+- `Create news items <create_news_items.html>`_, which will introduce
+ more advanced database operations and form validation.
+- `Conclusion <conclusion.html>`_, which will give you some pointers on
+ further reading and other resources.
+
+Enjoy your exploration of the CodeIgniter framework.
+
+.. toctree::
+ :glob:
+ :hidden:
+ :titlesonly:
+
+ static_pages
+ news_section
+ create_news_items
+ conclusion \ No newline at end of file
diff --git a/user_guide_src/source/tutorial/news_section.rst b/user_guide_src/source/tutorial/news_section.rst
new file mode 100644
index 000000000..38e4214ca
--- /dev/null
+++ b/user_guide_src/source/tutorial/news_section.rst
@@ -0,0 +1,214 @@
+############
+News section
+############
+
+In the last section, we went over some basic concepts of the framework
+by writing a class that includes static pages. We cleaned up the URI by
+adding custom routing rules. Now it's time to introduce dynamic content
+and start using a database.
+
+Setting up your model
+---------------------
+
+Instead of writing database operations right in the controller, queries
+should be placed in a model, so they can easily be reused later. Models
+are the place where you retrieve, insert, and update information in your
+database or other data stores. They represent your data.
+
+Open up the application/models directory and create a new file called
+news_model.php and add the following code. Make sure you've configured
+your database properly as described
+`here <../database/configuration.html>`_.
+
+::
+
+ <?php
+ class News_model extends CI_Model {
+
+ public function __construct()
+ {
+ $this->load->database();
+ }
+ }
+
+This code looks similar to the controller code that was used earlier. It
+creates a new model by extending CI\_Model and loads the database
+library. This will make the database class available through the
+$this->db object.
+
+Before querying the database, a database schema has to be created.
+Connect to your database and run the SQL command below. Also add some
+seed records.
+
+::
+
+ CREATE TABLE news (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ title varchar(128) NOT NULL,
+ slug varchar(128) NOT NULL,
+ text text NOT NULL,
+ PRIMARY KEY (id),
+ KEY slug (slug)
+ );
+
+Now that the database and a model have been set up, you'll need a method
+to get all of our posts from our database. To do this, the database
+abstraction layer that is included with CodeIgniter — `Active
+Record <../database/active_record.html>`_ — is used. This makes it
+possible to write your 'queries' once and make them work on `all
+supported database systems <../general/requirements.html>`_. Add the
+following code to your model.
+
+::
+
+ public function get_news($slug = FALSE)
+ {
+ if ($slug === FALSE)
+ {
+ $query = $this->db->get('news');
+ return $query->result_array();
+ }
+
+ $query = $this->db->get_where('news', array('slug' => $slug));
+ return $query->row_array();
+ }
+
+With this code you can perform two different queries. You can get all
+news records, or get a news item by its `slug <#>`_. You might have
+noticed that the $slug variable wasn't sanitized before running the
+query; Active Record does this for you.
+
+Display the news
+----------------
+
+Now that the queries are written, the model should be tied to the views
+that are going to display the news items to the user. This could be done
+in our pages controller created earlier, but for the sake of clarity, a
+new "news" controller is defined. Create the new controller at
+application/controllers/news.php.
+
+::
+
+ <?php
+ class News extends CI_Controller {
+
+ public function __construct()
+ {
+ parent::__construct();
+ $this->load->model('news_model');
+ }
+
+ public function index()
+ {
+ $data['news'] = $this->news_model->get_news();
+ }
+
+ public function view($slug)
+ {
+ $data['news'] = $this->news_model->get_news($slug);
+ }
+ }
+
+Looking at the code, you may see some similarity with the files we
+created earlier. First, the "\_\_construct" method: it calls the
+constructor of its parent class (CI\_Controller) and loads the model, so
+it can be used in all other methods in this controller.
+
+Next, there are two methods to view all news items and one for a
+specific news item. You can see that the $slug variable is passed to the
+model's method in the second method. The model is using this slug to
+identify the news item to be returned.
+
+Now the data is retrieved by the controller through our model, but
+nothing is displayed yet. The next thing to do is passing this data to
+the views.
+
+::
+
+ public function index()
+ {
+ $data['news'] = $this->news_model->get_news();
+ $data['title'] = 'News archive';
+
+ $this->load->view('templates/header', $data);
+ $this->load->view('news/index', $data);
+ $this->load->view('templates/footer');
+ }
+
+The code above gets all news records from the model and assigns it to a
+variable. The value for the title is also assigned to the $data['title']
+element and all data is passed to the views. You now need to create a
+view to render the news items. Create application/views/news/index.php
+and add the next piece of code.
+
+::
+
+ <?php foreach ($news as $news_item): ?>
+
+ <h2><?php echo $news_item['title'] ?></h2>
+ <div id="main">
+ <?php echo $news_item['text'] ?>
+ </div>
+ <p><a href="<?php echo $news_item['slug'] ?>">View article</a></p>
+
+ <?php endforeach ?>
+
+Here, each news item is looped and displayed to the user. You can see we
+wrote our template in PHP mixed with HTML. If you prefer to use a
+template language, you can use CodeIgniter's `Template
+Parser <../libraries/parser.html>`_ class or a third party parser.
+
+The news overview page is now done, but a page to display individual
+news items is still absent. The model created earlier is made in such
+way that it can easily be used for this functionality. You only need to
+add some code to the controller and create a new view. Go back to the
+news controller and add the following lines to the file.
+
+::
+
+ public function view($slug)
+ {
+ $data['news_item'] = $this->news_model->get_news($slug);
+
+ if (empty($data['news_item']))
+ {
+ show_404();
+ }
+
+ $data['title'] = $data['news_item']['title'];
+
+ $this->load->view('templates/header', $data);
+ $this->load->view('news/view', $data);
+ $this->load->view('templates/footer');
+ }
+
+Instead of calling the get\_news() method without a parameter, the $slug
+variable is passed, so it will return the specific news item. The only
+things left to do is create the corresponding view at
+application/views/news/view.php. Put the following code in this file.
+
+::
+
+ <?php
+ echo '<h2>'.$news_item['title'].'</h2>';
+ echo $news_item['text'];
+
+Routing
+-------
+
+Because of the wildcard routing rule created earlier, you need need an
+extra route to view the controller that you just made. Modify your
+routing file (application/config/routes.php) so it looks as follows.
+This makes sure the requests reaches the news controller instead of
+going directly to the pages controller. The first line routes URI's with
+a slug to the view method in the news controller.
+
+::
+
+ $route['news/(:any)'] = 'news/view/$1';
+ $route['news'] = 'news';
+ $route['(:any)'] = 'pages/view/$1';
+ $route['default_controller'] = 'pages/view';
+
+Point your browser to your document root, followed by index.php/news and
+watch your news page.
diff --git a/user_guide_src/source/tutorial/static_pages.rst b/user_guide_src/source/tutorial/static_pages.rst
new file mode 100644
index 000000000..708eaeb7b
--- /dev/null
+++ b/user_guide_src/source/tutorial/static_pages.rst
@@ -0,0 +1,170 @@
+############
+Static pages
+############
+
+**Note:** This tutorial assumes you've downloaded CodeIgniter and
+`installed the framework <../installation/index.html>`_ in your
+development environment.
+
+The first thing you're going to do is set up a **controller** to handle
+static pages. A controller is simply a class that helps delegate work.
+It is the glue of your web application.
+
+For example, when a call is made to:
+``http://example.com/news/latest/10`` We might imagine that there is a
+controller named "news". The method being called on news would be
+"latest". The news method's job could be to grab 10 news items, and
+render them on the page. Very often in MVC, you'll see URL patterns that
+match:
+``http://example.com/[controller-class]/[controller-method]/[arguments]``
+As URL schemes become more complex, this may change. But for now, this
+is all we will need to know.
+
+Create a file at application/controllers/pages.php with the following
+code.
+
+::
+
+ <?php
+ class Pages extends CI_Controller {
+
+ public function view($page = 'home')
+ {
+
+ }
+
+ }
+
+You have created a class named "pages", with a view method that accepts
+one argument named $page. The pages class is extending the
+CI_Controller class. This means that the new pages class can access the
+methods and variables defined in the CI_Controller class
+(system/core/Controller.php).
+
+The **controller is what will become the center of every request** to
+your web application. In very technical CodeIgniter discussions, it may
+be referred to as the *super object*. Like any php class, you refer to
+it within your controllers as $this. Referring to $this is how you will
+load libraries, views, and generally command the framework.
+
+Now you've created your first method, it's time to make some basic page
+templates. We will be creating two "views" (page templates) that act as
+our page footer and header.
+
+Create the header at application/views/templates/header.php and add the
+following code.
+
+::
+
+ <html>
+ <head>
+ <title>CodeIgniter 2 Tutorial</title>
+ </head>
+ <body>
+
+ <h1>CodeIgniter 2 Tutorial</h1>
+
+The header contains the basic HTML code that you'll want to display
+before loading the main view, together with a heading. It will also
+output the $title variable, which we'll define later in the controller.
+Now create a footer at application/views/templates/footer.php that
+includes the following code:
+
+::
+
+ <em>&copy; 2012</em>
+ </body>
+ <html>
+
+Adding logic to the controller
+------------------------------
+
+Earlier you set up a controller with a view() method. The method accepts
+one parameter, which is the name of the page to be loaded. The static
+page templates will be located in the application/views/pages/
+directory.
+
+In that directory, create two files named home.php and about.php. Within
+those files, type some text − anything you'd like − and save them. If
+you like to be particularly un-original, try "Hello World!".
+
+In order to load those pages, you'll have to check whether the requested
+page actually exists:
+
+::
+
+ <?php
+ public function view($page = 'home')
+ {
+
+ if ( ! file_exists(APPPATH.'/views/pages/'.$page.'.php'))
+ {
+ // Whoops, we don't have a page for that!
+ show_404();
+ }
+
+ $data['title'] = ucfirst($page); // Capitalize the first letter
+
+ $this->load->view('templates/header', $data);
+ $this->load->view('pages/'.$page, $data);
+ $this->load->view('templates/footer', $data);
+
+ }
+
+Now, when the page does exist, it is loaded, including the header and
+footer, and displayed to the user. If the page doesn't exist, a "404
+Page not found" error is shown.
+
+The first line in this method checks whether the page actually exists.
+PHP's native file\_exists() function is used to check whether the file
+is where it's expected to be. show\_404() is a built-in CodeIgniter
+function that renders the default error page.
+
+In the header template, the $title variable was used to customize the
+page title. The value of title is defined in this method, but instead of
+assigning the value to a variable, it is assigned to the title element
+in the $data array.
+
+The last thing that has to be done is loading the views in the order
+they should be displayed. The second parameter in the view() method is
+used to pass values to the view. Each value in the $data array is
+assigned to a variable with the name of its key. So the value of
+$data['title'] in the controller is equivalent to $title in the view.
+
+Routing
+-------
+
+The controller is now functioning! Point your browser to
+[your-site-url]index.php/pages/view to see your page. When you visit
+index.php/pages/view/about you'll see the about page, again including
+the header and footer.
+
+Using custom routing rules, you have the power to map any URI to any
+controller and method, and break free from the normal convention:
+``http://example.com/[controller-class]/[controller-method]/[arguments]``
+
+Let's do that. Open the routing file located at
+application/config/routes.php and add the following two lines. Remove
+all other code that sets any element in the $route array.
+
+::
+
+ $route['default_controller'] = 'pages/view';
+ $route['(:any)'] = 'pages/view/$1';
+
+CodeIgniter reads its routing rules from top to bottom and routes the
+request to the first matching rule. Each rule is a regular expression
+(left-side) mapped to a controller and method name separated by slashes
+(right-side). When a request comes in, CodeIgniter looks for the first
+match, and calls the appropriate controller and method, possibly with
+arguments.
+
+More information about routing can be found in the URI Routing
+`documentation <../general/routing.html>`_.
+
+Here, the second rule in the $routes array matches **any** request using
+the wildcard string (:any). and passes the parameter to the view()
+method of the pages class.
+
+Now visit index.php/about. Did it get routed correctly to the view()
+method in the pages controller? Awesome!