Dienstag, 29. Dezember 2015

Was die Cmsms - Leute bei Smarty nicht verstehen

Cmsms arbeitet bis heute eigentlich nicht mit Smarty in der aktuellen Version sondern über SmaryBC mit Smarty in der 2 er Variante.

Dabei verzichtet man  auf Vorteile der Serie 3.2 und nimmt auch in Kauf das nicht mehr alles aus der Serie 2 funktioniert.

Da aber die ganze Cms auf Smarty basiert kann man nur eines sagen - eine lahme und veraltete Software läuft hier nur noch mit Hilfe von Krücken.

PHP eval ist so ein Beispiel von langsamer und nicht zu empfehlender Programmierung:

Das findet man bei der aktuellen Cmsms Version im Smarty Ordner:


Found 60 matches of eval in 38 files.
SmartyBC.class.php
    eval($content);      [position 456:5]
function.mailto.php
        return '<script type="text/javascript">eval(unescape(\'' . $js_encode . '\'))</script>';      [position 112:48]
function.math.php
    eval("\$smarty_math_result = " . $equation . ";");      [position 76:5]
modifier.regex_replace.php
    // remove eval-modifier from $search      [position 52:15]
function.mailto.php
        return '<script type="text/javascript">eval(unescape(\'' . $js_encode . '\'))</script>';      [position 111:48]
function.math.php
    eval("\$smarty_math_result = ".$equation.";");      [position 75:5]
modifier.regex_replace.php
    // remove eval-modifier from $search      [position 49:15]
shared.literal_compiler_param.php
    eval("\$t = " . $params[$index] . ";");      [position 31:5]
shared.literal_compiler_param.php
    eval("\$t = " . $params[$index] . ";");      [position 32:5]
smarty_cacheresource_custom.php
            eval("?>" . $content);      [position 141:13]
smarty_cacheresource_keyvaluestore.php
            eval("?>" . $content);      [position 106:13]
smarty_internal_compile_eval.php
 * Smarty Internal Plugin Compile Eval      [position 3:35]
 * Compiles the {eval} tag.      [position 4:18]
 * Smarty Internal Plugin Compile Eval Class      [position 12:35]
     * Compiles code for the {eval} tag      [position 42:31]
        $_output = "\$_template = new {$compiler->smarty->template_class}('eval:'." . $_attr['var'] . ", \$_smarty_tpl->smarty, \$_smarty_tpl);";      [position 61:76]
smarty_internal_compile_include_php.php
        eval('$_file = @' . $_attr['file'] . ';');      [position 67:9]
smarty_internal_compile_insert.php
        eval('$_name = @' . $_attr['name'] . ';');      [position 69:9]
            eval('$_script = @' . $_attr['script'] . ';');      [position 86:13]
smarty_internal_debug.php
        static $_is_stringy = array('string' => true, 'eval' => true);      [position 84:56]
        static $_is_stringy = array('string' => true, 'eval' => true);      [position 361:56]
smarty_internal_resource_eval.php
 * Smarty Internal Plugin Resource Eval      [position 3:36]
 * Smarty Internal Plugin Resource Eval      [position 12:36]
 * {@internal unlike string-resources the compiled state of eval-resources is NOT saved for subsequent access}}      [position 14:61]
smarty_internal_resource_string.php
 * {@internal unlike eval-resources the compiled state of string-resources is saved for subsequent access}}      [position 14:22]
smarty_internal_runtime_tplfunction.php
                eval($match[0]);      [position 70:17]
smarty_internal_templatecompilerbase.php
        if (in_array($this->template->source->type, array('eval', 'string'))) {      [position 1127:60]
smarty_resource.php
                                      'eval'    => 'smarty_internal_resource_eval.php',      [position 42:40]
smarty_template_compiled.php
                    eval("?>" . $this->content);      [position 130:21]
smarty_cacheresource_custom.php
            eval("?>" . $content);      [position 135:13]
smarty_cacheresource_keyvaluestore.php
            eval("?>" . $content);      [position 101:13]
smarty_internal_compile_eval.php
 * Smarty Internal Plugin Compile Eval      [position 3:35]
 * Compiles the {eval} tag.      [position 5:18]
 * Smarty Internal Plugin Compile Eval Class      [position 13:35]
     * Compiles code for the {eval} tag      [position 43:31]
        $_output = "\$_template = new {$compiler->smarty->template_class}('eval:'.".$_attr['var'].", \$_smarty_tpl->smarty, \$_smarty_tpl);";      [position 61:76]
smarty_internal_compile_extends.php
        eval("\$tpl_name = $name;");      [position 56:9]
smarty_internal_compile_function.php
            eval ('$tmp='.$_data.';');      [position 69:13]
smarty_internal_compile_include.php
            eval("\$tpl_name = $include_file;");      [position 168:13]
smarty_internal_compile_include_php.php
        eval('$_file = ' . $_attr['file'] . ';');      [position 61:9]
smarty_internal_compile_insert.php
        eval('$_name = ' . $_attr['name'] . ';');      [position 63:9]
            eval('$_script = ' . $_attr['script'] . ';');      [position 75:13]
smarty_internal_debug.php
        static $_is_stringy = array('string' => true, 'eval' => true);      [position 55:56]
        static $_is_stringy = array('string' => true, 'eval' => true);      [position 232:56]
smarty_internal_function_call_handler.php
            eval($_code);      [position 48:13]
smarty_internal_resource_eval.php
 * Smarty Internal Plugin Resource Eval      [position 3:36]
 * Smarty Internal Plugin Resource Eval      [position 12:36]
 * {@internal unlike string-resources the compiled state of eval-resources is NOT saved for subsequent access}}      [position 16:61]
smarty_internal_resource_string.php
 * {@internal unlike eval-resources the compiled state of string-resources is saved for subsequent access}}      [position 16:22]
smarty_internal_runtime_tplfunction.php
                eval($match[0]);      [position 70:17]
smarty_internal_template.php
        eval("?>" . $content);      [position 223:9]
                // do not cache eval resources      [position 652:33]
                if ($this->source->type != 'eval') {      [position 653:45]
smarty_internal_templatebase.php
                        eval("?>" . $code);      [position 141:25]
                        eval("?>" . $code);      [position 151:25]
                            eval("?>" . $code);      [position 165:29]
                    eval("?>" . $output);      [position 254:21]
smarty_resource.php
        'eval' => true,      [position 44:10]
        static $_incompatible_resources = array('eval' => true, 'string' => true, 'extends' => true, 'php' => true);      [position 579:50]
smarty_template_compiled.php
                    eval("?>" . $this->content);      [position 130:21]


sucht man dagegen in der aktuellen Smartyversion findet man eval überhaupt nicht !!

Das erklärt auch den ziemlichen Anstieg der Geschwindigkeit bei Smarty in den letzten Versionen.

Begriffen haben das die Developer von Cmsms nicht - im Gegenteil - man setzt eine 3.1 DEV Uraltversion  mit SmartyBC ein und das auch noch in einer total verkackten eigenen gehackten Version.

Webentwickler die sich mit Cmsms gut auskennen meinen dazu im deutschen Forum folgendes:




Keine Kommentare:

Kommentar veröffentlichen