From db915259d4f16d986ff3961cc0c8e16b0ade7716 Mon Sep 17 00:00:00 2001 From: FO-nTTaX Date: Tue, 3 Sep 2019 15:28:14 +0200 Subject: [PATCH] change order of checking to avoid edgecases with the $egVariablesAreVolatile setting in Extension:Variables add .gitignore file moved some files around for cleanup purposes renamed some files and moved to AutoloadNamespaces instead of AutoloadClasses --- .gitignore | 1 + extension.json | 7 +++---- mw.ext.VariablesLua.lua => lua/mw.ext.VariablesLua.lua | 0 VariablesLuaHooks.php => src/Hooks.php | 0 .../Scribunto_LuaVariablesLuaLibrary.php | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 .gitignore rename mw.ext.VariablesLua.lua => lua/mw.ext.VariablesLua.lua (100%) rename VariablesLuaHooks.php => src/Hooks.php (100%) rename Scribunto_LuaVariablesLuaLibrary.php => src/Scribunto_LuaVariablesLuaLibrary.php (92%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..40b7eda --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/nbproject/ diff --git a/extension.json b/extension.json index 620bae8..4bd7be8 100644 --- a/extension.json +++ b/extension.json @@ -1,6 +1,6 @@ { "name": "VariablesLua", - "version": "1.4.0", + "version": "1.4.1", "author": [ "[https://fo-nttax.de Alex Winkler]" ], @@ -20,9 +20,8 @@ "i18n" ] }, - "AutoloadClasses": { - "Liquipedia\\VariablesLua\\Hooks": "VariablesLuaHooks.php", - "Liquipedia\\VariablesLua\\Scribunto_LuaVariablesLuaLibrary": "Scribunto_LuaVariablesLuaLibrary.php" + "AutoloadNamespaces": { + "Liquipedia\\VariablesLua\\": "src/" }, "Hooks": { "ScribuntoExternalLibraries": [ diff --git a/mw.ext.VariablesLua.lua b/lua/mw.ext.VariablesLua.lua similarity index 100% rename from mw.ext.VariablesLua.lua rename to lua/mw.ext.VariablesLua.lua diff --git a/VariablesLuaHooks.php b/src/Hooks.php similarity index 100% rename from VariablesLuaHooks.php rename to src/Hooks.php diff --git a/Scribunto_LuaVariablesLuaLibrary.php b/src/Scribunto_LuaVariablesLuaLibrary.php similarity index 92% rename from Scribunto_LuaVariablesLuaLibrary.php rename to src/Scribunto_LuaVariablesLuaLibrary.php index 0028f51..9b8f448 100644 --- a/Scribunto_LuaVariablesLuaLibrary.php +++ b/src/Scribunto_LuaVariablesLuaLibrary.php @@ -15,7 +15,7 @@ public function register() { 'varexists' => [ $this, 'fn_varexists' ], ]; return $this->getEngine()->registerInterface( - __DIR__ . '/mw.ext.VariablesLua.lua', $lib, [] + __DIR__ . '/../lua/mw.ext.VariablesLua.lua', $lib, [] ); } @@ -46,10 +46,10 @@ public function fn_vardefineecho() { public function fn_varexists() { $params = func_get_args(); $parser = $this->getParser(); - if ( method_exists( 'ExtVariables', 'pf_varexists' ) ) { - return [ ExtVariables::pf_varexists( $parser, ...$params ) ]; - } else { + if ( method_exists( 'ExtVariables', 'pfObj_varexists' ) ) { return [ ExtVariables::pfObj_varexists( $parser, $parser->getPreprocessor()->newFrame(), $params ) ]; + } else { + return [ ExtVariables::pf_varexists( $parser, ...$params ) ]; } }