From ceb262e08027531717f1a16faafc343e8d9656e3 Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Mon, 21 Sep 2020 20:46:15 +0200 Subject: Move to r7r namespace and r7r composer package vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let's face it, no one but my CMS Ratatöskr (r7r for short) uses this template engine anyway. Also it's a good excuse to get rid of more remnants of my old kch42 nickname. --- README.markdown | 2 +- composer.json | 4 +- example/index.php | 2 +- src/ste/ASTNode.php | 2 +- src/ste/BreakException.php | 2 +- src/ste/Calc.php | 2 +- src/ste/CantLoadTemplate.php | 2 +- src/ste/CantSaveTemplate.php | 2 +- src/ste/ContinueException.php | 2 +- src/ste/FatalRuntimeError.php | 2 +- src/ste/FilesystemStorageAccess.php | 2 +- src/ste/Misc.php | 2 +- src/ste/ParseCompileError.php | 2 +- src/ste/Parser.php | 2 +- src/ste/RuntimeError.php | 2 +- src/ste/STECore.php | 2 +- src/ste/STEStandardLibrary.php | 2 +- src/ste/Scope.php | 2 +- src/ste/StorageAccess.php | 2 +- src/ste/StorageAccessFailure.php | 2 +- src/ste/TagNode.php | 2 +- src/ste/TextNode.php | 2 +- src/ste/Transcompiler.php | 48 +++++++++++----------- src/ste/VarNotInScope.php | 2 +- src/ste/VariableNode.php | 2 +- ste.php | 36 ++++++++-------- steloader.php | 2 +- tests/functional/BaseTest.php | 2 +- tests/functional/TestStorage.php | 2 +- tests/functional/test_array/Test.php | 2 +- tests/functional/test_blocks/Test.php | 2 +- tests/functional/test_closure/Test.php | 2 +- tests/functional/test_escapes/Test.php | 2 +- tests/functional/test_foreach/Test.php | 2 +- tests/functional/test_getset/Test.php | 2 +- tests/functional/test_loop/Test.php | 2 +- tests/functional/test_mktag/Test.php | 2 +- tests/functional/test_pseudotags/Test.php | 2 +- tests/functional/test_recursive/Test.php | 2 +- tests/functional/test_scoping/Test.php | 2 +- tests/functional/test_short/Test.php | 2 +- .../test_short_for_additional_attribs/Test.php | 2 +- tests/functional/test_simple/Test.php | 2 +- .../test_static_numeric_array_access/Test.php | 2 +- tests/functional/test_tagname/Test.php | 4 +- .../test_trailing_closing_array_bracket/Test.php | 2 +- tests/unit/ParserTest.php | 10 ++--- 47 files changed, 93 insertions(+), 93 deletions(-) diff --git a/README.markdown b/README.markdown index 9f6d299..9018a41 100644 --- a/README.markdown +++ b/README.markdown @@ -9,7 +9,7 @@ Get it via composer / packagist [Composer](https://getcomposer.org) is a dependency manager and package manager for PHP. Using composer is the recommended way of installing STE. -Just put `kch42/ste` in your requirements (I suggest using the version `1.*`) and execute `composer install`. Then include composer's autoloader and you can simply use all stuff in the `\kch42\ste` namespace without further `require`s or `include`s. Awesome! +Just put `r7r/ste` in your requirements (I suggest using the version `1.*`) and execute `composer install`. Then include composer's autoloader and you can simply use all stuff in the `\r7r\ste` namespace without further `require`s or `include`s. Awesome! Requirements diff --git a/composer.json b/composer.json index a83c26c..eb828f3 100644 --- a/composer.json +++ b/composer.json @@ -1,11 +1,11 @@ { - "name": "kch42/ste", + "name": "r7r/ste", "require": { "php": ">=7.3.0" }, "autoload": { "psr-4": { - "kch42\\ste\\": "src/ste" + "r7r\\ste\\": "src/ste" } }, "autoload-dev": { diff --git a/example/index.php b/example/index.php index 0213c34..f62e8a4 100644 --- a/example/index.php +++ b/example/index.php @@ -3,7 +3,7 @@ # Example program to demonstrate the STE... require_once(dirname(__FILE__) . "/../steloader.php"); -use \kch42\ste; +use r7r\ste; # Initialize an STECore instance $ste = new ste\STECore( diff --git a/src/ste/ASTNode.php b/src/ste/ASTNode.php index 4eb0348..efb7d65 100644 --- a/src/ste/ASTNode.php +++ b/src/ste/ASTNode.php @@ -1,6 +1,6 @@ diff --git a/src/ste/CantLoadTemplate.php b/src/ste/CantLoadTemplate.php index 92604cc..655248f 100644 --- a/src/ste/CantLoadTemplate.php +++ b/src/ste/CantLoadTemplate.php @@ -1,6 +1,6 @@ self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_if"]), - "cmp" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_cmp"]), - "not" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_not"]), - "even" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_even"]), - "for" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_for"]), - "foreach" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_foreach"]), - "infloop" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_infloop"]), - "break" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_break"]), - "continue" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_continue"]), - "block" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_block"]), - "load" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_load"]), - "mktag" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_mktag"]), - "tagcontent" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_tagcontent"]), - "set" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_set"]), - "setlocal" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_setlocal"]), - "get" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_get"]), - "calc" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_calc"]) + "if" => self::mark_builtin_callable([self::class, "builtin_if"]), + "cmp" => self::mark_builtin_callable([self::class, "builtin_cmp"]), + "not" => self::mark_builtin_callable([self::class, "builtin_not"]), + "even" => self::mark_builtin_callable([self::class, "builtin_even"]), + "for" => self::mark_builtin_callable([self::class, "builtin_for"]), + "foreach" => self::mark_builtin_callable([self::class, "builtin_foreach"]), + "infloop" => self::mark_builtin_callable([self::class, "builtin_infloop"]), + "break" => self::mark_builtin_callable([self::class, "builtin_break"]), + "continue" => self::mark_builtin_callable([self::class, "builtin_continue"]), + "block" => self::mark_builtin_callable([self::class, "builtin_block"]), + "load" => self::mark_builtin_callable([self::class, "builtin_load"]), + "mktag" => self::mark_builtin_callable([self::class, "builtin_mktag"]), + "tagcontent" => self::mark_builtin_callable([self::class, "builtin_tagcontent"]), + "set" => self::mark_builtin_callable([self::class, "builtin_set"]), + "setlocal" => self::mark_builtin_callable([self::class, "builtin_setlocal"]), + "get" => self::mark_builtin_callable([self::class, "builtin_get"]), + "calc" => self::mark_builtin_callable([self::class, "builtin_calc"]) ]; } @@ -156,7 +156,7 @@ class Transcompiler }, $operators )); - $code .= "default: throw new \\kch42\\ste\\RuntimeError('Unknown operator in .');\n}\n"; + $code .= "default: throw new \\r7r\\ste\\RuntimeError('Unknown operator in .');\n}\n"; } return $code; } @@ -235,7 +235,7 @@ class Transcompiler $loopbody = self::indent_code("{\n" . self::loopbody(self::indent_code($loopbody)) . "\n}\n"); if ($step === null) { - $code .= "if(\$${loopname}_step == 0)\n\tthrow new \\kch42\\ste\\RuntimeError('step can not be 0 in .');\n"; + $code .= "if(\$${loopname}_step == 0)\n\tthrow new \\r7r\\ste\\RuntimeError('step can not be 0 in .');\n"; $code .= "if(\$${loopname}_step > 0)\n{\n"; $code .= "\tfor(\$${loopname}_counter = \$${loopname}_start; \$${loopname}_counter <= \$${loopname}_stop; \$${loopname}_counter += \$${loopname}_step)\n"; $code .= $loopbody; @@ -342,7 +342,7 @@ class Transcompiler */ private static function builtin_break(TagNode $ast): string { - return "throw new \\kch42\\ste\\BreakException();\n"; + return "throw new \\r7r\\ste\\BreakException();\n"; } /** @@ -351,7 +351,7 @@ class Transcompiler */ private static function builtin_continue(TagNode $ast): string { - return "throw new \\kch42\\ste\\ContinueException();\n"; + return "throw new \\r7r\\ste\\ContinueException();\n"; } /** @@ -421,7 +421,7 @@ class Transcompiler $code .= self::_transcompile($ast->params["mandatory"]); $code .= "\$outputstack_i--;\n\$mandatory_params = explode('|', array_pop(\$outputstack));\n"; - $fxbody .= "foreach(\$mandatory_params as \$mp)\n{\n\tif(!isset(\$params[\$mp]))\n\t\tthrow new \\kch42\\ste\\RuntimeError(\"\$mp missing in .\");\n}"; + $fxbody .= "foreach(\$mandatory_params as \$mp)\n{\n\tif(!isset(\$params[\$mp]))\n\t\tthrow new \\r7r\\ste\\RuntimeError(\"\$mp missing in .\");\n}"; } $fxbody .= self::_transcompile($ast->sub); @@ -528,7 +528,7 @@ class Transcompiler private static function loopbody(string $code): string { - return "try\n{\n" . self::indent_code($code) . "\n}\ncatch(\\kch42\\ste\\BreakException \$e) { break; }\ncatch(\\kch42\\ste\\ContinueException \$e) { continue; }\n"; + return "try\n{\n" . self::indent_code($code) . "\n}\ncatch(\\r7r\\ste\\BreakException \$e) { break; }\ncatch(\\r7r\\ste\\ContinueException \$e) { continue; }\n"; } /** diff --git a/src/ste/VarNotInScope.php b/src/ste/VarNotInScope.php index 6dc5eda..bc417a9 100644 --- a/src/ste/VarNotInScope.php +++ b/src/ste/VarNotInScope.php @@ -1,6 +1,6 @@ register_tag( $name, diff --git a/tests/functional/test_trailing_closing_array_bracket/Test.php b/tests/functional/test_trailing_closing_array_bracket/Test.php index a24f93c..586fb21 100644 --- a/tests/functional/test_trailing_closing_array_bracket/Test.php +++ b/tests/functional/test_trailing_closing_array_bracket/Test.php @@ -2,7 +2,7 @@ namespace tests\functional\test_trailing_closing_array_bracket; -use kch42\ste\STECore; +use r7r\ste\STECore; use tests\functional\BaseTest; class Test extends BaseTest diff --git a/tests/unit/ParserTest.php b/tests/unit/ParserTest.php index b559913..3784582 100644 --- a/tests/unit/ParserTest.php +++ b/tests/unit/ParserTest.php @@ -4,11 +4,11 @@ namespace tests\unit; use PHPUnit\Framework\TestCase; -use kch42\ste\Parser; -use kch42\ste\TextNode; -use kch42\ste\VariableNode; -use kch42\ste\TagNode; -use kch42\ste\ParseCompileError; +use r7r\ste\Parser; +use r7r\ste\TextNode; +use r7r\ste\VariableNode; +use r7r\ste\TagNode; +use r7r\ste\ParseCompileError; class ParserTest extends TestCase { -- cgit v1.2.3-70-g09d2