Pastakhov has uploaded a new change for review.
https://gerrit.wikimedia.org/r/153378
Change subject: Hook release 5 (v 3.2.2)
......................................................................
Hook release 5 (v 3.2.2)
Change-Id: I5dee4a8082f84f1057ff22cfb06c665a4e98b277
---
M PhpTagsFunctions.php
M includes/PhpTagsFuncNativeObject.php
2 files changed, 11 insertions(+), 14 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PhpTagsFunctions
refs/changes/78/153378/1
diff --git a/PhpTagsFunctions.php b/PhpTagsFunctions.php
index 6b9bbf1..c5cc240 100644
--- a/PhpTagsFunctions.php
+++ b/PhpTagsFunctions.php
@@ -19,7 +19,7 @@
die( 'ERROR: The <a
href="https://www.mediawiki.org/wiki/Extension:PhpTags">extension PhpTags</a>
must be installed for the extension PhpTags Functions to run!' );
}
-$needVersion = '2.5.0';
+$needVersion = '3.3.0';
if ( version_compare( PHPTAGS_VERSION, $needVersion, '<' ) ) {
die(
'<b>Error:</b> This version of extension PhpTags Functions
needs <a href="https://www.mediawiki.org/wiki/Extension:PhpTags">PhpTags</a> '
. $needVersion . ' or later.
@@ -27,13 +27,13 @@
);
}
-if ( PHPTAGS_HOOK_RELEASE != 4 ) {
+if ( PHPTAGS_HOOK_RELEASE != 5 ) {
die (
'<b>Error:</b> This version of extension PhpTags
Functions is not compatible to current version of extension PhpTags.'
);
}
-define( 'PHPTAGS_FUNCTIONS_VERSION' , '3.2.1' );
+define( 'PHPTAGS_FUNCTIONS_VERSION' , '3.2.2' );
// Register this extension on Special:Version
$wgExtensionCredits['phptags'][] = array(
diff --git a/includes/PhpTagsFuncNativeObject.php
b/includes/PhpTagsFuncNativeObject.php
index 3402568..5754be5 100644
--- a/includes/PhpTagsFuncNativeObject.php
+++ b/includes/PhpTagsFuncNativeObject.php
@@ -8,7 +8,7 @@
*/
class PhpTagsFuncNativeObject extends \PhpTags\GenericObject {
- public function m___construct( ) {
+ public function m___construct() {
$arguments = func_get_args();
foreach ( $arguments as &$arg ) {
if ( $arg instanceof \PhpTags\GenericObject ) {
@@ -27,10 +27,9 @@
}
public function __call( $name, $arguments ) {
- $callType = substr( $name, 0, 2 );
- $subname = substr($name, 2);
+ list ( $callType, $subname ) = explode( '_', $name, 2 );
switch ( $callType ) {
- case 'm_':
+ case 'm':
if ( method_exists( $this->value, $subname ) ) {
foreach ( $arguments as &$arg ) {
if( $arg instanceof
\PhpTags\GenericObject ) {
@@ -44,7 +43,7 @@
return $return;
}
break;
- case 'p_':
+ case 'p':
$object_vars = get_object_vars( $this->value );
if ( isset( $object_vars[$subname] ) ) {
return $this->value->$subname;
@@ -55,11 +54,10 @@
}
public static function __callStatic( $name, $arguments ) {
- $object = array_pop( $arguments );
- $callType = substr( $name, 0, 2 );
- $subname = substr($name, 2);
+ list ( $callType, $subname ) = explode( '_', $name, 2 );
+ $object = \PhpTags\Hooks::$objectName;
switch ( $callType ) {
- case 's_': // static method
+ case 's': // static method
$reflect = new \ReflectionClass( $object );
try {
$method = $reflect->getMethod( $subname
);
@@ -87,14 +85,13 @@
return $return;
}
break;
- case 'c_': // constant
+ case 'c': // constant
$reflect = new \ReflectionClass( $object );
if ( true === $reflect->hasConstant( $subname )
) {
return $reflect->getConstant( $subname
);
}
break;
}
- $arguments[] = $object;
return parent::__callStatic( $name, $arguments );
}
--
To view, visit https://gerrit.wikimedia.org/r/153378
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5dee4a8082f84f1057ff22cfb06c665a4e98b277
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PhpTagsFunctions
Gerrit-Branch: master
Gerrit-Owner: Pastakhov <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits