Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'staging' of https://github.com/joomla/joomla-platform i…

…nto foldernames
  • Loading branch information...
commit 92f0c48ade217432a98e4154c426716f12259a19 2 parents 1b53f91 + 917d160
@aaronschmitz authored
Showing with 6,979 additions and 3,592 deletions.
  1. +1 −1  README.markdown
  2. +99 −102 build.xml
  3. +360 −128 build/changelog.php
  4. +1 −1  build/phpcs/Joomla/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php
  5. +2 −2 build/phpcs/Joomla/ruleset.xml
  6. +1 −1  docs/coding-standards/en-US/Book_Info.xml
  7. +0 −33 docs/coding-standards/en-US/Chapter.xml
  8. +1 −1  docs/coding-standards/en-US/appendices/Revision_History.xml
  9. +1 −1  docs/coding-standards/en-US/chapters/basic-guidelines.xml
  10. +3 −2 docs/coding-standards/en-US/chapters/comments.xml
  11. +6 −8 docs/coding-standards/en-US/chapters/php.xml
  12. +1 −1  docs/coding-standards/en-US/chapters/source-code-management.xml
  13. +1 −1  docs/manual/en-US/Book_Info.xml
  14. +39 −13 docs/manual/en-US/appendices/analysis.xml
  15. +70 −0 docs/manual/en-US/chapters/classes/jcontrollerbase.xml
  16. +162 −0 docs/manual/en-US/chapters/classes/jhttp.xml
  17. +21 −0 docs/manual/en-US/chapters/classes/jhttpfactory.xml
  18. +11 −0 docs/manual/en-US/chapters/classes/jhttpresponse.xml
  19. +11 −0 docs/manual/en-US/chapters/classes/jhttptransportcurl.xml
  20. +11 −0 docs/manual/en-US/chapters/classes/jhttptransportsocket.xml
  21. +11 −0 docs/manual/en-US/chapters/classes/jhttptransportstream.xml
  22. +51 −0 docs/manual/en-US/chapters/classes/jmodelbase.xml
  23. +73 −0 docs/manual/en-US/chapters/classes/jmodeldatabase.xml
  24. +75 −0 docs/manual/en-US/chapters/classes/jviewbase.xml
  25. +93 −0 docs/manual/en-US/chapters/classes/jviewhtml.xml
  26. +13 −0 docs/manual/en-US/chapters/interfaces/jcontroller.xml
  27. +11 −0 docs/manual/en-US/chapters/interfaces/jhttptransport.xml
  28. +12 −0 docs/manual/en-US/chapters/interfaces/jmodel.xml
  29. +12 −0 docs/manual/en-US/chapters/interfaces/jview.xml
  30. +9 −0 docs/manual/en-US/chapters/introduction.xml
  31. +7 −0 docs/manual/en-US/chapters/packages.xml
  32. +30 −0 docs/manual/en-US/chapters/packages/database.xml
  33. +44 −53 docs/manual/en-US/chapters/packages/github.xml
  34. +28 −0 docs/manual/en-US/chapters/packages/http.xml
  35. +13 −14 docs/manual/en-US/chapters/packages/log.xml
  36. +57 −0 docs/manual/en-US/chapters/packages/mvc.xml
  37. +29 −0 legacy.xml.dist
  38. +8 −3 libraries/import.legacy.php
  39. +15 −5 libraries/joomla/access/access.php
  40. +61 −16 libraries/joomla/application/base.php
  41. +3 −12 libraries/joomla/application/cli.php
  42. +2 −2 libraries/joomla/application/daemon.php
  43. +52 −65 libraries/joomla/application/web.php
  44. +35 −1 libraries/joomla/application/web/client.php
  45. +16 −20 libraries/joomla/archive/archive.php
  46. +58 −55 libraries/joomla/archive/bzip2.php
  47. +67 −22 libraries/joomla/archive/gzip.php
  48. +35 −13 libraries/joomla/archive/tar.php
  49. +114 −55 libraries/joomla/archive/zip.php
  50. +2 −2 libraries/joomla/base/adapter.php
  51. +1 −2  libraries/joomla/cache/cache.php
  52. +2 −2 libraries/joomla/cache/controller.php
  53. +0 −1  libraries/joomla/cache/controller/callback.php
  54. +0 −3  libraries/joomla/cache/controller/page.php
  55. +0 −1  libraries/joomla/cache/controller/view.php
  56. +4 −2 libraries/joomla/cache/storage.php
  57. +0 −1  libraries/joomla/cache/storage/cachelite.php
  58. +2 −2 libraries/joomla/cache/storage/memcache.php
  59. +2 −2 libraries/joomla/cache/storage/memcached.php
  60. +0 −12 libraries/joomla/client/ftp.php
  61. +10 −2 libraries/joomla/client/helper.php
  62. +1 −0  libraries/joomla/client/ldap.php
  63. +137 −0 libraries/joomla/controller/base.php
  64. +51 −0 libraries/joomla/controller/controller.php
  65. +2 −0  libraries/joomla/crypt/cipher/simple.php
  66. +130 −0 libraries/joomla/crypt/crypt.php
  67. +20 −4 libraries/joomla/database/database.php
  68. +1 −2  libraries/joomla/database/database/mysql.php
  69. +1 −2  libraries/joomla/database/database/mysqlexporter.php
  70. +1 −2  libraries/joomla/database/database/mysqli.php
  71. +1 −2  libraries/joomla/database/database/mysqliexporter.php
  72. +1 −2  libraries/joomla/database/database/mysqliimporter.php
  73. +1 −2  libraries/joomla/database/database/mysqlimporter.php
  74. +1 −2  libraries/joomla/database/database/mysqliquery.php
  75. +1 −2  libraries/joomla/database/database/mysqlquery.php
  76. +1 −2  libraries/joomla/database/database/sqlazure.php
  77. +1 −2  libraries/joomla/database/database/sqlazurequery.php
  78. +1 −2  libraries/joomla/database/database/sqlsrv.php
  79. +1 −2  libraries/joomla/database/database/sqlsrvquery.php
  80. +65 −22 libraries/joomla/database/driver.php
  81. +26 −11 libraries/joomla/database/driver/mysql.php
  82. +23 −17 libraries/joomla/database/driver/mysqli.php
  83. +19 −6 libraries/joomla/database/driver/oracle.php
  84. +17 −4 libraries/joomla/database/driver/pdo.php
  85. +70 −30 libraries/joomla/database/driver/postgresql.php
  86. +18 −4 libraries/joomla/database/driver/sqlite.php
  87. +26 −20 libraries/joomla/database/driver/sqlsrv.php
  88. +3 −3 libraries/joomla/database/exporter/mysql.php
  89. +7 −7 libraries/joomla/database/exporter/postgresql.php
  90. +5 −23 libraries/joomla/database/factory.php
  91. +3 −3 libraries/joomla/database/importer/mysql.php
  92. +7 −7 libraries/joomla/database/importer/postgresql.php
  93. +205 −0 libraries/joomla/database/iterator.php
  94. +21 −0 libraries/joomla/database/iterator/azure.php
  95. +58 −0 libraries/joomla/database/iterator/mysql.php
  96. +57 −0 libraries/joomla/database/iterator/mysqli.php
  97. +21 −0 libraries/joomla/database/iterator/oracle.php
  98. +74 −0 libraries/joomla/database/iterator/pdo.php
  99. +21 −0 libraries/joomla/database/iterator/sqlite.php
  100. +57 −0 libraries/joomla/database/iterator/sqlsrv.php
  101. +16 −22 libraries/joomla/database/query/oracle.php
  102. +13 −19 libraries/joomla/database/query/preparable.php
  103. +16 −22 libraries/joomla/database/query/sqlite.php
  104. +6 −9 libraries/joomla/{utilities → date}/date.php
  105. +4 −4 libraries/joomla/document/document.php
  106. +0 −1  libraries/joomla/document/html/html.php
  107. +4 −4 libraries/joomla/document/xml/xml.php
  108. +112 −112 libraries/joomla/environment/browser.php
  109. +81 −80 libraries/joomla/environment/uri.php
  110. +8 −7 libraries/joomla/event/dispatcher.php
  111. +12 −8 libraries/joomla/factory.php
  112. +10 −10 libraries/joomla/filesystem/folder.php
  113. +6 −6 libraries/joomla/filesystem/patcher.php
  114. +74 −74 libraries/joomla/filesystem/stream.php
  115. +32 −32 libraries/joomla/filesystem/streams/string.php
  116. +23 −10 libraries/joomla/form/field.php
  117. +2 −2 libraries/joomla/form/fields/databaseconnection.php
  118. +0 −6 libraries/joomla/form/fields/password.php
  119. +0 −7 libraries/joomla/form/fields/plugins.php
  120. +0 −5 libraries/joomla/form/fields/rules.php
  121. +0 −7 libraries/joomla/form/fields/sql.php
  122. +79 −101 libraries/joomla/form/form.php
  123. +2 −2 libraries/joomla/form/helper.php
  124. +8 −8 libraries/joomla/form/rule.php
  125. +8 −8 libraries/joomla/form/rules/color.php
  126. +8 −15 libraries/joomla/form/rules/email.php
  127. +13 −13 libraries/joomla/form/rules/equals.php
  128. +8 −8 libraries/joomla/form/rules/options.php
  129. +11 −11 libraries/joomla/form/rules/rules.php
  130. +8 −8 libraries/joomla/form/rules/tel.php
  131. +8 −8 libraries/joomla/form/rules/url.php
  132. +8 −14 libraries/joomla/form/rules/username.php
  133. +42 −2 libraries/joomla/github/issues.php
  134. +0 −2  libraries/joomla/html/editor.php
  135. +9 −22 libraries/joomla/html/html.php
  136. +0 −28 libraries/joomla/html/html/access.php
  137. +1 −1  libraries/joomla/html/html/content.php
  138. +1 −1  libraries/joomla/html/html/grid.php
  139. +1 −7 libraries/joomla/html/html/list.php
  140. +2 −2 libraries/joomla/html/html/rules.php
  141. +4 −5 libraries/joomla/html/html/select.php
  142. +0 −13 libraries/joomla/html/html/user.php
  143. +14 −14 libraries/joomla/html/pagination.php
  144. +1 −1  libraries/joomla/http/factory.php
  145. +151 −31 libraries/joomla/http/http.php
  146. +20 −8 libraries/joomla/image/image.php
  147. +26 −0 libraries/joomla/input/files.php
  148. +6 −9 libraries/joomla/input/input.php
  149. +7 −28 libraries/joomla/installer/adapters/component.php
  150. +0 −3  libraries/joomla/installer/adapters/file.php
  151. +7 −7 libraries/joomla/installer/adapters/language.php
  152. +1 −4 libraries/joomla/installer/adapters/module.php
  153. +0 −3  libraries/joomla/installer/adapters/package.php
  154. +48 −20 libraries/joomla/installer/adapters/template.php
  155. +3 −3 libraries/joomla/installer/extension.php
  156. +7 −4 libraries/joomla/installer/helper.php
  157. +51 −51 libraries/joomla/installer/installer.php
  158. +4 −23 libraries/joomla/language/language.php
  159. +78 −0 libraries/joomla/language/stemmer.php
  160. +448 −0 libraries/joomla/language/stemmer/porteren.php
  161. +1 −2  libraries/joomla/language/transliterate.php
  162. +1 −3 libraries/joomla/log/entry.php
  163. +5 −126 libraries/joomla/log/log.php
  164. +14 −0 libraries/joomla/log/logger.php
  165. +14 −32 libraries/joomla/log/loggers/database.php
  166. +22 −11 libraries/joomla/log/loggers/echo.php
  167. +6 −20 libraries/joomla/log/loggers/formattedtext.php
  168. +1 −1  libraries/joomla/log/loggers/messagequeue.php
  169. +11 −11 libraries/joomla/log/loggers/syslog.php
  170. +5 −5 libraries/joomla/log/loggers/w3c.php
  171. +33 −6 libraries/joomla/mail/mail.php
  172. +79 −0 libraries/joomla/model/base.php
  173. +82 −0 libraries/joomla/model/database.php
  174. +40 −0 libraries/joomla/model/model.php
  175. +1 −1  libraries/joomla/object/object.php
  176. +12 −22 libraries/joomla/plugin/helper.php
  177. +30 −28 libraries/joomla/profiler/profiler.php
  178. +2 −2 libraries/joomla/registry/format.php
  179. +23 −7 libraries/joomla/session/session.php
  180. +1 −1  libraries/joomla/session/storage.php
  181. +2 −2 libraries/joomla/session/storage/apc.php
  182. +3 −3 libraries/joomla/session/storage/database.php
  183. +2 −1  libraries/joomla/session/storage/eaccelerator.php
  184. +2 −2 libraries/joomla/session/storage/memcache.php
  185. +2 −1  libraries/joomla/session/storage/memcached.php
  186. +2 −2 libraries/joomla/session/storage/wincache.php
  187. +2 −2 libraries/joomla/session/storage/xcache.php
  188. +33 −27 libraries/joomla/string/normalise.php
  189. +6 −3 libraries/joomla/string/string.php
  190. +2 −14 libraries/joomla/table/asset.php
  191. +0 −7 libraries/joomla/table/extension.php
  192. +4 −20 libraries/joomla/table/menutype.php
  193. +2 −9 libraries/joomla/table/session.php
  194. +30 −162 libraries/joomla/table/table.php
  195. +18 −83 libraries/joomla/table/user.php
  196. +8 −21 libraries/joomla/table/usergroup.php
  197. +12 −13 libraries/joomla/updater/adapters/collection.php
  198. +13 −13 libraries/joomla/updater/adapters/extension.php
  199. +46 −34 libraries/joomla/updater/update.php
  200. +10 −10 libraries/joomla/updater/updateadapter.php
  201. +20 −22 libraries/joomla/user/authentication.php
  202. +23 −33 libraries/joomla/user/helper.php
  203. +7 −11 libraries/joomla/user/user.php
  204. +13 −13 libraries/joomla/utilities/buffer.php
  205. +5 −0 libraries/joomla/utilities/xmlelement.php
  206. +56 −0 libraries/joomla/view/base.php
  207. +201 −0 libraries/joomla/view/html.php
  208. +41 −0 libraries/joomla/view/view.php
  209. +1 −37 libraries/legacy/application/application.php
  210. +4 −12 libraries/legacy/application/helper.php
  211. +16 −0 libraries/{joomla → legacy}/base/node.php
  212. +10 −2 libraries/{joomla → legacy}/base/tree.php
  213. +3 −136 libraries/legacy/categories/categories.php
  214. +4 −13 libraries/{joomla/application → legacy}/component/helper.php
  215. +4 −4 libraries/{joomla/application/component/controlleradmin.php → legacy/controller/admin.php}
  216. +45 −28 libraries/{joomla/application/component → legacy/controller}/controller.php
  217. +13 −12 libraries/{joomla/application/component/controllerform.php → legacy/controller/form.php}
  218. +2 −3 libraries/{joomla → legacy}/database/exception.php
  219. +32 −0 libraries/legacy/dispatcher/dispatcher.php
  220. +9 −32 libraries/legacy/error/error.php
  221. +8 −6 libraries/legacy/exception/exception.php
  222. 0  libraries/{joomla/form/fields → legacy/form/field}/category.php
  223. +1 −7 libraries/{joomla/form/fields → legacy/form/field}/componentlayout.php
  224. 0  libraries/{joomla/form/fields → legacy/form/field}/contentlanguage.php
  225. +116 −25 libraries/legacy/form/field/media.php
  226. 0  libraries/{joomla/form/fields → legacy/form/field}/menu.php
  227. +1 −7 libraries/{joomla/form/fields → legacy/form/field}/modulelayout.php
  228. +0 −105 libraries/legacy/form/field/templatestyle.php
  229. +2 −2 libraries/legacy/help/help.php
  230. +1 −1  libraries/{joomla/html → legacy}/html/batch.php
  231. 0  libraries/{joomla/html → legacy}/html/category.php
  232. +0 −6 libraries/{joomla/html → legacy}/html/contentlanguage.php
  233. +0 −6 libraries/{joomla/html → legacy}/html/menu.php
  234. +3 −1 libraries/{joomla → legacy}/log/logexception.php
  235. +2 −29 libraries/legacy/menu/menu.php
  236. +6 −8 libraries/{joomla/application/component/modeladmin.php → legacy/model/admin.php}
  237. +3 −14 libraries/{joomla/application/component/modelform.php → legacy/model/form.php}
  238. +2 −22 libraries/{joomla/application/component/modelitem.php → legacy/model/item.php}
  239. +5 −6 libraries/{joomla/application/component/modellist.php → legacy/model/list.php}
  240. +4 −22 libraries/{joomla/application/component → legacy/model}/model.php
  241. +19 −7 libraries/{joomla/application → legacy}/module/helper.php
  242. +2 −14 libraries/legacy/pathway/pathway.php
  243. +3 −3 libraries/legacy/request/request.php
  244. +6 −7 libraries/{joomla/utilities → legacy/simplecrypt}/simplecrypt.php
  245. +5 −101 libraries/{joomla/application/component → legacy/view}/view.php
  246. +3 −3 libraries/platform.php
  247. +29 −15 media/system/js/mootools-core-uncompressed.js
  248. +122 −119 media/system/js/mootools-core.js
  249. +16 −14 phpunit.xml.dist
  250. +70 −0 tests/bootstrap.legacy.php
  251. +1 −1  tests/bootstrap.php
  252. +35 −17 tests/core/case/case.php
  253. +20 −11 tests/core/case/database.php
  254. +3 −0  tests/core/mock/application.php
  255. +60 −0 tests/core/mock/application/base.php
  256. +53 −0 tests/core/mock/application/cli.php
  257. +110 −3 tests/core/mock/application/web.php
  258. +96 −0 tests/core/mock/cache.php
  259. +54 −0 tests/core/mock/controller.php
  260. +1 −0  tests/core/mock/database/driver.php
  261. +4 −4 tests/core/mock/dispatcher.php
  262. +189 −0 tests/suites/database/driver/mysql/iterator/JDatabaseIteratorMySQLTest.php
  263. +37 −8 tests/suites/database/driver/postgresql/JDatabasePostgresqlTest.php
  264. 0  tests/suites/{unit → }/legacy/application/JApplicationHelperTest.php
  265. +2 −0  tests/suites/{unit → }/legacy/application/JApplicationTest.php
  266. +1 −1  tests/suites/{unit/joomla → legacy}/base/JNodeTest.php
  267. +1 −1  tests/suites/{unit/joomla → legacy}/base/JTreeTest.php
  268. 0  tests/suites/{unit → }/legacy/categories/JCategoriesTest.php
  269. 0  tests/suites/{unit → }/legacy/categories/JCategoryNodeTest.php
  270. +0 −2  tests/suites/{unit/joomla/application → legacy}/component/JComponentHelperTest.php
  271. +0 −2  tests/suites/{unit/joomla/application/component → legacy/controller}/JControllerAdminTest.php
  272. +1 −1  tests/suites/{unit/joomla/application/component → legacy/controller}/JControllerFormTest.php
  273. +20 −4 tests/suites/{unit/joomla/application/component → legacy/controller}/JControllerTest.php
  274. 0  tests/suites/{unit/joomla/application/component → legacy/controller}/stubs/component1/controller.json.php
  275. 0  tests/suites/{unit/joomla/application/component → legacy/controller}/stubs/component2/controller.php
  276. 0  tests/suites/{unit/joomla/application/component → legacy/controller}/stubs/controller.php
  277. 0  tests/suites/{unit/joomla/application/component → legacy/controller}/stubs/controllerform.php
  278. +36 −0 tests/suites/legacy/error/JErrorInspector.php
  279. +166 −49 tests/suites/{unit → }/legacy/error/JErrorTest.php
  280. 0  tests/suites/{unit → }/legacy/exception/JExceptionTest.php
  281. +3 −14 tests/suites/{unit/joomla/form/fields → legacy/form/field}/JFormFieldCategoryTest.php
  282. +3 −14 tests/suites/{unit/joomla/form/fields → legacy/form/field}/JFormFieldComponentLayoutTest.php
  283. +4 −3 tests/suites/{unit/joomla/form/fields → legacy/form/field}/JFormFieldContentLanguageTest.php
  284. +3 −10 tests/suites/{unit → }/legacy/form/field/JFormFieldHelpsiteTest.php
  285. +3 −9 tests/suites/{unit → }/legacy/form/field/JFormFieldMediaTest.php
  286. +3 −14 tests/suites/{unit/joomla/form/fields → legacy/form/field}/JFormFieldModuleLayoutTest.php
  287. +4 −9 tests/suites/{unit → }/legacy/form/field/JFormFieldUserTest.php
  288. +6 −2 tests/suites/{unit/joomla/html → legacy}/html/JHtmlBatchTest.php
  289. +1 −1  tests/suites/{unit/joomla/html → legacy}/html/JHtmlCategoryTest.php
  290. +4 −2 tests/suites/{unit/joomla/html → legacy}/html/JHtmlMenuTest.php
  291. 0  tests/suites/{unit → }/legacy/menu/JMenuTest.php
  292. +0 −2  tests/suites/{unit/joomla/application/component → legacy/model}/JModelAdminTest.php
  293. +0 −2  tests/suites/{unit/joomla/application/component → legacy/model}/JModelFormTest.php
  294. +0 −2  tests/suites/{unit/joomla/application/component → legacy/model}/JModelItemTest.php
  295. +0 −2  tests/suites/{unit/joomla/application/component → legacy/model}/JModelListTest.php
  296. +0 −2  tests/suites/{unit/joomla/application/component → legacy/model}/JModelTest.php
  297. +0 −2  tests/suites/{unit/joomla/application → legacy}/module/JModuleHelperTest.php
  298. +8 −0 tests/suites/{unit → }/legacy/pathway/JPathwayTest.php
  299. 0  tests/suites/{unit → }/legacy/pathway/stubs/includes/pathway.php
  300. 0  tests/suites/{unit → }/legacy/request/JFilterInput-mock-general.php
Sorry, we could not display the entire diff because too many files (401) changed.
View
2  README.markdown
@@ -16,7 +16,7 @@ Requirements
------------
* PHP 5.2.4+ for Platform versions 11.x
-* PHP 5.3+ for Platform versions 12.x
+* PHP 5.3.1+ for Platform versions 12.x
Installation
View
201 build.xml
@@ -1,118 +1,115 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="joomla-platform" default="build" basedir=".">
- <property name="source" value="libraries"/>
- <property name="joomlasource" value="libraries/joomla,libraries/platform.php,libraries/loader.php,libraries/import.php"/>
+ <property name="source" value="libraries" />
+ <property name="joomlasource" value="libraries/joomla,libraries/platform.php,libraries/loader.php,libraries/import.php" />
- <target name="clean"
- description="Clean up and create artifact directories">
- <delete dir="${basedir}/build/api"/>
- <delete dir="${basedir}/build/code-browser"/>
- <delete dir="${basedir}/build/coverage"/>
- <delete dir="${basedir}/build/logs"/>
- <delete dir="${basedir}/build/pdepend"/>
+ <target name="clean" description="Clean up and create artifact directories">
+ <delete dir="${basedir}/build/api" />
+ <delete dir="${basedir}/build/code-browser" />
+ <delete dir="${basedir}/build/coverage" />
+ <delete dir="${basedir}/build/logs" />
+ <delete dir="${basedir}/build/pdepend" />
- <mkdir dir="${basedir}/build/api"/>
- <mkdir dir="${basedir}/build/code-browser"/>
- <mkdir dir="${basedir}/build/coverage"/>
- <mkdir dir="${basedir}/build/logs"/>
- <mkdir dir="${basedir}/build/pdepend"/>
- </target>
+ <mkdir dir="${basedir}/build/api" />
+ <mkdir dir="${basedir}/build/code-browser" />
+ <mkdir dir="${basedir}/build/coverage" />
+ <mkdir dir="${basedir}/build/logs" />
+ <mkdir dir="${basedir}/build/pdepend" />
+ </target>
- <target name="phpunit"
- description="Run unit tests using PHPUnit and generates junit.xml and clover.xml">
- <exec executable="phpunit"/>
- </target>
+ <target name="phpunit" description="Run unit tests using PHPUnit and generates junit.xml and clover.xml">
+ <exec executable="phpunit" />
+ </target>
- <target name="parallelTasks"
- description="Run the pdepend, phpmd, phpcpd, phpcs, phpdoc and phploc tasks in parallel using a maximum of 2 threads.">
- <parallel threadCount="2">
- <sequential>
- <antcall target="pdepend"/>
- <antcall target="phpmd"/>
- </sequential>
- <antcall target="phpcpd"/>
- <antcall target="phpcs"/>
- <antcall target="phpdoc"/>
- <antcall target="phploc"/>
- </parallel>
- </target>
+ <target name="phpunit-legacy" description="Run legacy tests using PHPUnit and generates junit.legacy.xml and clover.legacy.xml">
+ <exec executable="phpunit">
+ <arg value="-c" />
+ <arg value="legacy.xml.dist" />
+ </exec>
+ </target>
- <target name="pdepend"
- description="Generate jdepend.xml and software metrics charts using PHP_Depend">
- <exec executable="pdepend">
- <arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" />
- <arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" />
- <arg value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" />
- <arg path="${source}" />
- </exec>
- </target>
+ <target name="parallelTasks" description="Run the pdepend, phpmd, phpcpd, phpcs, phpdoc and phploc tasks in parallel using a maximum of 2 threads.">
+ <parallel threadCount="2">
+ <sequential>
+ <antcall target="pdepend" />
+ <antcall target="phpmd" />
+ </sequential>
+ <antcall target="phpcpd" />
+ <antcall target="phpcs" />
+ <antcall target="phpdoc" />
+ <antcall target="phploc" />
+ </parallel>
+ </target>
- <target name="phpmd"
- description="Generate pmd.xml using PHPMD">
- <exec executable="phpmd">
- <arg path="${joomlasource}" />
- <arg value="xml" />
- <arg value="${basedir}/build/phpmd.xml" />
- <arg value="--reportfile" />
- <arg value="${basedir}/build/logs/pmd.xml" />
- </exec>
- </target>
+ <target name="pdepend" description="Generate jdepend.xml and software metrics charts using PHP_Depend">
+ <exec executable="pdepend">
+ <arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" />
+ <arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" />
+ <arg value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" />
+ <arg path="${source}" />
+ </exec>
+ </target>
- <target name="phpcpd"
- description="Generate pmd-cpd.xml using PHPCPD">
- <exec executable="phpcpd">
- <arg value="--log-pmd" />
- <arg value="${basedir}/build/logs/pmd-cpd.xml" />
- <arg path="${source}/joomla" />
- </exec>
- </target>
+ <target name="phpmd" description="Generate pmd.xml using PHPMD">
+ <exec executable="phpmd">
+ <arg path="${joomlasource}" />
+ <arg value="xml" />
+ <arg value="${basedir}/build/phpmd.xml" />
+ <arg value="--reportfile" />
+ <arg value="${basedir}/build/logs/pmd.xml" />
+ </exec>
+ </target>
- <target name="phploc"
- description="Generate phploc.csv">
- <exec executable="phploc">
- <arg value="--log-csv" />
- <arg value="${basedir}/build/logs/phploc.csv" />
- <arg path="${source}/joomla" />
- </exec>
- </target>
+ <target name="phpcpd" description="Generate pmd-cpd.xml using PHPCPD">
+ <exec executable="phpcpd">
+ <arg value="--log-pmd" />
+ <arg value="${basedir}/build/logs/pmd-cpd.xml" />
+ <arg path="${source}/joomla" />
+ </exec>
+ </target>
- <target name="phpcs"
- description="Generate checkstyle.xml using PHP_CodeSniffer">
- <exec executable="phpcs">
- <arg value="--report=checkstyle" />
- <arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
- <arg value="--standard=${basedir}/build/phpcs/Joomla" />
- <arg value="--ignore=${source}/phpmailer,${source}/phputf8,${source}/simplepie/,${source}/config.example.php" />
- <arg path="${source}" />
- </exec>
- </target>
+ <target name="phploc" description="Generate phploc.csv">
+ <exec executable="phploc">
+ <arg value="--log-csv" />
+ <arg value="${basedir}/build/logs/phploc.csv" />
+ <arg path="${source}/joomla" />
+ </exec>
+ </target>
- <target name="phpdoc"
- description="Generate API documentation using PHPDocumentor">
- <exec executable="phpdox">
- <arg value="-c" />
- <arg path="${source}" />
- <arg value="-d" />
- <arg path="${basedir}/build/api" />
- <arg value="-x" />
- <arg path="${basedir}/build/docs" />
- <arg value="-g" />
- <arg value="html" />
- </exec>
- </target>
+ <target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer">
+ <exec executable="phpcs">
+ <arg value="--report=checkstyle" />
+ <arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
+ <arg value="--standard=${basedir}/build/phpcs/Joomla" />
+ <arg value="--ignore=${source}/phpmailer,${source}/phputf8,${source}/simplepie/,${source}/config.example.php" />
+ <arg path="${source}" />
+ </exec>
+ </target>
- <target name="phpcb"
- description="Aggregate tool output with PHP_CodeBrowser">
- <exec executable="phpcb">
- <arg value="--log" />
- <arg path="${basedir}/build/logs" />
- <arg value="--source" />
- <arg path="${source}" />
- <arg value="--output" />
- <arg path="${basedir}/build/code-browser" />
- </exec>
- </target>
+ <target name="phpdoc" description="Generate API documentation using PHPDocumentor">
+ <exec executable="phpdox">
+ <arg value="-c" />
+ <arg path="${source}" />
+ <arg value="-d" />
+ <arg path="${basedir}/build/api" />
+ <arg value="-x" />
+ <arg path="${basedir}/build/docs" />
+ <arg value="-g" />
+ <arg value="html" />
+ </exec>
+ </target>
- <target name="build" depends="clean,parallelTasks,phpunit,phpcb"/>
+ <target name="phpcb" description="Aggregate tool output with PHP_CodeBrowser">
+ <exec executable="phpcb">
+ <arg value="--log" />
+ <arg path="${basedir}/build/logs" />
+ <arg value="--source" />
+ <arg path="${source}" />
+ <arg value="--output" />
+ <arg path="${basedir}/build/code-browser" />
+ </exec>
+ </target>
+
+ <target name="build" depends="clean,phpunit,phpunit-legacy,parallelTasks,phpcb" />
</project>
View
488 build/changelog.php
@@ -1,9 +1,17 @@
#!/usr/bin/php
<?php
/**
- * @package Joomla.Build
+ * An example command line application built on the Joomla Platform.
*
- * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
+ * To run this example, adjust the executable path above to suite your operating system,
+ * make this file executable and run the file.
+ *
+ * Alternatively, run the file using:
+ *
+ * php -f run.php
+ *
+ * @package Joomla.Examples
+ * @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
@@ -11,206 +19,430 @@
define('_JEXEC', 1);
// Setup the path related constants.
-define('JPATH_BASE', __DIR__);
+define('JPATH_BASE', dirname(__FILE__));
// Bootstrap the application.
-require '../libraries/import.php';
-
-jimport('joomla.application.cli');
+require realpath('../libraries/import.php');
/**
- * The command line application.
+ * Joomla Platform Changelog builder.
+ *
+ * This application builds the HTML version of the Joomla Platform change log from the Github API
+ * that is used in news annoucements.
*
- * @package NewLifeInIT
- * @subpackage cron
+ * @package Joomla.Examples
+ * @subpackage Changlog
+ * @since 12.1
*/
-class Changelog extends JCli
+class Changelog extends JApplicationCli
{
/**
+ * The github API object.
+ *
+ * @var JGithub
+ * @since 12.1
+ */
+ protected $api;
+
+ /**
+ * Debug mode switch.
+ *
+ * @var boolean
+ * @since 12.1
+ */
+ protected $debug = false;
+
+ /**
+ * An array of output buffers.
+ *
+ * @var array
+ * @since 12.1
+ */
+ protected $buffers = array();
+
+ /**
+ * Overrides JGithub constructor to initialise the api property.
+ *
+ * @param mixed $input An optional argument to provide dependency injection for the application's
+ * input object. If the argument is a JInputCli object that object will become
+ * the application's input object, otherwise a default input object is created.
+ * @param mixed $config An optional argument to provide dependency injection for the application's
+ * config object. If the argument is a JRegistry object that object will become
+ * the application's config object, otherwise a default config object is created.
+ * @param mixed $dispatcher An optional argument to provide dependency injection for the application's
+ * event dispatcher. If the argument is a JDispatcher object that object will become
+ * the application's event dispatcher, if it is null then the default event dispatcher
+ * will be created based on the application's loadDispatcher() method.
+ *
+ * @see loadDispatcher()
+ * @since 11.1
+ */
+ public function __construct(JInputCli $input = null, JRegistry $config = null, JDispatcher $dispatcher = null)
+ {
+ parent::__construct($input, $config, $dispatcher);
+
+ $options = new JRegistry;
+ $options->set('headers.Accept', 'application/vnd.github.html+json');
+ $this->api = new JGithub($options);
+ }
+
+ /**
* Execute the application.
*
* @return void
*
- * @since 11.3
+ * @since 12.1
*/
public function execute()
{
- // Import dependancies.
- jimport('joomla.client.http');
+ // Check if we just want the help page.
+ if ($this->input->get('h'))
+ {
+ $this->help();
+
+ return;
+ }
+
+ // Check for debug mode.
+ $this->debug = $this->input->getBool('d');
+
+ // Set the maximum number of pages (and runaway failsafe).
+ $cutoff = 100;
+ $page = 1;
+
+ // Check if we only want to get the latest version information.
+ $latestOnly = $this->input->get('l');
+
+ // Initialise the version cutoffs.
+ $versions = array(
+ 0 => '12.1',
+ 653 => '11.4',
+ 310 => '11.3',
+ 140 => '11.2',
+ 72 => '11.1',
+ );
+
+ // Initialise arrays and metrics.
+ $log = array();
+ $userCount = array();
+ $pullCount = 0;
+ $mergedBy = array();
+ $labelled = array();
- try
+ // Set the current version.
+ $version = $versions[0];
+
+ while ($cutoff--)
{
- // Get a list of the merged pull requests.
- $merged = $this->getMergedPulls();
-
- $doc = new XMLWriter;
- $doc->openMemory();
- $doc->setIndent(true);
- $doc->setIndentString("\t");
- $doc->startDocument('1.0', 'utf-8');
-
- $doc->startElement('appendix');
- $doc->writeAttribute('version', '5.0');
- $doc->writeAttribute('xmlns', 'http://docbook.org/ns/docbook');
- $doc->writeAttribute('xml:id', 'preface');
- $doc->writeAttribute('xmlns:ns', 'http://docbook.org/ns/docbook');
- $doc->writeAttribute('xmlns:ns2', 'http://www.w3.org/1999/xlink');
- $doc->writeAttribute('xmlns:ns3', 'http://www.w3.org/1998/Math/MathML');
- $doc->writeAttribute('xmlns:ns4', 'http://www.w3.org/2000/svg');
- $doc->writeAttribute('xmlns:ns5', 'http://www.w3.org/1999/xhtml');
-
- $doc->startElement('section');
-
- $cutoff = 10;
- $page = 1;
-
- while ($cutoff--)
+ // Get a page of the closed issues.
+ $issues = $this->getIssues($page++);
+
+ // Check if we've gone past the last page.
+ if (empty($issues))
{
- // Get a page of issues.
- $issues = $this->getIssues($page++);
+ break;
+ }
+
+ // Loop through each pull.
+ foreach ($issues as $i => $issue)
+ {
+ $this->out(sprintf(' %03d ', $i + 1), false);
- // Check if we've gone past the last page.
- if (empty($issues))
+ // Check if the issue is a pull request.
+ if (empty($issue->pull_request->html_url))
{
- break;
+ $this->out('Skipped; no pull request url.');
+ continue;
}
- $doc->startElement('itemizedlist');
-
- // Loop through each pull.
- foreach ($issues as $issue)
+ // Change the version
+ if (isset($versions[$issue->number]) || ($this->debug && $pullCount > 0))
{
- // Check if the issue has been merged.
- if (empty($issue->pull_request->html_url))
+ // Populate buffers.
+ $this->setBuffer("$version.userCount", $userCount);
+ $this->setBuffer("$version.pullCount", $pullCount, false);
+ $this->setBuffer("$version.mergedBy", $mergedBy);
+ $this->setBuffer("$version.labelled", $labelled);
+
+ // Reset counters.
+ $pullCount = 0;
+ $userCount = array();
+ $mergedBy = array();
+ $labelled = array();
+
+ // Break if we only want the latest version.
+ if ($latestOnly || $this->debug)
{
- continue;
+ break 2;
}
- // Check if the pull has been merged.
- if (!in_array($issue->number, $merged))
- {
- continue;
- }
-
- $doc->startElement('listitem');
-
- $doc->startElement('para');
-
- // Prepare the link to the pull.
- $doc->text('[');
- $doc->startElement('link');
- $doc->writeAttribute('ns2:href', $issue->html_url);
- $doc->writeAttribute('ns2:title', 'Closed '.$issue->closed_at);
- $doc->text('#'.$issue->number);
- $doc->endElement(); // ulink
- $doc->text('] '.$issue->title.' (');
+ // Increment version.
+ $version = $versions[$issue->number];
+ }
- // Prepare the link to the author.
- $doc->startElement('link');
- $doc->writeAttribute('ns2:href', 'https://github.com/'.$issue->user->login);
- $doc->text($issue->user->login);
- $doc->endElement(); // ulink
- $doc->text(')');
+ // Get specific information about the pull request.
+ $data = $this->getPull($issue->number);
- $doc->endElement(); // para
+ // Check if merged.
+ if (!$data->merged || $data->commits == 0)
+ {
+ $this->out(' - not merged.');
+ continue;
+ }
- if (trim($issue->body))
+ // Check if the issue is labelled.
+ foreach ($issue->labels as $label)
+ {
+ if (!isset($labelled[$label->name]))
{
- $doc->startElement('para');
- $doc->text($issue->body);
- $doc->endElement(); // para
+ $labelled[$label->name] = array();
}
+ $labelled[$label->name][] = '<a href="' . $issue->html_url . '">' . $issue->title . '</a>';
+ }
+
+ // Prepare the link to the pull.
+ $html = '[<a href="' . $issue->html_url . '" title="Closed ' . $issue->closed_at . '">';
+ $html .= '#' . $issue->number;
+ $html .= '</a>] <strong>' . $issue->title . '</strong>';
+ $html .= ' (<a href="https://github.com/' . $issue->user->login . '">' . $issue->user->login . '</a>)';
- $doc->endElement(); // listitem
+ if (trim($data->body_html))
+ {
+ $html .= $data->body_html;
}
- $doc->endElement(); // itemizedlist
- }
+ $this->setBuffer("$version.log", $html);
- $doc->endElement(); // section
- $doc->endElement(); // appendix
+ if (!isset($userCount[$issue->user->login]))
+ {
+ $userCount[$issue->user->login] = 0;
+ }
+ $userCount[$issue->user->login]++;
+ $pullCount++;
- // Write the file.
- if (!is_dir('./docs'))
- {
- mkdir('./docs');
- }
+ if (!isset($mergedBy[$data->merged_by->login]))
+ {
+ $mergedBy[$data->merged_by->login] = 0;
+ }
+ $mergedBy[$data->merged_by->login]++;
- file_put_contents('./docs/changelog.xml', $doc->outputMemory());
+ $this->out(' - ok');
+ }
}
- catch (Exception $e)
+
+ // Check if the output folder exists.
+ if (!is_dir('./docs'))
{
- $this->out($e->getMessage());
- $this->close($e->getCode());
+ mkdir('./docs');
}
+ // Write the file.
+ file_put_contents('./docs/changelog.html', $this->render($latestOnly ? array($versions[0]) : $versions));
+
// Close normally.
$this->close();
}
/**
+ * Display the help text for the app.
+ *
+ * @return void
+ *
+ * @since 12.1
+ */
+ public function help()
+ {
+ $this->out();
+ $this->out('Joomla Platform Changelog');
+ $this->out('-------------------------');
+ $this->out();
+ $this->out('Usage: ./changelog [-l]');
+ $this->out();
+ $this->out(' -l Build the changelog for the latest version only.');
+ $this->out(' -d Debug mode. Test one issue.');
+ $this->out();
+ $this->out('Output is sent to docs/changelog.html');
+ $this->out();
+ }
+
+ /**
+ * Gets a named buffer.
+ *
+ * @param string $name the name of the buffer.
+ *
+ * @return string
+ *
+ * @since 12.1
+ */
+ protected function getBuffer($name)
+ {
+ if (isset($this->buffers[$name]))
+ {
+ return $this->buffers[$name];
+ }
+ else
+ {
+ return '';
+ }
+ }
+
+ /**
* Get a page of issue data.
*
- * @param integer The page number.
+ * @param integer $page The page number.
*
* @return array
*
- * @since 11.3
+ * @since 12.1
*/
protected function getIssues($page)
{
- $http = new JHttp;
- $r = $http->get(
- 'https://api.github.com/repos/joomla/joomla-platform/issues?state=closed&sort=updated&direction=desc&page='.$page.'&per_page=100'
- );
+ $this->out(sprintf('Getting issues page #%02d.', $page));
+ $this->out(str_pad('', 40, '-'));
- return json_decode($r->body);
+ $issues = $this->api->issues
+ ->getListByRepository('joomla', 'joomla-platform', null, 'closed', null, null, null, 'updated', 'desc', null, $page, 100);
+
+ $this->out(sprintf('Got %s issues.', count($issues)));
+
+ return $issues;
}
/**
- * Gets a list of the merged pull numbers.
+ * Get information about a specific pull request.
*
- * @param integer The pull/issue number.
+ * @return object
*
- * @return array
- *
- * @since 11.3
+ * @since 12.1
*/
- protected function getMergedPulls()
+ protected function getPull($id)
{
- $cutoff = 10;
- $page = 1;
- $merged = array();
+ $this->out(sprintf('Getting info for pull %6d', $id), false);
- while ($cutoff--)
+ return $this->api->pulls->get('joomla', 'joomla-platform', $id);
+ }
+
+ /**
+ * Renders the output.
+ *
+ * @param array $versions An array of the versions to render.
+ *
+ * @return string
+ *
+ * @since 12.1
+ */
+ protected function render(array $versions)
+ {
+ $html = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+ <html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Joomla Platform pull request log</title>
+ </head>
+ <body>';
+
+ foreach ($versions as $version)
{
- $http = new JHttp;
+ // Print the version number.
+ $html .= PHP_EOL . ' <h1>' . $version . '</h1>';
- $r = $http->get(
- 'https://api.github.com/repos/joomla/joomla-platform/pulls?state=closed&page='.$page++.'&per_page=100'
- );
+ // Print out the labelled version of the changelog first.
+ $labelled = $this->getBuffer("$version.labelled");
+ if ($labelled)
+ {
+ foreach ($labelled as $label => $links)
+ {
+ $html .= PHP_EOL . "<h2>$label</h2>";
+ $html .= PHP_EOL . '<ul>';
- $pulls = json_decode($r->body);
+ foreach ($links as $link)
+ {
+ $html .= PHP_EOL . "<li>$link</li>";
+ }
- // Check if we've gone past the last page.
- if (empty($pulls))
+ $html .= PHP_EOL . '</ul>';
+ }
+ }
+
+ // Print out the detailed version of the changelog.
+ $log = $this->getBuffer("$version.log");
+ $html .= PHP_EOL . '<h2>The following pull requests made by community contributors were merged:</h2>';
+ $html .= PHP_EOL . '<ol>';
+ foreach ($log as $issue)
{
- break;
+ $html .= PHP_EOL . "<li>$issue</li>";
}
+ $html .= PHP_EOL . '</ol>';
+
+ // Print out the user-pull statistics.
+ $userCount = $this->getBuffer("$version.userCount");
+ arsort($userCount);
+ $pullCount = $this->getBuffer("$version.pullCount");
- // Loop through each of the pull requests.
- foreach ($pulls as $pull)
+ $html .= PHP_EOL . sprintf('<h4>%d pull requests.</h4>', $pullCount);
+ $html .= PHP_EOL . '<ol>';
+ foreach ($userCount as $user => $count)
{
- // If merged, add to the white list.
- if ($pull->merged_at)
- {
- $merged[] = $pull->number;
- }
+ $html .= PHP_EOL . sprintf('<li><a href="https://github.com/%1$s">%1$s</a>: %2$d</li>', $user, $count);
}
+ $html .= PHP_EOL . ' </ol>';
+
+ // Print out the admin-merge statistics.
+ $mergedBy = $this->getBuffer("$version.mergedBy");
+ arsort($mergedBy);
+
+ $html .= PHP_EOL . '<h4>Merged by:</h4>';
+ $html .= PHP_EOL . '<ol>';
+ foreach ($mergedBy as $user => $count)
+ {
+ $html .= PHP_EOL . sprintf('<li><a href="https://github.com/%1$s">%1$s</a>: %2$d</li>', $user, $count);
+ }
+ $html .= PHP_EOL . '</ol>';
+ }
+
+ $html .= PHP_EOL . '</body>';
+ $html .= PHP_EOL . '</html>';
+
+ return $html;
+ }
+
+ /**
+ * Sets a named buffer.
+ *
+ * @param string $name The name of the buffer.
+ * @param mixed $text The text to put into/append to the buffer.
+ * @param boolean $append Append to the array buffer.
+ *
+ * @return void
+ *
+ * @since 12.1
+ */
+ protected function setBuffer($name, $text, $append = true)
+ {
+ if (!isset($this->buffers[$name]))
+ {
+ $this->buffers[$name] = array();
}
- return $merged;
+ if (is_array($text) || !$append)
+ {
+ $this->buffers[$name] = $text;
+ }
+ else
+ {
+ $this->buffers[$name][] = $text;
+ }
}
}
-JCli::getInstance('Changelog')->execute();
+// Catch any exceptions thrown.
+try
+{
+ JCli::getInstance('Changelog')->execute();
+}
+catch (Exception $e)
+{
+ // An exception has been caught, just echo the message.
+ fwrite(STDOUT, $e->getMessage() . "\n");
+ exit($e->getCode());
+}
View
2  build/phpcs/Joomla/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php
@@ -143,7 +143,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
}
}
- // It cant be the last thing on the line either.
+ // It can't be the last thing on the line either.
$content = $phpcsFile->findNext(T_WHITESPACE, ($next + 1), null, true);
if ($tokens[$content]['line'] !== $tokens[$next]['line']) {
$error = 'Object operator must be at the start of the line, not the end';
View
4 build/phpcs/Joomla/ruleset.xml
@@ -16,7 +16,7 @@
<exclude-pattern>*/modal.css</exclude-pattern>
<!-- Include all sniffs in an external standard directory -->
-
+
<!-- Include some additional sniffs from the Generic standard -->
<rule ref="PEAR.Classes.ClassDeclaration"/>
@@ -67,7 +67,7 @@
</properties>
</rule>
- <!-- This messgae is not required as spaces are allowed for alignment -->
+ <!-- This message is not required as spaces are allowed for alignment -->
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma">
<severity>0</severity>
</rule>
View
2  docs/coding-standards/en-US/Book_Info.xml
@@ -7,7 +7,7 @@
<title>Coding Standards</title>
<subtitle>A Concise Guide</subtitle>
<productname>Joomla Platform</productname>
- <productnumber>11.3</productnumber>
+ <productnumber>12.1</productnumber>
<edition>1</edition>
<pubsnumber>1</pubsnumber>
<abstract>
View
33 docs/coding-standards/en-US/Chapter.xml
@@ -1,33 +0,0 @@
-<?xml version='1.0' encoding='utf-8' ?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-<!ENTITY % BOOK_ENTITIES SYSTEM "Coding_Standards.ent">
-%BOOK_ENTITIES;
-]>
-<chapter id="chap-Coding_Standards-Test_Chapter">
- <title>Test Chapter</title>
- <para>
- This is a test paragraph
- </para>
- <section id="sect-Coding_Standards-Test_Chapter-Test_Section_1">
- <title>Test Section 1</title>
- <para>
- This is a test paragraph in a section
- </para>
- </section>
-
- <section id="sect-Coding_Standards-Test_Chapter-Test_Section_2">
- <title>Test Section 2</title>
- <para>
- This is a test paragraph in Section 2
- <orderedlist>
- <listitem>
- <para>
- listitem text
- </para>
- </listitem>
- </orderedlist>
- </para>
- </section>
-
-</chapter>
-
View
2  docs/coding-standards/en-US/appendices/Revision_History.xml
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-<!ENTITY % BOOK_ENTITIES SYSTEM "coding-standards.ent">
+<!ENTITY % BOOK_ENTITIES SYSTEM "../Coding_Standards.ent">
%BOOK_ENTITIES;
]>
<appendix id="appe-coding-standards-Revision_History">
View
2  docs/coding-standards/en-US/chapters/basic-guidelines.xml
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-<!ENTITY % BOOK_ENTITIES SYSTEM "Coding_Standards.ent">
+<!ENTITY % BOOK_ENTITIES SYSTEM "../Coding_Standards.ent">
%BOOK_ENTITIES;
]>
<chapter id="chap-Coding_Standards-Basic_Guidelines">
View
5 docs/coding-standards/en-US/chapters/comments.xml
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-<!ENTITY % BOOK_ENTITIES SYSTEM "Coding_Standards.ent">
+<!ENTITY % BOOK_ENTITIES SYSTEM "../Coding_Standards.ent">
%BOOK_ENTITIES;
]>
<chapter id="chap-Comments">
@@ -96,12 +96,13 @@
<programlisting>
// Get its ID</programlisting>
<para>It’s is a contraction of it is</para>
- <programlisting>// It’s time to save</programlisting></para>
+ <programlisting>// It’s time to save</programlisting>
<para>The correct Joomla! spelling of some commonly used words.</para>
<itemizedlist>
<listitem>
<para>Dependant</para>
</listitem>
+ </itemizedlist>
</section>
</chapter>
View
14 docs/coding-standards/en-US/chapters/php.xml
@@ -20,8 +20,7 @@
<para>For files that contain only PHP code, the closing tag (?&gt;) should not be included. It is not required by PHP.
Leaving this out prevents trailing white space from being accidentally injected into the output that can introduce errors in
- the Joomla session (see the PHP manual on instruction separation at
- http://php.net/basic-syntax.instruction-separation).</para>
+ the Joomla session (see the PHP manual on <ulink url="http://php.net/basic-syntax.instruction-separation">Instruction separation</ulink>.</para>
<para>Files should always end with a blank new line.</para>
@@ -646,7 +645,7 @@ class JClass extends JObject
<para>Exceptions should be used for error handling.</para>
- <para>The follow sections outline how to semantically use SPL exceptions</para>
+ <para>The follow sections outline how to semantically use <ulink url="http://php.net/manual/en/spl.exceptions.php">SPL exceptions</ulink>.</para>
<section>
<title>Logic Exceptions</title>
@@ -655,7 +654,7 @@ class JClass extends JObject
being used. For example:</para>
<simplelist>
- <member>A dependancy has failed (you try to operate on an object that has not been loaded yet).</member>
+ <member>A dependency has failed (you try to operate on an object that has not been loaded yet).</member>
</simplelist>
<para>The following child classes can also be used in appropriate situations.</para>
@@ -679,8 +678,7 @@ class JClass extends JObject
<simplelist>
<member><methodname>is_callable</methodname>, or similar, fails on a class method.</member>
-
- <member>There where missing arguments passed to a magic call method.</member>
+ <member>Arguments passed to a magic call method are missing.</member>
</simplelist>
</section>
@@ -723,7 +721,7 @@ class JClass extends JObject
<para>The <exceptionname>RuntimeException</exceptionname> is thrown when some sort of external entity or environment causes
a problem that is beyond your control providing the input is valid. This exception is the default case for when the cause of
- an error can't explicity be determined. For example:</para>
+ an error can't explicitly be determined. For example:</para>
<simplelist>
<member>Tried to connect to a database but the database was not available (server down, etc).</member>
@@ -734,7 +732,7 @@ class JClass extends JObject
<section>
<title>UnexpectedValueException</title>
- <para>This type of exception should be used when an unecpected result is encountered. For example:</para>
+ <para>This type of exception should be used when an unexpected result is encountered. For example:</para>
<simplelist>
<member>A function call returned a string when a boolean was expected.</member>
View
2  docs/coding-standards/en-US/chapters/source-code-management.xml
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-<!ENTITY % BOOK_ENTITIES SYSTEM "Coding_Standards.ent">
+<!ENTITY % BOOK_ENTITIES SYSTEM "../Coding_Standards.ent">
%BOOK_ENTITIES;
]>
<chapter id="chap-Coding_Standards-Source_Code_Management">
View
2  docs/manual/en-US/Book_Info.xml
@@ -7,7 +7,7 @@
<title>Developer Manual</title>
<subtitle>A Reference Guide</subtitle>
<productname>Joomla Platform</productname>
- <productnumber>11.3</productnumber>
+ <productnumber>12.1</productnumber>
<edition>1</edition>
<pubsnumber>1</pubsnumber>
<abstract>
View
52 docs/manual/en-US/appendices/analysis.xml
@@ -20,22 +20,23 @@
<section>
<title>Configuring Your Environment: The Database</title>
- <para>Standard unit tests run against a <ulink url="http://www.sqlite.org/quickstart.html">Sqlite</ulink> in memory
- database for ease of setup and performance. Other than <ulink url="http://www.sqlite.org/quickstart.html">installing Sqlite</ulink>
- no manual intervention or set up is required. The database is built at runtime and deleted when finished.
+ <para>Standard unit tests run against a <ulink url="http://www.sqlite.org/quickstart.html">Sqlite</ulink> in memory
+ database for ease of setup and performance. Other than <ulink url="http://www.sqlite.org/quickstart.html">installing Sqlite</ulink>
+ no manual intervention or set up is required. The database is built at runtime and deleted when finished.
</para>
<para>To run the specific database tests:</para>
<itemizedlist>
- <para>Create your database and use the appropriate database-specific DDL located in
+ <listitem>
+ <para>Create your database and use the appropriate database-specific DDL located in
tests/suites/database/stubs to create the database tables required.</para>
</listitem>
-
+
<listitem>
<para>In the root directory, copy the file named phpunit.xml.dist, leaving it in the same
folder and naming it phpunit.xml.</para>
- </listitem>
+ </listitem>
<listitem>
<para>Uncomment the php block and include the const line(s) related to the database(s) you will be testing.</para>
@@ -48,17 +49,39 @@
</section>
<section>
- <title>Configuring Your Environment: The JHttpTransport Test Stubs</title>
-
- <para>There is a special stub that is required for testing the JHttp transports so that actual web requests can be simulated
- and assertions can be made about the results. To set these up, copy the file jhttp_stub.php to a web server and add the address
- to your config file with the config variable <code>$jhttp_stub</code>.</para>
- </section>
+ <title>Configuring Your Environment: The JHttpTransport Test Stubs</title>
+
+ <para>There is a special stub that is required for testing the JHttp transports so that actual web requests can be simulated
+ and assertions can be made about the results. To set these up, you'll need to do the following:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>In the root directory, copy the file named phpunit.xml.dist, leaving it in the same
+ folder and naming it phpunit.xml.</para>
+ </listitem>
+
+ <listitem>
+ <para>Uncomment the php block and include the "JTEST_HTTP_STUB" const.</para>
+ </listitem>
+
+ <listitem>
+ <para>The default file path for the const assumes that you have checked out the Joomla Platform to the web root
+ of your test environment inside a folder named "joomla-platform". If this is not the case, you can change
+ the path to suit your environment and, if need be, copy the file from its default location to be available within
+ your web environment.</para>
+ </listitem>
+ </itemizedlist>
+ </section>
<section>
<title>Running the Tests</title>
<para>You can run the tests by going to the platform root directory and executing <command>phpunit</command></para>
+
+ <para>Alternatively, if you have Ant installed on your system, you may run the unit tests by going to the platform root
+ directory and executing <command>ant phpunit</command> to execute the tests on classes located under the libraries/joomla
+ directory or executing <command>ant phpunit-legacy</command> to execute the tests on classes located under the
+ libraries/legacy directory.</para>
</section>
</section>
@@ -77,8 +100,11 @@
<section>
<title>Running CodeSniffer</title>
- <para>You can run CodeSniffer by going to the platform root directory and executing <command>phpcs --report=checkstyle
+ <para>You can run the CodeSniffer by going to the platform root directory and executing <command>phpcs --report=checkstyle
--report-file=build/logs/checkstyle.xml --standard=/path/to/platform/build/phpcs/Joomla /path/to/platform</command></para>
+
+ <para>Alternatively, if you have Ant installed on your system, you may run the CodeSniffer by going to the platform root
+ directory and executing <command>ant phpcs</command></para>
</section>
<section>
View
70 docs/manual/en-US/chapters/classes/jcontrollerbase.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "../../Developer_Manual.ent">
+%BOOK_ENTITIES;
+]>
+<section>
+ <title>JControllerBase</title>
+
+ <section>
+ <title>Construction</title>
+
+ <para>The constructor for <classname>JControllerBase</classname> takes an optional <classname>JInput</classname> object and an
+ optional <classname>JApplciationBase</classname> object. If either is omitted, the constructor defers to the protected
+ loadInput and loadApplication methods respectively. These methods can be overriden in derived classes if the default
+ application and request input is not appropriate.</para>
+ </section>
+
+ <section>
+ <title>Usage</title>
+
+ <para>The <classname>JControllerBase</classname> class is abstract so cannot be used directly. The derived class must
+ implement the execute method to satisfy the interface requirements. Note that the execute method no longer takes a "task"
+ argument as each controller class. Multi-task controllers are still possible by overriding the
+ <methodname>execute</methodname> method in derived classes. Each controller class should do just one sort of 'thing', such as
+ saving, deleting, checking in, checking out and so on. However, controllers, or even models and views, have the liberty of
+ invoking other controllers to allow for HMVC architectures.</para>
+
+ <example>
+ <title>Example controller</title>
+
+ <programlisting>/**
+ * My custom controller.
+ *
+ * @package Examples
+ *
+ * @since 12.1
+ */
+class MyController extends JControllerBase
+{
+ /**
+ * Method to execute the controller.
+ *
+ * @return void
+ *
+ * @since 12.1
+ * @throws RuntimeException
+ */
+ public function execute()
+ {
+ echo time();
+ }
+}
+
+// Instantiate the controller.
+$controller = new MyController;
+
+// Print the time.
+$controller-&gt;execute();</programlisting>
+ </example>
+ </section>
+
+ <section>
+ <title>Serialization</title>
+
+ <para>The <classname>JControllerBase</classname> class implements <interfacename>Serializable</interfacename>. When
+ serializing, only the input property is serialized. When unserializing, the input variable is unserialized and the internal
+ application property is loaded at runtime.</para>
+ </section>
+</section>
View
162 docs/manual/en-US/chapters/classes/jhttp.xml
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "../../Developer_Manual.ent">
+%BOOK_ENTITIES;
+]>
+<section id="chap-Joomla_Platform_Manual-JHttp">
+ <title>JHttp</title>
+
+ <para>The JHttp class provides methods for making RESTful requests.</para>
+
+ <section>
+ <title>Construction</title>
+
+ <para>Construction of JHttp object is generally done using the JHttpFactory class. However, JHttp is not abstract and can be
+ instantiated directly passing an optional JRegistry object of options and an optional JHttpTransport object. If the transport
+ is omitted, the default transport will be used. The default is determined by looking up the transports folder and selecting
+ the first transport that is supported (this will usually be the "curl" transport).</para>
+
+ <example>
+ <title>Creating a JHttp object</title>
+
+ <programlisting>// Create an instance of a default JHttp object.
+$http = new JHttp;
+
+$options = new JRegistry;
+
+$transport = new JHttpTransportStream($options);
+
+// Create a 'stream' transport.
+$http = new JHttp($options, $transport);</programlisting>
+ </example>
+ </section>
+
+ <section>
+ <title>Making a HEAD request</title>
+
+ <para>An HTTP HEAD request can be made using the head method passing a URL and an optional key-value array of header
+ variables. The method will return a JHttpResponse object.</para>
+
+ <example>
+ <title>Making a HEAD request</title>
+
+ <programlisting>// Create an instance of a default JHttp object.
+$http = JHttpFactory::getHttp();
+
+// Invoke the HEAD request.
+$response = $http-&gt;head('http://example.com');
+
+// The response code is included in the "code" property.
+// See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
+var_dump($response-&gt;code);
+
+// The response headers are included as an associative array in the "headers" property.
+var_dump($response-&gt;headers);
+
+// The body of the response (not applicable for the HEAD method) is included in the "body" property.
+var_dump($response-&gt;body);</programlisting>
+ </example>
+ </section>
+
+ <section>
+ <title>Making a GET request</title>
+
+ <para>An HTTP GET request can be made using the get method passing a URL, an optional key-value array of header variables and
+ an optional timeout value. In RESTful terms, a GET request is sent to read data from the server.</para>
+
+ <example>
+ <title>Making a GET request</title>
+
+ <programlisting>// Invoke the GET request.
+$response = $http-&gt;get('http://api.example.com/cars');</programlisting>
+ </example>
+ </section>
+
+ <section>
+ <title>Making a POST request</title>
+
+ <para>An HTTP POST request can be made using the post method passing a URL, a data variable, an optional key-value array of
+ header variables and an optional timeout value. The data can be either an associative array of POST variables, or a string to
+ be sent with the request. In RESTful terms, a POST request is sent to create new data on the server.</para>
+
+ <example>
+ <title>Making a POST request</title>
+
+ <programlisting>// Prepare the update data.
+$data = array('make' =&gt; 'Holden', model =&gt; 'EJ-Special');
+
+// Invoke the GET request.
+$response = $http-&gt;post('http://api.example.com/cars/1', $data);</programlisting>
+ </example>
+ </section>
+
+ <section>
+ <title>Making a PUT request</title>
+
+ <para>An HTTP POST request can be made using the post method passing a URL, a data variable, an optional key-value array of
+ header variables and an optional timeout value. The data can be either an associative array of POST variables, or a string to
+ be sent with the request. In RESTful terms, a PUT request is typically sent to update existing data on the server.</para>
+
+ <example>
+ <title>Making a PUT request</title>
+
+ <programlisting>// Prepare the update data.
+$data = array('description' =&gt; 'My first car.', 'color' =&gt; 'gray');
+
+// Invoke the GET request.
+$response = $http-&gt;put('http://api.example.com/cars/1', $data);</programlisting>
+ </example>
+ </section>
+
+ <section>
+ <title>Making a DELETE request</title>
+
+ <para>An HTTP DELETE request can be made using the delete method passing a URL, an optional key-value array of header
+ variables and an optional timeout value. In RESTful terms, a DELETE request is typically sent to delete existing data on the
+ server.</para>
+
+ <example>
+ <title>Making a DELETE request</title>
+
+ <programlisting>// Invoke the DELETE request.
+$response = $http-&gt;delete('http://api.example.com/cars/1');</programlisting>
+ </example>
+ </section>
+
+ <section>
+ <title>Making a TRACE request</title>
+
+ <para>An HTTP TRACE request can be made using the trace method passing a URL and an optional key-value array of header
+ variables. In RESTful terms, a TRACE request is to echo data back to the client for debugging or testing purposes.</para>
+ </section>
+
+ <section>
+ <title>Working with options</title>
+
+ <para>Customs headers can be pased into each REST request, but they can also be set globally in the constructor options where
+ the registry path starts with "headers.". In the case where a request method passes additional headers, those will override
+ the headers set in the options.</para>
+
+ <example>
+ <title>Setting custom request headers</title>
+
+ <programlisting>// Create the options.
+$options = new JRegistry;
+
+// Configure a custom Accept header for all requests.
+$options-&gt;set('headers.Accept', 'application/vnd.github.html+json');
+
+// Make the request, knowing the custom Accept header will be used.
+$pull = $http-&gt;get('https://api.github.com/repos/joomla/joomla-platform/pulls/1');
+
+// Set up custom headers for a single request.
+$headers = array(
+ 'Accept' =&gt; 'application/foo',
+);
+
+// In this case, the Accept header in $headers will override the options header.
+$pull = $http-&gt;get('https://api.github.com/repos/joomla/joomla-platform/pulls/1', $headers);</programlisting>
+ </example>
+ </section>
+</section>
View
21 docs/manual/en-US/chapters/classes/jhttpfactory.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "../../Developer_Manual.ent">
+%BOOK_ENTITIES;
+]>
+<section id="chap-Joomla_Platform_Manual-JHttpFactory">
+ <title>JHttpFactory</title>
+
+ <para>JHttp objects are created by using the JHttpFactory::getHttp method.</para>
+
+ <example>
+ <title>Creating a JHttp object with the HTTP factory</title>
+
+ <programlisting>// The default transport will be 'curl' because this is the first transport.
+$http = JHttpFactory::getHttp();
+
+// Create a 'stream' transport.
+$http = JHttpFactory::getHttp(null, 'stream');</programlisting>
+ </example>
+</section>
View
11 docs/manual/en-US/chapters/classes/jhttpresponse.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "../../Developer_Manual.ent">
+%BOOK_ENTITIES;
+]>
+<section id="chap-Joomla_Platform_Manual-JHttpResponse">
+ <title>JHttpResponse</title>
+
+ <para>Can you help improve this section of the manual?</para>
+</section>
View
11 docs/manual/en-US/chapters/classes/jhttptransportcurl.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "../../Developer_Manual.ent">
+%BOOK_ENTITIES;
+]>
+<section id="chap-Joomla_Platform_Manual-JHttpTransportCurl">
+ <title>JHttpTransportCurl</title>
+
+ <para>Can you help improve this section of the manual?</para>
+</section>
View
11 docs/manual/en-US/chapters/classes/jhttptransportsocket.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "../../Developer_Manual.ent">
+%BOOK_ENTITIES;
+]>
+<section id="chap-Joomla_Platform_Manual-JHttpTransportSocket">
+ <title>JHttpTransportSocket</title>
+
+ <para>Can you help improve this section of the manual?</para>
+</section>
View
11 docs/manual/en-US/chapters/classes/jhttptransportstream.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "../../Developer_Manual.ent">
+%BOOK_ENTITIES;
+]>
+<section id="chap-Joomla_Platform_Manual-JHttpTransportStream">
+ <title>JHttpTransportStream</title>
+
+ <para>Can you help improve this section of the manual?</para>
+</section>
View
51 docs/manual/en-US/chapters/classes/jmodelbase.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "../../Developer_Manual.ent">
+%BOOK_ENTITIES;
+]>
+<section>
+ <title>JModelBase</title>
+
+ <section>
+ <title>Construction</title>
+
+ <para>The contructor for <classname>JModelBase</classname> takes an optional <classname>JRegistry</classname> object that
+ defines the state of the model. If omitted, the contructor defers to the protected <methodname>loadState</methodname> method.
+ This method can be overriden in a derived class and takes the place of the <methodname>populateState</methodname> method used
+ in the legacy model class.</para>
+ </section>
+
+ <section>
+ <title>Usage</title>
+
+ <para>The <classname>JModelBase</classname> class is abstract so cannot be used directly. All requirements of the interface
+ are already satisfied by the base class.</para>
+
+ <example>
+ <title>Example model</title>
+
+ <programlisting>/**
+ * My custom model.
+ *
+ * @pacakge Examples
+ *
+ * @since 12.1
+ */
+class MyModel extends JModelBase
+{
+ /**
+ * Get the time.
+ *
+ * @return integer
+ *
+ * @since 12.1
+ */
+ public function getTime()
+ {
+ return time();
+ }
+}</programlisting>
+ </example>
+ </section>
+</section>
View
73 docs/manual/en-US/chapters/classes/jmodeldatabase.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "../../Developer_Manual.ent">
+%BOOK_ENTITIES;
+]>
+<section>
+ <title>JModelDatabase</title>
+
+ <section>
+ <title>Construction</title>
+
+ <para><classname>JModelDatabase</classname> is extended from <classname>JModelBase</classname> and the contructor takes an
+ optional <classname>JDatabaseDriver</classname> object and an optional <classname>JRegistry</classname> object (the same one
+ that <classname>JModelBase</classname> uses). If the database object is omitted, the contructor defers to the protected
+ <methodname>loadDb</methodname> method which loads the database object from the platform factory.</para>
+ </section>
+
+ <section>
+ <title>Usage</title>
+
+ <para>The <classname>JModelDatabase</classname> class is abstract so cannot be used directly. It forms a base for any model
+ that needs to interact with a database.</para>
+
+ <example>
+ <title>Example database model</title>
+
+ <programlisting>/**
+ * My custom database model.
+ *
+ * @package Examples
+ *
+ * @since 12.1
+ */
+class MyDatabaseModel extends JModelDatabase
+{
+ /**
+ * Get the content count.
+ *
+ * @return integer
+ *
+ * @since 12.1
+ * @throws RuntimeException on database error.
+ */
+ public function getCount()
+ {
+ // Get the query builder from the internal database object.
+ $q = $this-&gt;db-&gt;getQuery(true);
+
+ // Prepare the query to count the number of content records.
+ $q-&gt;select('COUNT(*)')
+ -&gt;from($q-&gt;qn('#__content'));
+
+ $this-&gt;db-&gt;setQuery($q);
+
+ // Execute and return the result.
+ return $this-&gt;db-&gt;loadResult();
+ }
+}
+
+try
+{
+ $model = new MyDatabaseModel;
+ $count = $model-&gt;getCount();
+}
+catch (RuntimeException $e)
+{
+ // Handle database error.
+}
+</programlisting>
+ </example>
+ </section>
+</section>
View
75 docs/manual/en-US/chapters/classes/jviewbase.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "../../Developer_Manual.ent">
+%BOOK_ENTITIES;
+]>
+<section>
+ <title>JViewBase</title>
+
+ <section>
+ <title>Construction</title>
+
+ <para>The contructor for <classname>JViewBase</classname> takes a <classname>JModel</classname> object and a
+ <classname>JController</classname> object. Both are mandatory.</para>
+
+ <para>Note that these are interfaces so the objects do no necessarily have to extend from <classname>JModelBase</classname> or
+ <classname>JControllerBase</classname> classes. Given that, the view should only rely on the API that is exposed by the
+ interface and not concrete classes unless the contructor is changed in a derived class to take more explicit classes or
+ interaces as required by the developer.</para>
+ </section>
+
+ <section>
+ <title>Usage</title>
+
+ <para>The <classname>JViewBase</classname> class is abstract so cannot be used directly. It forms a simple base for rendering
+ any kind of data. The class already implements the <methodname>escape</methodname> method so only a
+ <methodname>render</methodname> method need to be added. Views derived from this class would be used to support very simple
+ cases, well suited to supporting web services returning JSON, XML or possibly binary data types. This class does not support
+ layouts.</para>
+
+ <example>
+ <title>Example view</title>
+
+ <programlisting>/**
+ * My custom view.
+ *
+ * @package Examples
+ *
+ * @since 12.1
+ */
+class MyView extends JViewBase
+{
+ /**
+ * Render some data
+ *
+ * @return string The rendered view.
+ *
+ * @since 12.1
+ * @throws RuntimeException on database error.
+ */
+ public function render()
+ {
+ // Prepare some data from the model.
+ $data = array(
+ 'count' =&gt; $this-&gt;model-&gt;getCount()
+ );
+
+ // Convert the data to JSON format.
+ return json_encode($data);
+ }
+}
+
+try
+{
+ $view = new MyView(new MyDatabaseModel, new MyController);
+ echo $view-&gt;render();
+}
+catch (RuntimeException $e)
+{
+ // Handle database error.
+}
+</programlisting>
+ </example>
+ </section>
+</section>
View
93 docs/manual/en-US/chapters/classes/jviewhtml.xml
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "../../Developer_Manual.ent">
+%BOOK_ENTITIES;
+]>
+<section>
+ <title>JViewHtml</title>
+
+ <section>
+ <title>Construction</title>
+
+ <para><classname>JViewHtml</classname> is extended from <classname>JViewBase</classname>. The constructor, in addition to the
+ model and controller arguments, take an optional <classname>SplPriorityQueue</classname> object that serves as a lookup for
+ layouts. If omitted, the view defers to the protected <methodname>loadPaths</methodname> method.</para>
+ </section>
+
+ <section>
+ <title>Usage</title>
+
+ <para>The <classname>JViewHtml</classname> class is abstract so cannot be used directly. This view class implements render. It
+ will try to find the layout, include it using output buffering and return the result. The following examples show a layout
+ file that is assumed to be stored in a generic layout folder not stored under the web-server root.</para>
+
+ <example>
+ <title>Example HTML layout</title>
+