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,462 @@
|
|
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 Text Helpers
|
20
|
+
*
|
21
|
+
* @package CodeIgniter
|
22
|
+
* @subpackage Helpers
|
23
|
+
* @category Helpers
|
24
|
+
* @author ExpressionEngine Dev Team
|
25
|
+
* @link http://codeigniter.com/user_guide/helpers/text_helper.html
|
26
|
+
*/
|
27
|
+
|
28
|
+
// ------------------------------------------------------------------------
|
29
|
+
|
30
|
+
/**
|
31
|
+
* Word Limiter
|
32
|
+
*
|
33
|
+
* Limits a string to X number of words.
|
34
|
+
*
|
35
|
+
* @access public
|
36
|
+
* @param string
|
37
|
+
* @param integer
|
38
|
+
* @param string the end character. Usually an ellipsis
|
39
|
+
* @return string
|
40
|
+
*/
|
41
|
+
if ( ! function_exists('word_limiter'))
|
42
|
+
{
|
43
|
+
function word_limiter($str, $limit = 100, $end_char = '…')
|
44
|
+
{
|
45
|
+
if (trim($str) == '')
|
46
|
+
{
|
47
|
+
return $str;
|
48
|
+
}
|
49
|
+
|
50
|
+
preg_match('/^\s*+(?:\S++\s*+){1,'.(int) $limit.'}/', $str, $matches);
|
51
|
+
|
52
|
+
if (strlen($str) == strlen($matches[0]))
|
53
|
+
{
|
54
|
+
$end_char = '';
|
55
|
+
}
|
56
|
+
|
57
|
+
return rtrim($matches[0]).$end_char;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
// ------------------------------------------------------------------------
|
62
|
+
|
63
|
+
/**
|
64
|
+
* Character Limiter
|
65
|
+
*
|
66
|
+
* Limits the string based on the character count. Preserves complete words
|
67
|
+
* so the character count may not be exactly as specified.
|
68
|
+
*
|
69
|
+
* @access public
|
70
|
+
* @param string
|
71
|
+
* @param integer
|
72
|
+
* @param string the end character. Usually an ellipsis
|
73
|
+
* @return string
|
74
|
+
*/
|
75
|
+
if ( ! function_exists('character_limiter'))
|
76
|
+
{
|
77
|
+
function character_limiter($str, $n = 500, $end_char = '…')
|
78
|
+
{
|
79
|
+
if (strlen($str) < $n)
|
80
|
+
{
|
81
|
+
return $str;
|
82
|
+
}
|
83
|
+
|
84
|
+
$str = preg_replace("/\s+/", ' ', str_replace(array("\r\n", "\r", "\n"), ' ', $str));
|
85
|
+
|
86
|
+
if (strlen($str) <= $n)
|
87
|
+
{
|
88
|
+
return $str;
|
89
|
+
}
|
90
|
+
|
91
|
+
$out = "";
|
92
|
+
foreach (explode(' ', trim($str)) as $val)
|
93
|
+
{
|
94
|
+
$out .= $val.' ';
|
95
|
+
|
96
|
+
if (strlen($out) >= $n)
|
97
|
+
{
|
98
|
+
$out = trim($out);
|
99
|
+
return (strlen($out) == strlen($str)) ? $out : $out.$end_char;
|
100
|
+
}
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
104
|
+
|
105
|
+
// ------------------------------------------------------------------------
|
106
|
+
|
107
|
+
/**
|
108
|
+
* High ASCII to Entities
|
109
|
+
*
|
110
|
+
* Converts High ascii text and MS Word special characters to character entities
|
111
|
+
*
|
112
|
+
* @access public
|
113
|
+
* @param string
|
114
|
+
* @return string
|
115
|
+
*/
|
116
|
+
if ( ! function_exists('ascii_to_entities'))
|
117
|
+
{
|
118
|
+
function ascii_to_entities($str)
|
119
|
+
{
|
120
|
+
$count = 1;
|
121
|
+
$out = '';
|
122
|
+
$temp = array();
|
123
|
+
|
124
|
+
for ($i = 0, $s = strlen($str); $i < $s; $i++)
|
125
|
+
{
|
126
|
+
$ordinal = ord($str[$i]);
|
127
|
+
|
128
|
+
if ($ordinal < 128)
|
129
|
+
{
|
130
|
+
/*
|
131
|
+
If the $temp array has a value but we have moved on, then it seems only
|
132
|
+
fair that we output that entity and restart $temp before continuing. -Paul
|
133
|
+
*/
|
134
|
+
if (count($temp) == 1)
|
135
|
+
{
|
136
|
+
$out .= '&#'.array_shift($temp).';';
|
137
|
+
$count = 1;
|
138
|
+
}
|
139
|
+
|
140
|
+
$out .= $str[$i];
|
141
|
+
}
|
142
|
+
else
|
143
|
+
{
|
144
|
+
if (count($temp) == 0)
|
145
|
+
{
|
146
|
+
$count = ($ordinal < 224) ? 2 : 3;
|
147
|
+
}
|
148
|
+
|
149
|
+
$temp[] = $ordinal;
|
150
|
+
|
151
|
+
if (count($temp) == $count)
|
152
|
+
{
|
153
|
+
$number = ($count == 3) ? (($temp['0'] % 16) * 4096) + (($temp['1'] % 64) * 64) + ($temp['2'] % 64) : (($temp['0'] % 32) * 64) + ($temp['1'] % 64);
|
154
|
+
|
155
|
+
$out .= '&#'.$number.';';
|
156
|
+
$count = 1;
|
157
|
+
$temp = array();
|
158
|
+
}
|
159
|
+
}
|
160
|
+
}
|
161
|
+
|
162
|
+
return $out;
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
// ------------------------------------------------------------------------
|
167
|
+
|
168
|
+
/**
|
169
|
+
* Entities to ASCII
|
170
|
+
*
|
171
|
+
* Converts character entities back to ASCII
|
172
|
+
*
|
173
|
+
* @access public
|
174
|
+
* @param string
|
175
|
+
* @param bool
|
176
|
+
* @return string
|
177
|
+
*/
|
178
|
+
if ( ! function_exists('entities_to_ascii'))
|
179
|
+
{
|
180
|
+
function entities_to_ascii($str, $all = TRUE)
|
181
|
+
{
|
182
|
+
if (preg_match_all('/\&#(\d+)\;/', $str, $matches))
|
183
|
+
{
|
184
|
+
for ($i = 0, $s = count($matches['0']); $i < $s; $i++)
|
185
|
+
{
|
186
|
+
$digits = $matches['1'][$i];
|
187
|
+
|
188
|
+
$out = '';
|
189
|
+
|
190
|
+
if ($digits < 128)
|
191
|
+
{
|
192
|
+
$out .= chr($digits);
|
193
|
+
|
194
|
+
}
|
195
|
+
elseif ($digits < 2048)
|
196
|
+
{
|
197
|
+
$out .= chr(192 + (($digits - ($digits % 64)) / 64));
|
198
|
+
$out .= chr(128 + ($digits % 64));
|
199
|
+
}
|
200
|
+
else
|
201
|
+
{
|
202
|
+
$out .= chr(224 + (($digits - ($digits % 4096)) / 4096));
|
203
|
+
$out .= chr(128 + ((($digits % 4096) - ($digits % 64)) / 64));
|
204
|
+
$out .= chr(128 + ($digits % 64));
|
205
|
+
}
|
206
|
+
|
207
|
+
$str = str_replace($matches['0'][$i], $out, $str);
|
208
|
+
}
|
209
|
+
}
|
210
|
+
|
211
|
+
if ($all)
|
212
|
+
{
|
213
|
+
$str = str_replace(array("&", "<", ">", """, "'", "-"),
|
214
|
+
array("&","<",">","\"", "'", "-"),
|
215
|
+
$str);
|
216
|
+
}
|
217
|
+
|
218
|
+
return $str;
|
219
|
+
}
|
220
|
+
}
|
221
|
+
|
222
|
+
// ------------------------------------------------------------------------
|
223
|
+
|
224
|
+
/**
|
225
|
+
* Word Censoring Function
|
226
|
+
*
|
227
|
+
* Supply a string and an array of disallowed words and any
|
228
|
+
* matched words will be converted to #### or to the replacement
|
229
|
+
* word you've submitted.
|
230
|
+
*
|
231
|
+
* @access public
|
232
|
+
* @param string the text string
|
233
|
+
* @param string the array of censoered words
|
234
|
+
* @param string the optional replacement value
|
235
|
+
* @return string
|
236
|
+
*/
|
237
|
+
if ( ! function_exists('word_censor'))
|
238
|
+
{
|
239
|
+
function word_censor($str, $censored, $replacement = '')
|
240
|
+
{
|
241
|
+
if ( ! is_array($censored))
|
242
|
+
{
|
243
|
+
return $str;
|
244
|
+
}
|
245
|
+
|
246
|
+
$str = ' '.$str.' ';
|
247
|
+
|
248
|
+
// \w, \b and a few others do not match on a unicode character
|
249
|
+
// set for performance reasons. As a result words like über
|
250
|
+
// will not match on a word boundary. Instead, we'll assume that
|
251
|
+
// a bad word will be bookended by any of these characters.
|
252
|
+
$delim = '[-_\'\"`(){}<>\[\]|!?@#%&,.:;^~*+=\/ 0-9\n\r\t]';
|
253
|
+
|
254
|
+
foreach ($censored as $badword)
|
255
|
+
{
|
256
|
+
if ($replacement != '')
|
257
|
+
{
|
258
|
+
$str = preg_replace("/({$delim})(".str_replace('\*', '\w*?', preg_quote($badword, '/')).")({$delim})/i", "\\1{$replacement}\\3", $str);
|
259
|
+
}
|
260
|
+
else
|
261
|
+
{
|
262
|
+
$str = preg_replace("/({$delim})(".str_replace('\*', '\w*?', preg_quote($badword, '/')).")({$delim})/ie", "'\\1'.str_repeat('#', strlen('\\2')).'\\3'", $str);
|
263
|
+
}
|
264
|
+
}
|
265
|
+
|
266
|
+
return trim($str);
|
267
|
+
}
|
268
|
+
}
|
269
|
+
|
270
|
+
// ------------------------------------------------------------------------
|
271
|
+
|
272
|
+
/**
|
273
|
+
* Code Highlighter
|
274
|
+
*
|
275
|
+
* Colorizes code strings
|
276
|
+
*
|
277
|
+
* @access public
|
278
|
+
* @param string the text string
|
279
|
+
* @return string
|
280
|
+
*/
|
281
|
+
if ( ! function_exists('highlight_code'))
|
282
|
+
{
|
283
|
+
function highlight_code($str)
|
284
|
+
{
|
285
|
+
// The highlight string function encodes and highlights
|
286
|
+
// brackets so we need them to start raw
|
287
|
+
$str = str_replace(array('<', '>'), array('<', '>'), $str);
|
288
|
+
|
289
|
+
// Replace any existing PHP tags to temporary markers so they don't accidentally
|
290
|
+
// break the string out of PHP, and thus, thwart the highlighting.
|
291
|
+
|
292
|
+
$str = str_replace(array('<?', '?>', '<%', '%>', '\\', '</script>'),
|
293
|
+
array('phptagopen', 'phptagclose', 'asptagopen', 'asptagclose', 'backslashtmp', 'scriptclose'), $str);
|
294
|
+
|
295
|
+
// The highlight_string function requires that the text be surrounded
|
296
|
+
// by PHP tags, which we will remove later
|
297
|
+
$str = '<?php '.$str.' ?>'; // <?
|
298
|
+
|
299
|
+
// All the magic happens here, baby!
|
300
|
+
$str = highlight_string($str, TRUE);
|
301
|
+
|
302
|
+
// Prior to PHP 5, the highligh function used icky <font> tags
|
303
|
+
// so we'll replace them with <span> tags.
|
304
|
+
|
305
|
+
if (abs(PHP_VERSION) < 5)
|
306
|
+
{
|
307
|
+
$str = str_replace(array('<font ', '</font>'), array('<span ', '</span>'), $str);
|
308
|
+
$str = preg_replace('#color="(.*?)"#', 'style="color: \\1"', $str);
|
309
|
+
}
|
310
|
+
|
311
|
+
// Remove our artificially added PHP, and the syntax highlighting that came with it
|
312
|
+
$str = preg_replace('/<span style="color: #([A-Z0-9]+)"><\?php( | )/i', '<span style="color: #$1">', $str);
|
313
|
+
$str = preg_replace('/(<span style="color: #[A-Z0-9]+">.*?)\?><\/span>\n<\/span>\n<\/code>/is', "$1</span>\n</span>\n</code>", $str);
|
314
|
+
$str = preg_replace('/<span style="color: #[A-Z0-9]+"\><\/span>/i', '', $str);
|
315
|
+
|
316
|
+
// Replace our markers back to PHP tags.
|
317
|
+
$str = str_replace(array('phptagopen', 'phptagclose', 'asptagopen', 'asptagclose', 'backslashtmp', 'scriptclose'),
|
318
|
+
array('<?', '?>', '<%', '%>', '\\', '</script>'), $str);
|
319
|
+
|
320
|
+
return $str;
|
321
|
+
}
|
322
|
+
}
|
323
|
+
|
324
|
+
// ------------------------------------------------------------------------
|
325
|
+
|
326
|
+
/**
|
327
|
+
* Phrase Highlighter
|
328
|
+
*
|
329
|
+
* Highlights a phrase within a text string
|
330
|
+
*
|
331
|
+
* @access public
|
332
|
+
* @param string the text string
|
333
|
+
* @param string the phrase you'd like to highlight
|
334
|
+
* @param string the openging tag to precede the phrase with
|
335
|
+
* @param string the closing tag to end the phrase with
|
336
|
+
* @return string
|
337
|
+
*/
|
338
|
+
if ( ! function_exists('highlight_phrase'))
|
339
|
+
{
|
340
|
+
function highlight_phrase($str, $phrase, $tag_open = '<strong>', $tag_close = '</strong>')
|
341
|
+
{
|
342
|
+
if ($str == '')
|
343
|
+
{
|
344
|
+
return '';
|
345
|
+
}
|
346
|
+
|
347
|
+
if ($phrase != '')
|
348
|
+
{
|
349
|
+
return preg_replace('/('.preg_quote($phrase, '/').')/i', $tag_open."\\1".$tag_close, $str);
|
350
|
+
}
|
351
|
+
|
352
|
+
return $str;
|
353
|
+
}
|
354
|
+
}
|
355
|
+
|
356
|
+
// ------------------------------------------------------------------------
|
357
|
+
|
358
|
+
/**
|
359
|
+
* Word Wrap
|
360
|
+
*
|
361
|
+
* Wraps text at the specified character. Maintains the integrity of words.
|
362
|
+
* Anything placed between {unwrap}{/unwrap} will not be word wrapped, nor
|
363
|
+
* will URLs.
|
364
|
+
*
|
365
|
+
* @access public
|
366
|
+
* @param string the text string
|
367
|
+
* @param integer the number of characters to wrap at
|
368
|
+
* @return string
|
369
|
+
*/
|
370
|
+
if ( ! function_exists('word_wrap'))
|
371
|
+
{
|
372
|
+
function word_wrap($str, $charlim = '76')
|
373
|
+
{
|
374
|
+
// Se the character limit
|
375
|
+
if ( ! is_numeric($charlim))
|
376
|
+
$charlim = 76;
|
377
|
+
|
378
|
+
// Reduce multiple spaces
|
379
|
+
$str = preg_replace("| +|", " ", $str);
|
380
|
+
|
381
|
+
// Standardize newlines
|
382
|
+
if (strpos($str, "\r") !== FALSE)
|
383
|
+
{
|
384
|
+
$str = str_replace(array("\r\n", "\r"), "\n", $str);
|
385
|
+
}
|
386
|
+
|
387
|
+
// If the current word is surrounded by {unwrap} tags we'll
|
388
|
+
// strip the entire chunk and replace it with a marker.
|
389
|
+
$unwrap = array();
|
390
|
+
if (preg_match_all("|(\{unwrap\}.+?\{/unwrap\})|s", $str, $matches))
|
391
|
+
{
|
392
|
+
for ($i = 0; $i < count($matches['0']); $i++)
|
393
|
+
{
|
394
|
+
$unwrap[] = $matches['1'][$i];
|
395
|
+
$str = str_replace($matches['1'][$i], "{{unwrapped".$i."}}", $str);
|
396
|
+
}
|
397
|
+
}
|
398
|
+
|
399
|
+
// Use PHP's native function to do the initial wordwrap.
|
400
|
+
// We set the cut flag to FALSE so that any individual words that are
|
401
|
+
// too long get left alone. In the next step we'll deal with them.
|
402
|
+
$str = wordwrap($str, $charlim, "\n", FALSE);
|
403
|
+
|
404
|
+
// Split the string into individual lines of text and cycle through them
|
405
|
+
$output = "";
|
406
|
+
foreach (explode("\n", $str) as $line)
|
407
|
+
{
|
408
|
+
// Is the line within the allowed character count?
|
409
|
+
// If so we'll join it to the output and continue
|
410
|
+
if (strlen($line) <= $charlim)
|
411
|
+
{
|
412
|
+
$output .= $line."\n";
|
413
|
+
continue;
|
414
|
+
}
|
415
|
+
|
416
|
+
$temp = '';
|
417
|
+
while((strlen($line)) > $charlim)
|
418
|
+
{
|
419
|
+
// If the over-length word is a URL we won't wrap it
|
420
|
+
if (preg_match("!\[url.+\]|://|wwww.!", $line))
|
421
|
+
{
|
422
|
+
break;
|
423
|
+
}
|
424
|
+
|
425
|
+
// Trim the word down
|
426
|
+
$temp .= substr($line, 0, $charlim-1);
|
427
|
+
$line = substr($line, $charlim-1);
|
428
|
+
}
|
429
|
+
|
430
|
+
// If $temp contains data it means we had to split up an over-length
|
431
|
+
// word into smaller chunks so we'll add it back to our current line
|
432
|
+
if ($temp != '')
|
433
|
+
{
|
434
|
+
$output .= $temp . "\n" . $line;
|
435
|
+
}
|
436
|
+
else
|
437
|
+
{
|
438
|
+
$output .= $line;
|
439
|
+
}
|
440
|
+
|
441
|
+
$output .= "\n";
|
442
|
+
}
|
443
|
+
|
444
|
+
// Put our markers back
|
445
|
+
if (count($unwrap) > 0)
|
446
|
+
{
|
447
|
+
foreach ($unwrap as $key => $val)
|
448
|
+
{
|
449
|
+
$output = str_replace("{{unwrapped".$key."}}", $val, $output);
|
450
|
+
}
|
451
|
+
}
|
452
|
+
|
453
|
+
// Remove the unwrap tags
|
454
|
+
$output = str_replace(array('{unwrap}', '{/unwrap}'), '', $output);
|
455
|
+
|
456
|
+
return $output;
|
457
|
+
}
|
458
|
+
}
|
459
|
+
|
460
|
+
|
461
|
+
/* End of file text_helper.php */
|
462
|
+
/* Location: ./system/helpers/text_helper.php */
|
@@ -0,0 +1,71 @@
|
|
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 Typography Helpers
|
20
|
+
*
|
21
|
+
* @package CodeIgniter
|
22
|
+
* @subpackage Helpers
|
23
|
+
* @category Helpers
|
24
|
+
* @author ExpressionEngine Dev Team
|
25
|
+
* @link http://codeigniter.com/user_guide/helpers/typography_helper.html
|
26
|
+
*/
|
27
|
+
|
28
|
+
// ------------------------------------------------------------------------
|
29
|
+
|
30
|
+
/**
|
31
|
+
* Convert newlines to HTML line breaks except within PRE tags
|
32
|
+
*
|
33
|
+
* @access public
|
34
|
+
* @param string
|
35
|
+
* @return string
|
36
|
+
*/
|
37
|
+
if ( ! function_exists('nl2br_except_pre'))
|
38
|
+
{
|
39
|
+
function nl2br_except_pre($str)
|
40
|
+
{
|
41
|
+
$CI =& get_instance();
|
42
|
+
|
43
|
+
$CI->load->library('typography');
|
44
|
+
|
45
|
+
return $CI->typography->nl2br_except_pre($str);
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
// ------------------------------------------------------------------------
|
50
|
+
|
51
|
+
/**
|
52
|
+
* Auto Typography Wrapper Function
|
53
|
+
*
|
54
|
+
*
|
55
|
+
* @access public
|
56
|
+
* @param string
|
57
|
+
* @param bool whether to reduce multiple instances of double newlines to two
|
58
|
+
* @return string
|
59
|
+
*/
|
60
|
+
if ( ! function_exists('auto_typography'))
|
61
|
+
{
|
62
|
+
function auto_typography($str, $reduce_linebreaks = FALSE)
|
63
|
+
{
|
64
|
+
$CI =& get_instance();
|
65
|
+
$CI->load->library('typography');
|
66
|
+
return $CI->typography->auto_typography($str, $reduce_linebreaks);
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
/* End of file typography_helper.php */
|
71
|
+
/* Location: ./system/helpers/typography_helper.php */
|