[MediaWiki-commits] [Gerrit] mediawiki...MediaWikiFarm[master]: Documentation and heavy testing

2017-03-26 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/344830 )

Change subject: Documentation and heavy testing
..


Documentation and heavy testing

Documentation:
* Configured phpDocumentor2 to report issue in all directories, notably /tests
* Fixed all phpDocumentor2 errors
* Added @api or @internal on runtime methods
* Added @package on all classes and functions
* Added PHPDoc on placeholder functions (attributed them @package MediaWiki)
* The first line of PHPDoc is always a single line ending with a period or a 
question mark
* Added some metadata in composer.json and extension.json
* The file PHPDoc is always only the classes and functions contained in the 
file, no more description

Code:
* Removed a duplicate function (rmdirr as function and public static method)
* Registered the config parameter $wgMediaWikiFarmSyslog in extension.json

Testing:
* Tested with HHVM 3.18.1 (~PHP 5.6.99) with PHPUnit 4.8.35, 5.7.17
* Tested with PHP 7.2.0-dev (php+phpdbg) with PHPUnit 4.8.35, 5.7.17, 6.0.10, 
6.1-dev
* Tested with PHP 7.1.0 (php+phpdbg) with PHPUnit 4.8.35, 5.7.17, 6.0.10, 
6.1-dev
* Tested with PHP 7.0.16 (php+phpdbg) with PHPUnit 4.8.35, 5.7.17, 6.0.10, 
6.1-dev
* Tested with PHP 5.6.30 (php+phpdbg) with PHPUnit 4.8.35, 5.7.17
* Tested with PHP 5.2.17 (php) with PHPUnit 3.4.15
* Strict code coverage always passes with 100% (no result for HHVM because no 
driver)
* Wrote a doc in docs/tests.rst about PHP 5.2 since I do not let some PHP 5.2 
oddities in tests
* Fixed a failed test with PHP 5.2 because PHPUnit 3.4 does not restore working 
directory between tests
* Changed assertEmpty to assertEquals( array(), … ) to make PHPUnit 3.4 happy
* When standalone PHPUnit is executed, MediaWikiFarmTestCase is either a 
subclass of
  PHPUnit_Framework_TestCase (PHPUnit < 6.0) or PHPUnit\Framework\TestCase 
(PHPUnit ≥ 6.0)
* Added scripts in composer.json for system PHP 5 (probably 5.6) and PHP 5.2 to 
facilitate
  tests for these versions

Change-Id: Icbce6af7a518acbc06c76b537252cb73a702beb6
---
M composer.json
M docs/index.rst
A docs/tests.rst
M extension.json
M src/AbstractMediaWikiFarmScript.php
M src/Hooks.php
M src/MediaWikiFarm.php
M src/MediaWikiFarmComposerScript.php
M src/MediaWikiFarmScript.php
M src/Yaml.php
M tests/perfs/MediaWikiFarmTestPerfs.php
M tests/perfs/index.php
M tests/perfs/perfs.php
M tests/phpunit/ConfigurationTest.php
M tests/phpunit/ConstructionTest.php
M tests/phpunit/FunctionsTest.php
M tests/phpunit/HooksTest.php
M tests/phpunit/InstallationIndependantTest.php
M tests/phpunit/LoadingTest.php
M tests/phpunit/LoggingTest.php
M tests/phpunit/MediaWikiFarmComposerScriptTest.php
M tests/phpunit/MediaWikiFarmScriptTest.php
M tests/phpunit/MediaWikiFarmTestCase.php
M tests/phpunit/MonoversionInstallationTest.php
M tests/phpunit/MultiversionInstallationTest.php
25 files changed, 379 insertions(+), 68 deletions(-)

Approvals:
  Seb35: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/composer.json b/composer.json
index 61956c2..f55954c 100644
--- a/composer.json
+++ b/composer.json
@@ -1,42 +1,69 @@
 {
"name": "mediawiki-extensions/media-wiki-farm",
"description": "Configuration management for MediaWiki farms.",
+   "version": "0.4.0",
"keywords": ["mediawiki"],
-   "homepage": "https://www.seb35.fr;,
+   "homepage": "https://www.mediawiki.org/wiki/Extension:MediaWikiFarm;,
+   "license": "GPL-3.0+",
"authors": [
{
"name": "Sébastien Beyou",
"homepage": "https://www.seb35.fr;
}
],
-   "license": "GPL-3.0+",
+   "support": {
+   "issues": 
"https://phabricator.wikimedia.org/tag/mediawiki-extensions-mediawikifarm;,
+   "wiki": 
"https://www.mediawiki.org/wiki/Extension:MediaWikiFarm;,
+   "source": "https://phabricator.wikimedia.org/diffusion/EMWF;
+   },
+
+
"require": {
"php": ">=5.2",
"symfony/yaml": "^2.0 || ^3.0"
},
"require-dev": {
"justinrainbow/json-schema": "~3.0",
-   "phpunit/phpunit": "~4.8",
+   "phpunit/phpunit": "^3.4 || ^4.0 || ^5.0 || ^6.0",
"jakub-onderka/php-parallel-lint": "*",
"phpmd/phpmd": "*",
"mediawiki/mediawiki-codesniffer": "*"
},
"suggest": {
-   "phpdocumentor/phpdocumentor": "*"
+   "phpdocumentor/phpdocumentor": "phpDocumentor2 (^2.8) is 
supported for code documentation; you should install it as PHAR because of 
version contraints."
},
+
+
"scripts": {
"validate-schema": "php ./bin/validate-schema.php",
+
"lint": "parallel-lint --exclude vendor .",
-   "phpcs": "phpcs -p -s",
-   "phpdoc": "[ \"`which 

[MediaWiki-commits] [Gerrit] mediawiki...MediaWikiFarm[master]: Documentation and heavy testing

2017-03-26 Thread Seb35 (Code Review)
Seb35 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/344830 )

Change subject: Documentation and heavy testing
..

Documentation and heavy testing

Documentation:
* Configured phpDocumentor2 to report issue in all directories, notably /tests
* Fixed all phpDocumentor2 errors
* Added @api or @internal on runtime methods
* Added @package on all classes and functions
* Added PHPDoc on placeholder functions (attributed them @package MediaWiki)
* The first line of PHPDoc is always a single line ending with a period or a 
question mark
* Added some metadata in composer.json and extension.json
* The file PHPDoc is always only the classes and functions contained in the 
file, no more description

Code:
* Removed a duplicate function (rmdirr as function and public static method)
* Registered the config parameter $wgMediaWikiFarmSyslog in extension.json

Testing:
* Tested with PHP 7.2.0-dev (php+phpdbg) with PHPUnit 4.8.35, 5.7.17, 6.0.10, 
6.1-dev
* Tested with PHP 7.1.0 (php+phpdbg) with PHPUnit 4.8.35, 5.7.17, 6.0.10, 
6.1-dev
* Tested with PHP 7.0.16 (php+phpdbg) with PHPUnit 4.8.35, 5.7.17, 6.0.10, 
6.1-dev
* Tested with PHP 5.6.30 (php+phpdbg) with PHPUnit 4.8.35, 5.7.17
* Tested with PHP 5.2.17 (php) with PHPUnit 3.4.15
* Strict code coverage always passes with 100%
* Wrote a doc in docs/tests.rst about PHP 5.2 since I do not let some PHP 5.2 
oddities in tests
* Fixed a failed test with PHP 5.2 because PHPUnit 3.4 does not restore working 
directory between tests
* Changed assertEmpty to assertEquals( array(), … ) to make PHPUnit 3.4 happy
* When standalone PHPUnit is executed, MediaWikiFarmTestCase is either a 
subclass of
  PHPUnit_Framework_TestCase (PHPUnit < 6.0) or PHPUnit\Framework\TestCase 
(PHPUnit ≥ 6.0)
* Added scripts in composer.json for system PHP 5 (probably 5.6) and PHP 5.2 to 
facilitate
  tests for these versions

Change-Id: Icbce6af7a518acbc06c76b537252cb73a702beb6
---
M composer.json
M docs/index.rst
A docs/tests.rst
M extension.json
M src/AbstractMediaWikiFarmScript.php
M src/Hooks.php
M src/MediaWikiFarm.php
M src/MediaWikiFarmComposerScript.php
M src/MediaWikiFarmScript.php
M src/Yaml.php
M tests/perfs/MediaWikiFarmTestPerfs.php
M tests/perfs/index.php
M tests/perfs/perfs.php
M tests/phpunit/ConfigurationTest.php
M tests/phpunit/ConstructionTest.php
M tests/phpunit/FunctionsTest.php
M tests/phpunit/HooksTest.php
M tests/phpunit/InstallationIndependantTest.php
M tests/phpunit/LoadingTest.php
M tests/phpunit/LoggingTest.php
M tests/phpunit/MediaWikiFarmComposerScriptTest.php
M tests/phpunit/MediaWikiFarmScriptTest.php
M tests/phpunit/MediaWikiFarmTestCase.php
M tests/phpunit/MonoversionInstallationTest.php
M tests/phpunit/MultiversionInstallationTest.php
25 files changed, 379 insertions(+), 68 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MediaWikiFarm 
refs/changes/30/344830/1

diff --git a/composer.json b/composer.json
index 61956c2..f55954c 100644
--- a/composer.json
+++ b/composer.json
@@ -1,42 +1,69 @@
 {
"name": "mediawiki-extensions/media-wiki-farm",
"description": "Configuration management for MediaWiki farms.",
+   "version": "0.4.0",
"keywords": ["mediawiki"],
-   "homepage": "https://www.seb35.fr;,
+   "homepage": "https://www.mediawiki.org/wiki/Extension:MediaWikiFarm;,
+   "license": "GPL-3.0+",
"authors": [
{
"name": "Sébastien Beyou",
"homepage": "https://www.seb35.fr;
}
],
-   "license": "GPL-3.0+",
+   "support": {
+   "issues": 
"https://phabricator.wikimedia.org/tag/mediawiki-extensions-mediawikifarm;,
+   "wiki": 
"https://www.mediawiki.org/wiki/Extension:MediaWikiFarm;,
+   "source": "https://phabricator.wikimedia.org/diffusion/EMWF;
+   },
+
+
"require": {
"php": ">=5.2",
"symfony/yaml": "^2.0 || ^3.0"
},
"require-dev": {
"justinrainbow/json-schema": "~3.0",
-   "phpunit/phpunit": "~4.8",
+   "phpunit/phpunit": "^3.4 || ^4.0 || ^5.0 || ^6.0",
"jakub-onderka/php-parallel-lint": "*",
"phpmd/phpmd": "*",
"mediawiki/mediawiki-codesniffer": "*"
},
"suggest": {
-   "phpdocumentor/phpdocumentor": "*"
+   "phpdocumentor/phpdocumentor": "phpDocumentor2 (^2.8) is 
supported for code documentation; you should install it as PHAR because of 
version contraints."
},
+
+
"scripts": {
"validate-schema": "php ./bin/validate-schema.php",
+
"lint": "parallel-lint --exclude vendor .",
-   "phpcs": "phpcs -p -s",
-   "phpdoc": "[ \"`which phpdoc`\" = \"\" ] || phpdoc -d bin,src 
-t ./docs/code",
-   "phpunit": "which 

[MediaWiki-commits] [Gerrit] mediawiki...MediaWikiFarm[master]: Documentation

2017-03-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/342762 )

Change subject: Documentation
..


Documentation

Fix phpDoc errors

Change-Id: I2142530d4c811b28156f2f331c94a21cf1c1149e
---
M bin/mwcomposer.php
M bin/mwscript.php
M bin/validate-schema.php
M src/AbstractMediaWikiFarmScript.php
M src/MediaWikiFarm.php
M src/MediaWikiFarmComposerAutoloader.php
M src/MediaWikiFarmComposerScript.php
M src/MediaWikiFarmScript.php
M src/Yaml.php
M src/main.php
M www/api.php
M www/img_auth.php
M www/index.php
M www/load.php
M www/opensearch_desc.php
15 files changed, 29 insertions(+), 2 deletions(-)

Approvals:
  Seb35: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/bin/mwcomposer.php b/bin/mwcomposer.php
index 97dbeca..c1372fc 100644
--- a/bin/mwcomposer.php
+++ b/bin/mwcomposer.php
@@ -2,6 +2,7 @@
 /**
  * Wrapper around Composer to create as many autoloaders as MediaWiki 
extensions.
  *
+ * @package MediaWikiFarm
  * @author Sébastien Beyou ~ Seb35 
  * @license GPL-3.0+ GNU General Public License v3.0 ou version ultérieure
  * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version 
ultérieure
diff --git a/bin/mwscript.php b/bin/mwscript.php
index 14751bf..1767d71 100644
--- a/bin/mwscript.php
+++ b/bin/mwscript.php
@@ -2,6 +2,7 @@
 /**
  * Entry point for CLI scripts in the context of a MediaWiki farm.
  *
+ * @package MediaWikiFarm
  * @author Sébastien Beyou ~ Seb35 
  * @license GPL-3.0+ GNU General Public License v3.0 ou version ultérieure
  * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version 
ultérieure
diff --git a/bin/validate-schema.php b/bin/validate-schema.php
index 758b5a6..b4aa8cc 100644
--- a/bin/validate-schema.php
+++ b/bin/validate-schema.php
@@ -3,6 +3,8 @@
  * Validate the files 'config/farms.[yml|json|php]' against 
'docs/farms-schema.json'.
  *
  * This files is mostly inspired from the README 
https://github.com/justinrainbow/json-schema
+ *
+ * @package MediaWikiFarm
  */
 // @codeCoverageIgnoreStart
 
diff --git a/src/AbstractMediaWikiFarmScript.php 
b/src/AbstractMediaWikiFarmScript.php
index ea407a4..8ef2bf7 100644
--- a/src/AbstractMediaWikiFarmScript.php
+++ b/src/AbstractMediaWikiFarmScript.php
@@ -2,6 +2,7 @@
 /**
  * Script class.
  *
+ * @package MediaWikiFarm
  * @author Sébastien Beyou ~ Seb35 
  * @license GPL-3.0+ GNU General Public License v3.0 ou version ultérieure
  * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version 
ultérieure
diff --git a/src/MediaWikiFarm.php b/src/MediaWikiFarm.php
index 89e60aa..5339e58 100644
--- a/src/MediaWikiFarm.php
+++ b/src/MediaWikiFarm.php
@@ -2,6 +2,7 @@
 /**
  * Class MediaWikiFarm.
  *
+ * @package MediaWikiFarm
  * @author Sébastien Beyou ~ Seb35 
  * @license GPL-3.0+ GNU General Public License v3.0 ou version ultérieure
  * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version 
ultérieure
@@ -186,6 +187,7 @@
 * @mediawikifarm-const
 *
 * @param string|null $key Key of the wanted section or null for the 
whole array.
+* @param string|null $key2 Subkey (specific to each entry) or null for 
the whole entry.
 * @return array MediaWiki configuration, either entire, either a part 
depending on the parameter.
 */
function getConfiguration( $key = null, $key2 = null ) {
@@ -219,6 +221,7 @@
 * @param string $entryPoint Name of the entry point, e.g. 'index.php', 
'load.php'…
 * @param string|null $host Host name (string) or null to use the 
global variables HTTP_HOST or SERVER_NAME.
 * @param array $state Parameters, see object property $state.
+* @param array $environment Environment which determines a given 
configuration.
 * @return string $entryPoint Identical entry point as passed in input.
 */
static function load( $entryPoint = '', $host = null, $state = array(), 
$environment = array() ) {
diff --git a/src/MediaWikiFarmComposerAutoloader.php 
b/src/MediaWikiFarmComposerAutoloader.php
index 41a8752..a6edfda 100644
--- a/src/MediaWikiFarmComposerAutoloader.php
+++ b/src/MediaWikiFarmComposerAutoloader.php
@@ -1,8 +1,9 @@
 getConfiguration( 'composer' 
);
foreach( $extensions as $extension ) {
diff --git a/src/MediaWikiFarmComposerScript.php 
b/src/MediaWikiFarmComposerScript.php
index ae3c9d9..f46e232 100644
--- a/src/MediaWikiFarmComposerScript.php
+++ b/src/MediaWikiFarmComposerScript.php
@@ -2,6 +2,7 @@
 /**
  * Wrapper around Composer to create as many autoloaders as MediaWiki 
extensions.
  *
+ * @package MediaWikiFarm
  * @author Sébastien Beyou ~ Seb35 
  * @license GPL-3.0+ GNU General Public License v3.0 ou version ultérieure
  * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version 
ultérieure
@@ -264,6 +265,15 @@
   

[MediaWiki-commits] [Gerrit] mediawiki...MediaWikiFarm[master]: Documentation

2017-03-14 Thread Seb35 (Code Review)
Seb35 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/342762 )

Change subject: Documentation
..

Documentation

Fix phpDoc errors

Change-Id: I2142530d4c811b28156f2f331c94a21cf1c1149e
---
M bin/mwcomposer.php
M bin/mwscript.php
M bin/validate-schema.php
M src/AbstractMediaWikiFarmScript.php
M src/MediaWikiFarm.php
M src/MediaWikiFarmComposerAutoloader.php
M src/MediaWikiFarmComposerScript.php
M src/MediaWikiFarmScript.php
M src/Yaml.php
M src/main.php
M www/api.php
M www/img_auth.php
M www/index.php
M www/load.php
M www/opensearch_desc.php
15 files changed, 29 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MediaWikiFarm 
refs/changes/62/342762/1

diff --git a/bin/mwcomposer.php b/bin/mwcomposer.php
index 97dbeca..c1372fc 100644
--- a/bin/mwcomposer.php
+++ b/bin/mwcomposer.php
@@ -2,6 +2,7 @@
 /**
  * Wrapper around Composer to create as many autoloaders as MediaWiki 
extensions.
  *
+ * @package MediaWikiFarm
  * @author Sébastien Beyou ~ Seb35 
  * @license GPL-3.0+ GNU General Public License v3.0 ou version ultérieure
  * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version 
ultérieure
diff --git a/bin/mwscript.php b/bin/mwscript.php
index 14751bf..1767d71 100644
--- a/bin/mwscript.php
+++ b/bin/mwscript.php
@@ -2,6 +2,7 @@
 /**
  * Entry point for CLI scripts in the context of a MediaWiki farm.
  *
+ * @package MediaWikiFarm
  * @author Sébastien Beyou ~ Seb35 
  * @license GPL-3.0+ GNU General Public License v3.0 ou version ultérieure
  * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version 
ultérieure
diff --git a/bin/validate-schema.php b/bin/validate-schema.php
index 758b5a6..b4aa8cc 100644
--- a/bin/validate-schema.php
+++ b/bin/validate-schema.php
@@ -3,6 +3,8 @@
  * Validate the files 'config/farms.[yml|json|php]' against 
'docs/farms-schema.json'.
  *
  * This files is mostly inspired from the README 
https://github.com/justinrainbow/json-schema
+ *
+ * @package MediaWikiFarm
  */
 // @codeCoverageIgnoreStart
 
diff --git a/src/AbstractMediaWikiFarmScript.php 
b/src/AbstractMediaWikiFarmScript.php
index ea407a4..8ef2bf7 100644
--- a/src/AbstractMediaWikiFarmScript.php
+++ b/src/AbstractMediaWikiFarmScript.php
@@ -2,6 +2,7 @@
 /**
  * Script class.
  *
+ * @package MediaWikiFarm
  * @author Sébastien Beyou ~ Seb35 
  * @license GPL-3.0+ GNU General Public License v3.0 ou version ultérieure
  * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version 
ultérieure
diff --git a/src/MediaWikiFarm.php b/src/MediaWikiFarm.php
index 89e60aa..5339e58 100644
--- a/src/MediaWikiFarm.php
+++ b/src/MediaWikiFarm.php
@@ -2,6 +2,7 @@
 /**
  * Class MediaWikiFarm.
  *
+ * @package MediaWikiFarm
  * @author Sébastien Beyou ~ Seb35 
  * @license GPL-3.0+ GNU General Public License v3.0 ou version ultérieure
  * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version 
ultérieure
@@ -186,6 +187,7 @@
 * @mediawikifarm-const
 *
 * @param string|null $key Key of the wanted section or null for the 
whole array.
+* @param string|null $key2 Subkey (specific to each entry) or null for 
the whole entry.
 * @return array MediaWiki configuration, either entire, either a part 
depending on the parameter.
 */
function getConfiguration( $key = null, $key2 = null ) {
@@ -219,6 +221,7 @@
 * @param string $entryPoint Name of the entry point, e.g. 'index.php', 
'load.php'…
 * @param string|null $host Host name (string) or null to use the 
global variables HTTP_HOST or SERVER_NAME.
 * @param array $state Parameters, see object property $state.
+* @param array $environment Environment which determines a given 
configuration.
 * @return string $entryPoint Identical entry point as passed in input.
 */
static function load( $entryPoint = '', $host = null, $state = array(), 
$environment = array() ) {
diff --git a/src/MediaWikiFarmComposerAutoloader.php 
b/src/MediaWikiFarmComposerAutoloader.php
index 41a8752..a6edfda 100644
--- a/src/MediaWikiFarmComposerAutoloader.php
+++ b/src/MediaWikiFarmComposerAutoloader.php
@@ -1,8 +1,9 @@
 getConfiguration( 'composer' 
);
foreach( $extensions as $extension ) {
diff --git a/src/MediaWikiFarmComposerScript.php 
b/src/MediaWikiFarmComposerScript.php
index ae3c9d9..f46e232 100644
--- a/src/MediaWikiFarmComposerScript.php
+++ b/src/MediaWikiFarmComposerScript.php
@@ -2,6 +2,7 @@
 /**
  * Wrapper around Composer to create as many autoloaders as MediaWiki 
extensions.
  *
+ * @package MediaWikiFarm
  * @author Sébastien Beyou ~ Seb35 
  * @license GPL-3.0+ GNU General Public License v3.0 ou version ultérieure
  * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version 
ultérieure
@@ -264,6