[MediaWiki-commits] [Gerrit] Improved BSCoreConfigGet Hook - change (mediawiki...BlueSpiceFoundation)

2015-07-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Improved BSCoreConfigGet Hook
..


Improved BSCoreConfigGet Hook

* Added doc

Change-Id: Ifaa14b435bf0d5a75037ec372767d8f2482b5a8e
(cherry picked from commit 7f19b88d3725459cdb973e88f4c2201684c0a21d)
---
M doc/hooks.txt
M includes/Config.class.php
2 files changed, 15 insertions(+), 13 deletions(-)

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



diff --git a/doc/hooks.txt b/doc/hooks.txt
index ae488f4..a3920f9 100644
--- a/doc/hooks.txt
+++ b/doc/hooks.txt
@@ -13,4 +13,9 @@
 'BsFoundationBeforeMakeGlobalVariablesScript': Allows last minute manipulation 
 of the RENDER_AS_JAVASCRIPT config vars
 $oUser: The current MediaWiki User object
-&$aScriptSettings: Array of script settings (BsConfig::getScriptSettings())
\ No newline at end of file
+&$aScriptSettings: Array of script settings (BsConfig::getScriptSettings())
+
+'BSCoreConfigGet': Allows override of the config return value before the 
setting
+is loaded - return false to use own value
+$sPath: Key of the Config (Like 'MW::SomeExttension::SomePreference')
+&$mReturn: Value to return, when hook handler returns false
\ No newline at end of file
diff --git a/includes/Config.class.php b/includes/Config.class.php
index da5a355..904763b 100644
--- a/includes/Config.class.php
+++ b/includes/Config.class.php
@@ -175,23 +175,20 @@
}
 
/**
-* gets the value of the variable, which is specified by the path
-*
-* @param string $path
-*  The unique identifier the variable should be accessibly 
by. I.e. 'Adapter::Extension::MyVar'.
+* Gets the value of the variable, which is specified by the path
+* @param string $sPath The unique identifier the variable should be 
accessibly by. I.e. 'Adapter::Extension::MyVar'.
 * @return mixed the value
 */
-   public static function get( $path ) {
+   public static function get( $sPath ) {
wfProfileIn ( 'BS::Core::ConfigGet' );
 
-   if ( function_exists ( 'wfRunHooks' ) ) {
-   $bChanged = false;
-   wfRunHooks ( "BSCoreConfigGet", array ( &$path, 
&$bChanged ) );
-   if ( $bChanged === true ) {
-   return $path;
-   }
+   $mReturn = null;
+   if( !wfRunHooks ( "BSCoreConfigGet", array ( $sPath, &$mReturn 
) ) ) {
+   wfProfileOut ( 'BS::Core::ConfigGet' );
+   return $mReturn;
}
-   $oSetting = self::getSettingObject ( $path );
+
+   $oSetting = self::getSettingObject ( $sPath );
 
wfProfileOut ( 'BS::Core::ConfigGet' );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/224787
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifaa14b435bf0d5a75037ec372767d8f2482b5a8e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: REL1_23
Gerrit-Owner: Pwirth 
Gerrit-Reviewer: Mglaser 
Gerrit-Reviewer: Robert Vogel 
Gerrit-Reviewer: Tweichart 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Improved BSCoreConfigGet Hook - change (mediawiki...BlueSpiceFoundation)

2015-07-15 Thread Pwirth (Code Review)
Pwirth has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/224787

Change subject: Improved BSCoreConfigGet Hook
..

Improved BSCoreConfigGet Hook

* Added doc

Change-Id: Ifaa14b435bf0d5a75037ec372767d8f2482b5a8e
(cherry picked from commit 7f19b88d3725459cdb973e88f4c2201684c0a21d)
---
M doc/hooks.txt
M includes/Config.class.php
2 files changed, 15 insertions(+), 13 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/87/224787/1

diff --git a/doc/hooks.txt b/doc/hooks.txt
index ae488f4..a3920f9 100644
--- a/doc/hooks.txt
+++ b/doc/hooks.txt
@@ -13,4 +13,9 @@
 'BsFoundationBeforeMakeGlobalVariablesScript': Allows last minute manipulation 
 of the RENDER_AS_JAVASCRIPT config vars
 $oUser: The current MediaWiki User object
-&$aScriptSettings: Array of script settings (BsConfig::getScriptSettings())
\ No newline at end of file
+&$aScriptSettings: Array of script settings (BsConfig::getScriptSettings())
+
+'BSCoreConfigGet': Allows override of the config return value before the 
setting
+is loaded - return false to use own value
+$sPath: Key of the Config (Like 'MW::SomeExttension::SomePreference')
+&$mReturn: Value to return, when hook handler returns false
\ No newline at end of file
diff --git a/includes/Config.class.php b/includes/Config.class.php
index da5a355..904763b 100644
--- a/includes/Config.class.php
+++ b/includes/Config.class.php
@@ -175,23 +175,20 @@
}
 
/**
-* gets the value of the variable, which is specified by the path
-*
-* @param string $path
-*  The unique identifier the variable should be accessibly 
by. I.e. 'Adapter::Extension::MyVar'.
+* Gets the value of the variable, which is specified by the path
+* @param string $sPath The unique identifier the variable should be 
accessibly by. I.e. 'Adapter::Extension::MyVar'.
 * @return mixed the value
 */
-   public static function get( $path ) {
+   public static function get( $sPath ) {
wfProfileIn ( 'BS::Core::ConfigGet' );
 
-   if ( function_exists ( 'wfRunHooks' ) ) {
-   $bChanged = false;
-   wfRunHooks ( "BSCoreConfigGet", array ( &$path, 
&$bChanged ) );
-   if ( $bChanged === true ) {
-   return $path;
-   }
+   $mReturn = null;
+   if( !wfRunHooks ( "BSCoreConfigGet", array ( $sPath, &$mReturn 
) ) ) {
+   wfProfileOut ( 'BS::Core::ConfigGet' );
+   return $mReturn;
}
-   $oSetting = self::getSettingObject ( $path );
+
+   $oSetting = self::getSettingObject ( $sPath );
 
wfProfileOut ( 'BS::Core::ConfigGet' );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/224787
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifaa14b435bf0d5a75037ec372767d8f2482b5a8e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: REL1_23
Gerrit-Owner: Pwirth 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Improved BSCoreConfigGet Hook - change (mediawiki...BlueSpiceFoundation)

2015-07-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Improved BSCoreConfigGet Hook
..


Improved BSCoreConfigGet Hook

* Added doc

Change-Id: Ifaa14b435bf0d5a75037ec372767d8f2482b5a8e
---
M doc/hooks.txt
M includes/Config.class.php
2 files changed, 15 insertions(+), 13 deletions(-)

Approvals:
  Tweichart: Looks good to me, but someone else must approve
  Pwirth: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/doc/hooks.txt b/doc/hooks.txt
index ae488f4..a3920f9 100644
--- a/doc/hooks.txt
+++ b/doc/hooks.txt
@@ -13,4 +13,9 @@
 'BsFoundationBeforeMakeGlobalVariablesScript': Allows last minute manipulation 
 of the RENDER_AS_JAVASCRIPT config vars
 $oUser: The current MediaWiki User object
-&$aScriptSettings: Array of script settings (BsConfig::getScriptSettings())
\ No newline at end of file
+&$aScriptSettings: Array of script settings (BsConfig::getScriptSettings())
+
+'BSCoreConfigGet': Allows override of the config return value before the 
setting
+is loaded - return false to use own value
+$sPath: Key of the Config (Like 'MW::SomeExttension::SomePreference')
+&$mReturn: Value to return, when hook handler returns false
\ No newline at end of file
diff --git a/includes/Config.class.php b/includes/Config.class.php
index da5a355..904763b 100644
--- a/includes/Config.class.php
+++ b/includes/Config.class.php
@@ -175,23 +175,20 @@
}
 
/**
-* gets the value of the variable, which is specified by the path
-*
-* @param string $path
-*  The unique identifier the variable should be accessibly 
by. I.e. 'Adapter::Extension::MyVar'.
+* Gets the value of the variable, which is specified by the path
+* @param string $sPath The unique identifier the variable should be 
accessibly by. I.e. 'Adapter::Extension::MyVar'.
 * @return mixed the value
 */
-   public static function get( $path ) {
+   public static function get( $sPath ) {
wfProfileIn ( 'BS::Core::ConfigGet' );
 
-   if ( function_exists ( 'wfRunHooks' ) ) {
-   $bChanged = false;
-   wfRunHooks ( "BSCoreConfigGet", array ( &$path, 
&$bChanged ) );
-   if ( $bChanged === true ) {
-   return $path;
-   }
+   $mReturn = null;
+   if( !wfRunHooks ( "BSCoreConfigGet", array ( $sPath, &$mReturn 
) ) ) {
+   wfProfileOut ( 'BS::Core::ConfigGet' );
+   return $mReturn;
}
-   $oSetting = self::getSettingObject ( $path );
+
+   $oSetting = self::getSettingObject ( $sPath );
 
wfProfileOut ( 'BS::Core::ConfigGet' );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/224755
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifaa14b435bf0d5a75037ec372767d8f2482b5a8e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Pwirth 
Gerrit-Reviewer: Mglaser 
Gerrit-Reviewer: Pwirth 
Gerrit-Reviewer: Robert Vogel 
Gerrit-Reviewer: Tweichart 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Improved BSCoreConfigGet Hook - change (mediawiki...BlueSpiceFoundation)

2015-07-15 Thread Pwirth (Code Review)
Pwirth has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/224755

Change subject: Improved BSCoreConfigGet Hook
..

Improved BSCoreConfigGet Hook

* Added doc

Change-Id: Ifaa14b435bf0d5a75037ec372767d8f2482b5a8e
---
M doc/hooks.txt
M includes/Config.class.php
2 files changed, 15 insertions(+), 13 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/55/224755/1

diff --git a/doc/hooks.txt b/doc/hooks.txt
index ae488f4..a3920f9 100644
--- a/doc/hooks.txt
+++ b/doc/hooks.txt
@@ -13,4 +13,9 @@
 'BsFoundationBeforeMakeGlobalVariablesScript': Allows last minute manipulation 
 of the RENDER_AS_JAVASCRIPT config vars
 $oUser: The current MediaWiki User object
-&$aScriptSettings: Array of script settings (BsConfig::getScriptSettings())
\ No newline at end of file
+&$aScriptSettings: Array of script settings (BsConfig::getScriptSettings())
+
+'BSCoreConfigGet': Allows override of the config return value before the 
setting
+is loaded - return false to use own value
+$sPath: Key of the Config (Like 'MW::SomeExttension::SomePreference')
+&$mReturn: Value to return, when hook handler returns false
\ No newline at end of file
diff --git a/includes/Config.class.php b/includes/Config.class.php
index da5a355..904763b 100644
--- a/includes/Config.class.php
+++ b/includes/Config.class.php
@@ -175,23 +175,20 @@
}
 
/**
-* gets the value of the variable, which is specified by the path
-*
-* @param string $path
-*  The unique identifier the variable should be accessibly 
by. I.e. 'Adapter::Extension::MyVar'.
+* Gets the value of the variable, which is specified by the path
+* @param string $sPath The unique identifier the variable should be 
accessibly by. I.e. 'Adapter::Extension::MyVar'.
 * @return mixed the value
 */
-   public static function get( $path ) {
+   public static function get( $sPath ) {
wfProfileIn ( 'BS::Core::ConfigGet' );
 
-   if ( function_exists ( 'wfRunHooks' ) ) {
-   $bChanged = false;
-   wfRunHooks ( "BSCoreConfigGet", array ( &$path, 
&$bChanged ) );
-   if ( $bChanged === true ) {
-   return $path;
-   }
+   $mReturn = null;
+   if( !wfRunHooks ( "BSCoreConfigGet", array ( $sPath, &$mReturn 
) ) ) {
+   wfProfileOut ( 'BS::Core::ConfigGet' );
+   return $mReturn;
}
-   $oSetting = self::getSettingObject ( $path );
+
+   $oSetting = self::getSettingObject ( $sPath );
 
wfProfileOut ( 'BS::Core::ConfigGet' );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/224755
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifaa14b435bf0d5a75037ec372767d8f2482b5a8e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Pwirth 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits