forked from joomla/joomla-platform
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'orig_master/staging' into media_preview
- Loading branch information
Showing
265 changed files
with
3,944 additions
and
2,446 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?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 but not recommended. Each controller class should | ||
do just one sort of 'thing', just 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->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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
Oops, something went wrong.