Pwirth has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372353 )

Change subject: [WIP] BSFoundation: Adding Hook base classes for all hooks 
provided by BSFoundation
......................................................................

[WIP] BSFoundation: Adding Hook base classes for all hooks provided by 
BSFoundation

Change-Id: Ice07909cbb5fd4aa50e42d9bcfc392011b6ef12f
---
A src/Hook/BSCoreConfigGet.php
1 file changed, 50 insertions(+), 0 deletions(-)


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

diff --git a/src/Hook/BSCoreConfigGet.php b/src/Hook/BSCoreConfigGet.php
new file mode 100644
index 0000000..3735370
--- /dev/null
+++ b/src/Hook/BSCoreConfigGet.php
@@ -0,0 +1,50 @@
+<?php
+
+namespace BlueSpice\Hook;
+use BlueSpice\Hook;
+
+abstract class BSCoreConfigGet extends Hook {
+
+       /**
+        * The identifier of the variable
+        * @var string
+        */
+       protected $sPath = null;
+
+       /**
+        * The value of the variable
+        * @var mixed
+        */
+       protected $mReturn = null;
+
+       /**
+        * Located in BsConfig::get. Enables modification of the value of the
+        * BSConfig variable specified by path.
+        * @param string $sPath
+        * @param mixed $mReturn
+        * @return type
+        */
+       public static function callback( $sPath, &$mReturn ) {
+               $className = static::class;
+               $hookHandler = new $className(
+                       null,
+                       null,
+                       $sPath,
+                       $mReturn
+               );
+               return $hookHandler->process();
+       }
+
+       /**
+        * @param \IContextSource $context
+        * @param \Config $config
+        * @param string $sPath
+        * @param mixed $mReturn
+        */
+       public function __construct( $context, $config, $sPath, &$mReturn ) {
+               parent::__construct( $context, $config );
+
+               $this->sPath = $sPath;
+               $this->mReturn = &$mReturn;
+       }
+}
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice07909cbb5fd4aa50e42d9bcfc392011b6ef12f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Pwirth <wi...@hallowelt.biz>

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

Reply via email to