Permalink
Browse files

Merge remote branch 'upstream/staging' into getlistcount

  • Loading branch information...
2 parents 0a9136a + 5da2f90 commit ae88e054a412e8ec34898bb73753d7b4694f8778 @mahagr committed Sep 16, 2012
Showing with 1,037 additions and 1,500 deletions.
  1. +14 −2 build.xml
  2. +0 −145 build/phpcs/Joomla/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php
  3. +7 −8 build/phpcs/Joomla/ruleset.xml
  4. +11 −0 composer.json
  5. +1 −1 libraries/joomla/access/rules.php
  6. +1 −1 libraries/joomla/application/base.php
  7. +1 −1 libraries/joomla/application/daemon.php
  8. +11 −11 libraries/joomla/application/web/router.php
  9. +5 −5 libraries/joomla/application/web/router/base.php
  10. +9 −9 libraries/joomla/application/web/router/rest.php
  11. +1 −1 libraries/joomla/archive/archive.php
  12. +5 −8 libraries/joomla/archive/zip.php
  13. +4 −4 libraries/joomla/base/adapterinstance.php
  14. +0 −1 libraries/joomla/cache/cache.php
  15. +2 −2 libraries/joomla/cache/controller/callback.php
  16. +1 −4 libraries/joomla/database/driver/pdo.php
  17. +0 −2 libraries/joomla/database/driver/sqlsrv.php
  18. +1 −0 libraries/joomla/date/date.php
  19. +12 −0 libraries/joomla/document/html/html.php
  20. +1 −1 libraries/joomla/document/html/renderer/head.php
  21. +1 −1 libraries/joomla/document/html/renderer/module.php
  22. +3 −2 libraries/joomla/factory.php
  23. +0 −1 libraries/joomla/filesystem/patcher.php
  24. +1 −2 libraries/joomla/filesystem/path.php
  25. +0 −1 libraries/joomla/filesystem/stream.php
  26. +0 −1 libraries/joomla/filter/input.php
  27. +1 −1 libraries/joomla/form/field.php
  28. +1 −1 libraries/joomla/form/form.php
  29. 0 libraries/joomla/form/{rules → rule}/boolean.php
  30. 0 libraries/joomla/form/{rules → rule}/color.php
  31. 0 libraries/joomla/form/{rules → rule}/email.php
  32. 0 libraries/joomla/form/{rules → rule}/equals.php
  33. +1 −0 libraries/joomla/form/{rules → rule}/options.php
  34. 0 libraries/joomla/form/{rules → rule}/rules.php
  35. 0 libraries/joomla/form/{rules → rule}/tel.php
  36. 0 libraries/joomla/form/{rules → rule}/url.php
  37. 0 libraries/joomla/form/{rules → rule}/username.php
  38. +47 −47 libraries/joomla/grid/grid.php
  39. +76 −118 libraries/joomla/html/behavior.php
  40. +1 −2 libraries/joomla/html/grid.php
  41. +59 −12 libraries/joomla/html/html.php
  42. +5 −15 libraries/joomla/html/sliders.php
  43. +6 −20 libraries/joomla/html/tabs.php
  44. +3 −2 libraries/joomla/http/transport/curl.php
  45. +3 −0 libraries/joomla/http/transport/stream.php
  46. +1 −2 libraries/joomla/image/image.php
  47. +2 −8 libraries/joomla/installer/adapters/file.php
  48. +0 −1 libraries/joomla/installer/adapters/language.php
  49. +1 −2 libraries/joomla/installer/adapters/library.php
  50. +1 −3 libraries/joomla/installer/adapters/package.php
  51. +2 −2 libraries/joomla/installer/extension.php
  52. +6 −10 libraries/joomla/installer/installer.php
  53. +0 −154 libraries/joomla/installer/librarymanifest.php
  54. +114 −0 libraries/joomla/installer/manifest.php
  55. +87 −0 libraries/joomla/installer/manifest/library.php
  56. +76 −0 libraries/joomla/installer/manifest/package.php
  57. +0 −141 libraries/joomla/installer/packagemanifest.php
  58. +1 −1 libraries/joomla/language/helper.php
  59. +5 −5 libraries/joomla/language/language.php
  60. +3 −2 libraries/joomla/language/text.php
  61. +1 −1 libraries/joomla/log/logger/callback.php
  62. +5 −4 libraries/joomla/mail/mail.php
  63. +1 −4 libraries/joomla/pagination/pagination.php
  64. +2 −2 libraries/joomla/plugin/helper.php
  65. +1 −1 libraries/joomla/table/asset.php
  66. +1 −1 libraries/joomla/table/language.php
  67. +2 −2 libraries/joomla/table/nested.php
  68. +1 −1 libraries/joomla/table/table.php
  69. +1 −1 libraries/joomla/table/update.php
  70. +1 −1 libraries/joomla/table/user.php
  71. +1 −1 libraries/joomla/table/usergroup.php
  72. +1 −1 libraries/joomla/table/viewlevel.php
  73. +20 −12 libraries/joomla/user/user.php
  74. +1 −1 libraries/joomla/utilities/arrayhelper.php
  75. +1 −1 libraries/legacy/application/application.php
  76. +2 −5 libraries/legacy/base/node.php
  77. +2 −2 libraries/legacy/base/tree.php
  78. +4 −7 libraries/legacy/categories/categories.php
  79. +5 −9 libraries/legacy/component/helper.php
  80. +0 −515 libraries/legacy/editor/editor.php
  81. +1 −1 libraries/legacy/model/admin.php
  82. +1 −1 libraries/legacy/model/form.php
  83. +1 −1 libraries/legacy/table/category.php
  84. +2 −2 libraries/legacy/table/content.php
  85. +1 −1 libraries/legacy/table/menu.php
  86. +1 −1 libraries/legacy/table/menu/type.php
  87. +1 −1 libraries/legacy/table/module.php
  88. +10 −1 libraries/legacy/table/session.php
  89. +6 −7 libraries/legacy/view/legacy.php
  90. +1 −16 libraries/legacy/web/web.php
  91. +8 −1 tests/core/case/database.php
  92. +0 −92 tests/suites/legacy/editor/JEditorTest.php
  93. +5 −5 tests/suites/unit/joomla/application/web/router/JApplicationWebRouterRestTest.php
  94. +12 −5 tests/suites/unit/joomla/form/fields/JFormFieldAccessLevelTest.php
  95. +12 −5 tests/suites/unit/joomla/form/fields/JFormFieldPluginsTest.php
  96. +12 −5 tests/suites/unit/joomla/form/fields/JFormFieldSQLTest.php
  97. +12 −5 tests/suites/unit/joomla/form/fields/JFormFieldUsergroupTest.php
  98. +0 −1 tests/suites/unit/joomla/form/{rules → rule}/JFormRuleBooleanTest.php
  99. +0 −1 tests/suites/unit/joomla/form/{rules → rule}/JFormRuleColorTest.php
  100. +0 −1 tests/suites/unit/joomla/form/{rules → rule}/JFormRuleEmailTest.php
  101. +0 −1 tests/suites/unit/joomla/form/{rules → rule}/JFormRuleEqualsTest.php
  102. +0 −1 tests/suites/unit/joomla/form/{rules → rule}/JFormRuleOptionsTest.php
  103. +0 −3 tests/suites/unit/joomla/form/{rules → rule}/JFormRuleRulesTest.php
  104. +0 −1 tests/suites/unit/joomla/form/{rules → rule}/JFormRuleTelTest.php
  105. +0 −3 tests/suites/unit/joomla/form/{rules → rule}/JFormRuleUrlTest.php
  106. +0 −1 tests/suites/unit/joomla/form/{rules → rule}/JFormRuleUsernameTest.php
  107. +46 −0 tests/suites/unit/joomla/installer/JInstallerManifestTest.php
  108. +1 −1 tests/suites/unit/joomla/installer/JInstallerTest.php
  109. +22 −0 tests/suites/unit/joomla/installer/data/joomla.xml
  110. +17 −0 tests/suites/unit/joomla/installer/data/pkg_joomla.xml
  111. +100 −0 tests/suites/unit/joomla/installer/manifest/JInstallerManifestLibraryTest.php
  112. +90 −0 tests/suites/unit/joomla/installer/manifest/JInstallerManifestPackageTest.php
  113. +14 −1 tests/suites/unit/joomla/user/JUserTest.php
  114. +14 −0 tests/suites/unit/joomla/user/JUserTest.xml
View
@@ -2,7 +2,7 @@
<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="joomlasource" value="libraries/joomla,libraries/legacy,libraries/compat,libraries/platform.php,libraries/loader.php,libraries/import.php" />
<target name="clean" description="Clean up and create artifact directories">
<delete dir="${basedir}/build/api" />
@@ -80,9 +80,10 @@
<target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer">
<exec executable="phpcs">
<arg value="--report=checkstyle" />
+ <arg value="--extensions=php,css" />
<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 value="--ignore=config.example.php" />
<arg path="${source}" />
</exec>
</target>
@@ -111,5 +112,16 @@
</exec>
</target>
+ <target name="lint" description="Perform syntax check of sourcecode files">
+ <apply executable="php" failonerror="true">
+ <arg value="-l" />
+
+ <fileset dir="${source}">
+ <include name="**/*.php" />
+ <modified />
+ </fileset>
+ </apply>
+ </target>
+
<target name="build" depends="clean,phpunit,phpunit-legacy,parallelTasks,phpcb" />
</project>
@@ -1,145 +0,0 @@
-<?php
-/**
- * Joomla_Sniffs_Whitespace_ScopeClosingBraceSniff.
- *
- * PHP version 5
- *
- * @category PHP
- * @package PHP_CodeSniffer
- * @author Greg Sherwood <gsherwood@squiz.net>
- * @author Marc McIntyre <mmcintyre@squiz.net>
- * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600)
- * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
- * @version CVS: $Id: ScopeClosingBraceSniff.php 287526 2009-08-21 05:42:05Z squiz $
- * @link http://pear.php.net/package/PHP_CodeSniffer
- */
-
-/**
- * Joomla_Sniffs_Whitespace_ScopeClosingBraceSniff.
- *
- * Checks that the closing braces of scopes are aligned correctly.
- *
- * @category PHP
- * @package PHP_CodeSniffer
- * @author Greg Sherwood <gsherwood@squiz.net>
- * @author Marc McIntyre <mmcintyre@squiz.net>
- * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600)
- * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
- * @version Release: 1.3.0RC2
- * @link http://pear.php.net/package/PHP_CodeSniffer
- */
-class Joomla_Sniffs_WhiteSpace_ScopeClosingBraceSniff implements PHP_CodeSniffer_Sniff
-{
-
-
- /**
- * Returns an array of tokens this test wants to listen for.
- *
- * @return array
- */
- public function register()
- {
- return PHP_CodeSniffer_Tokens::$scopeOpeners;
-
- }//end register()
-
-
- /**
- * Processes this test, when one of its tokens is encountered.
- *
- * @param PHP_CodeSniffer_File $phpcsFile All the tokens found in the document.
- * @param int $stackPtr The position of the current token
- * in the stack passed in $tokens.
- *
- * @return void
- */
- public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
- {
- $tokens = $phpcsFile->getTokens();
-
- // If this is an inline condition (ie. there is no scope opener), then
- // return, as this is not a new scope.
- if (isset($tokens[$stackPtr]['scope_closer']) === false) {
- return;
- }
-
- $scopeStart = $tokens[$stackPtr]['scope_opener'];
- $scopeEnd = $tokens[$stackPtr]['scope_closer'];
-
- // If the scope closer doesn't think it belongs to this scope opener
- // then the opener is sharing its closer ith other tokens. We only
- // want to process the closer once, so skip this one.
- if ($tokens[$scopeEnd]['scope_condition'] !== $stackPtr) {
- return;
- }
-
- // We need to actually find the first piece of content on this line,
- // because if this is a method with tokens before it (public, static etc)
- // or an if with an else before it, then we need to start the scope
- // checking from there, rather than the current token.
- $lineStart = ($stackPtr - 1);
- for ($lineStart; $lineStart > 0; $lineStart--) {
- if (strpos($tokens[$lineStart]['content'], $phpcsFile->eolChar) !== false) {
- break;
- }
- }
-
- // We found a new line, now go forward and find the first non-whitespace
- // token.
- $lineStart= $phpcsFile->findNext(
- array(T_WHITESPACE),
- ($lineStart + 1),
- null,
- true
- );
-
- $startColumn = $tokens[$lineStart]['column'];
-
- // Check that the closing brace is on it's own line.
- $lastContent = $phpcsFile->findPrevious(
- array(T_WHITESPACE),
- ($scopeEnd - 1),
- $scopeStart,
- true
- );
-
- if ($tokens[$lastContent]['line'] === $tokens[$scopeEnd]['line']) {
- $error = 'Closing brace must be on a line by itself';
- $phpcsFile->addError($error, $scopeEnd, 'Line');
- return;
- }
-
- // Check now that the closing brace is lined up correctly.
- $braceIndent = $tokens[$scopeEnd]['column'];
- $isBreakCloser = ($tokens[$scopeEnd]['code'] === T_BREAK);
- if (in_array($tokens[$stackPtr]['code'], array(T_CASE, T_DEFAULT)) === true
- && $isBreakCloser === true
- ) {
- // BREAK statements should be indented 4 spaces from the
- // CASE or DEFAULT statement.
- if ($braceIndent !== ($startColumn + 4)) {
-// TODO AJE Allow for tab indents instead of spaces
-// $error = 'Break statement indented incorrectly; expected %s spaces, found %s';
-// $data = array(
-// ($startColumn + 3),
-// ($braceIndent - 1),
-// );
-// $phpcsFile->addError($error, $scopeEnd, 'BreakIdent', $data);
- }
- } else {
- if ($braceIndent !== $startColumn) {
- $error = 'Closing brace indented incorrectly; expected %s spaces, found %s';
- $data = array(
- ($startColumn - 1),
- ($braceIndent - 1),
- );
- $phpcsFile->addError($error, $scopeEnd, 'Indent', $data);
- }
- }
-
- }//end process()
-
-
-}//end class
-
-?>
@@ -2,15 +2,12 @@
<ruleset name="Joomla">
<description>The Joomla coding standard.</description>
- <!-- Exclude all javascript files. There are bugs and we don't have any rules anyways. -->
- <exclude-pattern>*.js</exclude-pattern>
-
<!-- Exclude 3rd party libraries. -->
- <exclude-pattern>*/phputf8/*</exclude-pattern>
- <exclude-pattern>*/simplepie/*</exclude-pattern>
- <exclude-pattern>*/phpmailer/phpmailer.php</exclude-pattern>
- <exclude-pattern>*/phpmailer/smtp.php</exclude-pattern>
- <exclude-pattern>*/phpmailer/pop3.php</exclude-pattern>
+ <exclude-pattern>phputf8/*</exclude-pattern>
+ <exclude-pattern>simplepie/*</exclude-pattern>
+ <exclude-pattern>phpmailer/phpmailer.php</exclude-pattern>
+ <exclude-pattern>phpmailer/smtp.php</exclude-pattern>
+ <exclude-pattern>phpmailer/pop3.php</exclude-pattern>
<exclude-pattern>*/mootree*.css</exclude-pattern>
<exclude-pattern>*/mooRainbow.css</exclude-pattern>
<exclude-pattern>*/modal.css</exclude-pattern>
@@ -52,6 +49,8 @@
<rule ref="Squiz.Scope.StaticThisUsage"/>
+ <rule ref="Squiz.WhiteSpace.ScopeClosingBrace"/>
+
<!-- Lines can be 85 chars long, but never show errors -->
<rule ref="Generic.Files.LineLength">
<properties>
View
@@ -0,0 +1,11 @@
+{
+ "name": "joomla/joomla-platform",
+ "type": "library",
+ "description": "The Joomla Platform is a platform for writing Web and command line applications in PHP.",
+ "keywords": ["joomla","platform"],
+ "homepage": "https://github.com/joomla/joomla-platform",
+ "license": "GNU Public License",
+ "require": {
+ "php": ">=5.3.1"
+ }
+}
@@ -178,7 +178,7 @@ public function allow($action, $identity)
*
* @param mixed $identity An integer representing the identity or an array of identities
*
- * @return object Allowed actions for the identity or identities
+ * @return JObject Allowed actions for the identity or identities
*
* @since 11.1
*/
@@ -73,7 +73,7 @@ public function getIdentity()
* Registers a handler to a particular event group.
*
* @param string $event The event name.
- * @param callback $handler The handler, a function or an instance of a event object.
+ * @param callable $handler The handler, a function or an instance of a event object.
*
* @return JApplicationBase The application to allow chaining.
*
@@ -858,7 +858,7 @@ protected function pcntlFork()
* Method to install a signal handler.
*
* @param integer $signal The signal number.
- * @param callback $handler The signal handler which may be the name of a user created function,
+ * @param callable $handler The signal handler which may be the name of a user created function,
* or method, or either of the two global constants SIG_IGN or SIG_DFL.
* @param boolean $restart Specifies whether system call restarting should be used when this
* signal arrives.
@@ -14,31 +14,31 @@
*
* @package Joomla.Platform
* @subpackage Application
- * @since 12.3
+ * @since 12.2
*/
abstract class JApplicationWebRouter
{
/**
* @var JApplicationWeb The web application on whose behalf we are routing the request.
- * @since 12.3
+ * @since 12.2
*/
protected $app;
/**
* @var string The default page controller name for an empty route.
- * @since 12.3
+ * @since 12.2
*/
protected $default;
/**
* @var string Controller class name prefix for creating controller objects by name.
- * @since 12.3
+ * @since 12.2
*/
protected $controllerPrefix;
/**
* @var JInput An input object from which to derive the route.
- * @since 12.3
+ * @since 12.2
*/
protected $input;
@@ -49,7 +49,7 @@
* @param JInput $input An optional input object from which to derive the route. If none
* is given than the input from the application object will be used.
*
- * @since 12.3
+ * @since 12.2
*/
public function __construct(JApplicationWeb $app, JInput $input = null)
{
@@ -64,7 +64,7 @@ public function __construct(JApplicationWeb $app, JInput $input = null)
*
* @return void
*
- * @since 12.3
+ * @since 12.2
* @throws InvalidArgumentException
* @throws RuntimeException
*/
@@ -87,7 +87,7 @@ public function execute($route)
*
* @return JApplicationWebRouter This object for method chaining.
*
- * @since 12.3
+ * @since 12.2
*/
public function setControllerPrefix($prefix)
{
@@ -103,7 +103,7 @@ public function setControllerPrefix($prefix)
*
* @return JApplicationWebRouter This object for method chaining.
*
- * @since 12.3
+ * @since 12.2
*/
public function setDefaultController($name)
{
@@ -119,7 +119,7 @@ public function setDefaultController($name)
*
* @return string The controller name for the given route excluding prefix.
*
- * @since 12.3
+ * @since 12.2
* @throws InvalidArgumentException
*/
abstract protected function parseRoute($route);
@@ -131,7 +131,7 @@ public function setDefaultController($name)
*
* @return JController
*
- * @since 12.3
+ * @since 12.2
* @throws RuntimeException
*/
protected function fetchController($name)
@@ -14,14 +14,14 @@
*
* @package Joomla.Platform
* @subpackage Application
- * @since 12.3
+ * @since 12.2
*/
class JApplicationWebRouterBase extends JApplicationWebRouter
{
/**
* @var array An array of rules, each rule being an associative array('regex'=> $regex, 'vars' => $vars, 'controller' => $controller)
* for routing the request.
- * @since 12.3
+ * @since 12.2
*/
protected $maps = array();
@@ -33,7 +33,7 @@ class JApplicationWebRouterBase extends JApplicationWebRouter
*
* @return JApplicationWebRouter This object for method chaining.
*
- * @since 12.3
+ * @since 12.2
*/
public function addMap($pattern, $controller)
{
@@ -104,7 +104,7 @@ public function addMap($pattern, $controller)
*
* @return JApplicationWebRouter This object for method chaining.
*
- * @since 12.3
+ * @since 12.2
*/
public function addMaps($maps)
{
@@ -123,7 +123,7 @@ public function addMaps($maps)
*
* @return string The controller name for the given route excluding prefix.
*
- * @since 12.3
+ * @since 12.2
* @throws InvalidArgumentException
*/
protected function parseRoute($route)
Oops, something went wrong. Retry.

0 comments on commit ae88e05

Please sign in to comment.