codeigniter_vender 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/MIT-LICENSE +20 -0
- data/README +40 -0
- data/Rakefile +18 -0
- data/VERSION +1 -0
- data/codeigniter_vender.gemspec +389 -0
- data/generators/ci_app/USAGE +8 -0
- data/generators/ci_app/ci_app_generator.rb +12 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/index.php +118 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/license.txt +52 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/autoload.php +116 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/config.php +329 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/constants.php +41 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/database.php +55 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/doctypes.php +15 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/hooks.php +16 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/mimes.php +105 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/routes.php +48 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/smileys.php +66 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/user_agents.php +175 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/controllers/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/controllers/welcome.php +17 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/error_404.php +34 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/error_db.php +34 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/error_general.php +34 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/error_php.php +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/helpers/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/hooks/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/language/english/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/libraries/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/models/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/views/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/views/welcome_message.php +62 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/cache/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/Base4.php +69 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/Base5.php +56 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/CodeIgniter.php +280 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/Common.php +421 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/Compat.php +93 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB.php +146 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_active_rec.php +1820 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_cache.php +195 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_driver.php +1366 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_forge.php +375 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_result.php +342 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_utility.php +389 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/mssql_driver.php +667 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/mssql_forge.php +248 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/mssql_result.php +169 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/mssql_utility.php +123 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/mysql_driver.php +670 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/mysql_forge.php +254 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/mysql_result.php +169 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/mysql_utility.php +245 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/mysqli_driver.php +671 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/mysqli_forge.php +254 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/mysqli_result.php +169 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/mysqli_utility.php +123 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/oci8_driver.php +780 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/oci8_forge.php +248 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/oci8_result.php +249 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/oci8_utility.php +122 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/odbc_driver.php +639 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/odbc_forge.php +266 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/odbc_result.php +228 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/odbc_utility.php +148 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/postgre_driver.php +684 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/postgre_forge.php +248 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/postgre_result.php +169 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/postgre_utility.php +124 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/sqlite_driver.php +657 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/sqlite_forge.php +265 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/sqlite_result.php +179 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/sqlite_utility.php +141 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/fonts/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/fonts/texb.ttf +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/array_helper.php +78 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/compatibility_helper.php +498 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/cookie_helper.php +144 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/date_helper.php +611 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/directory_helper.php +84 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/download_helper.php +100 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/email_helper.php +62 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/file_helper.php +464 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/form_helper.php +1025 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/html_helper.php +416 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/inflector_helper.php +171 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/language_helper.php +58 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/number_helper.php +75 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/path_helper.php +72 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/security_helper.php +126 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/smiley_helper.php +273 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/string_helper.php +273 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/text_helper.php +462 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/typography_helper.php +71 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/url_helper.php +593 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/xml_helper.php +62 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/calendar_lang.php +51 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/date_lang.php +60 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/db_lang.php +28 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/email_lang.php +24 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/form_validation_lang.php +24 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/ftp_lang.php +17 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/imglib_lang.php +24 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/number_lang.php +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/profiler_lang.php +19 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/scaffolding_lang.php +17 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/unit_test_lang.php +24 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/upload_lang.php +22 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/validation_lang.php +24 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Benchmark.php +113 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Calendar.php +477 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Cart.php +550 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Config.php +244 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Controller.php +127 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Email.php +2041 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Encrypt.php +484 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Exceptions.php +174 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Form_validation.php +1278 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Ftp.php +618 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Hooks.php +226 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Image_lib.php +1544 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Input.php +1067 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Language.php +123 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Loader.php +1085 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Log.php +117 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Model.php +83 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Output.php +409 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Pagination.php +244 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Parser.php +173 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Profiler.php +392 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Router.php +389 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Session.php +758 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Sha1.php +251 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Table.php +440 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Trackback.php +547 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Typography.php +406 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/URI.php +586 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Unit_test.php +347 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Upload.php +970 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/User_agent.php +502 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Validation.php +875 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Xmlrpc.php +1421 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Xmlrpcs.php +536 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Zip.php +359 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/logs/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/plugins/captcha_pi.php +356 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/plugins/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/plugins/js_calendar_pi.php +629 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/Scaffolding.php +291 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/images/background.jpg +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/images/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/images/logo.jpg +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/add.php +32 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/delete.php +9 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/edit.php +33 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/footer.php +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/header.php +29 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/index.html +10 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/no_data.php +8 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/stylesheet.css +143 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/view.php +27 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/changelog.html +1080 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/active_record.html +757 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/caching.html +220 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/call_function.html +118 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/configuration.html +157 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/connecting.html +186 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/examples.html +217 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/fields.html +163 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/forge.html +234 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/helpers.html +151 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/index.html +99 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/queries.html +153 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/results.html +238 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/table_data.html +113 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/transactions.html +200 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/utilities.html +295 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/doc_style/index.html +86 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/doc_style/template.html +128 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/alternative_php.html +147 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/ancillary_classes.html +117 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/autoloader.html +101 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/caching.html +115 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/common_functions.html +119 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/controllers.html +385 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/core_classes.html +185 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/creating_libraries.html +298 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/credits.html +86 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/errors.html +138 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/helpers.html +185 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/hooks.html +167 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/libraries.html +94 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/managing_apps.html +133 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/models.html +251 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/plugins.html +127 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/profiling.html +104 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/quick_reference.html +77 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/requirements.html +82 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/reserved_names.html +156 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/routing.html +176 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/scaffolding.html +147 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/security.html +153 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/styleguide.html +687 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/urls.html +151 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/views.html +274 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/array_helper.html +119 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/compatibility_helper.html +118 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/cookie_helper.html +147 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/date_helper.html +408 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/directory_helper.html +143 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/download_helper.html +112 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/email_helper.html +102 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/file_helper.html +178 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/form_helper.html +484 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/html_helper.html +385 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/inflector_helper.html +151 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/language_helper.html +98 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/number_helper.html +107 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/path_helper.html +106 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/security_helper.html +125 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/smiley_helper.html +215 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/string_helper.html +176 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/text_helper.html +192 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/typography_helper.html +112 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/url_helper.html +289 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/xml_helper.html +105 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/appflowchart.gif +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/arrow.gif +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/ci_logo.jpg +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/ci_logo_flame.jpg +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/ci_quick_ref.png +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/codeigniter_1.7.1_helper_reference.pdf +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/codeigniter_1.7.1_helper_reference.png +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/codeigniter_1.7.1_library_reference.pdf +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/codeigniter_1.7.1_library_reference.png +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/file.gif +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/folder.gif +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/nav_bg_darker.jpg +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/nav_separator_darker.jpg +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/nav_toggle_darker.jpg +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/smile.gif +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/transparent.gif +0 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/index.html +99 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/downloads.html +105 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/index.html +97 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/troubleshooting.html +90 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_120.html +92 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_130.html +203 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_131.html +102 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_132.html +100 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_133.html +112 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_140.html +145 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_141.html +148 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_150.html +178 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_152.html +111 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_153.html +100 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_154.html +116 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_160.html +125 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_161.html +98 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_162.html +106 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_163.html +99 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_170.html +121 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_171.html +98 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_172.html +105 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_b11.html +144 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrading.html +101 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/benchmark.html +198 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/calendar.html +249 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/cart.html +346 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/config.html +181 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/email.html +307 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/encryption.html +182 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/file_uploading.html +451 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/form_validation.html +1221 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/ftp.html +303 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/image_lib.html +666 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/input.html +231 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/language.html +137 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/loader.html +214 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/output.html +145 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/pagination.html +218 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/parser.html +208 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/sessions.html +311 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/table.html +292 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/trackback.html +246 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/typography.html +160 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/unit_testing.html +205 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/uri.html +252 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/user_agent.html +201 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/validation.html +740 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/xmlrpc.html +517 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/zip.html +278 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/license.html +107 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/hacks.txt +9 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/moo.fx.js +119 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/moo.fx.pack.js +241 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/nav.js +139 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/prototype.lite.js +127 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/user_guide_menu.js +4 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/appflow.html +95 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/at_a_glance.html +172 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/cheatsheets.html +83 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/features.html +120 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/getting_started.html +92 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/goals.html +98 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/index.html +84 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/mvc.html +100 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/toc.html +209 -0
- data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/userguide.css +406 -0
- data/generators/ci_app/templates/README +1 -0
- data/generators/ci_controller/USAGE +2 -0
- data/generators/ci_controller/ci_controller_generator.rb +11 -0
- data/generators/ci_controller/templates/ci_controller.php.erb +15 -0
- data/generators/ci_controller/templates/ci_view.php.erb +8 -0
- data/generators/ci_layout/USAGE +2 -0
- data/generators/ci_layout/ci_layout_generator.rb +24 -0
- data/generators/ci_layout/templates/application_layout.php.erb +19 -0
- data/generators/ci_model/USAGE +2 -0
- data/generators/ci_model/ci_model_generator.rb +42 -0
- data/generators/ci_model/templates/ci_model.php.erb +15 -0
- data/generators/ci_model/templates/model.rb +5 -0
- data/generators/ci_model/templates/model_migration.rb.erb +16 -0
- data/init.rb +1 -0
- data/install.rb +1 -0
- data/lib/codeigniter_vender.rb +1 -0
- data/lib/tasks/app.rake +8 -0
- data/test/codeigniter_vender_test.rb +8 -0
- data/test/test_helper.rb +3 -0
- data/uninstall.rb +1 -0
- metadata +411 -0
@@ -0,0 +1,117 @@
|
|
1
|
+
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
2
|
+
/**
|
3
|
+
* CodeIgniter
|
4
|
+
*
|
5
|
+
* An open source application development framework for PHP 4.3.2 or newer
|
6
|
+
*
|
7
|
+
* @package CodeIgniter
|
8
|
+
* @author ExpressionEngine Dev Team
|
9
|
+
* @copyright Copyright (c) 2008 - 2010, EllisLab, Inc.
|
10
|
+
* @license http://codeigniter.com/user_guide/license.html
|
11
|
+
* @link http://codeigniter.com
|
12
|
+
* @since Version 1.0
|
13
|
+
* @filesource
|
14
|
+
*/
|
15
|
+
|
16
|
+
// ------------------------------------------------------------------------
|
17
|
+
|
18
|
+
/**
|
19
|
+
* Logging Class
|
20
|
+
*
|
21
|
+
* @package CodeIgniter
|
22
|
+
* @subpackage Libraries
|
23
|
+
* @category Logging
|
24
|
+
* @author ExpressionEngine Dev Team
|
25
|
+
* @link http://codeigniter.com/user_guide/general/errors.html
|
26
|
+
*/
|
27
|
+
class CI_Log {
|
28
|
+
|
29
|
+
var $log_path;
|
30
|
+
var $_threshold = 1;
|
31
|
+
var $_date_fmt = 'Y-m-d H:i:s';
|
32
|
+
var $_enabled = TRUE;
|
33
|
+
var $_levels = array('ERROR' => '1', 'DEBUG' => '2', 'INFO' => '3', 'ALL' => '4');
|
34
|
+
|
35
|
+
/**
|
36
|
+
* Constructor
|
37
|
+
*
|
38
|
+
* @access public
|
39
|
+
*/
|
40
|
+
function CI_Log()
|
41
|
+
{
|
42
|
+
$config =& get_config();
|
43
|
+
|
44
|
+
$this->log_path = ($config['log_path'] != '') ? $config['log_path'] : BASEPATH.'logs/';
|
45
|
+
|
46
|
+
if ( ! is_dir($this->log_path) OR ! is_really_writable($this->log_path))
|
47
|
+
{
|
48
|
+
$this->_enabled = FALSE;
|
49
|
+
}
|
50
|
+
|
51
|
+
if (is_numeric($config['log_threshold']))
|
52
|
+
{
|
53
|
+
$this->_threshold = $config['log_threshold'];
|
54
|
+
}
|
55
|
+
|
56
|
+
if ($config['log_date_format'] != '')
|
57
|
+
{
|
58
|
+
$this->_date_fmt = $config['log_date_format'];
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
// --------------------------------------------------------------------
|
63
|
+
|
64
|
+
/**
|
65
|
+
* Write Log File
|
66
|
+
*
|
67
|
+
* Generally this function will be called using the global log_message() function
|
68
|
+
*
|
69
|
+
* @access public
|
70
|
+
* @param string the error level
|
71
|
+
* @param string the error message
|
72
|
+
* @param bool whether the error is a native PHP error
|
73
|
+
* @return bool
|
74
|
+
*/
|
75
|
+
function write_log($level = 'error', $msg, $php_error = FALSE)
|
76
|
+
{
|
77
|
+
if ($this->_enabled === FALSE)
|
78
|
+
{
|
79
|
+
return FALSE;
|
80
|
+
}
|
81
|
+
|
82
|
+
$level = strtoupper($level);
|
83
|
+
|
84
|
+
if ( ! isset($this->_levels[$level]) OR ($this->_levels[$level] > $this->_threshold))
|
85
|
+
{
|
86
|
+
return FALSE;
|
87
|
+
}
|
88
|
+
|
89
|
+
$filepath = $this->log_path.'log-'.date('Y-m-d').EXT;
|
90
|
+
$message = '';
|
91
|
+
|
92
|
+
if ( ! file_exists($filepath))
|
93
|
+
{
|
94
|
+
$message .= "<"."?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?".">\n\n";
|
95
|
+
}
|
96
|
+
|
97
|
+
if ( ! $fp = @fopen($filepath, FOPEN_WRITE_CREATE))
|
98
|
+
{
|
99
|
+
return FALSE;
|
100
|
+
}
|
101
|
+
|
102
|
+
$message .= $level.' '.(($level == 'INFO') ? ' -' : '-').' '.date($this->_date_fmt). ' --> '.$msg."\n";
|
103
|
+
|
104
|
+
flock($fp, LOCK_EX);
|
105
|
+
fwrite($fp, $message);
|
106
|
+
flock($fp, LOCK_UN);
|
107
|
+
fclose($fp);
|
108
|
+
|
109
|
+
@chmod($filepath, FILE_WRITE_MODE);
|
110
|
+
return TRUE;
|
111
|
+
}
|
112
|
+
|
113
|
+
}
|
114
|
+
// END Log Class
|
115
|
+
|
116
|
+
/* End of file Log.php */
|
117
|
+
/* Location: ./system/libraries/Log.php */
|
@@ -0,0 +1,83 @@
|
|
1
|
+
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
2
|
+
/**
|
3
|
+
* CodeIgniter
|
4
|
+
*
|
5
|
+
* An open source application development framework for PHP 4.3.2 or newer
|
6
|
+
*
|
7
|
+
* @package CodeIgniter
|
8
|
+
* @author ExpressionEngine Dev Team
|
9
|
+
* @copyright Copyright (c) 2008 - 2010, EllisLab, Inc.
|
10
|
+
* @license http://codeigniter.com/user_guide/license.html
|
11
|
+
* @link http://codeigniter.com
|
12
|
+
* @since Version 1.0
|
13
|
+
* @filesource
|
14
|
+
*/
|
15
|
+
|
16
|
+
// ------------------------------------------------------------------------
|
17
|
+
|
18
|
+
/**
|
19
|
+
* CodeIgniter Model Class
|
20
|
+
*
|
21
|
+
* @package CodeIgniter
|
22
|
+
* @subpackage Libraries
|
23
|
+
* @category Libraries
|
24
|
+
* @author ExpressionEngine Dev Team
|
25
|
+
* @link http://codeigniter.com/user_guide/libraries/config.html
|
26
|
+
*/
|
27
|
+
class Model {
|
28
|
+
|
29
|
+
var $_parent_name = '';
|
30
|
+
|
31
|
+
/**
|
32
|
+
* Constructor
|
33
|
+
*
|
34
|
+
* @access public
|
35
|
+
*/
|
36
|
+
function Model()
|
37
|
+
{
|
38
|
+
// If the magic __get() or __set() methods are used in a Model references can't be used.
|
39
|
+
$this->_assign_libraries( (method_exists($this, '__get') OR method_exists($this, '__set')) ? FALSE : TRUE );
|
40
|
+
|
41
|
+
// We don't want to assign the model object to itself when using the
|
42
|
+
// assign_libraries function below so we'll grab the name of the model parent
|
43
|
+
$this->_parent_name = ucfirst(get_class($this));
|
44
|
+
|
45
|
+
log_message('debug', "Model Class Initialized");
|
46
|
+
}
|
47
|
+
|
48
|
+
/**
|
49
|
+
* Assign Libraries
|
50
|
+
*
|
51
|
+
* Creates local references to all currently instantiated objects
|
52
|
+
* so that any syntax that can be legally used in a controller
|
53
|
+
* can be used within models.
|
54
|
+
*
|
55
|
+
* @access private
|
56
|
+
*/
|
57
|
+
function _assign_libraries($use_reference = TRUE)
|
58
|
+
{
|
59
|
+
$CI =& get_instance();
|
60
|
+
foreach (array_keys(get_object_vars($CI)) as $key)
|
61
|
+
{
|
62
|
+
if ( ! isset($this->$key) AND $key != $this->_parent_name)
|
63
|
+
{
|
64
|
+
// In some cases using references can cause
|
65
|
+
// problems so we'll conditionally use them
|
66
|
+
if ($use_reference == TRUE)
|
67
|
+
{
|
68
|
+
$this->$key = NULL; // Needed to prevent reference errors with some configurations
|
69
|
+
$this->$key =& $CI->$key;
|
70
|
+
}
|
71
|
+
else
|
72
|
+
{
|
73
|
+
$this->$key = $CI->$key;
|
74
|
+
}
|
75
|
+
}
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
}
|
80
|
+
// END Model Class
|
81
|
+
|
82
|
+
/* End of file Model.php */
|
83
|
+
/* Location: ./system/libraries/Model.php */
|
@@ -0,0 +1,409 @@
|
|
1
|
+
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
2
|
+
/**
|
3
|
+
* CodeIgniter
|
4
|
+
*
|
5
|
+
* An open source application development framework for PHP 4.3.2 or newer
|
6
|
+
*
|
7
|
+
* @package CodeIgniter
|
8
|
+
* @author ExpressionEngine Dev Team
|
9
|
+
* @copyright Copyright (c) 2008 - 2010, EllisLab, Inc.
|
10
|
+
* @license http://codeigniter.com/user_guide/license.html
|
11
|
+
* @link http://codeigniter.com
|
12
|
+
* @since Version 1.0
|
13
|
+
* @filesource
|
14
|
+
*/
|
15
|
+
|
16
|
+
// ------------------------------------------------------------------------
|
17
|
+
|
18
|
+
/**
|
19
|
+
* Output Class
|
20
|
+
*
|
21
|
+
* Responsible for sending final output to browser
|
22
|
+
*
|
23
|
+
* @package CodeIgniter
|
24
|
+
* @subpackage Libraries
|
25
|
+
* @category Output
|
26
|
+
* @author ExpressionEngine Dev Team
|
27
|
+
* @link http://codeigniter.com/user_guide/libraries/output.html
|
28
|
+
*/
|
29
|
+
class CI_Output {
|
30
|
+
|
31
|
+
var $final_output;
|
32
|
+
var $cache_expiration = 0;
|
33
|
+
var $headers = array();
|
34
|
+
var $enable_profiler = FALSE;
|
35
|
+
|
36
|
+
|
37
|
+
function CI_Output()
|
38
|
+
{
|
39
|
+
log_message('debug', "Output Class Initialized");
|
40
|
+
}
|
41
|
+
|
42
|
+
// --------------------------------------------------------------------
|
43
|
+
|
44
|
+
/**
|
45
|
+
* Get Output
|
46
|
+
*
|
47
|
+
* Returns the current output string
|
48
|
+
*
|
49
|
+
* @access public
|
50
|
+
* @return string
|
51
|
+
*/
|
52
|
+
function get_output()
|
53
|
+
{
|
54
|
+
return $this->final_output;
|
55
|
+
}
|
56
|
+
|
57
|
+
// --------------------------------------------------------------------
|
58
|
+
|
59
|
+
/**
|
60
|
+
* Set Output
|
61
|
+
*
|
62
|
+
* Sets the output string
|
63
|
+
*
|
64
|
+
* @access public
|
65
|
+
* @param string
|
66
|
+
* @return void
|
67
|
+
*/
|
68
|
+
function set_output($output)
|
69
|
+
{
|
70
|
+
$this->final_output = $output;
|
71
|
+
}
|
72
|
+
|
73
|
+
// --------------------------------------------------------------------
|
74
|
+
|
75
|
+
/**
|
76
|
+
* Append Output
|
77
|
+
*
|
78
|
+
* Appends data onto the output string
|
79
|
+
*
|
80
|
+
* @access public
|
81
|
+
* @param string
|
82
|
+
* @return void
|
83
|
+
*/
|
84
|
+
function append_output($output)
|
85
|
+
{
|
86
|
+
if ($this->final_output == '')
|
87
|
+
{
|
88
|
+
$this->final_output = $output;
|
89
|
+
}
|
90
|
+
else
|
91
|
+
{
|
92
|
+
$this->final_output .= $output;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
// --------------------------------------------------------------------
|
97
|
+
|
98
|
+
/**
|
99
|
+
* Set Header
|
100
|
+
*
|
101
|
+
* Lets you set a server header which will be outputted with the final display.
|
102
|
+
*
|
103
|
+
* Note: If a file is cached, headers will not be sent. We need to figure out
|
104
|
+
* how to permit header data to be saved with the cache data...
|
105
|
+
*
|
106
|
+
* @access public
|
107
|
+
* @param string
|
108
|
+
* @return void
|
109
|
+
*/
|
110
|
+
function set_header($header, $replace = TRUE)
|
111
|
+
{
|
112
|
+
$this->headers[] = array($header, $replace);
|
113
|
+
}
|
114
|
+
|
115
|
+
// --------------------------------------------------------------------
|
116
|
+
|
117
|
+
/**
|
118
|
+
* Set HTTP Status Header
|
119
|
+
* moved to Common procedural functions in 1.7.2
|
120
|
+
*
|
121
|
+
* @access public
|
122
|
+
* @param int the status code
|
123
|
+
* @param string
|
124
|
+
* @return void
|
125
|
+
*/
|
126
|
+
function set_status_header($code = '200', $text = '')
|
127
|
+
{
|
128
|
+
set_status_header($code, $text);
|
129
|
+
}
|
130
|
+
|
131
|
+
// --------------------------------------------------------------------
|
132
|
+
|
133
|
+
/**
|
134
|
+
* Enable/disable Profiler
|
135
|
+
*
|
136
|
+
* @access public
|
137
|
+
* @param bool
|
138
|
+
* @return void
|
139
|
+
*/
|
140
|
+
function enable_profiler($val = TRUE)
|
141
|
+
{
|
142
|
+
$this->enable_profiler = (is_bool($val)) ? $val : TRUE;
|
143
|
+
}
|
144
|
+
|
145
|
+
// --------------------------------------------------------------------
|
146
|
+
|
147
|
+
/**
|
148
|
+
* Set Cache
|
149
|
+
*
|
150
|
+
* @access public
|
151
|
+
* @param integer
|
152
|
+
* @return void
|
153
|
+
*/
|
154
|
+
function cache($time)
|
155
|
+
{
|
156
|
+
$this->cache_expiration = ( ! is_numeric($time)) ? 0 : $time;
|
157
|
+
}
|
158
|
+
|
159
|
+
// --------------------------------------------------------------------
|
160
|
+
|
161
|
+
/**
|
162
|
+
* Display Output
|
163
|
+
*
|
164
|
+
* All "view" data is automatically put into this variable by the controller class:
|
165
|
+
*
|
166
|
+
* $this->final_output
|
167
|
+
*
|
168
|
+
* This function sends the finalized output data to the browser along
|
169
|
+
* with any server headers and profile data. It also stops the
|
170
|
+
* benchmark timer so the page rendering speed and memory usage can be shown.
|
171
|
+
*
|
172
|
+
* @access public
|
173
|
+
* @return mixed
|
174
|
+
*/
|
175
|
+
function _display($output = '')
|
176
|
+
{
|
177
|
+
// Note: We use globals because we can't use $CI =& get_instance()
|
178
|
+
// since this function is sometimes called by the caching mechanism,
|
179
|
+
// which happens before the CI super object is available.
|
180
|
+
global $BM, $CFG;
|
181
|
+
|
182
|
+
// --------------------------------------------------------------------
|
183
|
+
|
184
|
+
// Set the output data
|
185
|
+
if ($output == '')
|
186
|
+
{
|
187
|
+
$output =& $this->final_output;
|
188
|
+
}
|
189
|
+
|
190
|
+
// --------------------------------------------------------------------
|
191
|
+
|
192
|
+
// Do we need to write a cache file?
|
193
|
+
if ($this->cache_expiration > 0)
|
194
|
+
{
|
195
|
+
$this->_write_cache($output);
|
196
|
+
}
|
197
|
+
|
198
|
+
// --------------------------------------------------------------------
|
199
|
+
|
200
|
+
// Parse out the elapsed time and memory usage,
|
201
|
+
// then swap the pseudo-variables with the data
|
202
|
+
|
203
|
+
$elapsed = $BM->elapsed_time('total_execution_time_start', 'total_execution_time_end');
|
204
|
+
$output = str_replace('{elapsed_time}', $elapsed, $output);
|
205
|
+
|
206
|
+
$memory = ( ! function_exists('memory_get_usage')) ? '0' : round(memory_get_usage()/1024/1024, 2).'MB';
|
207
|
+
$output = str_replace('{memory_usage}', $memory, $output);
|
208
|
+
|
209
|
+
// --------------------------------------------------------------------
|
210
|
+
|
211
|
+
// Is compression requested?
|
212
|
+
if ($CFG->item('compress_output') === TRUE)
|
213
|
+
{
|
214
|
+
if (extension_loaded('zlib'))
|
215
|
+
{
|
216
|
+
if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) AND strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE)
|
217
|
+
{
|
218
|
+
ob_start('ob_gzhandler');
|
219
|
+
}
|
220
|
+
}
|
221
|
+
}
|
222
|
+
|
223
|
+
// --------------------------------------------------------------------
|
224
|
+
|
225
|
+
// Are there any server headers to send?
|
226
|
+
if (count($this->headers) > 0)
|
227
|
+
{
|
228
|
+
foreach ($this->headers as $header)
|
229
|
+
{
|
230
|
+
@header($header[0], $header[1]);
|
231
|
+
}
|
232
|
+
}
|
233
|
+
|
234
|
+
// --------------------------------------------------------------------
|
235
|
+
|
236
|
+
// Does the get_instance() function exist?
|
237
|
+
// If not we know we are dealing with a cache file so we'll
|
238
|
+
// simply echo out the data and exit.
|
239
|
+
if ( ! function_exists('get_instance'))
|
240
|
+
{
|
241
|
+
echo $output;
|
242
|
+
log_message('debug', "Final output sent to browser");
|
243
|
+
log_message('debug', "Total execution time: ".$elapsed);
|
244
|
+
return TRUE;
|
245
|
+
}
|
246
|
+
|
247
|
+
// --------------------------------------------------------------------
|
248
|
+
|
249
|
+
// Grab the super object. We'll need it in a moment...
|
250
|
+
$CI =& get_instance();
|
251
|
+
|
252
|
+
// Do we need to generate profile data?
|
253
|
+
// If so, load the Profile class and run it.
|
254
|
+
if ($this->enable_profiler == TRUE)
|
255
|
+
{
|
256
|
+
$CI->load->library('profiler');
|
257
|
+
|
258
|
+
// If the output data contains closing </body> and </html> tags
|
259
|
+
// we will remove them and add them back after we insert the profile data
|
260
|
+
if (preg_match("|</body>.*?</html>|is", $output))
|
261
|
+
{
|
262
|
+
$output = preg_replace("|</body>.*?</html>|is", '', $output);
|
263
|
+
$output .= $CI->profiler->run();
|
264
|
+
$output .= '</body></html>';
|
265
|
+
}
|
266
|
+
else
|
267
|
+
{
|
268
|
+
$output .= $CI->profiler->run();
|
269
|
+
}
|
270
|
+
}
|
271
|
+
|
272
|
+
// --------------------------------------------------------------------
|
273
|
+
|
274
|
+
// Does the controller contain a function named _output()?
|
275
|
+
// If so send the output there. Otherwise, echo it.
|
276
|
+
if (method_exists($CI, '_output'))
|
277
|
+
{
|
278
|
+
$CI->_output($output);
|
279
|
+
}
|
280
|
+
else
|
281
|
+
{
|
282
|
+
echo $output; // Send it to the browser!
|
283
|
+
}
|
284
|
+
|
285
|
+
log_message('debug', "Final output sent to browser");
|
286
|
+
log_message('debug', "Total execution time: ".$elapsed);
|
287
|
+
}
|
288
|
+
|
289
|
+
// --------------------------------------------------------------------
|
290
|
+
|
291
|
+
/**
|
292
|
+
* Write a Cache File
|
293
|
+
*
|
294
|
+
* @access public
|
295
|
+
* @return void
|
296
|
+
*/
|
297
|
+
function _write_cache($output)
|
298
|
+
{
|
299
|
+
$CI =& get_instance();
|
300
|
+
$path = $CI->config->item('cache_path');
|
301
|
+
|
302
|
+
$cache_path = ($path == '') ? BASEPATH.'cache/' : $path;
|
303
|
+
|
304
|
+
if ( ! is_dir($cache_path) OR ! is_really_writable($cache_path))
|
305
|
+
{
|
306
|
+
return;
|
307
|
+
}
|
308
|
+
|
309
|
+
$uri = $CI->config->item('base_url').
|
310
|
+
$CI->config->item('index_page').
|
311
|
+
$CI->uri->uri_string();
|
312
|
+
|
313
|
+
$cache_path .= md5($uri);
|
314
|
+
|
315
|
+
if ( ! $fp = @fopen($cache_path, FOPEN_WRITE_CREATE_DESTRUCTIVE))
|
316
|
+
{
|
317
|
+
log_message('error', "Unable to write cache file: ".$cache_path);
|
318
|
+
return;
|
319
|
+
}
|
320
|
+
|
321
|
+
$expire = time() + ($this->cache_expiration * 60);
|
322
|
+
|
323
|
+
if (flock($fp, LOCK_EX))
|
324
|
+
{
|
325
|
+
fwrite($fp, $expire.'TS--->'.$output);
|
326
|
+
flock($fp, LOCK_UN);
|
327
|
+
}
|
328
|
+
else
|
329
|
+
{
|
330
|
+
log_message('error', "Unable to secure a file lock for file at: ".$cache_path);
|
331
|
+
return;
|
332
|
+
}
|
333
|
+
fclose($fp);
|
334
|
+
@chmod($cache_path, DIR_WRITE_MODE);
|
335
|
+
|
336
|
+
log_message('debug', "Cache file written: ".$cache_path);
|
337
|
+
}
|
338
|
+
|
339
|
+
// --------------------------------------------------------------------
|
340
|
+
|
341
|
+
/**
|
342
|
+
* Update/serve a cached file
|
343
|
+
*
|
344
|
+
* @access public
|
345
|
+
* @return void
|
346
|
+
*/
|
347
|
+
function _display_cache(&$CFG, &$URI)
|
348
|
+
{
|
349
|
+
$cache_path = ($CFG->item('cache_path') == '') ? BASEPATH.'cache/' : $CFG->item('cache_path');
|
350
|
+
|
351
|
+
if ( ! is_dir($cache_path) OR ! is_really_writable($cache_path))
|
352
|
+
{
|
353
|
+
return FALSE;
|
354
|
+
}
|
355
|
+
|
356
|
+
// Build the file path. The file name is an MD5 hash of the full URI
|
357
|
+
$uri = $CFG->item('base_url').
|
358
|
+
$CFG->item('index_page').
|
359
|
+
$URI->uri_string;
|
360
|
+
|
361
|
+
$filepath = $cache_path.md5($uri);
|
362
|
+
|
363
|
+
if ( ! @file_exists($filepath))
|
364
|
+
{
|
365
|
+
return FALSE;
|
366
|
+
}
|
367
|
+
|
368
|
+
if ( ! $fp = @fopen($filepath, FOPEN_READ))
|
369
|
+
{
|
370
|
+
return FALSE;
|
371
|
+
}
|
372
|
+
|
373
|
+
flock($fp, LOCK_SH);
|
374
|
+
|
375
|
+
$cache = '';
|
376
|
+
if (filesize($filepath) > 0)
|
377
|
+
{
|
378
|
+
$cache = fread($fp, filesize($filepath));
|
379
|
+
}
|
380
|
+
|
381
|
+
flock($fp, LOCK_UN);
|
382
|
+
fclose($fp);
|
383
|
+
|
384
|
+
// Strip out the embedded timestamp
|
385
|
+
if ( ! preg_match("/(\d+TS--->)/", $cache, $match))
|
386
|
+
{
|
387
|
+
return FALSE;
|
388
|
+
}
|
389
|
+
|
390
|
+
// Has the file expired? If so we'll delete it.
|
391
|
+
if (time() >= trim(str_replace('TS--->', '', $match['1'])))
|
392
|
+
{
|
393
|
+
@unlink($filepath);
|
394
|
+
log_message('debug', "Cache file has expired. File deleted");
|
395
|
+
return FALSE;
|
396
|
+
}
|
397
|
+
|
398
|
+
// Display the cache
|
399
|
+
$this->_display(str_replace($match['0'], '', $cache));
|
400
|
+
log_message('debug', "Cache file is current. Sending it to browser.");
|
401
|
+
return TRUE;
|
402
|
+
}
|
403
|
+
|
404
|
+
|
405
|
+
}
|
406
|
+
// END Output Class
|
407
|
+
|
408
|
+
/* End of file Output.php */
|
409
|
+
/* Location: ./system/libraries/Output.php */
|