Do not dynamically call static methods
authorMatthias Schmidt <gravatronics@live.com>
Sat, 30 Jul 2016 21:03:53 +0000 (23:03 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 30 Jul 2016 21:03:53 +0000 (23:03 +0200)
13 files changed:
wcfsetup/install/files/lib/system/WCF.class.php
wcfsetup/install/files/lib/system/WCFSetup.class.php
wcfsetup/install/files/lib/system/benchmark/Benchmark.class.php
wcfsetup/install/files/lib/system/io/ZipWriter.class.php
wcfsetup/install/files/lib/system/mail/DebugMailSender.class.php
wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php
wcfsetup/install/files/lib/system/template/plugin/AppendCompilerTemplatePlugin.class.php
wcfsetup/install/files/lib/system/template/plugin/AssignCompilerTemplatePlugin.class.php
wcfsetup/install/files/lib/system/template/plugin/FetchCompilerTemplatePlugin.class.php
wcfsetup/install/files/lib/system/template/plugin/ImplodeCompilerTemplatePlugin.class.php
wcfsetup/install/files/lib/system/template/plugin/LangCompilerTemplatePlugin.class.php
wcfsetup/install/files/lib/system/template/plugin/PagesFunctionTemplatePlugin.class.php
wcfsetup/install/files/lib/system/template/plugin/PrependCompilerTemplatePlugin.class.php

index 55e84187aa2b60fa07d926376ee6717fbc049773..abcc054b92e1a605c9009ad2ae7f8a36ef4e9cec 100644 (file)
@@ -457,7 +457,7 @@ class WCF {
                // TODO: what exactly should the base href represent and how should it be calculated, also because
                // defining it here eventually breaks the ACP due to tpl initialization occurs first
                if (!class_exists(WCFACP::class, false)) {
-                       $this->getTPL()->assign('baseHref', self::$applications['wcf']->getPageURL());
+                       static::getTPL()->assign('baseHref', self::$applications['wcf']->getPageURL());
                }
                
                // start main application
@@ -545,13 +545,13 @@ class WCF {
                        // register template path if not within ACP
                        if (!class_exists('wcf\system\WCFACP', false)) {
                                // add template path and abbreviation
-                               $this->getTPL()->addApplication($abbreviation, $packageDir . 'templates/');
+                               static::getTPL()->addApplication($abbreviation, $packageDir . 'templates/');
                        }
                        EmailTemplateEngine::getInstance()->addApplication($abbreviation, $packageDir . 'templates/');
                        
                        // init application and assign it as template variable
                        self::$applicationObjects[$application->packageID] = call_user_func([$className, 'getInstance']);
-                       $this->getTPL()->assign('__'.$abbreviation, self::$applicationObjects[$application->packageID]);
+                       static::getTPL()->assign('__'.$abbreviation, self::$applicationObjects[$application->packageID]);
                        EmailTemplateEngine::getInstance()->assign('__'.$abbreviation, self::$applicationObjects[$application->packageID]);
                }
                else {
@@ -561,11 +561,11 @@ class WCF {
                
                // register template path in ACP
                if (class_exists('wcf\system\WCFACP', false)) {
-                       $this->getTPL()->addApplication($abbreviation, $packageDir . 'acp/templates/');
+                       static::getTPL()->addApplication($abbreviation, $packageDir . 'acp/templates/');
                }
                else if (!$isDependentApplication) {
                        // assign base tag
-                       $this->getTPL()->assign('baseHref', $application->getPageURL());
+                       static::getTPL()->assign('baseHref', $application->getPageURL());
                }
                
                // register application
index 5743ef87aec06cfd57f8a4b1132968fbc29bdc04..821aa7c527021cbf1a6e8cfb17b14de80f5c3946 100644 (file)
@@ -89,14 +89,14 @@ class WCFSetup extends WCF {
        public function __construct() {
                @set_time_limit(0);
                
-               $this->getDeveloperMode();
-               $this->getLanguageSelection();
-               $this->getInstallationDirectories();
+               static::getDeveloperMode();
+               static::getLanguageSelection();
+               static::getInstallationDirectories();
                $this->initLanguage();
                $this->initTPL();
                /** @noinspection PhpUndefinedMethodInspection */
                self::getLanguage()->loadLanguage();
-               $this->getPackageNames();
+               static::getPackageNames();
                
                // start setup
                $this->setup();
@@ -541,7 +541,7 @@ class WCFSetup extends WCF {
                }
                // WCF not yet installed, install files first
                else {
-                       $this->installFiles();
+                       static::installFiles();
                        
                        $this->gotoNextStep('selectLanguages');
                }
index 23564f684ac1085f2a46f13a95b49b9a21aef862..50a82df96122b19b7509b7854531778ff17b8c2f 100644 (file)
@@ -89,7 +89,7 @@ class Benchmark extends SingletonFactory {
         * @return      float
         */
        public function getExecutionTime() {
-               return $this->compareMicrotimes($this->startTime, self::getMicrotime());
+               return self::compareMicrotimes($this->startTime, self::getMicrotime());
        }
        
        /**
index e0061df08340cb2ad4c83ba5bcf4ebfb39522659..379c3f790edbe2fadbc940963d561b090ab9fccb 100644 (file)
@@ -57,7 +57,7 @@ class ZipWriter {
                $record .= "\x00\x00\x0a\x00";
                $record .= "\x00\x00\x00\x00";
                //$record .= "\x00\x00\x00\x00";
-               $record .= $this->getDosDatetime($date);
+               $record .= static::getDosDatetime($date);
                $record .= pack("V", 0);
                $record .= pack("V", 0);
                $record .= pack("V", 0);
@@ -131,7 +131,7 @@ class ZipWriter {
                $record = "\x50\x4b\x01\x02";
                $record .= "\x00\x00\x14\x00";
                $record .= "\x00\x00\x08\x00";
-               $record .= $this->getDosDatetime($date);
+               $record .= static::getDosDatetime($date);
                $record .= pack("V", $crc);
                $record .= pack("V", $sizeCompressed);
                $record .= pack("V", $sizeUncompressed);
index b0ca59fa766b806b6d95d3641f8516113707aadf..b4e18dfcd2aa425b97f1f38fd5060e30e5392297 100644 (file)
@@ -30,7 +30,7 @@ class DebugMailSender extends MailSender {
                        $this->log = new File($logFilePath . 'mail.log', 'ab');
                }
                
-               $this->log->write($this->printMail($mail));
+               $this->log->write(self::printMail($mail));
        }
        
        /**
index b9d0c22ff8d7ed88ceb22de66e4b992c5f98334c..2059a4c9e4a99a73cd8c2da2e83c7db40e9d75b2 100644 (file)
@@ -255,7 +255,7 @@ class TemplateScriptingCompiler {
                // throw error messages for unclosed tags
                if (count($this->tagStack) > 0) {
                        foreach ($this->tagStack as $tagStack) {
-                               throw new SystemException($this->formatSyntaxError('unclosed tag {'.$tagStack[0].'}', $this->currentIdentifier, $tagStack[1]));
+                               throw new SystemException(static::formatSyntaxError('unclosed tag {'.$tagStack[0].'}', $this->currentIdentifier, $tagStack[1]));
                        }
                        return false;
                }
@@ -335,7 +335,7 @@ class TemplateScriptingCompiler {
                                case 'elseif':
                                        list($openTag) = end($this->tagStack);
                                        if ($openTag != 'if' && $openTag != 'elseif') {
-                                               throw new SystemException($this->formatSyntaxError('unxepected {elseif}', $this->currentIdentifier, $this->currentLineNo));
+                                               throw new SystemException(static::formatSyntaxError('unxepected {elseif}', $this->currentIdentifier, $this->currentLineNo));
                                        }
                                        else if ($openTag == 'if') {
                                                $this->pushTag('elseif');
@@ -345,7 +345,7 @@ class TemplateScriptingCompiler {
                                case 'else':
                                        list($openTag) = end($this->tagStack);
                                        if ($openTag != 'if' && $openTag != 'elseif') {
-                                               throw new SystemException($this->formatSyntaxError('unexpected {else}', $this->currentIdentifier, $this->currentLineNo));
+                                               throw new SystemException(static::formatSyntaxError('unexpected {else}', $this->currentIdentifier, $this->currentLineNo));
                                        }
                                        $this->pushTag('else');
                                        return '<?php } else { ?>';
@@ -353,7 +353,7 @@ class TemplateScriptingCompiler {
                                case '/if':
                                        list($openTag) = end($this->tagStack);
                                        if ($openTag != 'if' && $openTag != 'elseif' && $openTag != 'else') {
-                                               throw new SystemException($this->formatSyntaxError('unexpected {/if}', $this->currentIdentifier, $this->currentLineNo));
+                                               throw new SystemException(static::formatSyntaxError('unexpected {/if}', $this->currentIdentifier, $this->currentLineNo));
                                        }
                                        $this->popTag('if');
                                        return '<?php } ?>';
@@ -368,7 +368,7 @@ class TemplateScriptingCompiler {
                                case 'foreachelse':
                                        list($openTag) = end($this->tagStack);
                                        if ($openTag != 'foreach') {
-                                               throw new SystemException($this->formatSyntaxError('unexpected {foreachelse}', $this->currentIdentifier, $this->currentLineNo));
+                                               throw new SystemException(static::formatSyntaxError('unexpected {foreachelse}', $this->currentIdentifier, $this->currentLineNo));
                                        }
                                        $this->pushTag('foreachelse');
                                        return '<?php } } else { { ?>';
@@ -376,7 +376,7 @@ class TemplateScriptingCompiler {
                                case '/foreach':
                                        list($openTag) = end($this->tagStack);
                                        if ($openTag != 'foreach' && $openTag != 'foreachelse') {
-                                               throw new SystemException($this->formatSyntaxError('unexpected {/foreach}', $this->currentIdentifier, $this->currentLineNo));
+                                               throw new SystemException(static::formatSyntaxError('unexpected {/foreach}', $this->currentIdentifier, $this->currentLineNo));
                                        }
                                        $this->popTag('foreach');
                                        return "<?php } } ?>";
@@ -388,7 +388,7 @@ class TemplateScriptingCompiler {
                                case 'sectionelse':
                                        list($openTag) = end($this->tagStack);
                                        if ($openTag != 'section') {
-                                               throw new SystemException($this->formatSyntaxError('unexpected {sectionelse}', $this->currentIdentifier, $this->currentLineNo));
+                                               throw new SystemException(static::formatSyntaxError('unexpected {sectionelse}', $this->currentIdentifier, $this->currentLineNo));
                                        }
                                        $this->pushTag('sectionelse');
                                        return '<?php } } else { { ?>';
@@ -396,7 +396,7 @@ class TemplateScriptingCompiler {
                                case '/section':
                                        list($openTag) = end($this->tagStack);
                                        if ($openTag != 'section' && $openTag != 'sectionelse') {
-                                               throw new SystemException($this->formatSyntaxError('unexpected {/section}', $this->currentIdentifier, $this->currentLineNo));
+                                               throw new SystemException(static::formatSyntaxError('unexpected {/section}', $this->currentIdentifier, $this->currentLineNo));
                                        }
                                        $this->popTag('section');
                                        return "<?php } } ?>";
@@ -408,7 +408,7 @@ class TemplateScriptingCompiler {
                                case '/capture':
                                        list($openTag) = end($this->tagStack);
                                        if ($openTag != 'capture') {
-                                               throw new SystemException($this->formatSyntaxError('unexpected {/capture}', $this->currentIdentifier, $this->currentLineNo));
+                                               throw new SystemException(static::formatSyntaxError('unexpected {/capture}', $this->currentIdentifier, $this->currentLineNo));
                                        }
                                        $this->popTag('capture');
                                        return $this->compileCaptureTag(false);
@@ -435,7 +435,7 @@ class TemplateScriptingCompiler {
                        }
                }
                
-               throw new SystemException($this->formatSyntaxError('unknown tag {'.$tag.'}', $this->currentIdentifier, $this->currentLineNo));
+               throw new SystemException(static::formatSyntaxError('unknown tag {'.$tag.'}', $this->currentIdentifier, $this->currentLineNo));
        }
        
        /**
@@ -453,7 +453,7 @@ class TemplateScriptingCompiler {
                }
                $this->autoloadPlugins[$className] = $className;
                
-               $tagArgs = $this->makeArgString($this->parseTagArgs($tagArgs, $tagCommand));
+               $tagArgs = static::makeArgString($this->parseTagArgs($tagArgs, $tagCommand));
                
                return "<?php echo \$this->pluginObjects['".$className."']->execute(array(".$tagArgs."), \$this); ?>";
        }
@@ -487,7 +487,7 @@ class TemplateScriptingCompiler {
                if ($startTag) {
                        $this->pushTag($tagCommand);
                        
-                       $tagArgs = $this->makeArgString($this->parseTagArgs($tagArgs, $tagCommand));
+                       $tagArgs = static::makeArgString($this->parseTagArgs($tagArgs, $tagCommand));
                        
                        $phpCode = "<?php \$this->tagStack[] = array('".$tagCommand."', array(".$tagArgs."));\n";
                        $phpCode .= "\$this->pluginObjects['".$className."']->init(\$this->tagStack[count(\$this->tagStack) - 1][1], \$this);\n";
@@ -496,7 +496,7 @@ class TemplateScriptingCompiler {
                else {
                        list($openTag) = end($this->tagStack);
                        if ($openTag != $tagCommand) {
-                               throw new SystemException($this->formatSyntaxError('unexpected {/'.$tagCommand.'}', $this->currentIdentifier, $this->currentLineNo));
+                               throw new SystemException(static::formatSyntaxError('unexpected {/'.$tagCommand.'}', $this->currentIdentifier, $this->currentLineNo));
                        }
                        $this->popTag($tagCommand);
                        $phpCode = "<?php echo \$this->pluginObjects['".$className."']->execute(\$this->tagStack[count(\$this->tagStack) - 1][1], ob_get_clean(), \$this); }\n";
@@ -536,7 +536,7 @@ class TemplateScriptingCompiler {
                        $this->compilerPlugins[$className] = new $className();
                        
                        if (!($this->compilerPlugins[$className] instanceof ICompilerTemplatePlugin)) {
-                               throw new SystemException($this->formatSyntaxError("Compiler plugin '".$tagCommand."' does not implement the interface 'ICompilerTemplatePlugin'", $this->currentIdentifier));
+                               throw new SystemException(static::formatSyntaxError("Compiler plugin '".$tagCommand."' does not implement the interface 'ICompilerTemplatePlugin'", $this->currentIdentifier));
                        }
                }
                
@@ -603,10 +603,10 @@ class TemplateScriptingCompiler {
                
                // check arguments
                if (!isset($args['loop'])) {
-                       throw new SystemException($this->formatSyntaxError("missing 'loop' attribute in section tag", $this->currentIdentifier, $this->currentLineNo));
+                       throw new SystemException(static::formatSyntaxError("missing 'loop' attribute in section tag", $this->currentIdentifier, $this->currentLineNo));
                }
                if (!isset($args['name'])) {
-                       throw new SystemException($this->formatSyntaxError("missing 'name' attribute in section tag", $this->currentIdentifier, $this->currentLineNo));
+                       throw new SystemException(static::formatSyntaxError("missing 'name' attribute in section tag", $this->currentIdentifier, $this->currentLineNo));
                }
                if (!isset($args['show'])) {
                        $args['show'] = true;
@@ -678,10 +678,10 @@ class TemplateScriptingCompiler {
                
                // check arguments
                if (!isset($args['from'])) {
-                       throw new SystemException($this->formatSyntaxError("missing 'from' attribute in foreach tag", $this->currentIdentifier, $this->currentLineNo));
+                       throw new SystemException(static::formatSyntaxError("missing 'from' attribute in foreach tag", $this->currentIdentifier, $this->currentLineNo));
                }
                if (!isset($args['item'])) {
-                       throw new SystemException($this->formatSyntaxError("missing 'item' attribute in foreach tag", $this->currentIdentifier, $this->currentLineNo));
+                       throw new SystemException(static::formatSyntaxError("missing 'item' attribute in foreach tag", $this->currentIdentifier, $this->currentLineNo));
                }
                
                $foreachProp = '';
@@ -729,7 +729,7 @@ class TemplateScriptingCompiler {
                
                // check arguments
                if (!isset($args['file'])) {
-                       throw new SystemException($this->formatSyntaxError("missing 'file' attribute in include tag", $this->currentIdentifier, $this->currentLineNo));
+                       throw new SystemException(static::formatSyntaxError("missing 'file' attribute in include tag", $this->currentIdentifier, $this->currentLineNo));
                }
                
                // get filename
@@ -824,7 +824,7 @@ class TemplateScriptingCompiler {
                }
                
                // make argument string
-               $argString = $this->makeArgString($args);
+               $argString = static::makeArgString($args);
                
                // build phpCode
                $phpCode = "<?php\n";
@@ -868,7 +868,7 @@ class TemplateScriptingCompiler {
                
                // validate tag arguments
                if (!preg_match('~^(?:\s+\w+\s*=\s*[^=]*(?=\s|$))*$~s', $tagArgs)) {
-                       throw new SystemException($this->formatSyntaxError('syntax error in tag {'.$tag.'}', $this->currentIdentifier, $this->currentLineNo));
+                       throw new SystemException(static::formatSyntaxError('syntax error in tag {'.$tag.'}', $this->currentIdentifier, $this->currentLineNo));
                }
                
                // parse tag arguments
@@ -961,7 +961,7 @@ class TemplateScriptingCompiler {
                        $operator = (isset($operators[$i]) ? $operators[$i] : null);
                        
                        if ($operator !== '!' && $values[$i] == '') {
-                               throw new SystemException($this->formatSyntaxError('syntax error in tag {'.($elseif ? 'elseif' : 'if').'}', $this->currentIdentifier, $this->currentLineNo));
+                               throw new SystemException(static::formatSyntaxError('syntax error in tag {'.($elseif ? 'elseif' : 'if').'}', $this->currentIdentifier, $this->currentLineNo));
                        }
                        
                        $leftParenthesis = mb_substr_count($values[$i], '(');
@@ -972,7 +972,7 @@ class TemplateScriptingCompiler {
                                $result .= str_repeat('(', $leftParenthesis - $rightParenthesis);
                                
                                if (str_replace('(', '', mb_substr($values[$i], 0, $leftParenthesis - $rightParenthesis)) != '') {
-                                       throw new SystemException($this->formatSyntaxError('syntax error in tag {'.($elseif ? 'elseif' : 'if').'}', $this->currentIdentifier, $this->currentLineNo));
+                                       throw new SystemException(static::formatSyntaxError('syntax error in tag {'.($elseif ? 'elseif' : 'if').'}', $this->currentIdentifier, $this->currentLineNo));
                                }
                        }
                        else if ($leftParenthesis < $rightParenthesis) {
@@ -980,7 +980,7 @@ class TemplateScriptingCompiler {
                                $value = mb_substr($values[$i], 0, $leftParenthesis - $rightParenthesis);
                                
                                if ($leftParentheses < 0 || str_replace(')', '', mb_substr($values[$i], $leftParenthesis - $rightParenthesis)) != '') {
-                                       throw new SystemException($this->formatSyntaxError('syntax error in tag {'.($elseif ? 'elseif' : 'if').'}', $this->currentIdentifier, $this->currentLineNo));
+                                       throw new SystemException(static::formatSyntaxError('syntax error in tag {'.($elseif ? 'elseif' : 'if').'}', $this->currentIdentifier, $this->currentLineNo));
                                }
                        }
                        else $value = $values[$i];
@@ -989,7 +989,7 @@ class TemplateScriptingCompiler {
                                $result .= $this->compileVariableTag($value, false);
                        }
                        catch (SystemException $e) {
-                               throw new SystemException($this->formatSyntaxError('syntax error in tag {'.($elseif ? 'elseif' : 'if').'}', $this->currentIdentifier, $this->currentLineNo), 0, nl2br($e, false));
+                               throw new SystemException(static::formatSyntaxError('syntax error in tag {'.($elseif ? 'elseif' : 'if').'}', $this->currentIdentifier, $this->currentLineNo), 0, nl2br($e, false));
                        }
                        
                        if ($leftParenthesis < $rightParenthesis) {
@@ -1168,7 +1168,7 @@ class TemplateScriptingCompiler {
                                        
                                        case 'object access':
                                                if (/*strpos($values[$i], '$') !== false || */strpos($values[$i], '@@') !== false) {
-                                                       throw new SystemException($this->formatSyntaxError("unexpected '->".$values[$i]."' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
+                                                       throw new SystemException(static::formatSyntaxError("unexpected '->".$values[$i]."' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
                                                }
                                                if (strpos($values[$i], '$') !== false) $result .= '{'.$this->compileSimpleVariable($values[$i], $variableType).'}';
                                                else $result .= $values[$i];
@@ -1216,7 +1216,7 @@ class TemplateScriptingCompiler {
                                        
                                        case 'modifier':
                                                if (strpos($values[$i], '$') !== false || strpos($values[$i], '@@') !== false) {
-                                                       throw new SystemException($this->formatSyntaxError("unknown modifier '".$values[$i]."'", $this->currentIdentifier, $this->currentLineNo));
+                                                       throw new SystemException(static::formatSyntaxError("unknown modifier '".$values[$i]."'", $this->currentIdentifier, $this->currentLineNo));
                                                }
                                                
                                                // handle modifier name
@@ -1227,7 +1227,7 @@ class TemplateScriptingCompiler {
                                                        $this->autoloadPlugins[$modifierData['className']] = $modifierData['className'];
                                                }
                                                else if ((!function_exists($modifierData['name']) && !in_array($modifierData['name'], $this->unknownPHPFunctions)) || in_array($modifierData['name'], $this->disabledPHPFunctions)) {
-                                                       throw new SystemException($this->formatSyntaxError("unknown modifier '".$values[$i]."'", $this->currentIdentifier, $this->currentLineNo));
+                                                       throw new SystemException(static::formatSyntaxError("unknown modifier '".$values[$i]."'", $this->currentIdentifier, $this->currentLineNo));
                                                }
                                                
                                                $statusStack[count($statusStack) - 1] = $status = 'modifier end';
@@ -1237,7 +1237,7 @@ class TemplateScriptingCompiler {
                                        case 'constant': 
                                        case 'variable':
                                        case 'string': 
-                                               throw new SystemException($this->formatSyntaxError('unknown tag {'.$tag.'}', $this->currentIdentifier, $this->currentLineNo));
+                                               throw new SystemException(static::formatSyntaxError('unknown tag {'.$tag.'}', $this->currentIdentifier, $this->currentLineNo));
                                        break;
                                }
                        }
@@ -1253,7 +1253,7 @@ class TemplateScriptingCompiler {
                                                        break;
                                                }
                                                
-                                               throw new SystemException($this->formatSyntaxError("unexpected '.' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
+                                               throw new SystemException(static::formatSyntaxError("unexpected '.' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
                                        break;
                                        
                                        // object access
@@ -1264,7 +1264,7 @@ class TemplateScriptingCompiler {
                                                        break;
                                                }
                                                
-                                               throw new SystemException($this->formatSyntaxError("unexpected '->' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
+                                               throw new SystemException(static::formatSyntaxError("unexpected '->' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
                                        break;
                                        
                                        // left parenthesis
@@ -1282,7 +1282,7 @@ class TemplateScriptingCompiler {
                                                        break;
                                                }
                                                
-                                               throw new SystemException($this->formatSyntaxError("unexpected '(' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
+                                               throw new SystemException(static::formatSyntaxError("unexpected '(' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
                                        break;
                                        
                                        // right parenthesis
@@ -1297,7 +1297,7 @@ class TemplateScriptingCompiler {
                                                        }
                                                }
                                                
-                                               throw new SystemException($this->formatSyntaxError("unexpected ')' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
+                                               throw new SystemException(static::formatSyntaxError("unexpected ')' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
                                        break;
                                        
                                        // bracket open
@@ -1309,7 +1309,7 @@ class TemplateScriptingCompiler {
                                                        break;
                                                }
                                                
-                                               throw new SystemException($this->formatSyntaxError("unexpected '[' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
+                                               throw new SystemException(static::formatSyntaxError("unexpected '[' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
                                        break;
                                        
                                        // bracket close
@@ -1324,7 +1324,7 @@ class TemplateScriptingCompiler {
                                                        }
                                                }
                                                
-                                               throw new SystemException($this->formatSyntaxError("unexpected ']' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
+                                               throw new SystemException(static::formatSyntaxError("unexpected ']' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
                                        break;
                                        
                                        // modifier
@@ -1338,7 +1338,7 @@ class TemplateScriptingCompiler {
                                                // clear status stack
                                                while ($oldStatus = array_pop($statusStack)) {
                                                        if ($oldStatus != 'variable' && $oldStatus != 'object' && $oldStatus != 'constant' && $oldStatus != 'string' && $oldStatus != 'modifier end') {
-                                                               throw new SystemException($this->formatSyntaxError("unexpected '|' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
+                                                               throw new SystemException(static::formatSyntaxError("unexpected '|' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
                                                        }
                                                }
                                                
@@ -1361,7 +1361,7 @@ class TemplateScriptingCompiler {
                                                        }
                                                }
                                                
-                                               throw new SystemException($this->formatSyntaxError("unexpected ':' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
+                                               throw new SystemException(static::formatSyntaxError("unexpected ':' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
                                        break;
                                        
                                        case ',':
@@ -1377,7 +1377,7 @@ class TemplateScriptingCompiler {
                                                        }
                                                }
                                                
-                                               throw new SystemException($this->formatSyntaxError("unexpected ',' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
+                                               throw new SystemException(static::formatSyntaxError("unexpected ',' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
                                                break;
                                        
                                        // math operators
@@ -1393,7 +1393,7 @@ class TemplateScriptingCompiler {
                                                        break;
                                                }
                                                
-                                               throw new SystemException($this->formatSyntaxError("unexpected '".$operator."' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
+                                               throw new SystemException(static::formatSyntaxError("unexpected '".$operator."' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
                                        break;
                                }
                        }
@@ -1487,7 +1487,7 @@ class TemplateScriptingCompiler {
                        if (!is_object($prefilter)) {
                                $className = $this->template->getPluginClassName('prefilter', $prefilter);
                                if (!class_exists($className)) {
-                                       throw new SystemException($this->formatSyntaxError('unable to find prefilter class '.$className, $this->currentIdentifier));
+                                       throw new SystemException(static::formatSyntaxError('unable to find prefilter class '.$className, $this->currentIdentifier));
                                }
                                $prefilter = new $className();
                        }
@@ -1496,7 +1496,7 @@ class TemplateScriptingCompiler {
                                $string = $prefilter->execute($templateName, $string, $this);
                        }
                        else {
-                               throw new SystemException($this->formatSyntaxError("Prefilter '".(is_object($prefilter) ? get_class($prefilter) : $prefilter)."' does not implement the interface 'IPrefilterTemplatePlugin'", $this->currentIdentifier));
+                               throw new SystemException(static::formatSyntaxError("Prefilter '".(is_object($prefilter) ? get_class($prefilter) : $prefilter)."' does not implement the interface 'IPrefilterTemplatePlugin'", $this->currentIdentifier));
                        }
                }
                
index 1d1b7ef4e349e21e5cef27dcdf9e684d2157019e..1a0843ddb5084a398c9dfc1320772e6bc569b0ff 100644 (file)
@@ -20,12 +20,12 @@ class AppendCompilerTemplatePlugin implements ICompilerTemplatePlugin {
         */
        public function executeStart($tagArgs, TemplateScriptingCompiler $compiler) {
                if (!isset($tagArgs['var'])) {
-                       throw new SystemException($compiler->formatSyntaxError("missing 'var' argument in append tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
+                       throw new SystemException($compiler::formatSyntaxError("missing 'var' argument in append tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
                }
                if (!isset($tagArgs['value'])) {
-                       throw new SystemException($compiler->formatSyntaxError("missing 'value' argument in append tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
+                       throw new SystemException($compiler::formatSyntaxError("missing 'value' argument in append tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
                }
-                               
+               
                return "<?php \$this->append(".$tagArgs['var'].", ".$tagArgs['value']."); ?>";
        }
        
@@ -33,6 +33,6 @@ class AppendCompilerTemplatePlugin implements ICompilerTemplatePlugin {
         * @inheritDoc
         */
        public function executeEnd(TemplateScriptingCompiler $compiler) {
-               throw new SystemException($compiler->formatSyntaxError("unknown tag {/append}", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
+               throw new SystemException($compiler::formatSyntaxError("unknown tag {/append}", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
        }
 }
index b862f24966fc21bc0a75205838c8600aa0a337e1..65b02c8d84ff2a11939d802c5cbb1fd208a2b442 100644 (file)
@@ -20,12 +20,12 @@ class AssignCompilerTemplatePlugin implements ICompilerTemplatePlugin {
         */
        public function executeStart($tagArgs, TemplateScriptingCompiler $compiler) {
                if (!isset($tagArgs['var'])) {
-                       throw new SystemException($compiler->formatSyntaxError("missing 'var' argument in assign tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
+                       throw new SystemException($compiler::formatSyntaxError("missing 'var' argument in assign tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
                }
                if (!isset($tagArgs['value'])) {
-                       throw new SystemException($compiler->formatSyntaxError("missing 'value' argument in assign tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
+                       throw new SystemException($compiler::formatSyntaxError("missing 'value' argument in assign tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
                }
-                               
+               
                return "<?php \$this->assign(".$tagArgs['var'].", ".$tagArgs['value']."); ?>";
        }
        
@@ -33,6 +33,6 @@ class AssignCompilerTemplatePlugin implements ICompilerTemplatePlugin {
         * @inheritDoc
         */
        public function executeEnd(TemplateScriptingCompiler $compiler) {
-               throw new SystemException($compiler->formatSyntaxError("unknown tag {/assign}", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
+               throw new SystemException($compiler::formatSyntaxError("unknown tag {/assign}", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
        }
 }
index 98cb5244eb65d042f5aa3f0c4ffb0e3521b36af4..8d78c86a143678cfbbe6c4a790b627669f7c4963 100644 (file)
@@ -22,7 +22,7 @@ class FetchCompilerTemplatePlugin implements ICompilerTemplatePlugin {
         */
        public function executeStart($tagArgs, TemplateScriptingCompiler $compiler) {
                if (!isset($tagArgs['file'])) {
-                       throw new SystemException($compiler->formatSyntaxError("missing 'file' argument in fetch tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
+                       throw new SystemException($compiler::formatSyntaxError("missing 'file' argument in fetch tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
                }
                
                if (isset($tagArgs['assign'])) {
@@ -37,6 +37,6 @@ class FetchCompilerTemplatePlugin implements ICompilerTemplatePlugin {
         * @inheritDoc
         */
        public function executeEnd(TemplateScriptingCompiler $compiler) {
-               throw new SystemException($compiler->formatSyntaxError("unknown tag {/fetch}", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
+               throw new SystemException($compiler::formatSyntaxError("unknown tag {/fetch}", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
        }
 }
index 66ecc45c7b215ba15b7fa58599a2412e6eb01d47..dd452a3d2416413a86838d4c5e9b275af6b350f3 100644 (file)
@@ -29,10 +29,10 @@ class ImplodeCompilerTemplatePlugin implements ICompilerTemplatePlugin {
                $compiler->pushTag('implode');
                
                if (!isset($tagArgs['from'])) {
-                       throw new SystemException($compiler->formatSyntaxError("missing 'from' argument in implode tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
+                       throw new SystemException($compiler::formatSyntaxError("missing 'from' argument in implode tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
                }
                if (!isset($tagArgs['item'])) {
-                       throw new SystemException($compiler->formatSyntaxError("missing 'item' argument in implode tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
+                       throw new SystemException($compiler::formatSyntaxError("missing 'item' argument in implode tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
                }
                
                $hash = StringUtil::getRandomID();
index ac744fd88cf89a48d9ff3301997f673a80b03151..4385c742da1fbc9bf5f02033934e41ff71007f66 100644 (file)
@@ -21,7 +21,7 @@ class LangCompilerTemplatePlugin implements ICompilerTemplatePlugin {
        public function executeStart($tagArgs, TemplateScriptingCompiler $compiler) {
                $compiler->pushTag('lang');
                
-               $tagArgs = $compiler->makeArgString($tagArgs);
+               $tagArgs = $compiler::makeArgString($tagArgs);
                return "<?php
                        \$this->tagStack[] = array('lang', array_merge(\$this->v, array($tagArgs)));
                        ob_start();
index 868a5df0d13723f691ad9eabe0f80b0ccd1ee037..2c3482efae5d7c562378d70e4e62ca085c4d231b 100644 (file)
@@ -58,7 +58,7 @@ class PagesFunctionTemplatePlugin implements IFunctionTemplatePlugin {
        protected function makeLink($link, $pageNo, $activePage, $pages) {
                // first page
                if ($activePage != $pageNo) {
-                       return '<li><a href="'.$this->insertPageNumber($link, $pageNo).'" title="'.WCF::getLanguage()->getDynamicVariable('wcf.page.pageNo', ['pageNo' => $pageNo]).'">'.StringUtil::formatInteger($pageNo).'</a></li>'."\n";
+                       return '<li><a href="'.self::insertPageNumber($link, $pageNo).'" title="'.WCF::getLanguage()->getDynamicVariable('wcf.page.pageNo', ['pageNo' => $pageNo]).'">'.StringUtil::formatInteger($pageNo).'</a></li>'."\n";
                }
                else {
                        return '<li class="active"><span>'.StringUtil::formatInteger($pageNo).'</span><span class="invisible">'.WCF::getLanguage()->getDynamicVariable('wcf.page.pagePosition', ['pageNo' => $pageNo, 'pages' => $pages]).'</span></li>'."\n";
@@ -74,7 +74,7 @@ class PagesFunctionTemplatePlugin implements IFunctionTemplatePlugin {
         */
        protected function makePreviousLink($link, $pageNo) {
                if ($pageNo > 1) {
-                       return '<li class="skip"><a href="'.$this->insertPageNumber($link, $pageNo - 1).'" title="'.WCF::getLanguage()->getDynamicVariable('wcf.global.page.previous').'" class="icon icon16 fa-chevron-left jsTooltip"></a></li>'."\n";
+                       return '<li class="skip"><a href="'.self::insertPageNumber($link, $pageNo - 1).'" title="'.WCF::getLanguage()->getDynamicVariable('wcf.global.page.previous').'" class="icon icon16 fa-chevron-left jsTooltip"></a></li>'."\n";
                }
                else {
                        return '<li class="skip disabled"><span class="icon icon16 fa-chevron-left"></span></li>'."\n";
@@ -91,7 +91,7 @@ class PagesFunctionTemplatePlugin implements IFunctionTemplatePlugin {
         */
        protected function makeNextLink($link, $pageNo, $pages) {
                if ($pageNo && $pageNo < $pages) {
-                       return '<li class="skip"><a href="'.$this->insertPageNumber($link, $pageNo + 1).'" title="'.WCF::getLanguage()->getDynamicVariable('wcf.global.page.next').'" class="icon icon16 fa-chevron-right jsTooltip"></a></li>'."\n";
+                       return '<li class="skip"><a href="'.self::insertPageNumber($link, $pageNo + 1).'" title="'.WCF::getLanguage()->getDynamicVariable('wcf.global.page.next').'" class="icon icon16 fa-chevron-right jsTooltip"></a></li>'."\n";
                }
                else {
                        return '<li class="skip disabled"><span class="icon icon16 fa-chevron-right"></span></li>'."\n";
index 33903ed4db05442c1dba36e2a9c88f4025a9764d..925415e7dc86f77c46116bee9af032a65e3138c4 100644 (file)
@@ -20,10 +20,10 @@ class PrependCompilerTemplatePlugin implements ICompilerTemplatePlugin {
         */
        public function executeStart($tagArgs, TemplateScriptingCompiler $compiler) {
                if (!isset($tagArgs['var'])) {
-                       throw new SystemException($compiler->formatSyntaxError("missing 'var' argument in prepend tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
+                       throw new SystemException($compiler::formatSyntaxError("missing 'var' argument in prepend tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
                }
                if (!isset($tagArgs['value'])) {
-                       throw new SystemException($compiler->formatSyntaxError("missing 'value' argument in prepend tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
+                       throw new SystemException($compiler::formatSyntaxError("missing 'value' argument in prepend tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
                }
                
                return "<?php \$this->prepend(".$tagArgs['var'].", ".$tagArgs['value']."); ?>";
@@ -33,6 +33,6 @@ class PrependCompilerTemplatePlugin implements ICompilerTemplatePlugin {
         * @inheritDoc
         */
        public function executeEnd(TemplateScriptingCompiler $compiler) {
-               throw new SystemException($compiler->formatSyntaxError("unknown tag {/prepend}", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
+               throw new SystemException($compiler::formatSyntaxError("unknown tag {/prepend}", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
        }
 }