[MediaWiki-commits] [Gerrit] Documentation - change (mediawiki...MediaWikiFarm)
Seb35 has uploaded a new change for review. https://gerrit.wikimedia.org/r/299413 Change subject: Documentation .. Documentation --- M MediaWikiFarm.php M docs/config/LocalSettings.multiversion.php M src/MediaWikiFarm.php 3 files changed, 13 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MediaWikiFarm refs/changes/13/299413/1 diff --git a/MediaWikiFarm.php b/MediaWikiFarm.php index 7e0c71f..6f59fef 100644 --- a/MediaWikiFarm.php +++ b/MediaWikiFarm.php @@ -23,6 +23,6 @@ MediaWikiFarm::load(); # Load MediaWiki configuration - require_once MediaWikiFarm::getInstance()->loadConfigDirectory(); + require_once MediaWikiFarm::getInstance()->getConfigFile(); } diff --git a/docs/config/LocalSettings.multiversion.php b/docs/config/LocalSettings.multiversion.php index 40e6cb0..a3676a5 100644 --- a/docs/config/LocalSettings.multiversion.php +++ b/docs/config/LocalSettings.multiversion.php @@ -7,7 +7,7 @@ if( !defined( 'MEDIAWIKI' ) ) exit; # Include the code. -require_once MediaWikiFarm::getInstance()->loadConfigDirectory(); +require_once MediaWikiFarm::getInstance()->getConfigFile(); # Do not add other configuration here, but instead in the config files # read by MediaWikiFarm -- even for global settings. diff --git a/src/MediaWikiFarm.php b/src/MediaWikiFarm.php index 6ccb7b6..f3deeeb 100644 --- a/src/MediaWikiFarm.php +++ b/src/MediaWikiFarm.php @@ -237,7 +237,17 @@ } } - function loadConfigDirectory() { + /** +* Return the file where is loaded the configuration. +* +* This function is important to avoid the two parts of the extension (checking of +* existence and loading of configuration) are located in the same directory in the +* case mono- and multi-version installations are mixed. Without it, this class +* could be defined by two different files, and PHP doesn’t like it. +* +* @return string File where is loaded the configuration. +*/ + function getConfigFile() { return $this->farmDir . '/src/main.php'; } -- To view, visit https://gerrit.wikimedia.org/r/299413 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ide5bb6197d2c50868ca71cfc45d7ff4db3a74313 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MediaWikiFarm Gerrit-Branch: master Gerrit-Owner: Seb35___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Documentation - change (mediawiki...MediaWikiFarm)
Seb35 has uploaded a new change for review. https://gerrit.wikimedia.org/r/299407 Change subject: Documentation .. Documentation --- M composer.json M scripts/mwscript.php M src/api.php.txt M src/img_auth.php.txt M src/index.php.txt M src/load.php.txt M src/opensearch_desc.php.txt 7 files changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MediaWikiFarm refs/changes/07/299407/1 diff --git a/composer.json b/composer.json index 51528b8..185a3a2 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ }, "scripts": { "validate-schema": "php ./scripts/validate-schema.php", - "phpdoc": "./vendor/bin/phpdoc -d ./src -t ./docs/code", + "phpdoc": "./vendor/bin/phpdoc -d src,scripts -e php,php.txt -t ./docs/code", "parallel-lint": "./vendor/bin/parallel-lint --exclude vendor ." } } diff --git a/scripts/mwscript.php b/scripts/mwscript.php index bf9cdb0..248c9cc 100644 --- a/scripts/mwscript.php +++ b/scripts/mwscript.php @@ -10,7 +10,7 @@ # Protect against web entry if( PHP_SAPI != 'cli' ) exit; -# Definition of a constant to protect dedicated entry points +/** Definition of a constant to protect dedicated entry points. */ define( 'MEDIAWIKI_FARM', true ); # Configuration of the MediaWiki Farm diff --git a/src/api.php.txt b/src/api.php.txt index 43e0634..782f5a7 100644 --- a/src/api.php.txt +++ b/src/api.php.txt @@ -7,7 +7,7 @@ * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version ultérieure */ -# Definition of a constant to protect dedicated entry points +/** Definition of a constant to protect dedicated entry points. */ define( 'MEDIAWIKI_FARM', true ); # Configuration of the MediaWiki Farm diff --git a/src/img_auth.php.txt b/src/img_auth.php.txt index 039538c..74402b0 100644 --- a/src/img_auth.php.txt +++ b/src/img_auth.php.txt @@ -7,7 +7,7 @@ * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version ultérieure */ -# Definition of a constant to protect dedicated entry points +/** Definition of a constant to protect dedicated entry points. */ define( 'MEDIAWIKI_FARM', true ); # Configuration of the MediaWiki Farm diff --git a/src/index.php.txt b/src/index.php.txt index 4879943..998b670 100644 --- a/src/index.php.txt +++ b/src/index.php.txt @@ -7,7 +7,7 @@ * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version ultérieure */ -# Definition of a constant to protect dedicated entry points +/** Definition of a constant to protect dedicated entry points. */ define( 'MEDIAWIKI_FARM', true ); # Configuration of the MediaWiki Farm diff --git a/src/load.php.txt b/src/load.php.txt index 50e4c78..f33e996 100644 --- a/src/load.php.txt +++ b/src/load.php.txt @@ -7,7 +7,7 @@ * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version ultérieure */ -# Definition of a constant to protect dedicated entry points +/** Definition of a constant to protect dedicated entry points. */ define( 'MEDIAWIKI_FARM', true ); # Configuration of the MediaWiki Farm diff --git a/src/opensearch_desc.php.txt b/src/opensearch_desc.php.txt index 01caaab..3bb374b 100644 --- a/src/opensearch_desc.php.txt +++ b/src/opensearch_desc.php.txt @@ -7,7 +7,7 @@ * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version ultérieure */ -# Definition of a constant to protect dedicated entry points +/** Definition of a constant to protect dedicated entry points. */ define( 'MEDIAWIKI_FARM', true ); # Configuration of the MediaWiki Farm -- To view, visit https://gerrit.wikimedia.org/r/299407 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I86562355bc2ab7ea214daac40d819e24cfd96e76 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MediaWikiFarm Gerrit-Branch: master Gerrit-Owner: Seb35___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Documentation - change (mediawiki...MediaWikiFarm)
Seb35 has uploaded a new change for review. https://gerrit.wikimedia.org/r/299376 Change subject: Documentation .. Documentation --- M src/MediaWikiFarm.php 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MediaWikiFarm refs/changes/76/299376/1 diff --git a/src/MediaWikiFarm.php b/src/MediaWikiFarm.php index 21ffcc3..de3d641 100644 --- a/src/MediaWikiFarm.php +++ b/src/MediaWikiFarm.php @@ -98,6 +98,7 @@ if( !$this->setWikiProperties() ) return false; + # Set available suffixes and wikis $this->setWgConf(); return true; @@ -220,11 +221,16 @@ return true; } + /** +* Set available suffixes and wikis. +* +* @todo Still hacky: before setting parameters in stone in farms.yml, various configurations should be reviewed to select accordingly the rights management modelisation +* @return void +*/ function setWgConf() { global $wgConf; - // TODO Still hacky: before setting parameters in stone in farms.yml, various configurations should be reviewed to select accordingly the rights management modelisation $wgConf->suffixes = array( $this->wiki['suffix'] ); $wikiIDs = $this->readFile( $this->configDir . '/' . $this->wiki['suffix'] . '/wikis.yml' ); foreach( $wikiIDs as $wiki => $value ) { -- To view, visit https://gerrit.wikimedia.org/r/299376 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I34f13007c990760d16d95d5c062435694e5004c7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MediaWikiFarm Gerrit-Branch: master Gerrit-Owner: Seb35___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits