codeigniter_vender 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (350) hide show
  1. data/.gitignore +2 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README +40 -0
  4. data/Rakefile +18 -0
  5. data/VERSION +1 -0
  6. data/codeigniter_vender.gemspec +389 -0
  7. data/generators/ci_app/USAGE +8 -0
  8. data/generators/ci_app/ci_app_generator.rb +12 -0
  9. data/generators/ci_app/templates/CodeIgniter_1.7.2/index.php +118 -0
  10. data/generators/ci_app/templates/CodeIgniter_1.7.2/license.txt +52 -0
  11. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/autoload.php +116 -0
  12. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/config.php +329 -0
  13. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/constants.php +41 -0
  14. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/database.php +55 -0
  15. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/doctypes.php +15 -0
  16. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/hooks.php +16 -0
  17. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/index.html +10 -0
  18. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/mimes.php +105 -0
  19. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/routes.php +48 -0
  20. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/smileys.php +66 -0
  21. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/config/user_agents.php +175 -0
  22. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/controllers/index.html +10 -0
  23. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/controllers/welcome.php +17 -0
  24. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/error_404.php +34 -0
  25. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/error_db.php +34 -0
  26. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/error_general.php +34 -0
  27. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/error_php.php +10 -0
  28. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/errors/index.html +10 -0
  29. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/helpers/index.html +10 -0
  30. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/hooks/index.html +10 -0
  31. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/index.html +10 -0
  32. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/language/english/index.html +10 -0
  33. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/libraries/index.html +10 -0
  34. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/models/index.html +10 -0
  35. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/views/index.html +10 -0
  36. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/application/views/welcome_message.php +62 -0
  37. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/cache/index.html +10 -0
  38. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/Base4.php +69 -0
  39. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/Base5.php +56 -0
  40. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/CodeIgniter.php +280 -0
  41. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/Common.php +421 -0
  42. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/Compat.php +93 -0
  43. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/codeigniter/index.html +10 -0
  44. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB.php +146 -0
  45. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_active_rec.php +1820 -0
  46. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_cache.php +195 -0
  47. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_driver.php +1366 -0
  48. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_forge.php +375 -0
  49. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_result.php +342 -0
  50. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/DB_utility.php +389 -0
  51. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/index.html +10 -0
  52. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/index.html +10 -0
  53. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/mssql_driver.php +667 -0
  54. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/mssql_forge.php +248 -0
  55. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/mssql_result.php +169 -0
  56. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mssql/mssql_utility.php +123 -0
  57. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/index.html +10 -0
  58. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/mysql_driver.php +670 -0
  59. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/mysql_forge.php +254 -0
  60. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/mysql_result.php +169 -0
  61. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysql/mysql_utility.php +245 -0
  62. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/index.html +10 -0
  63. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/mysqli_driver.php +671 -0
  64. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/mysqli_forge.php +254 -0
  65. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/mysqli_result.php +169 -0
  66. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/mysqli/mysqli_utility.php +123 -0
  67. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/index.html +10 -0
  68. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/oci8_driver.php +780 -0
  69. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/oci8_forge.php +248 -0
  70. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/oci8_result.php +249 -0
  71. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/oci8/oci8_utility.php +122 -0
  72. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/index.html +10 -0
  73. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/odbc_driver.php +639 -0
  74. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/odbc_forge.php +266 -0
  75. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/odbc_result.php +228 -0
  76. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/odbc/odbc_utility.php +148 -0
  77. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/index.html +10 -0
  78. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/postgre_driver.php +684 -0
  79. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/postgre_forge.php +248 -0
  80. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/postgre_result.php +169 -0
  81. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/postgre/postgre_utility.php +124 -0
  82. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/index.html +10 -0
  83. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/sqlite_driver.php +657 -0
  84. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/sqlite_forge.php +265 -0
  85. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/sqlite_result.php +179 -0
  86. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/drivers/sqlite/sqlite_utility.php +141 -0
  87. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/database/index.html +10 -0
  88. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/fonts/index.html +10 -0
  89. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/fonts/texb.ttf +0 -0
  90. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/array_helper.php +78 -0
  91. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/compatibility_helper.php +498 -0
  92. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/cookie_helper.php +144 -0
  93. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/date_helper.php +611 -0
  94. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/directory_helper.php +84 -0
  95. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/download_helper.php +100 -0
  96. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/email_helper.php +62 -0
  97. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/file_helper.php +464 -0
  98. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/form_helper.php +1025 -0
  99. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/html_helper.php +416 -0
  100. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/index.html +10 -0
  101. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/inflector_helper.php +171 -0
  102. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/language_helper.php +58 -0
  103. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/number_helper.php +75 -0
  104. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/path_helper.php +72 -0
  105. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/security_helper.php +126 -0
  106. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/smiley_helper.php +273 -0
  107. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/string_helper.php +273 -0
  108. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/text_helper.php +462 -0
  109. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/typography_helper.php +71 -0
  110. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/url_helper.php +593 -0
  111. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/helpers/xml_helper.php +62 -0
  112. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/index.html +10 -0
  113. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/calendar_lang.php +51 -0
  114. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/date_lang.php +60 -0
  115. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/db_lang.php +28 -0
  116. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/email_lang.php +24 -0
  117. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/form_validation_lang.php +24 -0
  118. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/ftp_lang.php +17 -0
  119. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/imglib_lang.php +24 -0
  120. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/index.html +10 -0
  121. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/number_lang.php +10 -0
  122. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/profiler_lang.php +19 -0
  123. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/scaffolding_lang.php +17 -0
  124. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/unit_test_lang.php +24 -0
  125. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/upload_lang.php +22 -0
  126. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/english/validation_lang.php +24 -0
  127. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/language/index.html +10 -0
  128. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Benchmark.php +113 -0
  129. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Calendar.php +477 -0
  130. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Cart.php +550 -0
  131. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Config.php +244 -0
  132. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Controller.php +127 -0
  133. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Email.php +2041 -0
  134. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Encrypt.php +484 -0
  135. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Exceptions.php +174 -0
  136. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Form_validation.php +1278 -0
  137. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Ftp.php +618 -0
  138. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Hooks.php +226 -0
  139. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Image_lib.php +1544 -0
  140. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Input.php +1067 -0
  141. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Language.php +123 -0
  142. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Loader.php +1085 -0
  143. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Log.php +117 -0
  144. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Model.php +83 -0
  145. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Output.php +409 -0
  146. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Pagination.php +244 -0
  147. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Parser.php +173 -0
  148. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Profiler.php +392 -0
  149. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Router.php +389 -0
  150. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Session.php +758 -0
  151. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Sha1.php +251 -0
  152. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Table.php +440 -0
  153. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Trackback.php +547 -0
  154. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Typography.php +406 -0
  155. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/URI.php +586 -0
  156. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Unit_test.php +347 -0
  157. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Upload.php +970 -0
  158. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/User_agent.php +502 -0
  159. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Validation.php +875 -0
  160. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Xmlrpc.php +1421 -0
  161. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Xmlrpcs.php +536 -0
  162. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/Zip.php +359 -0
  163. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/libraries/index.html +10 -0
  164. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/logs/index.html +10 -0
  165. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/plugins/captcha_pi.php +356 -0
  166. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/plugins/index.html +10 -0
  167. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/plugins/js_calendar_pi.php +629 -0
  168. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/Scaffolding.php +291 -0
  169. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/images/background.jpg +0 -0
  170. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/images/index.html +10 -0
  171. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/images/logo.jpg +0 -0
  172. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/index.html +10 -0
  173. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/add.php +32 -0
  174. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/delete.php +9 -0
  175. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/edit.php +33 -0
  176. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/footer.php +10 -0
  177. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/header.php +29 -0
  178. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/index.html +10 -0
  179. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/no_data.php +8 -0
  180. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/stylesheet.css +143 -0
  181. data/generators/ci_app/templates/CodeIgniter_1.7.2/system/scaffolding/views/view.php +27 -0
  182. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/changelog.html +1080 -0
  183. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/active_record.html +757 -0
  184. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/caching.html +220 -0
  185. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/call_function.html +118 -0
  186. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/configuration.html +157 -0
  187. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/connecting.html +186 -0
  188. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/examples.html +217 -0
  189. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/fields.html +163 -0
  190. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/forge.html +234 -0
  191. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/helpers.html +151 -0
  192. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/index.html +99 -0
  193. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/queries.html +153 -0
  194. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/results.html +238 -0
  195. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/table_data.html +113 -0
  196. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/transactions.html +200 -0
  197. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/database/utilities.html +295 -0
  198. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/doc_style/index.html +86 -0
  199. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/doc_style/template.html +128 -0
  200. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/alternative_php.html +147 -0
  201. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/ancillary_classes.html +117 -0
  202. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/autoloader.html +101 -0
  203. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/caching.html +115 -0
  204. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/common_functions.html +119 -0
  205. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/controllers.html +385 -0
  206. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/core_classes.html +185 -0
  207. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/creating_libraries.html +298 -0
  208. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/credits.html +86 -0
  209. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/errors.html +138 -0
  210. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/helpers.html +185 -0
  211. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/hooks.html +167 -0
  212. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/libraries.html +94 -0
  213. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/managing_apps.html +133 -0
  214. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/models.html +251 -0
  215. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/plugins.html +127 -0
  216. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/profiling.html +104 -0
  217. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/quick_reference.html +77 -0
  218. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/requirements.html +82 -0
  219. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/reserved_names.html +156 -0
  220. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/routing.html +176 -0
  221. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/scaffolding.html +147 -0
  222. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/security.html +153 -0
  223. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/styleguide.html +687 -0
  224. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/urls.html +151 -0
  225. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/general/views.html +274 -0
  226. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/array_helper.html +119 -0
  227. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/compatibility_helper.html +118 -0
  228. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/cookie_helper.html +147 -0
  229. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/date_helper.html +408 -0
  230. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/directory_helper.html +143 -0
  231. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/download_helper.html +112 -0
  232. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/email_helper.html +102 -0
  233. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/file_helper.html +178 -0
  234. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/form_helper.html +484 -0
  235. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/html_helper.html +385 -0
  236. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/inflector_helper.html +151 -0
  237. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/language_helper.html +98 -0
  238. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/number_helper.html +107 -0
  239. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/path_helper.html +106 -0
  240. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/security_helper.html +125 -0
  241. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/smiley_helper.html +215 -0
  242. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/string_helper.html +176 -0
  243. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/text_helper.html +192 -0
  244. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/typography_helper.html +112 -0
  245. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/url_helper.html +289 -0
  246. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/helpers/xml_helper.html +105 -0
  247. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/appflowchart.gif +0 -0
  248. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/arrow.gif +0 -0
  249. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/ci_logo.jpg +0 -0
  250. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/ci_logo_flame.jpg +0 -0
  251. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/ci_quick_ref.png +0 -0
  252. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/codeigniter_1.7.1_helper_reference.pdf +0 -0
  253. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/codeigniter_1.7.1_helper_reference.png +0 -0
  254. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/codeigniter_1.7.1_library_reference.pdf +0 -0
  255. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/codeigniter_1.7.1_library_reference.png +0 -0
  256. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/file.gif +0 -0
  257. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/folder.gif +0 -0
  258. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/nav_bg_darker.jpg +0 -0
  259. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/nav_separator_darker.jpg +0 -0
  260. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/nav_toggle_darker.jpg +0 -0
  261. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/smile.gif +0 -0
  262. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/images/transparent.gif +0 -0
  263. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/index.html +99 -0
  264. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/downloads.html +105 -0
  265. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/index.html +97 -0
  266. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/troubleshooting.html +90 -0
  267. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_120.html +92 -0
  268. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_130.html +203 -0
  269. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_131.html +102 -0
  270. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_132.html +100 -0
  271. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_133.html +112 -0
  272. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_140.html +145 -0
  273. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_141.html +148 -0
  274. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_150.html +178 -0
  275. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_152.html +111 -0
  276. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_153.html +100 -0
  277. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_154.html +116 -0
  278. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_160.html +125 -0
  279. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_161.html +98 -0
  280. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_162.html +106 -0
  281. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_163.html +99 -0
  282. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_170.html +121 -0
  283. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_171.html +98 -0
  284. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_172.html +105 -0
  285. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrade_b11.html +144 -0
  286. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/installation/upgrading.html +101 -0
  287. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/benchmark.html +198 -0
  288. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/calendar.html +249 -0
  289. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/cart.html +346 -0
  290. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/config.html +181 -0
  291. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/email.html +307 -0
  292. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/encryption.html +182 -0
  293. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/file_uploading.html +451 -0
  294. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/form_validation.html +1221 -0
  295. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/ftp.html +303 -0
  296. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/image_lib.html +666 -0
  297. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/input.html +231 -0
  298. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/language.html +137 -0
  299. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/loader.html +214 -0
  300. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/output.html +145 -0
  301. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/pagination.html +218 -0
  302. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/parser.html +208 -0
  303. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/sessions.html +311 -0
  304. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/table.html +292 -0
  305. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/trackback.html +246 -0
  306. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/typography.html +160 -0
  307. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/unit_testing.html +205 -0
  308. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/uri.html +252 -0
  309. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/user_agent.html +201 -0
  310. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/validation.html +740 -0
  311. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/xmlrpc.html +517 -0
  312. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/libraries/zip.html +278 -0
  313. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/license.html +107 -0
  314. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/hacks.txt +9 -0
  315. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/moo.fx.js +119 -0
  316. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/moo.fx.pack.js +241 -0
  317. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/nav.js +139 -0
  318. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/prototype.lite.js +127 -0
  319. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/nav/user_guide_menu.js +4 -0
  320. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/appflow.html +95 -0
  321. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/at_a_glance.html +172 -0
  322. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/cheatsheets.html +83 -0
  323. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/features.html +120 -0
  324. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/getting_started.html +92 -0
  325. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/goals.html +98 -0
  326. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/index.html +84 -0
  327. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/overview/mvc.html +100 -0
  328. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/toc.html +209 -0
  329. data/generators/ci_app/templates/CodeIgniter_1.7.2/user_guide/userguide.css +406 -0
  330. data/generators/ci_app/templates/README +1 -0
  331. data/generators/ci_controller/USAGE +2 -0
  332. data/generators/ci_controller/ci_controller_generator.rb +11 -0
  333. data/generators/ci_controller/templates/ci_controller.php.erb +15 -0
  334. data/generators/ci_controller/templates/ci_view.php.erb +8 -0
  335. data/generators/ci_layout/USAGE +2 -0
  336. data/generators/ci_layout/ci_layout_generator.rb +24 -0
  337. data/generators/ci_layout/templates/application_layout.php.erb +19 -0
  338. data/generators/ci_model/USAGE +2 -0
  339. data/generators/ci_model/ci_model_generator.rb +42 -0
  340. data/generators/ci_model/templates/ci_model.php.erb +15 -0
  341. data/generators/ci_model/templates/model.rb +5 -0
  342. data/generators/ci_model/templates/model_migration.rb.erb +16 -0
  343. data/init.rb +1 -0
  344. data/install.rb +1 -0
  345. data/lib/codeigniter_vender.rb +1 -0
  346. data/lib/tasks/app.rake +8 -0
  347. data/test/codeigniter_vender_test.rb +8 -0
  348. data/test/test_helper.rb +3 -0
  349. data/uninstall.rb +1 -0
  350. metadata +411 -0
@@ -0,0 +1,687 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>Style Guide : CodeIgniter User Guide</title>
7
+
8
+ <style type='text/css' media='all'>@import url('../userguide.css');</style>
9
+ <link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
10
+
11
+ <style type="text/css" media="screen">
12
+ code {
13
+ white-space: pre;
14
+ }
15
+ </style>
16
+
17
+ <script type="text/javascript" src="../nav/nav.js"></script>
18
+ <script type="text/javascript" src="../nav/prototype.lite.js"></script>
19
+ <script type="text/javascript" src="../nav/moo.fx.js"></script>
20
+ <script type="text/javascript" src="../nav/user_guide_menu.js"></script>
21
+
22
+ <meta http-equiv='expires' content='-1' />
23
+ <meta http-equiv= 'pragma' content='no-cache' />
24
+ <meta name='robots' content='all' />
25
+ <meta name='author' content='ExpressionEngine Dev Team' />
26
+ <meta name='description' content='CodeIgniter User Guide' />
27
+
28
+ </head>
29
+ <body>
30
+
31
+ <!-- START NAVIGATION -->
32
+ <div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
33
+ <div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
34
+ <div id="masthead">
35
+ <table cellpadding="0" cellspacing="0" border="0" style="width:100%">
36
+ <tr>
37
+ <td><h1>CodeIgniter User Guide Version 1.7.2</h1></td>
38
+ <td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
39
+ </tr>
40
+ </table>
41
+ </div>
42
+ <!-- END NAVIGATION -->
43
+
44
+
45
+ <!-- START BREADCRUMB -->
46
+ <table cellpadding="0" cellspacing="0" border="0" style="width:100%">
47
+ <tr>
48
+ <td id="breadcrumb">
49
+ <a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
50
+ <a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
51
+ Style Guide
52
+ </td>
53
+ <td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
54
+ </tr>
55
+ </table>
56
+ <!-- END BREADCRUMB -->
57
+
58
+ <br clear="all" />
59
+
60
+
61
+ <!-- START CONTENT -->
62
+ <div id="content">
63
+
64
+
65
+ <h1>General Style and Syntax</h1>
66
+
67
+ <p>The following page describes the coding rules use adhere to when developing CodeIgniter.</p>
68
+
69
+
70
+ <h2>Table of Contents</h2>
71
+ <ul class="minitoc">
72
+ <li><a href="#file_format">File Format</a></li>
73
+ <li><a href="#php_closing_tag">PHP Closing Tag</a></li>
74
+ <li><a href="#class_and_method_naming">Class and Method Naming</a></li>
75
+ <li><a href="#variable_names">Variable Names</a></li>
76
+ <li><a href="#commenting">Commenting</a></li>
77
+ <li><a href="#constants">Constants</a></li>
78
+ <li><a href="#true_false_and_null">TRUE, FALSE, and NULL</a></li>
79
+ <li><a href="#logical_operators">Logical Operators</a></li>
80
+ <li><a href="#comparing_return_values_and_typecasting">Comparing Return Values and Typecasting</a></li>
81
+ <li><a href="#debugging_code">Debugging Code</a></li>
82
+ <li><a href="#whitespace_in_files">Whitespace in Files</a></li>
83
+ <li><a href="#compatibility">Compatibility</a></li>
84
+ <li><a href="#class_and_file_names_using_common_words">Class and File Names using Common Words</a></li>
85
+ <li><a href="#database_table_names">Database Table Names</a></li>
86
+ <li><a href="#one_file_per_class">One File per Class</a></li>
87
+ <li><a href="#whitespace">Whitespace</a></li>
88
+ <li><a href="#line_breaks">Line Breaks</a></li>
89
+ <li><a href="#code_indenting">Code Indenting</a></li>
90
+ <li><a href="#bracket_spacing">Bracket and Parenthetic Spacing</li>
91
+ <li><a href="#localized_text_in_control_panel">Localized Text in Control Panel</a></li>
92
+ <li><a href="#private_methods_and_variables">Private Methods and Variables</a></li>
93
+ <li><a href="#php_errors">PHP Errors</a></li>
94
+ <li><a href="#short_open_tags">Short Open Tags</a></li>
95
+ <li><a href="#one_statement_per_line">One Statement Per Line</a></li>
96
+ <li><a href="#strings">Strings</a></li>
97
+ <li><a href="#sql_queries">SQL Queries</a></li>
98
+ <li><a href="#default_function_arguments">Default Function Arguments</a></li>
99
+ <li><a href="#overlapping_tag_parameters">Overlapping Tag Parameters</a></li>
100
+ </ul>
101
+
102
+ <li>
103
+
104
+ <h2><a name="file_format"></a>File Format</h2>
105
+ <div class="guidelineDetails">
106
+ <p>Files should be saved with Unicode (UTF-8) encoding. The <abbr title="Byte Order Mark">BOM</abbr>
107
+ should <em>not</em> be used. Unlike UTF-16 and UTF-32, there's no byte order to indicate in
108
+ a UTF-8 encoded file, and the <abbr title="Byte Order Mark">BOM</abbr> can have a negative side effect in PHP of sending output,
109
+ preventing the application from being able to set its own headers. Unix line endings should
110
+ be used (LF).</p>
111
+
112
+ <p>Here is how to apply these settings in some of the more common text editors. Instructions for your
113
+ text editor may vary; check your text editor's documentation.</p>
114
+
115
+ <h5>TextMate</h5>
116
+
117
+ <ol>
118
+ <li>Open the Application Preferences</li>
119
+ <li>Click Advanced, and then the "Saving" tab</li>
120
+ <li>In "File Encoding", select "UTF-8 (recommended)"</li>
121
+ <li>In "Line Endings", select "LF (recommended)"</li>
122
+ <li><em>Optional:</em> Check "Use for existing files as well" if you wish to modify the line
123
+ endings of files you open to your new preference.</li>
124
+ </ol>
125
+
126
+ <h5>BBEdit</h5>
127
+
128
+ <ol>
129
+ <li>Open the Application Preferences</li>
130
+ <li>Select "Text Encodings" on the left.</li>
131
+ <li>In "Default text encoding for new documents", select "Unicode (UTF-8, no BOM)"</li>
132
+ <li><em>Optional:</em> In "If file's encoding can't be guessed, use", select
133
+ "Unicode (UTF-8, no BOM)"</li>
134
+ <li>Select "Text Files" on the left.</li>
135
+ <li>In "Default line breaks", select "Mac OS X and Unix (LF)"</li>
136
+ </ol>
137
+ </div>
138
+
139
+ <h2><a name="php_closing_tag"></a>PHP Closing Tag</h2>
140
+ <div class="guidelineDetails">
141
+ <p>The PHP closing tag on a PHP document <strong>?&gt;</strong> is optional to the PHP parser. However, if used, any whitespace following the closing tag, whether introduced
142
+ by the developer, user, or an FTP application, can cause unwanted output, PHP errors, or if the latter are suppressed, blank pages. For this reason, all PHP files should
143
+ <strong>OMIT</strong> the closing PHP tag, and instead use a comment block to mark the end of file and it's location relative to the application root.
144
+ This allows you to still identify a file as being complete and not truncated.</p>
145
+ <code><strong>INCORRECT</strong>:
146
+ &lt;?php
147
+
148
+ echo "Here's my code!";
149
+
150
+ ?&gt;
151
+
152
+ <strong>CORRECT</strong>:
153
+ &lt;?php
154
+
155
+ echo "Here's my code!";
156
+
157
+ /* End of file myfile.php */
158
+ /* Location: ./system/modules/mymodule/myfile.php */
159
+ </code>
160
+ </div>
161
+
162
+
163
+ <h2><a name="class_and_method_naming"></a>Class and Method Naming</h2>
164
+ <div class="guidelineDetails">
165
+ <p>Class names should always have their first letter uppercase, and the constructor method should match identically. Multiple words should be separated with an underscore, and not CamelCased. All other class methods should be entirely lowercased and named to clearly indicate their function, preferably including a verb. Try to avoid overly long and verbose names.</p>
166
+
167
+ <code><strong>INCORRECT</strong>:
168
+ class superclass
169
+ class SuperClass
170
+
171
+ <strong>CORRECT</strong>:
172
+ class Super_class</code>
173
+
174
+ <p>Notice that the Class and constructor methods are identically named and cased:</p>
175
+
176
+ <code>class Super_class {
177
+
178
+ function Super_class()
179
+ {
180
+
181
+ }
182
+ }</code>
183
+
184
+ <p>Examples of improper and proper method naming:</p>
185
+
186
+ <code><strong>INCORRECT</strong>:
187
+ function fileproperties() // not descriptive and needs underscore separator
188
+ function fileProperties() // not descriptive and uses CamelCase
189
+ function getfileproperties() // Better! But still missing underscore separator
190
+ function getFileProperties() // uses CamelCase
191
+ function get_the_file_properties_from_the_file() // wordy
192
+
193
+ <strong>CORRECT</strong>:
194
+ function get_file_properties() // descriptive, underscore separator, and all lowercase letters</code>
195
+
196
+ </div>
197
+
198
+
199
+ <h2><a name="variable_names"></a>Variable Names</h2>
200
+ <div class="guidelineDetails">
201
+ <p>The guidelines for variable naming is very similar to that used for class methods. Namely, variables should contain only lowercase letters, use underscore separators, and be reasonably named to indicate their purpose and contents. Very short, non-word variables should only be used as iterators in for() loops.</p>
202
+ <code><strong>INCORRECT</strong>:
203
+ $j = &apos;foo&apos;; // single letter variables should only be used in for() loops
204
+ $Str // contains uppercase letters
205
+ $bufferedText // uses CamelCasing, and could be shortened without losing semantic meaning
206
+ $groupid // multiple words, needs underscore separator
207
+ $name_of_last_city_used // too long
208
+
209
+ <strong>CORRECT</strong>:
210
+ for ($j = 0; $j &lt; 10; $j++)
211
+ $str
212
+ $buffer
213
+ $group_id
214
+ $last_city
215
+ </code>
216
+ </div>
217
+
218
+
219
+ <h2><a name="commenting"></a>Commenting</h2>
220
+ <div class="guidelineDetails">
221
+ <p>In general, code should be commented prolifically. It not only helps describe the flow and intent of the code for less experienced programmers, but can prove invaluable when returning to your own code months down the line. There is not a required format for comments, but the following are recommended.</p>
222
+
223
+ <p><a href="http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#basics.docblock">DocBlock</a> style comments preceding class and method declarations so they can be picked up by IDEs:</p>
224
+
225
+ <code>/**
226
+ * Super Class
227
+ *
228
+ * @package Package Name
229
+ * @subpackage Subpackage
230
+ * @category Category
231
+ * @author Author Name
232
+ * @link http://example.com
233
+ */
234
+ class Super_class {</code>
235
+
236
+ <code>/**
237
+ * Encodes string for use in XML
238
+ *
239
+ * @access public
240
+ * @param string
241
+ * @return string
242
+ */
243
+ function xml_encode($str)</code>
244
+
245
+ <p>Use single line comments within code, leaving a blank line between large comment blocks and code.</p>
246
+
247
+ <code>// break up the string by newlines
248
+ $parts = explode("\n", $str);
249
+
250
+ // A longer comment that needs to give greater detail on what is
251
+ // occurring and why can use multiple single-line comments. Try to
252
+ // keep the width reasonable, around 70 characters is the easiest to
253
+ // read. Don't hesitate to link to permanent external resources
254
+ // that may provide greater detail:
255
+ //
256
+ // http://example.com/information_about_something/in_particular/
257
+
258
+ $parts = $this->foo($parts);
259
+ </code>
260
+ </div>
261
+
262
+
263
+ <h2><a name="constants"></a>Constants</h2>
264
+ <div class="guidelineDetails">
265
+ <p>Constants follow the same guidelines as do variables, except constants should always be fully uppercase. <em>Always use CodeIgniter constants when appropriate, i.e. SLASH, LD, RD, PATH_CACHE, etc.</em></p>
266
+ <code><strong>INCORRECT</strong>:
267
+ myConstant // missing underscore separator and not fully uppercase
268
+ N // no single-letter constants
269
+ S_C_VER // not descriptive
270
+ $str = str_replace('{foo}', 'bar', $str); // should use LD and RD constants
271
+
272
+ <strong>CORRECT</strong>:
273
+ MY_CONSTANT
274
+ NEWLINE
275
+ SUPER_CLASS_VERSION
276
+ $str = str_replace(LD.'foo'.RD, 'bar', $str);
277
+ </code>
278
+ </div>
279
+
280
+
281
+ <h2><a name="true_false_and_null"></a>TRUE, FALSE, and NULL</h2>
282
+ <div class="guidelineDetails">
283
+ <p><strong>TRUE</strong>, <strong>FALSE</strong>, and <strong>NULL</strong> keywords should always be fully uppercase.</p>
284
+ <code><strong>INCORRECT</strong>:
285
+ if ($foo == true)
286
+ $bar = false;
287
+ function foo($bar = null)
288
+
289
+ <strong>CORRECT</strong>:
290
+ if ($foo == TRUE)
291
+ $bar = FALSE;
292
+ function foo($bar = NULL)</code>
293
+ </div>
294
+
295
+
296
+
297
+ <h2><a name="logical_operators"></a>Logical Operators</h2>
298
+ <div class="guidelineDetails">
299
+ <p>Use of <strong>||</strong> is discouraged as its clarity on some output devices is low (looking like the number 11 for instance).
300
+ <strong>&amp;&amp;</strong> is preferred over <strong>AND</strong> but either are acceptable, and a space should always precede and follow <strong>!</strong>.</p>
301
+ <code><strong>INCORRECT</strong>:
302
+ if ($foo || $bar)
303
+ if ($foo AND $bar) // okay but not recommended for common syntax highlighting applications
304
+ if (!$foo)
305
+ if (! is_array($foo))
306
+
307
+ <strong>CORRECT</strong>:
308
+ if ($foo OR $bar)
309
+ if ($foo && $bar) // recommended
310
+ if ( ! $foo)
311
+ if ( ! is_array($foo))
312
+ </code>
313
+ </div>
314
+
315
+
316
+
317
+ <h2><a name="comparing_return_values_and_typecasting"></a>Comparing Return Values and Typecasting</h2>
318
+ <div class="guidelineDetails">
319
+ <p>Some PHP functions return FALSE on failure, but may also have a valid return value of "" or 0, which would evaluate to FALSE in loose comparisons. Be explicit by comparing the variable type when using these return values in conditionals to ensure the return value is indeed what you expect, and not a value that has an equivalent loose-type evaluation.</p>
320
+ <p>Use the same stringency in returning and checking your own variables. Use <strong>===</strong> and <strong>!==</strong> as necessary.
321
+
322
+ <code><strong>INCORRECT</strong>:
323
+ // If 'foo' is at the beginning of the string, strpos will return a 0,
324
+ // resulting in this conditional evaluating as TRUE
325
+ if (strpos($str, 'foo') == FALSE)
326
+
327
+ <strong>CORRECT</strong>:
328
+ if (strpos($str, 'foo') === FALSE)
329
+ </code>
330
+
331
+ <code><strong>INCORRECT</strong>:
332
+ function build_string($str = "")
333
+ {
334
+ if ($str == "") // uh-oh! What if FALSE or the integer 0 is passed as an argument?
335
+ {
336
+
337
+ }
338
+ }
339
+
340
+ <strong>CORRECT</strong>:
341
+ function build_string($str = "")
342
+ {
343
+ if ($str === "")
344
+ {
345
+
346
+ }
347
+ }</code>
348
+
349
+ <p>See also information regarding <a href="http://us3.php.net/manual/en/language.types.type-juggling.php#language.types.typecasting">typecasting</a>, which can be quite useful. Typecasting has a slightly different effect which may be desirable. When casting a variable as a string, for instance, NULL and boolean FALSE variables become empty strings, 0 (and other numbers) become strings of digits, and boolean TRUE becomes "1":</p>
350
+
351
+ <code>$str = (string) $str; // cast $str as a string</code>
352
+
353
+ </div>
354
+
355
+
356
+ <h2><a name="debugging_code"></a>Debugging Code</h2>
357
+ <div class="guidelineDetails">
358
+ <p>No debugging code can be left in place for submitted add-ons unless it is commented out, i.e. no var_dump(), print_r(), die(), and exit() calls that were used while creating the add-on, unless they are commented out.</p>
359
+
360
+ <code>// print_r($foo);</code>
361
+ </div>
362
+
363
+
364
+
365
+ <h2><a name="whitespace_in_files"></a>Whitespace in Files</h2>
366
+ <div class="guidelineDetails">
367
+ <p>No whitespace can precede the opening PHP tag or follow the closing PHP tag. Output is buffered, so whitespace in your files can cause output to begin before CodeIgniter outputs its content, leading to errors and an inability for CodeIgniter to send proper headers. In the examples below, select the text with your mouse to reveal the incorrect whitespace.</p>
368
+
369
+ <p><strong>INCORRECT</strong>:</p>
370
+ <code>
371
+ &lt;?php
372
+ // ...there is whitespace and a linebreak above the opening PHP tag
373
+ // as well as whitespace after the closing PHP tag
374
+ ?&gt;
375
+ </code>
376
+ <p><strong>CORRECT</strong>:</p>
377
+ <code>&lt;?php
378
+ // this sample has no whitespace before or after the opening and closing PHP tags
379
+ ?&gt;</code>
380
+
381
+ </div>
382
+
383
+
384
+ <h2><a name="compatibility"></a>Compatibility</h2>
385
+ <div class="guidelineDetails">
386
+ <p>Unless specifically mentioned in your add-on's documentation, all code must be compatible with PHP version 4.3+. Additionally, do not use PHP functions that require non-default libraries to be installed unless your code contains an alternative method when the function is not available, or you implicitly document that your add-on requires said PHP libraries.</p>
387
+ </div>
388
+
389
+
390
+
391
+ <h2><a name="class_and_file_names_using_common_words"></a>Class and File Names using Common Words</h2>
392
+ <div class="guidelineDetails">
393
+ <p>When your class or filename is a common word, or might quite likely be identically named in another PHP script, provide a unique prefix to help prevent collision. Always realize that your end users may be running other add-ons or third party PHP scripts. Choose a prefix that is unique to your identity as a developer or company.</p>
394
+
395
+ <code><strong>INCORRECT</strong>:
396
+ class Email pi.email.php
397
+ class Xml ext.xml.php
398
+ class Import mod.import.php
399
+
400
+ <strong>CORRECT</strong>:
401
+ class Pre_email pi.pre_email.php
402
+ class Pre_xml ext.pre_xml.php
403
+ class Pre_import mod.pre_import.php
404
+ </code>
405
+ </div>
406
+
407
+
408
+ <h2><a name="database_table_names"></a>Database Table Names</h2>
409
+ <div class="guidelineDetails">
410
+ <p>Any tables that your add-on might use must use the 'exp_' prefix, followed by a prefix uniquely identifying you as the developer or company, and then a short descriptive table name. You do not need to be concerned about the database prefix being used on the user's installation, as CodeIgniter's database class will automatically convert 'exp_' to what is actually being used.</p>
411
+
412
+ <code><strong>INCORRECT</strong>:
413
+ email_addresses // missing both prefixes
414
+ pre_email_addresses // missing exp_ prefix
415
+ exp_email_addresses // missing unique prefix
416
+
417
+ <strong>CORRECT</strong>:
418
+ exp_pre_email_addresses
419
+ </code>
420
+
421
+ <p class="important"><strong>NOTE:</strong> Be mindful that MySQL has a limit of 64 characters for table names. This should not be an issue as table names that would exceed this would likely have unreasonable names. For instance, the following table name exceeds this limitation by one character. Silly, no? <strong>exp_pre_email_addresses_of_registered_users_in_seattle_washington</strong>
422
+ </div>
423
+
424
+
425
+
426
+ <h2><a name="one_file_per_class"></a>One File per Class</h2>
427
+ <div class="guidelineDetails">
428
+ <p>Use separate files for each class your add-on uses, unless the classes are <em>closely related</em>. An example of CodeIgniter files that contains multiple classes is the Database class file, which contains both the DB class and the DB_Cache class, and the Magpie plugin, which contains both the Magpie and Snoopy classes.</p>
429
+ </div>
430
+
431
+
432
+
433
+ <h2><a name="whitespace"></a>Whitespace</h2>
434
+ <div class="guidelineDetails">
435
+ <p>Use tabs for whitespace in your code, not spaces. This may seem like a small thing, but using tabs instead of whitespace allows the developer looking at your code to have indentation at levels that they prefer and customize in whatever application they use. And as a side benefit, it results in (slightly) more compact files, storing one tab character versus, say, four space characters.</p>
436
+ </div>
437
+
438
+
439
+
440
+ <h2><a name="line_breaks"></a>Line Breaks</h2>
441
+ <div class="guidelineDetails">
442
+ <p>Files must be saved with Unix line breaks. This is more of an issue for developers who work in Windows, but in any case ensure that your text editor is setup to save files with Unix line breaks.</p>
443
+ </div>
444
+
445
+
446
+
447
+ <h2><a name="code_indenting"></a>Code Indenting</h2>
448
+ <div class="guidelineDetails">
449
+ <p>Use Allman style indenting. With the exception of Class declarations, braces are always placed on a line by themselves, and indented at the same level as the control statement that "owns" them.</p>
450
+
451
+ <code><strong>INCORRECT</strong>:
452
+ function foo($bar) {
453
+ // ...
454
+ }
455
+
456
+ foreach ($arr as $key => $val) {
457
+ // ...
458
+ }
459
+
460
+ if ($foo == $bar) {
461
+ // ...
462
+ } else {
463
+ // ...
464
+ }
465
+
466
+ for ($i = 0; $i &lt; 10; $i++)
467
+ {
468
+ for ($j = 0; $j &lt; 10; $j++)
469
+ {
470
+ // ...
471
+ }
472
+ }
473
+
474
+ <strong>CORRECT</strong>:
475
+ function foo($bar)
476
+ {
477
+ // ...
478
+ }
479
+
480
+ foreach ($arr as $key => $val)
481
+ {
482
+ // ...
483
+ }
484
+
485
+ if ($foo == $bar)
486
+ {
487
+ // ...
488
+ }
489
+ else
490
+ {
491
+ // ...
492
+ }
493
+
494
+ for ($i = 0; $i &lt; 10; $i++)
495
+ {
496
+ for ($j = 0; $j &lt; 10; $j++)
497
+ {
498
+ // ...
499
+ }
500
+ }</code>
501
+ </div>
502
+
503
+
504
+ <h2><a name="bracket_spacing"></a>Bracket and Parenthetic Spacing</h2>
505
+ <div class="guidelineDetails">
506
+ <p>In general, parenthesis and brackets should not use any additional spaces. The exception is that a space should always follow PHP control structures that accept arguments with parenthesis (declare, do-while, elseif, for, foreach, if, switch, while), to help distinguish them from functions and increase readability.</p>
507
+
508
+ <code>INCORRECT:
509
+ $arr[ $foo ] = 'foo';
510
+
511
+ CORRECT:
512
+ $arr[$foo] = 'foo'; // no spaces around array keys
513
+
514
+
515
+ INCORRECT:
516
+ function foo ( $bar )
517
+ {
518
+
519
+ }
520
+
521
+ CORRECT:
522
+ function foo($bar) // no spaces around parenthesis in function declarations
523
+ {
524
+
525
+ }
526
+
527
+
528
+ INCORRECT:
529
+ foreach( $query->result() as $row )
530
+
531
+ CORRECT:
532
+ foreach ($query->result() as $row) // single space following PHP control structures, but not in interior parenthesis
533
+ </code>
534
+ </div>
535
+
536
+
537
+
538
+ <h2><a name="localized_text_in_control_panel"></a>Localized Text in Control Panel</h2>
539
+ <div class="guidelineDetails">
540
+ <p>Any text that is output in the control panel should use language variables in your module's lang file to allow localization.</p>
541
+
542
+ <code>INCORRECT:
543
+ return "Invalid Selection";
544
+
545
+ CORRECT:
546
+ return $LANG->line('invalid_selection');</code>
547
+ </div>
548
+
549
+
550
+
551
+ <h2><a name="private_methods_and_variables"></a>Private Methods and Variables</h2>
552
+ <div class="guidelineDetails">
553
+ <p>Methods and variables that are only accessed internally by your class, such as utility and helper functions that your public methods use for code abstraction, should be prefixed with an underscore.</p>
554
+
555
+ <code>convert_text() // public method
556
+ _convert_text() // private method</code>
557
+ </div>
558
+
559
+
560
+
561
+ <h2><a name="php_errors"></a>PHP Errors</h2>
562
+ <div class="guidelineDetails">
563
+ <p>Code must run error free and not rely on warnings and notices to be hidden to meet this requirement. For instance, never access a variable that you did not set yourself (such as $_POST array keys) without first checking to see that it isset().</p>
564
+
565
+ <p>Make sure that while developing your add-on, error reporting is enabled for ALL users, and that display_errors is enabled in the PHP environment. You can check this setting with:</p>
566
+
567
+ <code>if (ini_get('display_errors') == 1)
568
+ {
569
+ exit "Enabled";
570
+ }</code>
571
+
572
+ <p>On some servers where display_errors is disabled, and you do not have the ability to change this in the php.ini, you can often enable it with:</p>
573
+
574
+ <code>ini_set('display_errors', 1);</code>
575
+
576
+ <p class="important"><strong>NOTE:</strong> Setting the <a href="http://us.php.net/manual/en/ref.errorfunc.php#ini.display-errors">display_errors</a> setting with ini_set() at runtime is not identical to having it enabled in the PHP environment. Namely, it will not have any effect if the script has fatal errors</p>
577
+ </div>
578
+
579
+
580
+
581
+ <h2><a name="short_open_tags"></a>Short Open Tags</h2>
582
+ <div class="guidelineDetails">
583
+ <p>Always use full PHP opening tags, in case a server does not have short_open_tag enabled.</p>
584
+
585
+ <code><strong>INCORRECT</strong>:
586
+ &lt;? echo $foo; ?&gt;
587
+
588
+ &lt;?=$foo?&gt;
589
+
590
+ <strong>CORRECT</strong>:
591
+ &lt;?php echo $foo; ?&gt;</code>
592
+ </div>
593
+
594
+
595
+
596
+ <h2><a name="one_statement_per_line"></a>One Statement Per Line</h2>
597
+ <div class="guidelineDetails">
598
+ <p>Never combine statements on one line.</p>
599
+
600
+ <code><strong>INCORRECT</strong>:
601
+ $foo = 'this'; $bar = 'that'; $bat = str_replace($foo, $bar, $bag);
602
+
603
+ <strong>CORRECT</strong>:
604
+ $foo = 'this';
605
+ $bar = 'that';
606
+ $bat = str_replace($foo, $bar, $bag);
607
+ </code>
608
+ </div>
609
+
610
+
611
+
612
+ <h2><a name="strings"></a>Strings</h2>
613
+ <div class="guidelineDetails">
614
+ <p>Always use single quoted strings unless you need variables parsed, and in cases where you do need variables parsed, use braces to prevent greedy token parsing. You may also use double-quoted strings if the string contains single quotes, so you do not have to use escape characters.</p>
615
+
616
+ <code><strong>INCORRECT</strong>:
617
+ "My String" // no variable parsing, so no use for double quotes
618
+ "My string $foo" // needs braces
619
+ 'SELECT foo FROM bar WHERE baz = \'bag\'' // ugly
620
+
621
+ <strong>CORRECT</strong>:
622
+ 'My String'
623
+ "My string {$foo}"
624
+ "SELECT foo FROM bar WHERE baz = 'bag'"</code>
625
+ </div>
626
+
627
+
628
+
629
+ <h2><a name="sql_queries"></a>SQL Queries</h2>
630
+ <div class="guidelineDetails">
631
+ <p>MySQL keywords are always capitalized: SELECT, INSERT, UPDATE, WHERE, AS, JOIN, ON, IN, etc.</p>
632
+
633
+ <p>Break up long queries into multiple lines for legibility, preferably breaking for each clause.</p>
634
+
635
+ <code><strong>INCORRECT</strong>:
636
+ // keywords are lowercase and query is too long for
637
+ // a single line (... indicates continuation of line)
638
+ $query = $this->db->query("select foo, bar, baz, foofoo, foobar as raboof, foobaz from exp_pre_email_addresses
639
+ ...where foo != 'oof' and baz != 'zab' order by foobaz limit 5, 100");
640
+
641
+ <strong>CORRECT</strong>:
642
+ $query = $this->db->query("SELECT foo, bar, baz, foofoo, foobar AS raboof, foobaz
643
+ FROM exp_pre_email_addresses
644
+ WHERE foo != 'oof'
645
+ AND baz != 'zab'
646
+ ORDER BY foobaz
647
+ LIMIT 5, 100");</code>
648
+ </div>
649
+
650
+
651
+
652
+ <h2><a name="default_function_arguments"></a>Default Function Arguments</h2>
653
+ <div class="guidelineDetails">
654
+ <p>Whenever appropriate, provide function argument defaults, which helps prevent PHP errors with mistaken calls and provides common fallback values which can save a few lines of code. Example:</p>
655
+
656
+ <code>function foo($bar = '', $baz = FALSE)</code>
657
+ </div>
658
+
659
+
660
+
661
+ <h2><a name="overlapping_tag_parameters"></a>Overlapping Tag Parameters</h2>
662
+ <div class="guidelineDetails">
663
+ <p>Avoid multiple tag parameters that have effect on the same thing. For instance, instead of <strong>include=</strong> and <strong>exclude=</strong>, perhaps allow <strong>include=</strong> to handle the parameter alone, with the addition of "not", e.g. <strong>include="not bar"</strong>. This will prevent problems of parameters overlapping or having to worry about which parameter has priority over another.</p>
664
+ </div>
665
+
666
+
667
+ </div>
668
+
669
+
670
+
671
+ </div>
672
+ <!-- END CONTENT -->
673
+
674
+
675
+ <div id="footer">
676
+ <p>
677
+ Previous Topic:&nbsp;&nbsp;<a href="security.html">Security</a>
678
+ &nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
679
+ <a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
680
+ <a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
681
+ Next Topic:&nbsp;&nbsp;<a href="../doc_style/index.html">Writing Documentation</a>
682
+ </p>
683
+ <p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006-2010 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">Ellislab, Inc.</a></p>
684
+ </div>
685
+
686
+ </body>
687
+ </html>