Pastakhov has submitted this change and it was merged.
Change subject: update for PhpTags version 5.1.2 Hook release 8 (v 1.4.2)
......................................................................
update for PhpTags version 5.1.2 Hook release 8 (v 1.4.2)
Bug: T99997
Change-Id: I2b16e99a4c4d5a5f7444399bb7d09600fea78197
---
M PhpTagsWidgets.php
M includes/GenericWidget.php
M includes/WidgetFontAwesome.php
M includes/WidgetVega.php
M tests/phpunit/!!!firstInit_Test.php
5 files changed, 16 insertions(+), 17 deletions(-)
Approvals:
Pastakhov: Looks good to me, approved
jenkins-bot: Verified
diff --git a/PhpTagsWidgets.php b/PhpTagsWidgets.php
index 0672190..f5dfc1e 100644
--- a/PhpTagsWidgets.php
+++ b/PhpTagsWidgets.php
@@ -15,7 +15,7 @@
die( 'This file is an extension to MediaWiki and thus not a valid entry
point.' );
}
-const PHPTAGS_WIDGETS_VERSION = '1.4.1';
+const PHPTAGS_WIDGETS_VERSION = '1.4.2';
// Register this extension on Special:Version
$wgExtensionCredits['phptags'][] = array(
@@ -37,11 +37,11 @@
if ( !defined( 'PHPTAGS_VERSION' ) ) {
throw new MWException( "\n\nYou need to have the PhpTags extension
installed in order to use the PhpTags Widgets extension." );
}
- $needVersion = '5.0.0';
+ $needVersion = '5.1.2';
if ( version_compare( PHPTAGS_VERSION, $needVersion, '<' ) ) {
throw new MWException( "\n\nThis version of the PhpTags Widgets
extension requires the PhpTags extension $needVersion or above.\n You have " .
PHPTAGS_VERSION . ". Please update it." );
}
- if ( PHPTAGS_HOOK_RELEASE != 7 ) {
+ if ( PHPTAGS_HOOK_RELEASE != 8 ) {
throw new MWException( "\n\nThis version of the PhpTags Widgets
extension is outdated and not compatible with current version of the PhpTags
extension.\n Please update it." );
}
return true;
diff --git a/includes/GenericWidget.php b/includes/GenericWidget.php
index 120247d..2af85f5 100644
--- a/includes/GenericWidget.php
+++ b/includes/GenericWidget.php
@@ -45,8 +45,8 @@
public function getString() {}
public function getCssClassName() {
- if ( ! isset(
\PhpTags::$globalVariablesScript['Widgets']['prefix'] ) ) {
- \PhpTags::$globalVariablesScript['Widgets']['prefix'] =
self::$classPrefix;
+ if ( ! isset(
Renderer::$globalVariablesScript['Widgets']['prefix'] ) ) {
+ Renderer::$globalVariablesScript['Widgets']['prefix'] =
self::$classPrefix;
}
return self::$classPrefix . $this->classID;
}
@@ -67,13 +67,13 @@
* @param array $values
*/
protected function addData( $values ) {
-
\PhpTags::$globalVariablesScript['Widgets']['data'][(string)$this->classID] =
$values;
+
Renderer::$globalVariablesScript['Widgets']['data'][(string)$this->classID] =
$values;
}
protected function addModules( $modules, $command = false ) {
static $output = false;
if ( $output === false ) {
- $output = \PhpTags\Runtime::$parser->getOutput();
+ $output = Renderer::getParser()->getOutput();
}
$arrayModules = (array)$modules;
@@ -91,11 +91,11 @@
if ( $command ) {
$md = md5( serialize( $arrayModules ) );
- if ( false === isset(
\PhpTags::$globalVariablesScript['Widgets']['whenReady'][$md] ) ) {
-
\PhpTags::$globalVariablesScript['Widgets']['whenReady'][$md]['modules'] =
$arrayModules;
+ if ( false === isset(
Renderer::$globalVariablesScript['Widgets']['whenReady'][$md] ) ) {
+
Renderer::$globalVariablesScript['Widgets']['whenReady'][$md]['modules'] =
$arrayModules;
$this->addModules(
'ext.PhpTagsWidgets.onReady', false );
}
-
\PhpTags::$globalVariablesScript['Widgets']['whenReady'][$md]['fn'][
(string)$this->classID ] = $command;
+
Renderer::$globalVariablesScript['Widgets']['whenReady'][$md]['fn'][
(string)$this->classID ] = $command;
}
}
diff --git a/includes/WidgetFontAwesome.php b/includes/WidgetFontAwesome.php
index 3550369..4f8ab77 100644
--- a/includes/WidgetFontAwesome.php
+++ b/includes/WidgetFontAwesome.php
@@ -14,10 +14,9 @@
if ( $callType == 'c' ) {
$prop = str_replace( '_', '-', $tmp );
- $icon = \PhpTags\Hooks::createObject( array( $prop ),
'FontAwesomeIcon', false );
- if ( $icon !== false ) {
- return $icon;
- }
+ try {
+ return \PhpTags\Hooks::createObject( array(
$prop ), 'FontAwesomeIcon' );
+ } catch ( \Exception $exc ) {}
}
return parent::__callStatic( $name, $arguments );
}
diff --git a/includes/WidgetVega.php b/includes/WidgetVega.php
index 2424631..737be55 100644
--- a/includes/WidgetVega.php
+++ b/includes/WidgetVega.php
@@ -19,7 +19,7 @@
if ( false === $domainWhiteListWasAdded ) {
$domainWhiteListWasAdded = true;
-
\PhpTags::$globalVariablesScript['Widgets']['vega']['domainWhiteList'] =
$wgPhpTagsWidgetVegaDomainWhiteList;
+
\PhpTags\Renderer::$globalVariablesScript['Widgets']['vega']['domainWhiteList']
= $wgPhpTagsWidgetVegaDomainWhiteList;
}
$this->addModules( 'ext.PhpTagsWidgets.vega', 'extpwVega' );
$this->addData( array( $this->value[self::PROP] ) );
diff --git "a/tests/phpunit/\041\041\041firstInit_Test.php"
"b/tests/phpunit/\041\041\041firstInit_Test.php"
index d668485..74f988a 100644
--- "a/tests/phpunit/\041\041\041firstInit_Test.php"
+++ "b/tests/phpunit/\041\041\041firstInit_Test.php"
@@ -1,8 +1,8 @@
<?php
-if ( PhpTags::$needInitRuntime ) {
+if ( PhpTags\Renderer::$needInitRuntime ) {
wfRunHooks( 'PhpTagsRuntimeFirstInit' );
\PhpTags\Hooks::loadData();
\PhpTags\Runtime::$loopsLimit = 1000;
- PhpTags::$needInitRuntime = false;
+ PhpTags\Renderer::$needInitRuntime = false;
}
--
To view, visit https://gerrit.wikimedia.org/r/212759
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2b16e99a4c4d5a5f7444399bb7d09600fea78197
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/PhpTagsWidgets
Gerrit-Branch: master
Gerrit-Owner: Pastakhov <[email protected]>
Gerrit-Reviewer: Pastakhov <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits