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,251 @@
|
|
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
|
+
* SHA1 Encoding Class
|
20
|
+
*
|
21
|
+
* Purpose: Provides 160 bit hashing using The Secure Hash Algorithm
|
22
|
+
* developed at the National Institute of Standards and Technology. The 40
|
23
|
+
* character SHA1 message hash is computationally infeasible to crack.
|
24
|
+
*
|
25
|
+
* This class is a fallback for servers that are not running PHP greater than
|
26
|
+
* 4.3, or do not have the MHASH library.
|
27
|
+
*
|
28
|
+
* This class is based on two scripts:
|
29
|
+
*
|
30
|
+
* Marcus Campbell's PHP implementation (GNU license)
|
31
|
+
* http://www.tecknik.net/sha-1/
|
32
|
+
*
|
33
|
+
* ...which is based on Paul Johnston's JavaScript version
|
34
|
+
* (BSD license). http://pajhome.org.uk/
|
35
|
+
*
|
36
|
+
* I encapsulated the functions and wrote one additional method to fix
|
37
|
+
* a hex conversion bug. - Rick Ellis
|
38
|
+
*
|
39
|
+
* @package CodeIgniter
|
40
|
+
* @subpackage Libraries
|
41
|
+
* @category Encryption
|
42
|
+
* @author ExpressionEngine Dev Team
|
43
|
+
* @link http://codeigniter.com/user_guide/general/encryption.html
|
44
|
+
*/
|
45
|
+
class CI_SHA {
|
46
|
+
|
47
|
+
function CI_SHA()
|
48
|
+
{
|
49
|
+
log_message('debug', "SHA1 Class Initialized");
|
50
|
+
}
|
51
|
+
|
52
|
+
/**
|
53
|
+
* Generate the Hash
|
54
|
+
*
|
55
|
+
* @access public
|
56
|
+
* @param string
|
57
|
+
* @return string
|
58
|
+
*/
|
59
|
+
function generate($str)
|
60
|
+
{
|
61
|
+
$n = ((strlen($str) + 8) >> 6) + 1;
|
62
|
+
|
63
|
+
for ($i = 0; $i < $n * 16; $i++)
|
64
|
+
{
|
65
|
+
$x[$i] = 0;
|
66
|
+
}
|
67
|
+
|
68
|
+
for ($i = 0; $i < strlen($str); $i++)
|
69
|
+
{
|
70
|
+
$x[$i >> 2] |= ord(substr($str, $i, 1)) << (24 - ($i % 4) * 8);
|
71
|
+
}
|
72
|
+
|
73
|
+
$x[$i >> 2] |= 0x80 << (24 - ($i % 4) * 8);
|
74
|
+
|
75
|
+
$x[$n * 16 - 1] = strlen($str) * 8;
|
76
|
+
|
77
|
+
$a = 1732584193;
|
78
|
+
$b = -271733879;
|
79
|
+
$c = -1732584194;
|
80
|
+
$d = 271733878;
|
81
|
+
$e = -1009589776;
|
82
|
+
|
83
|
+
for ($i = 0; $i < count($x); $i += 16)
|
84
|
+
{
|
85
|
+
$olda = $a;
|
86
|
+
$oldb = $b;
|
87
|
+
$oldc = $c;
|
88
|
+
$oldd = $d;
|
89
|
+
$olde = $e;
|
90
|
+
|
91
|
+
for($j = 0; $j < 80; $j++)
|
92
|
+
{
|
93
|
+
if ($j < 16)
|
94
|
+
{
|
95
|
+
$w[$j] = $x[$i + $j];
|
96
|
+
}
|
97
|
+
else
|
98
|
+
{
|
99
|
+
$w[$j] = $this->_rol($w[$j - 3] ^ $w[$j - 8] ^ $w[$j - 14] ^ $w[$j - 16], 1);
|
100
|
+
}
|
101
|
+
|
102
|
+
$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)));
|
103
|
+
|
104
|
+
$e = $d;
|
105
|
+
$d = $c;
|
106
|
+
$c = $this->_rol($b, 30);
|
107
|
+
$b = $a;
|
108
|
+
$a = $t;
|
109
|
+
}
|
110
|
+
|
111
|
+
$a = $this->_safe_add($a, $olda);
|
112
|
+
$b = $this->_safe_add($b, $oldb);
|
113
|
+
$c = $this->_safe_add($c, $oldc);
|
114
|
+
$d = $this->_safe_add($d, $oldd);
|
115
|
+
$e = $this->_safe_add($e, $olde);
|
116
|
+
}
|
117
|
+
|
118
|
+
return $this->_hex($a).$this->_hex($b).$this->_hex($c).$this->_hex($d).$this->_hex($e);
|
119
|
+
}
|
120
|
+
|
121
|
+
// --------------------------------------------------------------------
|
122
|
+
|
123
|
+
/**
|
124
|
+
* Convert a decimal to hex
|
125
|
+
*
|
126
|
+
* @access private
|
127
|
+
* @param string
|
128
|
+
* @return string
|
129
|
+
*/
|
130
|
+
function _hex($str)
|
131
|
+
{
|
132
|
+
$str = dechex($str);
|
133
|
+
|
134
|
+
if (strlen($str) == 7)
|
135
|
+
{
|
136
|
+
$str = '0'.$str;
|
137
|
+
}
|
138
|
+
|
139
|
+
return $str;
|
140
|
+
}
|
141
|
+
|
142
|
+
// --------------------------------------------------------------------
|
143
|
+
|
144
|
+
/**
|
145
|
+
* Return result based on iteration
|
146
|
+
*
|
147
|
+
* @access private
|
148
|
+
* @return string
|
149
|
+
*/
|
150
|
+
function _ft($t, $b, $c, $d)
|
151
|
+
{
|
152
|
+
if ($t < 20)
|
153
|
+
return ($b & $c) | ((~$b) & $d);
|
154
|
+
if ($t < 40)
|
155
|
+
return $b ^ $c ^ $d;
|
156
|
+
if ($t < 60)
|
157
|
+
return ($b & $c) | ($b & $d) | ($c & $d);
|
158
|
+
|
159
|
+
return $b ^ $c ^ $d;
|
160
|
+
}
|
161
|
+
|
162
|
+
// --------------------------------------------------------------------
|
163
|
+
|
164
|
+
/**
|
165
|
+
* Determine the additive constant
|
166
|
+
*
|
167
|
+
* @access private
|
168
|
+
* @return string
|
169
|
+
*/
|
170
|
+
function _kt($t)
|
171
|
+
{
|
172
|
+
if ($t < 20)
|
173
|
+
{
|
174
|
+
return 1518500249;
|
175
|
+
}
|
176
|
+
else if ($t < 40)
|
177
|
+
{
|
178
|
+
return 1859775393;
|
179
|
+
}
|
180
|
+
else if ($t < 60)
|
181
|
+
{
|
182
|
+
return -1894007588;
|
183
|
+
}
|
184
|
+
else
|
185
|
+
{
|
186
|
+
return -899497514;
|
187
|
+
}
|
188
|
+
}
|
189
|
+
|
190
|
+
// --------------------------------------------------------------------
|
191
|
+
|
192
|
+
/**
|
193
|
+
* Add integers, wrapping at 2^32
|
194
|
+
*
|
195
|
+
* @access private
|
196
|
+
* @return string
|
197
|
+
*/
|
198
|
+
function _safe_add($x, $y)
|
199
|
+
{
|
200
|
+
$lsw = ($x & 0xFFFF) + ($y & 0xFFFF);
|
201
|
+
$msw = ($x >> 16) + ($y >> 16) + ($lsw >> 16);
|
202
|
+
|
203
|
+
return ($msw << 16) | ($lsw & 0xFFFF);
|
204
|
+
}
|
205
|
+
|
206
|
+
// --------------------------------------------------------------------
|
207
|
+
|
208
|
+
/**
|
209
|
+
* Bitwise rotate a 32-bit number
|
210
|
+
*
|
211
|
+
* @access private
|
212
|
+
* @return integer
|
213
|
+
*/
|
214
|
+
function _rol($num, $cnt)
|
215
|
+
{
|
216
|
+
return ($num << $cnt) | $this->_zero_fill($num, 32 - $cnt);
|
217
|
+
}
|
218
|
+
|
219
|
+
// --------------------------------------------------------------------
|
220
|
+
|
221
|
+
/**
|
222
|
+
* Pad string with zero
|
223
|
+
*
|
224
|
+
* @access private
|
225
|
+
* @return string
|
226
|
+
*/
|
227
|
+
function _zero_fill($a, $b)
|
228
|
+
{
|
229
|
+
$bin = decbin($a);
|
230
|
+
|
231
|
+
if (strlen($bin) < $b)
|
232
|
+
{
|
233
|
+
$bin = 0;
|
234
|
+
}
|
235
|
+
else
|
236
|
+
{
|
237
|
+
$bin = substr($bin, 0, strlen($bin) - $b);
|
238
|
+
}
|
239
|
+
|
240
|
+
for ($i=0; $i < $b; $i++)
|
241
|
+
{
|
242
|
+
$bin = "0".$bin;
|
243
|
+
}
|
244
|
+
|
245
|
+
return bindec($bin);
|
246
|
+
}
|
247
|
+
}
|
248
|
+
// END CI_SHA
|
249
|
+
|
250
|
+
/* End of file Sha1.php */
|
251
|
+
/* Location: ./system/libraries/Sha1.php */
|
@@ -0,0 +1,440 @@
|
|
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.3.1
|
13
|
+
* @filesource
|
14
|
+
*/
|
15
|
+
|
16
|
+
// ------------------------------------------------------------------------
|
17
|
+
|
18
|
+
/**
|
19
|
+
* HTML Table Generating Class
|
20
|
+
*
|
21
|
+
* Lets you create tables manually or from database result objects, or arrays.
|
22
|
+
*
|
23
|
+
* @package CodeIgniter
|
24
|
+
* @subpackage Libraries
|
25
|
+
* @category HTML Tables
|
26
|
+
* @author ExpressionEngine Dev Team
|
27
|
+
* @link http://codeigniter.com/user_guide/libraries/uri.html
|
28
|
+
*/
|
29
|
+
class CI_Table {
|
30
|
+
|
31
|
+
var $rows = array();
|
32
|
+
var $heading = array();
|
33
|
+
var $auto_heading = TRUE;
|
34
|
+
var $caption = NULL;
|
35
|
+
var $template = NULL;
|
36
|
+
var $newline = "\n";
|
37
|
+
var $empty_cells = "";
|
38
|
+
|
39
|
+
|
40
|
+
function CI_Table()
|
41
|
+
{
|
42
|
+
log_message('debug', "Table Class Initialized");
|
43
|
+
}
|
44
|
+
|
45
|
+
// --------------------------------------------------------------------
|
46
|
+
|
47
|
+
/**
|
48
|
+
* Set the template
|
49
|
+
*
|
50
|
+
* @access public
|
51
|
+
* @param array
|
52
|
+
* @return void
|
53
|
+
*/
|
54
|
+
function set_template($template)
|
55
|
+
{
|
56
|
+
if ( ! is_array($template))
|
57
|
+
{
|
58
|
+
return FALSE;
|
59
|
+
}
|
60
|
+
|
61
|
+
$this->template = $template;
|
62
|
+
}
|
63
|
+
|
64
|
+
// --------------------------------------------------------------------
|
65
|
+
|
66
|
+
/**
|
67
|
+
* Set the table heading
|
68
|
+
*
|
69
|
+
* Can be passed as an array or discreet params
|
70
|
+
*
|
71
|
+
* @access public
|
72
|
+
* @param mixed
|
73
|
+
* @return void
|
74
|
+
*/
|
75
|
+
function set_heading()
|
76
|
+
{
|
77
|
+
$args = func_get_args();
|
78
|
+
$this->heading = (is_array($args[0])) ? $args[0] : $args;
|
79
|
+
}
|
80
|
+
|
81
|
+
// --------------------------------------------------------------------
|
82
|
+
|
83
|
+
/**
|
84
|
+
* Set columns. Takes a one-dimensional array as input and creates
|
85
|
+
* a multi-dimensional array with a depth equal to the number of
|
86
|
+
* columns. This allows a single array with many elements to be
|
87
|
+
* displayed in a table that has a fixed column count.
|
88
|
+
*
|
89
|
+
* @access public
|
90
|
+
* @param array
|
91
|
+
* @param int
|
92
|
+
* @return void
|
93
|
+
*/
|
94
|
+
function make_columns($array = array(), $col_limit = 0)
|
95
|
+
{
|
96
|
+
if ( ! is_array($array) OR count($array) == 0)
|
97
|
+
{
|
98
|
+
return FALSE;
|
99
|
+
}
|
100
|
+
|
101
|
+
// Turn off the auto-heading feature since it's doubtful we
|
102
|
+
// will want headings from a one-dimensional array
|
103
|
+
$this->auto_heading = FALSE;
|
104
|
+
|
105
|
+
if ($col_limit == 0)
|
106
|
+
{
|
107
|
+
return $array;
|
108
|
+
}
|
109
|
+
|
110
|
+
$new = array();
|
111
|
+
while(count($array) > 0)
|
112
|
+
{
|
113
|
+
$temp = array_splice($array, 0, $col_limit);
|
114
|
+
|
115
|
+
if (count($temp) < $col_limit)
|
116
|
+
{
|
117
|
+
for ($i = count($temp); $i < $col_limit; $i++)
|
118
|
+
{
|
119
|
+
$temp[] = ' ';
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
$new[] = $temp;
|
124
|
+
}
|
125
|
+
|
126
|
+
return $new;
|
127
|
+
}
|
128
|
+
|
129
|
+
// --------------------------------------------------------------------
|
130
|
+
|
131
|
+
/**
|
132
|
+
* Set "empty" cells
|
133
|
+
*
|
134
|
+
* Can be passed as an array or discreet params
|
135
|
+
*
|
136
|
+
* @access public
|
137
|
+
* @param mixed
|
138
|
+
* @return void
|
139
|
+
*/
|
140
|
+
function set_empty($value)
|
141
|
+
{
|
142
|
+
$this->empty_cells = $value;
|
143
|
+
}
|
144
|
+
|
145
|
+
// --------------------------------------------------------------------
|
146
|
+
|
147
|
+
/**
|
148
|
+
* Add a table row
|
149
|
+
*
|
150
|
+
* Can be passed as an array or discreet params
|
151
|
+
*
|
152
|
+
* @access public
|
153
|
+
* @param mixed
|
154
|
+
* @return void
|
155
|
+
*/
|
156
|
+
function add_row()
|
157
|
+
{
|
158
|
+
$args = func_get_args();
|
159
|
+
$this->rows[] = (is_array($args[0])) ? $args[0] : $args;
|
160
|
+
}
|
161
|
+
|
162
|
+
// --------------------------------------------------------------------
|
163
|
+
|
164
|
+
/**
|
165
|
+
* Add a table caption
|
166
|
+
*
|
167
|
+
* @access public
|
168
|
+
* @param string
|
169
|
+
* @return void
|
170
|
+
*/
|
171
|
+
function set_caption($caption)
|
172
|
+
{
|
173
|
+
$this->caption = $caption;
|
174
|
+
}
|
175
|
+
|
176
|
+
// --------------------------------------------------------------------
|
177
|
+
|
178
|
+
/**
|
179
|
+
* Generate the table
|
180
|
+
*
|
181
|
+
* @access public
|
182
|
+
* @param mixed
|
183
|
+
* @return string
|
184
|
+
*/
|
185
|
+
function generate($table_data = NULL)
|
186
|
+
{
|
187
|
+
// The table data can optionally be passed to this function
|
188
|
+
// either as a database result object or an array
|
189
|
+
if ( ! is_null($table_data))
|
190
|
+
{
|
191
|
+
if (is_object($table_data))
|
192
|
+
{
|
193
|
+
$this->_set_from_object($table_data);
|
194
|
+
}
|
195
|
+
elseif (is_array($table_data))
|
196
|
+
{
|
197
|
+
$set_heading = (count($this->heading) == 0 AND $this->auto_heading == FALSE) ? FALSE : TRUE;
|
198
|
+
$this->_set_from_array($table_data, $set_heading);
|
199
|
+
}
|
200
|
+
}
|
201
|
+
|
202
|
+
// Is there anything to display? No? Smite them!
|
203
|
+
if (count($this->heading) == 0 AND count($this->rows) == 0)
|
204
|
+
{
|
205
|
+
return 'Undefined table data';
|
206
|
+
}
|
207
|
+
|
208
|
+
// Compile and validate the template date
|
209
|
+
$this->_compile_template();
|
210
|
+
|
211
|
+
|
212
|
+
// Build the table!
|
213
|
+
|
214
|
+
$out = $this->template['table_open'];
|
215
|
+
$out .= $this->newline;
|
216
|
+
|
217
|
+
// Add any caption here
|
218
|
+
if ($this->caption)
|
219
|
+
{
|
220
|
+
$out .= $this->newline;
|
221
|
+
$out .= '<caption>' . $this->caption . '</caption>';
|
222
|
+
$out .= $this->newline;
|
223
|
+
}
|
224
|
+
|
225
|
+
// Is there a table heading to display?
|
226
|
+
if (count($this->heading) > 0)
|
227
|
+
{
|
228
|
+
$out .= $this->template['heading_row_start'];
|
229
|
+
$out .= $this->newline;
|
230
|
+
|
231
|
+
foreach($this->heading as $heading)
|
232
|
+
{
|
233
|
+
$out .= $this->template['heading_cell_start'];
|
234
|
+
$out .= $heading;
|
235
|
+
$out .= $this->template['heading_cell_end'];
|
236
|
+
}
|
237
|
+
|
238
|
+
$out .= $this->template['heading_row_end'];
|
239
|
+
$out .= $this->newline;
|
240
|
+
}
|
241
|
+
|
242
|
+
// Build the table rows
|
243
|
+
if (count($this->rows) > 0)
|
244
|
+
{
|
245
|
+
$i = 1;
|
246
|
+
foreach($this->rows as $row)
|
247
|
+
{
|
248
|
+
if ( ! is_array($row))
|
249
|
+
{
|
250
|
+
break;
|
251
|
+
}
|
252
|
+
|
253
|
+
// We use modulus to alternate the row colors
|
254
|
+
$name = (fmod($i++, 2)) ? '' : 'alt_';
|
255
|
+
|
256
|
+
$out .= $this->template['row_'.$name.'start'];
|
257
|
+
$out .= $this->newline;
|
258
|
+
|
259
|
+
foreach($row as $cell)
|
260
|
+
{
|
261
|
+
$out .= $this->template['cell_'.$name.'start'];
|
262
|
+
|
263
|
+
if ($cell === "")
|
264
|
+
{
|
265
|
+
$out .= $this->empty_cells;
|
266
|
+
}
|
267
|
+
else
|
268
|
+
{
|
269
|
+
$out .= $cell;
|
270
|
+
}
|
271
|
+
|
272
|
+
$out .= $this->template['cell_'.$name.'end'];
|
273
|
+
}
|
274
|
+
|
275
|
+
$out .= $this->template['row_'.$name.'end'];
|
276
|
+
$out .= $this->newline;
|
277
|
+
}
|
278
|
+
}
|
279
|
+
|
280
|
+
$out .= $this->template['table_close'];
|
281
|
+
|
282
|
+
return $out;
|
283
|
+
}
|
284
|
+
|
285
|
+
// --------------------------------------------------------------------
|
286
|
+
|
287
|
+
/**
|
288
|
+
* Clears the table arrays. Useful if multiple tables are being generated
|
289
|
+
*
|
290
|
+
* @access public
|
291
|
+
* @return void
|
292
|
+
*/
|
293
|
+
function clear()
|
294
|
+
{
|
295
|
+
$this->rows = array();
|
296
|
+
$this->heading = array();
|
297
|
+
$this->auto_heading = TRUE;
|
298
|
+
}
|
299
|
+
|
300
|
+
// --------------------------------------------------------------------
|
301
|
+
|
302
|
+
/**
|
303
|
+
* Set table data from a database result object
|
304
|
+
*
|
305
|
+
* @access public
|
306
|
+
* @param object
|
307
|
+
* @return void
|
308
|
+
*/
|
309
|
+
function _set_from_object($query)
|
310
|
+
{
|
311
|
+
if ( ! is_object($query))
|
312
|
+
{
|
313
|
+
return FALSE;
|
314
|
+
}
|
315
|
+
|
316
|
+
// First generate the headings from the table column names
|
317
|
+
if (count($this->heading) == 0)
|
318
|
+
{
|
319
|
+
if ( ! method_exists($query, 'list_fields'))
|
320
|
+
{
|
321
|
+
return FALSE;
|
322
|
+
}
|
323
|
+
|
324
|
+
$this->heading = $query->list_fields();
|
325
|
+
}
|
326
|
+
|
327
|
+
// Next blast through the result array and build out the rows
|
328
|
+
|
329
|
+
if ($query->num_rows() > 0)
|
330
|
+
{
|
331
|
+
foreach ($query->result_array() as $row)
|
332
|
+
{
|
333
|
+
$this->rows[] = $row;
|
334
|
+
}
|
335
|
+
}
|
336
|
+
}
|
337
|
+
|
338
|
+
// --------------------------------------------------------------------
|
339
|
+
|
340
|
+
/**
|
341
|
+
* Set table data from an array
|
342
|
+
*
|
343
|
+
* @access public
|
344
|
+
* @param array
|
345
|
+
* @return void
|
346
|
+
*/
|
347
|
+
function _set_from_array($data, $set_heading = TRUE)
|
348
|
+
{
|
349
|
+
if ( ! is_array($data) OR count($data) == 0)
|
350
|
+
{
|
351
|
+
return FALSE;
|
352
|
+
}
|
353
|
+
|
354
|
+
$i = 0;
|
355
|
+
foreach ($data as $row)
|
356
|
+
{
|
357
|
+
if ( ! is_array($row))
|
358
|
+
{
|
359
|
+
$this->rows[] = $data;
|
360
|
+
break;
|
361
|
+
}
|
362
|
+
|
363
|
+
// If a heading hasn't already been set we'll use the first row of the array as the heading
|
364
|
+
if ($i == 0 AND count($data) > 1 AND count($this->heading) == 0 AND $set_heading == TRUE)
|
365
|
+
{
|
366
|
+
$this->heading = $row;
|
367
|
+
}
|
368
|
+
else
|
369
|
+
{
|
370
|
+
$this->rows[] = $row;
|
371
|
+
}
|
372
|
+
|
373
|
+
$i++;
|
374
|
+
}
|
375
|
+
}
|
376
|
+
|
377
|
+
// --------------------------------------------------------------------
|
378
|
+
|
379
|
+
/**
|
380
|
+
* Compile Template
|
381
|
+
*
|
382
|
+
* @access private
|
383
|
+
* @return void
|
384
|
+
*/
|
385
|
+
function _compile_template()
|
386
|
+
{
|
387
|
+
if ($this->template == NULL)
|
388
|
+
{
|
389
|
+
$this->template = $this->_default_template();
|
390
|
+
return;
|
391
|
+
}
|
392
|
+
|
393
|
+
$this->temp = $this->_default_template();
|
394
|
+
foreach (array('table_open','heading_row_start', 'heading_row_end', 'heading_cell_start', 'heading_cell_end', 'row_start', 'row_end', 'cell_start', 'cell_end', 'row_alt_start', 'row_alt_end', 'cell_alt_start', 'cell_alt_end', 'table_close') as $val)
|
395
|
+
{
|
396
|
+
if ( ! isset($this->template[$val]))
|
397
|
+
{
|
398
|
+
$this->template[$val] = $this->temp[$val];
|
399
|
+
}
|
400
|
+
}
|
401
|
+
}
|
402
|
+
|
403
|
+
// --------------------------------------------------------------------
|
404
|
+
|
405
|
+
/**
|
406
|
+
* Default Template
|
407
|
+
*
|
408
|
+
* @access private
|
409
|
+
* @return void
|
410
|
+
*/
|
411
|
+
function _default_template()
|
412
|
+
{
|
413
|
+
return array (
|
414
|
+
'table_open' => '<table border="0" cellpadding="4" cellspacing="0">',
|
415
|
+
|
416
|
+
'heading_row_start' => '<tr>',
|
417
|
+
'heading_row_end' => '</tr>',
|
418
|
+
'heading_cell_start' => '<th>',
|
419
|
+
'heading_cell_end' => '</th>',
|
420
|
+
|
421
|
+
'row_start' => '<tr>',
|
422
|
+
'row_end' => '</tr>',
|
423
|
+
'cell_start' => '<td>',
|
424
|
+
'cell_end' => '</td>',
|
425
|
+
|
426
|
+
'row_alt_start' => '<tr>',
|
427
|
+
'row_alt_end' => '</tr>',
|
428
|
+
'cell_alt_start' => '<td>',
|
429
|
+
'cell_alt_end' => '</td>',
|
430
|
+
|
431
|
+
'table_close' => '</table>'
|
432
|
+
);
|
433
|
+
}
|
434
|
+
|
435
|
+
|
436
|
+
}
|
437
|
+
|
438
|
+
|
439
|
+
/* End of file Table.php */
|
440
|
+
/* Location: ./system/libraries/Table.php */
|