[limb-svn] r6786 - in misc/template_engines_bench: . macro/cache macro_sl/cache macro_sl_bundled/cache quicky/cache quicky_one_tpl quicky_one_tpl/templates smarty/cache smarty_one_tpl smarty_one_tpl/templates
svn at limb-project.com
svn at limb-project.com
Fri Feb 8 18:29:57 MSK 2008
Author: korchasa
Date: 2008-02-08 18:29:56 +0300 (Fri, 08 Feb 2008)
New Revision: 6786
URL: http://fisheye.limb-project.com/changelog/limb/?cs=6786
Added:
misc/template_engines_bench/quicky_one_tpl/
misc/template_engines_bench/quicky_one_tpl/cache/
misc/template_engines_bench/quicky_one_tpl/main.php
misc/template_engines_bench/quicky_one_tpl/templates/
misc/template_engines_bench/quicky_one_tpl/templates/page.tpl
misc/template_engines_bench/smarty_one_tpl/
misc/template_engines_bench/smarty_one_tpl/cache/
misc/template_engines_bench/smarty_one_tpl/main.php
misc/template_engines_bench/smarty_one_tpl/templates/
misc/template_engines_bench/smarty_one_tpl/templates/page.tpl
Removed:
misc/template_engines_bench/macro/cache/25d2f43bc772ef8c59c16172955aeacf.php
misc/template_engines_bench/macro/cache/filters.cache
misc/template_engines_bench/macro/cache/tags.cache
misc/template_engines_bench/macro_sl/cache/25d2f43bc772ef8c59c16172955aeacf.php
misc/template_engines_bench/macro_sl/cache/filters.cache
misc/template_engines_bench/macro_sl/cache/tags.cache
misc/template_engines_bench/macro_sl_bundled/cache/25d2f43bc772ef8c59c16172955aeacf.php
misc/template_engines_bench/macro_sl_bundled/cache/filters.cache
misc/template_engines_bench/macro_sl_bundled/cache/tags.cache
misc/template_engines_bench/quicky/cache/adverts_item.tpl.324337.php
misc/template_engines_bench/quicky/cache/news_item.tpl.1b8762.php
misc/template_engines_bench/quicky/cache/page_begin.tpl.0d64d6.php
misc/template_engines_bench/quicky/cache/page_end.tpl.47b8e6.php
misc/template_engines_bench/quicky/cache/page_news.tpl.cb0a13.php
misc/template_engines_bench/smarty/cache/%%12^128^128846E2%%adverts_item.tpl.php
misc/template_engines_bench/smarty/cache/%%29^292^2929E2E0%%page_news.tpl.php
misc/template_engines_bench/smarty/cache/%%BA^BA2^BA2A5281%%news_item.tpl.php
misc/template_engines_bench/smarty/cache/%%D8^D8B^D8BE8273%%page.tpl.php
Modified:
misc/template_engines_bench/
misc/template_engines_bench/index.php
Log:
-- clean svn
Property changes on: misc/template_engines_bench
___________________________________________________________________
Name: svn:ignore
- .*
+ .*
apc.php
Modified: misc/template_engines_bench/index.php
===================================================================
--- misc/template_engines_bench/index.php 2008-02-08 15:16:56 UTC (rev 6785)
+++ misc/template_engines_bench/index.php 2008-02-08 15:29:56 UTC (rev 6786)
@@ -2,7 +2,8 @@
error_reporting(E_ALL);
define('BENCH_ITERATIONS_DEFAULT', 1000);
define('BENCH_ITERATIONS_MAX', 3000);
-define('BENCH_CONCURENCY', BENCH_ITERATIONS / 200);
+define('BENCH_CONCURENCY_FACTOR', 1 / 200);
+define('BENCH_CONCURENCY_MIN', 1);
define('BENCH_ENGINES_DIR', dirname(__FILE__));
require_once 'bench.inc.php';
define('BENCH_PATH_TO_AB', '/usr/sbin/ab');
@@ -44,9 +45,6 @@
<link rel="alternate" type="application/rss+xml" title="Recent News" href="/news/rss"/>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
- <script type="text/javascript">
-_uacct = "UA-207256-3";urchinTracker();
- </script>
<link rel="stylesheet" media="screen" type="text/css" href="/menu/styles/menu.css"/>
</head>
@@ -243,15 +241,40 @@
<td>
<?php
$action = get_action();
- if('bench_all' == $action || 'bench_selected' == $action) {
+ if('bench_all' != $action && 'bench_selected' != $action) {
+ ?>
+ <form action="" method="post">
+ <label for="iterations">Iterations:</label><input type="text" name="iterations" value="<?=BENCH_ITERATIONS_DEFAULT;?>" size="4"/>
+ <input type="submit" name="bench_selected" value="Compare selected"/>
+ <input type="submit" name="bench_all" value="Compare all"/>
+ <hr style="margin:10px 0"/>
+ <table>
+ <?php
+ foreach(get_engines() as $engine) {
+ echo '<tr>';
+ echo '<td><input type="checkbox" name="engines[]" value="'.$engine.'"/></td>';
+ echo "<td><a href=\"".get_bench_root_url().$engine."/main.php\">$engine</a></td>\n";
+ echo '</tr>';
+ }
+ ?>
+ </table>
+ </form>
+ <?php } else {
+ if(!isset($_REQUEST['iterations']) || $_REQUEST['iterations'] > BENCH_ITERATIONS_MAX)
+ $iterations = BENCH_ITERATIONS_DEFAULT;
+ else
+ $iterations = $_REQUEST['iterations'];
+
+ $concurency = max($iterations * BENCH_CONCURENCY_FACTOR, BENCH_CONCURENCY_MIN);
+
+ echo '<p><a href="'.get_bench_root_url().'">Back to template engines list</a></p>';
- echo '<p><a href="'.get_bench_root_url().'">Back to template engines list</a></p>';
-
if('bench_all' == $action)
$engines = get_engines();
else
- $engines = $_REQUEST['engines'];
- $results = bench_engines($engines);
+ $engines = $_REQUEST['engines'];
+
+ $results = bench_engines($engines, $iterations, $concurency);
$max_value = max($results);
@@ -259,36 +282,24 @@
<tr><th>name</th><th>rps</th><th>%</th></tr>
<?php foreach($results as $name=>$value) { ?>
<tr>
- <td><a href="<?=get_bench_root_url().$name?>"/main.php\"><?=name?></a></td>
+ <td><a href="<?=get_bench_root_url().$name?>/main.php"><?=$name?></a></td>
<td><?=$value?></td>
<td><?=round($value/$max_value*100)?>%</td>
</tr>
<?php } ?>
</table>
- <?php
- } else {
- ?>
- <form action="" method="post">
- <label for="iterations">Iterations:</label><input type="text" name="iterations" value="1000" size="4"/>
- <input type="submit" name="bench_selected" value="Compare selected"/>
- <input type="submit" name="bench_all" value="Compare all"/>
- <hr style="margin:10px 0"/>
- <table>
- <?php
- foreach(get_engines() as $engine) {
- echo '<tr>';
- echo '<td><input type="checkbox" name="engines[]" value="'.$engine.'"/></td>';
- echo "<td><a href=\"".get_bench_root_url().$engine."/main.php\">$engine</a></td>\n";
- echo '</tr>';
- }
- ?>
- </table>
- </form>
- <?php }
- ?>
-
- <p>You can get benchmark sources:</p>
- <code><pre>svn co https://svn.limb-project.com/limb/template_engines_bench/</pre></code>
+ <p>Iterations count: <?=$iterations;?></p>
+ <p>Concurency: <?=$concurency;?></p>
+ <?php } ?>
+ <h3>Примечания:</h3>
+ <ul>
+ <li>В роли опкод-кешера используется <a href="http://ru2.php.net/manual/ru/ref.apc.php">APC</a>.</li>
+ <li>Постфикс 'one_tpl' указывает, что шаблон один, и нет инклудов и враппов.</li>
+ <li>macro_sl - версия <a href="http://wiki.limb-project.com/doku.php?id=limb3:ru:packages:macro">macro</a> - с простым локатором шаблонов.</li>
+ <li>macro_sl_boundled - версия <a href="http://wiki.limb-project.com/doku.php?id=limb3:ru:packages:macro">macro</a> - с простым локатором и объединенная в один файл.</li>
+ </ul>
+ <h3>You can get benchmark sources:</h3>
+ <pre><code>svn co <a href="https://svn.limb-project.com/limb/misc/template_engines_bench/">https://svn.limb-project.com/limb/misc/template_engines_bench/</a></code></pre>
</td>
</tr>
</table>
Deleted: misc/template_engines_bench/macro/cache/25d2f43bc772ef8c59c16172955aeacf.php
===================================================================
--- misc/template_engines_bench/macro/cache/25d2f43bc772ef8c59c16172955aeacf.php 2008-02-08 15:16:56 UTC (rev 6785)
+++ misc/template_engines_bench/macro/cache/25d2f43bc772ef8c59c16172955aeacf.php 2008-02-08 15:29:56 UTC (rev 6786)
@@ -1,170 +0,0 @@
-<?php
-if(!class_exists('MacroTemplateExecutor47aac12058d77', false)){
-require_once('limb/macro/src/compiler/lmbMacroTemplateExecutor.class.php');
-class MacroTemplateExecutor47aac12058d77 extends lmbMacroTemplateExecutor {
-function render($args = array()) {
-if($args) extract($args);
-$this->_init();
- ?><table width=800>
-<tr><td width=200>
-
-<table bgcolor=#000000 cellspacing=2 cellpadding=4 border=0 width=100%>
-<tr><td bgcolor=#ffffff><h1>MacroExample</h1></td></tr>
-</table>
-</td>
-<?php $C = 0;$D = $this->adverts;
-foreach($D as $item) {if($C == 0) { ?>
-
- <?php } ?>
-
- <?php $this->__staticInclude1('adverts_item.phtml', $item); ?>
-
- <?php $C++;}if($C > 0) { ?>
-
-<?php } ?>
-
-</td>
-</tr>
-
-<tr valign=top>
-<td width=200>
-<table width=100% cellpadding=3>
-<?php $L = 0;$M = $this->sections;
-foreach($M as $item) {$parity = (( ($L + 1) % 2) ? "odd" : "even");if($L == 0) { ?>
-
- <?php } ?>
-
- <tr>
- <td bgcolor=#<?php echo ($parity == 'even') ? 'eeeeee' : 'dddddd'; ?>>
- <font color=#ffffff><b>
- <a href="/section.phtml?id=<?php echo $item['id']?>"><?php echo $item['name']?></a>
- <?php if($item['rip']) { ?><font color=#999999>R.I.P.</font><?php } ?></font>
- </td>
- </tr>
- <?php $L++;}if($L > 0) { ?>
-
-<?php } ?>
-
-</table>
-
-<p><b>Users</b>: <?php echo htmlspecialchars($this->users['TOTAL'],3);
- ?> <br>
-<b>Online</b>: <?php echo count($this->users['ONLINE'])?><br>
-<small>
-<i>
-<?php $U = 0;$V = $this->users['ONLINE'];
-foreach($V as $user) {if($U == 0) { ?>
-
- <?php } ?>
-
- <a href="/user.phtml?id=<?php echo $user['id'];?>"><?php echo $user['name'];?></a>
- <?php $U++;}if($U > 0) { ?>
-
-<?php } ?>
-
-</i>
-</small>
-
-</small>
-<p><b><?php echo htmlspecialchars($this->poll['TITLE'],3);
- ?></b><br>
-<small>
-<?php echo htmlspecialchars($this->poll['QUESTION'],3);
- ?>
-
-<small><br>
-<form method=post>
-<table>
-<?php $BI = 0;$BJ = $this->poll["ANSWERS"];
-foreach($BJ as $answer) {$cnt = $BI+1;if($BI == 0) { ?>
-
- <?php } ?>
-
- <tr valign=center><td><small><input type=radio name=a value=<?php echo $cnt;?>><?php echo $answer;?><br></td></tr>
- <?php $BI++;}if($BI > 0) { ?>
-
-<?php } ?>
-
-<tr><td align=center><input type=submit name="OK" value="<?php echo htmlspecialchars($this->poll['BUTTON'],3);
- ?>"></td></tr>
-</table>
-</form>
-</td>
-
-<td width=400 colspan=3>
-<?php if(isset($this->__slot_handler_content)) {call_user_func_array($this->__slot_handler_content, array());}$this->__slotHandler47aac121ee13c() ?>
-
-</td>
-</tr>
-<tr>
-<td colspan=4 align=center>
-<hr>
-<small>
-<i>Lebowski test (Copyleft) korchasa<br>
-based on BlitzTest (Alexey A. Rybak).<br>
-Texts are taken from IMDB.com, Memorable Quotes from "The Big Lebowski" (Ethan & Joel Coen, 1998). <br>
-</i>
-</td>
-</tr>
-</table>
-<?php
-}
-
-function __staticInclude1($file,$item) {
- ?><td width=200 valign=top>
-<table bgcolor=#000000 cellspacing=2 cellpadding=2 border=0 width=100%>
-<tr><td><font color=#ffffff><b><?php echo $item['section']?></b></font></td></tr>
-<tr><td bgcolor=#ffffff><small><a href="<?php echo $item['url']?>"><?php echo $item['title']?></a></small>
-</td></tr>
-</table><?php
-}
-
-function __slotHandler47aac121ee13c() {
- ?>
-
-<h2>Introduction</h2>
-<p>Mr. Treehorn draws a lot of water in this town. You don't draw shit, Lebowski. Now we got a nice, quiet little beach community here, and I aim to keep it nice and quiet. So let me make something plain. I don't like you sucking around, bothering our citizens, Lebowski. I don't like your jerk-off name. I don't like your jerk-off face. I don't like your jerk-off behavior, and I don't like you, jerk-off.</p>
-<h2>News</h2>
-<?php $BP = 0;$BQ = $this->news;
-foreach($BQ as $item) {if($BP == 0) { ?>
-
- <?php } ?>
-
- <?php $this->__staticInclude2('news_item.phtml', $item); ?>
-
- <?php $BP++;}if($BP > 0) { ?>
-
-<?php } ?>
-
-<?php
-}
-
-function __staticInclude2($file,$item) {
- ?><b><?php $BU='';
-$BV = $item;
-if((is_array($BV) || ($BV instanceof ArrayAccess)) && isset($BV['time'])) { $BU = $BV['time'];
-}else{ $BU = '';}
-echo htmlspecialchars($BU,3);
- ?> <?php $BW='';
-$BX = $item;
-if((is_array($BX) || ($BX instanceof ArrayAccess)) && isset($BX['title'])) { $BW = $BX['title'];
-}else{ $BW = '';}
-echo htmlspecialchars($BW,3);
- ?></b><br>
-<small><?php $BY='';
-$BZ = $item;
-if((is_array($BZ) || ($BZ instanceof ArrayAccess)) && isset($BZ['short'])) { $BY = $BZ['short'];
-}else{ $BY = '';}
-echo htmlspecialchars($BY,3);
- ?><a href="/news.phtml?id=<?php $CA='';
-$CB = $item;
-if((is_array($CB) || ($CB instanceof ArrayAccess)) && isset($CB['id'])) { $CA = $CB['id'];
-}else{ $CA = '';}
-echo htmlspecialchars($CA,3);
- ?>">[ read full story ]</a></small>
-<br><?php
-}
-
-}
-}
-$macro_executor_class='MacroTemplateExecutor47aac12058d77';
\ No newline at end of file
Deleted: misc/template_engines_bench/macro/cache/filters.cache
===================================================================
(Binary files differ)
Deleted: misc/template_engines_bench/macro/cache/tags.cache
===================================================================
(Binary files differ)
Deleted: misc/template_engines_bench/macro_sl/cache/25d2f43bc772ef8c59c16172955aeacf.php
===================================================================
--- misc/template_engines_bench/macro_sl/cache/25d2f43bc772ef8c59c16172955aeacf.php 2008-02-08 15:16:56 UTC (rev 6785)
+++ misc/template_engines_bench/macro_sl/cache/25d2f43bc772ef8c59c16172955aeacf.php 2008-02-08 15:29:56 UTC (rev 6786)
@@ -1,190 +0,0 @@
-<?php
-if(!class_exists('MacroTemplateExecutor47aaee0aa8389', false)){
-require_once('limb/macro/src/compiler/lmbMacroTemplateExecutor.class.php');
-class MacroTemplateExecutor47aaee0aa8389 extends lmbMacroTemplateExecutor {
-function render($args = array()) {
-if($args) extract($args);
-$this->_init();
- ?><table width=800>
-<tr><td width=200>
-
-<table bgcolor=#000000 cellspacing=2 cellpadding=4 border=0 width=100%>
-<tr><td bgcolor=#ffffff><h1>MacroExample</h1></td></tr>
-</table>
-</td>
-<?php $C = 0;$E = $this->adverts;
-
-if(!is_array($E) && !($E instanceof Iterator)) {
-$E = array();}
-$D = $E;
-foreach($D as $item) {if($C == 0) { ?>
-
- <?php } ?>
-
- <?php $this->__staticInclude1('adverts_item.phtml', $item); ?>
-
- <?php $C++;}if($C > 0) { ?>
-
-<?php } ?>
-
-</td>
-</tr>
-
-<tr valign=top>
-<td width=200>
-<table width=100% cellpadding=3>
-<?php $M = 0;$O = $this->sections;
-
-if(!is_array($O) && !($O instanceof Iterator)) {
-$O = array();}
-$N = $O;
-foreach($N as $item) {$parity = (( ($M + 1) % 2) ? "odd" : "even");if($M == 0) { ?>
-
- <?php } ?>
-
- <tr>
- <td bgcolor=#<?php echo ($parity == 'even') ? 'eeeeee' : 'dddddd'; ?>>
- <font color=#ffffff><b>
- <a href="/section.phtml?id=<?php echo $item['id']?>"><?php echo $item['name']?></a>
- <?php if($item['rip']) { ?><font color=#999999>R.I.P.</font><?php } ?></font>
- </td>
- </tr>
- <?php $M++;}if($M > 0) { ?>
-
-<?php } ?>
-
-</table>
-
-<p><b>Users</b>: <?php echo htmlspecialchars($this->users['TOTAL'],3);
- ?> <br>
-<b>Online</b>: <?php echo count($this->users['ONLINE'])?><br>
-<small>
-<i>
-<?php $W = 0;$Y = $this->users['ONLINE'];
-
-if(!is_array($Y) && !($Y instanceof Iterator)) {
-$Y = array();}
-$X = $Y;
-foreach($X as $user) {if($W == 0) { ?>
-
- <?php } ?>
-
- <a href="/user.phtml?id=<?php echo $user['id'];?>"><?php echo $user['name'];?></a>
- <?php $W++;}if($W > 0) { ?>
-
-<?php } ?>
-
-</i>
-</small>
-
-</small>
-<p><b><?php echo htmlspecialchars($this->poll['TITLE'],3);
- ?></b><br>
-<small>
-<?php echo htmlspecialchars($this->poll['QUESTION'],3);
- ?>
-
-<small><br>
-<form method=post>
-<table>
-<?php $BL = 0;$BN = $this->poll["ANSWERS"];
-
-if(!is_array($BN) && !($BN instanceof Iterator)) {
-$BN = array();}
-$BM = $BN;
-foreach($BM as $answer) {$cnt = $BL+1;if($BL == 0) { ?>
-
- <?php } ?>
-
- <tr valign=center><td><small><input type=radio name=a value=<?php echo $cnt;?>><?php echo $answer;?><br></td></tr>
- <?php $BL++;}if($BL > 0) { ?>
-
-<?php } ?>
-
-<tr><td align=center><input type=submit name="OK" value="<?php echo htmlspecialchars($this->poll['BUTTON'],3);
- ?>"></td></tr>
-</table>
-</form>
-</td>
-
-<td width=400 colspan=3>
-<?php if(isset($this->__slot_handler_content)) {call_user_func_array($this->__slot_handler_content, array());}$this->__slotHandler47aaee0c31201() ?>
-
-</td>
-</tr>
-<tr>
-<td colspan=4 align=center>
-<hr>
-<small>
-<i>Lebowski test (Copyleft) korchasa<br>
-based on BlitzTest (Alexey A. Rybak).<br>
-Texts are taken from IMDB.com, Memorable Quotes from "The Big Lebowski" (Ethan & Joel Coen, 1998). <br>
-</i>
-</td>
-</tr>
-</table>
-<?php
-}
-
-function __staticInclude1($file,$item) {
- ?><td width=200 valign=top>
-<table bgcolor=#000000 cellspacing=2 cellpadding=2 border=0 width=100%>
-<tr><td><font color=#ffffff><b><?php echo $item['section']?></b></font></td></tr>
-<tr><td bgcolor=#ffffff><small><a href="<?php echo $item['url']?>"><?php echo $item['title']?></a></small>
-</td></tr>
-</table><?php
-}
-
-function __slotHandler47aaee0c31201() {
- ?>
-
-<h2>Introduction</h2>
-<p>Mr. Treehorn draws a lot of water in this town. You don't draw shit, Lebowski. Now we got a nice, quiet little beach community here, and I aim to keep it nice and quiet. So let me make something plain. I don't like you sucking around, bothering our citizens, Lebowski. I don't like your jerk-off name. I don't like your jerk-off face. I don't like your jerk-off behavior, and I don't like you, jerk-off.</p>
-<h2>News</h2>
-<?php $BT = 0;$BV = $this->news;
-
-if(!is_array($BV) && !($BV instanceof Iterator)) {
-$BV = array();}
-$BU = $BV;
-foreach($BU as $item) {if($BT == 0) { ?>
-
- <?php } ?>
-
- <?php $this->__staticInclude2('news_item.phtml', $item); ?>
-
- <?php $BT++;}if($BT > 0) { ?>
-
-<?php } ?>
-
-<?php
-}
-
-function __staticInclude2($file,$item) {
- ?><b><?php $BZ='';
-$CA = $item;
-if((is_array($CA) || ($CA instanceof ArrayAccess)) && isset($CA['time'])) { $BZ = $CA['time'];
-}else{ $BZ = '';}
-echo htmlspecialchars($BZ,3);
- ?> <?php $CB='';
-$CC = $item;
-if((is_array($CC) || ($CC instanceof ArrayAccess)) && isset($CC['title'])) { $CB = $CC['title'];
-}else{ $CB = '';}
-echo htmlspecialchars($CB,3);
- ?></b><br>
-<small><?php $CD='';
-$CE = $item;
-if((is_array($CE) || ($CE instanceof ArrayAccess)) && isset($CE['short'])) { $CD = $CE['short'];
-}else{ $CD = '';}
-echo htmlspecialchars($CD,3);
- ?><a href="/news.phtml?id=<?php $CF='';
-$CG = $item;
-if((is_array($CG) || ($CG instanceof ArrayAccess)) && isset($CG['id'])) { $CF = $CG['id'];
-}else{ $CF = '';}
-echo htmlspecialchars($CF,3);
- ?>">[ read full story ]</a></small>
-<br><?php
-}
-
-}
-}
-$macro_executor_class='MacroTemplateExecutor47aaee0aa8389';
\ No newline at end of file
Deleted: misc/template_engines_bench/macro_sl/cache/filters.cache
===================================================================
(Binary files differ)
Deleted: misc/template_engines_bench/macro_sl/cache/tags.cache
===================================================================
(Binary files differ)
Deleted: misc/template_engines_bench/macro_sl_bundled/cache/25d2f43bc772ef8c59c16172955aeacf.php
===================================================================
--- misc/template_engines_bench/macro_sl_bundled/cache/25d2f43bc772ef8c59c16172955aeacf.php 2008-02-08 15:16:56 UTC (rev 6785)
+++ misc/template_engines_bench/macro_sl_bundled/cache/25d2f43bc772ef8c59c16172955aeacf.php 2008-02-08 15:29:56 UTC (rev 6786)
@@ -1,170 +0,0 @@
-<?php
-if(!class_exists('MacroTemplateExecutor47aafbfd3467e', false)){
-require_once('limb/macro/src/compiler/lmbMacroTemplateExecutor.class.php');
-class MacroTemplateExecutor47aafbfd3467e extends lmbMacroTemplateExecutor {
-function render($args = array()) {
-if($args) extract($args);
-$this->_init();
- ?><table width=800>
-<tr><td width=200>
-
-<table bgcolor=#000000 cellspacing=2 cellpadding=4 border=0 width=100%>
-<tr><td bgcolor=#ffffff><h1>MacroExample</h1></td></tr>
-</table>
-</td>
-<?php $C = 0;$E = $this->adverts;
-
-if(!is_array($E) && !($E instanceof Iterator)) {
-$E = array();}
-$D = $E;
-foreach($D as $item) {if($C == 0) { ?>
-
- <?php } ?>
-
- <?php $this->__staticInclude1('adverts_item.phtml', $item); ?>
-
- <?php $C++;}if($C > 0) { ?>
-
-<?php } ?>
-
-</td>
-</tr>
-
-<tr valign=top>
-<td width=200>
-<table width=100% cellpadding=3>
-<?php $M = 0;$O = $this->sections;
-
-if(!is_array($O) && !($O instanceof Iterator)) {
-$O = array();}
-$N = $O;
-foreach($N as $item) {$parity = (( ($M + 1) % 2) ? "odd" : "even");if($M == 0) { ?>
-
- <?php } ?>
-
- <tr>
- <td bgcolor=#<?php echo ($parity == 'even') ? 'eeeeee' : 'dddddd'; ?>>
- <font color=#ffffff><b>
- <a href="/section.phtml?id=<?php echo $item['id']?>"><?php echo $item['name']?></a>
- <?php if($item['rip']) { ?><font color=#999999>R.I.P.</font><?php } ?></font>
- </td>
- </tr>
- <?php $M++;}if($M > 0) { ?>
-
-<?php } ?>
-
-</table>
-
-<p><b>Users</b>: <?php echo htmlspecialchars($this->users['TOTAL'],3);
- ?> <br>
-<b>Online</b>: <?php echo count($this->users['ONLINE'])?><br>
-<small>
-<i>
-<?php $W = 0;$Y = $this->users['ONLINE'];
-
-if(!is_array($Y) && !($Y instanceof Iterator)) {
-$Y = array();}
-$X = $Y;
-foreach($X as $user) {if($W == 0) { ?>
-
- <?php } ?>
-
- <a href="/user.phtml?id=<?php echo $user['id'];?>"><?php echo $user['name'];?></a>
- <?php $W++;}if($W > 0) { ?>
-
-<?php } ?>
-
-</i>
-</small>
-
-</small>
-<p><b><?php echo htmlspecialchars($this->poll['TITLE'],3);
- ?></b><br>
-<small>
-<?php echo htmlspecialchars($this->poll['QUESTION'],3);
- ?>
-
-<small><br>
-<form method=post>
-<table>
-<?php $BL = 0;$BN = $this->poll["ANSWERS"];
-
-if(!is_array($BN) && !($BN instanceof Iterator)) {
-$BN = array();}
-$BM = $BN;
-foreach($BM as $answer) {$cnt = $BL+1;if($BL == 0) { ?>
-
- <?php } ?>
-
- <tr valign=center><td><small><input type=radio name=a value=<?php echo $cnt;?>><?php echo $answer;?><br></td></tr>
- <?php $BL++;}if($BL > 0) { ?>
-
-<?php } ?>
-
-<tr><td align=center><input type=submit name="OK" value="<?php echo htmlspecialchars($this->poll['BUTTON'],3);
- ?>"></td></tr>
-</table>
-</form>
-</td>
-
-<td width=400 colspan=3>
-<?php if(isset($this->__slot_handler_content)) {call_user_func_array($this->__slot_handler_content, array());}$this->__slotHandler47aafbfd56ac8() ?>
-
-</td>
-</tr>
-<tr>
-<td colspan=4 align=center>
-<hr>
-<small>
-<i>Lebowski test (Copyleft) korchasa<br>
-based on BlitzTest (Alexey A. Rybak).<br>
-Texts are taken from IMDB.com, Memorable Quotes from "The Big Lebowski" (Ethan & Joel Coen, 1998). <br>
-</i>
-</td>
-</tr>
-</table>
-<?php
-}
-
-function __staticInclude1($file,$item) {
- ?><td width=200 valign=top>
-<table bgcolor=#000000 cellspacing=2 cellpadding=2 border=0 width=100%>
-<tr><td><font color=#ffffff><b><?php echo $item['section']?></b></font></td></tr>
-<tr><td bgcolor=#ffffff><small><a href="<?php echo $item['url']?>"><?php echo $item['title']?></a></small>
-</td></tr>
-</table><?php
-}
-
-function __slotHandler47aafbfd56ac8() {
- ?>
-
-<h2>Introduction</h2>
-<p>Mr. Treehorn draws a lot of water in this town. You don't draw shit, Lebowski. Now we got a nice, quiet little beach community here, and I aim to keep it nice and quiet. So let me make something plain. I don't like you sucking around, bothering our citizens, Lebowski. I don't like your jerk-off name. I don't like your jerk-off face. I don't like your jerk-off behavior, and I don't like you, jerk-off.</p>
-<h2>News</h2>
-<?php $BT = 0;$BV = $this->news;
-
-if(!is_array($BV) && !($BV instanceof Iterator)) {
-$BV = array();}
-$BU = $BV;
-foreach($BU as $item) {if($BT == 0) { ?>
-
- <?php } ?>
-
- <?php $this->__staticInclude2('news_item.phtml', $item); ?>
-
- <?php $BT++;}if($BT > 0) { ?>
-
-<?php } ?>
-
-<?php
-}
-
-function __staticInclude2($file,$item) {
- ?><b><?php echo $item['time']?> <?php echo $item['title']?></b><br>
-<small><?php echo $item['short']?><a href="/news.phtml?id=<?php echo $item['id']?>">[ read full story ]</a></small>
-<br><?php
-}
-
-}
-}
-$macro_executor_class='MacroTemplateExecutor47aafbfd3467e';
\ No newline at end of file
Deleted: misc/template_engines_bench/macro_sl_bundled/cache/filters.cache
===================================================================
(Binary files differ)
Deleted: misc/template_engines_bench/macro_sl_bundled/cache/tags.cache
===================================================================
(Binary files differ)
Deleted: misc/template_engines_bench/quicky/cache/adverts_item.tpl.324337.php
===================================================================
--- misc/template_engines_bench/quicky/cache/adverts_item.tpl.324337.php 2008-02-08 15:16:56 UTC (rev 6785)
+++ misc/template_engines_bench/quicky/cache/adverts_item.tpl.324337.php 2008-02-08 15:29:56 UTC (rev 6786)
@@ -1,8 +0,0 @@
-<?php /* Quicky compiler version 0.3, created on Fri, 08 Feb 2008 15:54:03 +0300
- compiled from adverts_item.tpl */
-?><td width=200 valign=top>
-<table bgcolor=#000000 cellspacing=2 cellpadding=2 border=0 width=100%>
-<tr><td><font color=#ffffff><b><?php echo $var['advert']['section']; ?></b></font></td></tr>
-<tr><td bgcolor=#ffffff><small><a href="<?php echo $var['advert']['url']; ?>"><?php echo $var['advert']['title']; ?></a></small>
-</td></tr>
-</table>
\ No newline at end of file
Deleted: misc/template_engines_bench/quicky/cache/news_item.tpl.1b8762.php
===================================================================
--- misc/template_engines_bench/quicky/cache/news_item.tpl.1b8762.php 2008-02-08 15:16:56 UTC (rev 6785)
+++ misc/template_engines_bench/quicky/cache/news_item.tpl.1b8762.php 2008-02-08 15:29:56 UTC (rev 6786)
@@ -1,5 +0,0 @@
-<?php /* Quicky compiler version 0.3, created on Fri, 08 Feb 2008 15:49:12 +0300
- compiled from news_item.tpl */
-?><b><?php echo $var['i']['time']; ?> <?php echo $var['i']['title']; ?></b><br>
-<small><?php echo $var['i']['short']; ?><a href="/news.phtml?id=<?php echo $var['i']['id']; ?>">[ read full story ]</a></small>
-<br>
\ No newline at end of file
Deleted: misc/template_engines_bench/quicky/cache/page_begin.tpl.0d64d6.php
===================================================================
--- misc/template_engines_bench/quicky/cache/page_begin.tpl.0d64d6.php 2008-02-08 15:16:56 UTC (rev 6785)
+++ misc/template_engines_bench/quicky/cache/page_begin.tpl.0d64d6.php 2008-02-08 15:29:56 UTC (rev 6786)
@@ -1,65 +0,0 @@
-<?php /* Quicky compiler version 0.3, created on Fri, 08 Feb 2008 15:54:24 +0300
- compiled from page_begin.tpl */
-?><table width=800>
-<tr><td width=200>
-
-<table bgcolor=#000000 cellspacing=2 cellpadding=4 border=0 width=100%>
-<tr><td bgcolor=#ffffff><h1>QuickyExample</h1></td></tr>
-</table>
-</td>
-<?php $_from = $var['adverts'];
- if (sizeof($_from) > 0): foreach ($_from as $var['advert']): ?>
- <?php $this->display('adverts_item.tpl'); ?>
-<?php endforeach; endif; ?>
-</td>
-</tr>
-
-<tr valign=top>
-<td width=200>
-<table width=100% cellpadding=3>
-<?php
-$section['i'] = array();
-$section['i']['s'] = isInteger($var['sections'])?$var['sections']:sizeof($var['sections']);
-$section['i']['st'] = 0;
-$section['i']['step'] = 1;
-if ($section['i']['s'] > 0): for ($section['i']['i'] = 0; $section['i']['i'] < $section['i']['s']-$section['i']['st']; ++$section['i']['i']): ?>
-<tr>
-<td bgcolor=<?php if (((Quicky::ind($section['i'])) % 2 == 0)): ?>#eeeeee<?php else: ?>#dddddd<?php endif; ?>>
-<font color=#ffffff><b>
-<a href="/section.phtml?id=<?php echo $var['sections'][Quicky::ind($section['i'])]['id']; ?>"><?php echo $var['sections'][Quicky::ind($section['i'])]['name']; ?></a>
-<?php if ($var['sections'][Quicky::ind($section['i'])]['rip'] ): ?><font color=#999999>R.I.P.</font></font><?php endif; ?>
-</td>
-</tr>
-<?php endfor; endif; ?>
-</table>
-
-<p><b>Users</b>: <?php echo $var['num_total']; ?><br>
-
-<b>Online</b>: <?php echo $var['num_online']; ?><br>
-
-<small>
-<i>
-<?php $_from = $var['users'];
- if (sizeof($_from) > 0): foreach ($_from as $var['i']): ?>
-<a href="/user.phtml?id=<?php echo $var['i']['id']; ?>"><?php echo $var['i']['name']; ?></a>
-<?php endforeach; endif; ?>
-</i>
-</small>
-
-</small>
-<p><b><?php echo $var['poll_title']; ?></b><br>
-<small>
-<?php echo $var['poll_question']; ?>
-<small><br>
-<form method=post>
-<table>
-<?php $_from = $var['poll_answers'];
- if (sizeof($_from) > 0): foreach ($_from as $var['i']): ?>
-<tr valign=center><td><small><input type=radio name=a><?php echo $var['i']; ?><br></td></tr>
-<?php endforeach; endif; ?>
-<tr><td align=center><input type=submit name="OK" value="<?php echo $var['poll_button']; ?>"></td></tr>
-</table>
-</form>
-</td>
-
-<td width=400 colspan=3>
\ No newline at end of file
Deleted: misc/template_engines_bench/quicky/cache/page_end.tpl.47b8e6.php
===================================================================
--- misc/template_engines_bench/quicky/cache/page_end.tpl.47b8e6.php 2008-02-08 15:16:56 UTC (rev 6785)
+++ misc/template_engines_bench/quicky/cache/page_end.tpl.47b8e6.php 2008-02-08 15:29:56 UTC (rev 6786)
@@ -1,15 +0,0 @@
-<?php /* Quicky compiler version 0.3, created on Fri, 08 Feb 2008 15:49:12 +0300
- compiled from page_end.tpl */
-?></td>
-</tr>
-<tr>
-<td colspan=4 align=center>
-<hr>
-<small>
-<i>Lebowski test (Copyleft) korchasa<br>
-based on BlitzTest (Alexey A. Rybak).<br>
-Texts are taken from IMDB.com, Memorable Quotes from "The Big Lebowski" (Ethan & Joel Coen, 1998). <br>
-</i>
-</td>
-</tr>
-</table>
Deleted: misc/template_engines_bench/quicky/cache/page_news.tpl.cb0a13.php
===================================================================
--- misc/template_engines_bench/quicky/cache/page_news.tpl.cb0a13.php 2008-02-08 15:16:56 UTC (rev 6785)
+++ misc/template_engines_bench/quicky/cache/page_news.tpl.cb0a13.php 2008-02-08 15:29:56 UTC (rev 6786)
@@ -1,11 +0,0 @@
-<?php /* Quicky compiler version 0.3, created on Fri, 08 Feb 2008 15:49:12 +0300
- compiled from page_news.tpl */
- $this->display('page_begin.tpl'); ?>
-<h2>Introduction</h2>
-<p>Mr. Treehorn draws a lot of water in this town. You don't draw shit, Lebowski. Now we got a nice, quiet little beach community here, and I aim to keep it nice and quiet. So let me make something plain. I don't like you sucking around, bothering our citizens, Lebowski. I don't like your jerk-off name. I don't like your jerk-off face. I don't like your jerk-off behavior, and I don't like you, jerk-off.</p>
-<h2>News</h2>
-<?php $_from = $var['news'];
- if (sizeof($_from) > 0): foreach ($_from as $var['i']): ?>
- <?php $this->display('news_item.tpl'); ?>
-<?php endforeach; endif; ?>
-<?php $this->display('page_end.tpl'); ?>
\ No newline at end of file
Added: misc/template_engines_bench/quicky_one_tpl/main.php
===================================================================
--- misc/template_engines_bench/quicky_one_tpl/main.php (rev 0)
+++ misc/template_engines_bench/quicky_one_tpl/main.php 2008-02-08 15:29:56 UTC (rev 6786)
@@ -0,0 +1,38 @@
+<?
+include('../data.inc');
+include('../libs/quicky/Quicky.class.php');
+
+$tpl = new Quicky();
+
+$tpl->template_dir = './templates/';
+$tpl->compile_dir = './cache/';
+$tpl->inline_includes = true;
+$tpl->compile_check = false;
+
+// root vars
+$tpl->assign(
+ array (
+ 'num_total' => $_STAT['TOTAL'],
+ 'num_online'=> count($_STAT['ONLINE']),
+ 'poll_title' => $_POLL['TITLE'],
+ 'poll_question' => $_POLL['QUESTION'],
+ 'poll_button' => $_POLL['BUTTON'],
+ )
+);
+
+$random_keys = array_rand($_DATA['ADVERTS'],3);
+$adverts = array();
+foreach($random_keys as $i) {
+ array_push($adverts, $_DATA['ADVERTS'][$i]);
+}
+$tpl->assign_by_ref('adverts',$adverts);
+$tpl->assign_by_ref('sections',$_SECTIONS);
+$tpl->assign_by_ref('users',$_STAT['ONLINE']);
+$tpl->assign_by_ref('news',$_NEWS);
+$tpl->assign_by_ref('poll_answers',$_POLL['ANSWERS']);
+
+// out
+$tpl->assign('page','page_news');
+$tpl->display('page.tpl');
+
+?>
\ No newline at end of file
Added: misc/template_engines_bench/quicky_one_tpl/templates/page.tpl
===================================================================
--- misc/template_engines_bench/quicky_one_tpl/templates/page.tpl (rev 0)
+++ misc/template_engines_bench/quicky_one_tpl/templates/page.tpl 2008-02-08 15:29:56 UTC (rev 6786)
@@ -0,0 +1,81 @@
+<table width=800>
+<tr><td width=200>
+
+<table bgcolor=#000000 cellspacing=2 cellpadding=4 border=0 width=100%>
+<tr><td bgcolor=#ffffff><h1>QuickyExample</h1></td></tr>
+</table>
+</td>
+{section name=i loop=$adverts max=3}
+ <td width=200 valign=top>
+ <table bgcolor=#000000 cellspacing=2 cellpadding=2 border=0 width=100%>
+ <tr><td><font color=#ffffff><b>{$adverts[i].section}</b></font></td></tr>
+ <tr><td bgcolor=#ffffff><small><a href="{$adverts[i].url}">{$adverts[i].title}</a></small>
+ </td></tr>
+ </table>
+{/section}
+</td>
+</tr>
+
+<tr valign=top>
+<td width=200>
+<table width=100% cellpadding=3>
+{section name=i loop=$sections}
+<tr>
+<td bgcolor={if $smarty.section.i.index is odd}#eeeeee{else}#dddddd{/if}>
+<font color=#ffffff><b>
+<a href="/section.phtml?id={$sections[i].id}">{$sections[i].name}</a>
+{if $sections[i].rip }<font color=#999999>R.I.P.</font></font>{/if}
+</td>
+</tr>
+{/section}
+</table>
+
+<p><b>Users</b>: {$num_total}<br>
+
+<b>Online</b>: {$num_online}<br>
+
+<small>
+<i>
+{foreach from=$users item=i}
+<a href="/user.phtml?id={$i.id}">{$i.name}</a>
+{/foreach}
+</i>
+</small>
+
+</small>
+<p><b>{$poll_title}</b><br>
+<small>
+{$poll_question}
+<small><br>
+<form method=post>
+<table>
+{foreach item=i from=$poll_answers}
+<tr valign=center><td><small><input type=radio name=a>{$i}<br></td></tr>
+{/foreach}
+<tr><td align=center><input type=submit name="OK" value="{$poll_button}"></td></tr>
+</table>
+</form>
+</td>
+
+<td width=400 colspan=3>
+<h2>Introduction</h2>
+<p>Mr. Treehorn draws a lot of water in this town. You don't draw shit, Lebowski. Now we got a nice, quiet little beach community here, and I aim to keep it nice and quiet. So let me make something plain. I don't like you sucking around, bothering our citizens, Lebowski. I don't like your jerk-off name. I don't like your jerk-off face. I don't like your jerk-off behavior, and I don't like you, jerk-off.</p>
+<h2>News</h2>
+{foreach item=i from=$news}
+ <b>{$i.time} {$i.title}</b><br>
+ <small>{$i.short}<a href="/news.phtml?id={$i.id}">[ read full story ]</a></small>
+ <br>
+{/foreach}
+</td>
+</tr>
+<tr>
+<td colspan=4 align=center>
+<hr>
+<small>
+<i>Lebowski test (Copyleft) korchasa<br>
+based on BlitzTest (Alexey A. Rybak).<br>
+Texts are taken from IMDB.com, Memorable Quotes from "The Big Lebowski" (Ethan & Joel Coen, 1998). <br>
+</i>
+</td>
+</tr>
+</table>
Deleted: misc/template_engines_bench/smarty/cache/%%12^128^128846E2%%adverts_item.tpl.php
===================================================================
--- misc/template_engines_bench/smarty/cache/%%12^128^128846E2%%adverts_item.tpl.php 2008-02-08 15:16:56 UTC (rev 6785)
+++ misc/template_engines_bench/smarty/cache/%%12^128^128846E2%%adverts_item.tpl.php 2008-02-08 15:29:56 UTC (rev 6786)
@@ -1,11 +0,0 @@
-<?php /* Smarty version 2.6.15, created on 2008-02-07 11:28:25
- compiled from adverts_item.tpl */ ?>
-<td width=200 valign=top>
-<table bgcolor=#000000 cellspacing=2 cellpadding=2 border=0 width=100%>
-<tr><td><font color=#ffffff><b><?php echo $this->_tpl_vars['adverts'][$this->_sections['i']['index']]['section']; ?>
-</b></font></td></tr>
-<tr><td bgcolor=#ffffff><small><a href="<?php echo $this->_tpl_vars['adverts'][$this->_sections['i']['index']]['url']; ?>
-"><?php echo $this->_tpl_vars['adverts'][$this->_sections['i']['index']]['title']; ?>
-</a></small>
-</td></tr>
-</table>
\ No newline at end of file
Deleted: misc/template_engines_bench/smarty/cache/%%29^292^2929E2E0%%page_news.tpl.php
===================================================================
--- misc/template_engines_bench/smarty/cache/%%29^292^2929E2E0%%page_news.tpl.php 2008-02-08 15:16:56 UTC (rev 6785)
+++ misc/template_engines_bench/smarty/cache/%%29^292^2929E2E0%%page_news.tpl.php 2008-02-08 15:29:56 UTC (rev 6786)
@@ -1,13 +0,0 @@
-<?php /* Smarty version 2.6.15, created on 2008-02-07 11:28:25
- compiled from page_news.tpl */ ?>
-<h2>Introduction</h2>
-<p>Mr. Treehorn draws a lot of water in this town. You don't draw shit, Lebowski. Now we got a nice, quiet little beach community here, and I aim to keep it nice and quiet. So let me make something plain. I don't like you sucking around, bothering our citizens, Lebowski. I don't like your jerk-off name. I don't like your jerk-off face. I don't like your jerk-off behavior, and I don't like you, jerk-off.</p>
-<h2>News</h2>
-<?php $_from = $this->_tpl_vars['news']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
- foreach ($_from as $this->_tpl_vars['i']):
-?>
- <?php $_smarty_tpl_vars = $this->_tpl_vars;
-$this->_smarty_include(array('smarty_include_tpl_file' => "news_item.tpl", 'smarty_include_vars' => array()));
-$this->_tpl_vars = $_smarty_tpl_vars;
-unset($_smarty_tpl_vars);
- endforeach; endif; unset($_from); ?>
\ No newline at end of file
Deleted: misc/template_engines_bench/smarty/cache/%%BA^BA2^BA2A5281%%news_item.tpl.php
===================================================================
--- misc/template_engines_bench/smarty/cache/%%BA^BA2^BA2A5281%%news_item.tpl.php 2008-02-08 15:16:56 UTC (rev 6785)
+++ misc/template_engines_bench/smarty/cache/%%BA^BA2^BA2A5281%%news_item.tpl.php 2008-02-08 15:29:56 UTC (rev 6786)
@@ -1,9 +0,0 @@
-<?php /* Smarty version 2.6.15, created on 2008-02-07 11:28:25
- compiled from news_item.tpl */ ?>
-<b><?php echo $this->_tpl_vars['i']['time']; ?>
- <?php echo $this->_tpl_vars['i']['title']; ?>
-</b><br>
-<small><?php echo $this->_tpl_vars['i']['short']; ?>
-<a href="/news.phtml?id=<?php echo $this->_tpl_vars['i']['id']; ?>
-">[ read full story ]</a></small>
-<br>
\ No newline at end of file
Deleted: misc/template_engines_bench/smarty/cache/%%D8^D8B^D8BE8273%%page.tpl.php
===================================================================
--- misc/template_engines_bench/smarty/cache/%%D8^D8B^D8BE8273%%page.tpl.php 2008-02-08 15:16:56 UTC (rev 6785)
+++ misc/template_engines_bench/smarty/cache/%%D8^D8B^D8BE8273%%page.tpl.php 2008-02-08 15:29:56 UTC (rev 6786)
@@ -1,140 +0,0 @@
-<?php /* Smarty version 2.6.15, created on 2008-02-07 11:28:25
- compiled from page.tpl */ ?>
-<table width=800>
-<tr><td width=200>
-
-<table bgcolor=#000000 cellspacing=2 cellpadding=4 border=0 width=100%>
-<tr><td bgcolor=#ffffff><h1>SmartyExample</h1></td></tr>
-</table>
-</td>
-<?php unset($this->_sections['i']);
-$this->_sections['i']['name'] = 'i';
-$this->_sections['i']['loop'] = is_array($_loop=$this->_tpl_vars['adverts']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
-$this->_sections['i']['max'] = (int)3;
-$this->_sections['i']['show'] = true;
-if ($this->_sections['i']['max'] < 0)
- $this->_sections['i']['max'] = $this->_sections['i']['loop'];
-$this->_sections['i']['step'] = 1;
-$this->_sections['i']['start'] = $this->_sections['i']['step'] > 0 ? 0 : $this->_sections['i']['loop']-1;
-if ($this->_sections['i']['show']) {
- $this->_sections['i']['total'] = min(ceil(($this->_sections['i']['step'] > 0 ? $this->_sections['i']['loop'] - $this->_sections['i']['start'] : $this->_sections['i']['start']+1)/abs($this->_sections['i']['step'])), $this->_sections['i']['max']);
- if ($this->_sections['i']['total'] == 0)
- $this->_sections['i']['show'] = false;
-} else
- $this->_sections['i']['total'] = 0;
-if ($this->_sections['i']['show']):
-
- for ($this->_sections['i']['index'] = $this->_sections['i']['start'], $this->_sections['i']['iteration'] = 1;
- $this->_sections['i']['iteration'] <= $this->_sections['i']['total'];
- $this->_sections['i']['index'] += $this->_sections['i']['step'], $this->_sections['i']['iteration']++):
-$this->_sections['i']['rownum'] = $this->_sections['i']['iteration'];
-$this->_sections['i']['index_prev'] = $this->_sections['i']['index'] - $this->_sections['i']['step'];
-$this->_sections['i']['index_next'] = $this->_sections['i']['index'] + $this->_sections['i']['step'];
-$this->_sections['i']['first'] = ($this->_sections['i']['iteration'] == 1);
-$this->_sections['i']['last'] = ($this->_sections['i']['iteration'] == $this->_sections['i']['total']);
-?>
- <?php $_smarty_tpl_vars = $this->_tpl_vars;
-$this->_smarty_include(array('smarty_include_tpl_file' => "adverts_item.tpl", 'smarty_include_vars' => array()));
-$this->_tpl_vars = $_smarty_tpl_vars;
-unset($_smarty_tpl_vars);
- endfor; endif; ?>
-</td>
-</tr>
-
-<tr valign=top>
-<td width=200>
-<table width=100% cellpadding=3>
-<?php unset($this->_sections['i']);
-$this->_sections['i']['name'] = 'i';
-$this->_sections['i']['loop'] = is_array($_loop=$this->_tpl_vars['sections']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
-$this->_sections['i']['show'] = true;
-$this->_sections['i']['max'] = $this->_sections['i']['loop'];
-$this->_sections['i']['step'] = 1;
-$this->_sections['i']['start'] = $this->_sections['i']['step'] > 0 ? 0 : $this->_sections['i']['loop']-1;
-if ($this->_sections['i']['show']) {
- $this->_sections['i']['total'] = $this->_sections['i']['loop'];
- if ($this->_sections['i']['total'] == 0)
- $this->_sections['i']['show'] = false;
-} else
- $this->_sections['i']['total'] = 0;
-if ($this->_sections['i']['show']):
-
- for ($this->_sections['i']['index'] = $this->_sections['i']['start'], $this->_sections['i']['iteration'] = 1;
- $this->_sections['i']['iteration'] <= $this->_sections['i']['total'];
- $this->_sections['i']['index'] += $this->_sections['i']['step'], $this->_sections['i']['iteration']++):
-$this->_sections['i']['rownum'] = $this->_sections['i']['iteration'];
-$this->_sections['i']['index_prev'] = $this->_sections['i']['index'] - $this->_sections['i']['step'];
-$this->_sections['i']['index_next'] = $this->_sections['i']['index'] + $this->_sections['i']['step'];
-$this->_sections['i']['first'] = ($this->_sections['i']['iteration'] == 1);
-$this->_sections['i']['last'] = ($this->_sections['i']['iteration'] == $this->_sections['i']['total']);
-?>
-<tr>
-<td bgcolor=<?php if ((1 & $this->_sections['i']['index'])): ?>#eeeeee<?php else: ?>#dddddd<?php endif; ?>>
-<font color=#ffffff><b>
-<a href="/section.phtml?id=<?php echo $this->_tpl_vars['sections'][$this->_sections['i']['index']]['id']; ?>
-"><?php echo $this->_tpl_vars['sections'][$this->_sections['i']['index']]['name']; ?>
-</a>
-<?php if ($this->_tpl_vars['sections'][$this->_sections['i']['index']]['rip']): ?><font color=#999999>R.I.P.</font></font><?php endif; ?>
-</td>
-</tr>
-<?php endfor; endif; ?>
-</table>
-
-<p><b>Users</b>: <?php echo $this->_tpl_vars['num_total']; ?>
-<br>
-
-<b>Online</b>: <?php echo $this->_tpl_vars['num_online']; ?>
-<br>
-
-<small>
-<i>
-<?php $_from = $this->_tpl_vars['users']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
- foreach ($_from as $this->_tpl_vars['i']):
-?>
-<a href="/user.phtml?id=<?php echo $this->_tpl_vars['i']['id']; ?>
-"><?php echo $this->_tpl_vars['i']['name']; ?>
-</a>
-<?php endforeach; endif; unset($_from); ?>
-</i>
-</small>
-
-</small>
-<p><b><?php echo $this->_tpl_vars['poll_title']; ?>
-</b><br>
-<small>
-<?php echo $this->_tpl_vars['poll_question']; ?>
-
-<small><br>
-<form method=post>
-<table>
-<?php $_from = $this->_tpl_vars['poll_answers']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
- foreach ($_from as $this->_tpl_vars['i']):
-?>
-<tr valign=center><td><small><input type=radio name=a><?php echo $this->_tpl_vars['i']; ?>
-<br></td></tr>
-<?php endforeach; endif; unset($_from); ?>
-<tr><td align=center><input type=submit name="OK" value="<?php echo $this->_tpl_vars['poll_button']; ?>
-"></td></tr>
-</table>
-</form>
-</td>
-
-<td width=400 colspan=3>
-<?php $_smarty_tpl_vars = $this->_tpl_vars;
-$this->_smarty_include(array('smarty_include_tpl_file' => ($this->_tpl_vars['page']).".tpl", 'smarty_include_vars' => array()));
-$this->_tpl_vars = $_smarty_tpl_vars;
-unset($_smarty_tpl_vars);
- ?>
-</td>
-</tr>
-<tr>
-<td colspan=4 align=center>
-<hr>
-<small>
-<i>Lebowski test (Copyleft) korchasa<br>
-based on BlitzTest (Alexey A. Rybak).<br>
-Texts are taken from IMDB.com, Memorable Quotes from "The Big Lebowski" (Ethan & Joel Coen, 1998). <br>
-</i>
-</td>
-</tr>
-</table>
\ No newline at end of file
Added: misc/template_engines_bench/smarty_one_tpl/main.php
===================================================================
--- misc/template_engines_bench/smarty_one_tpl/main.php (rev 0)
+++ misc/template_engines_bench/smarty_one_tpl/main.php 2008-02-08 15:29:56 UTC (rev 6786)
@@ -0,0 +1,35 @@
+<?
+
+include('../data.inc');
+include('../libs/smarty/libs/Smarty.class.php');
+
+$tpl = new Smarty();
+
+$tpl->template_dir = './templates';
+$tpl->compile_dir = './cache';
+$tpl->compile_check = true;
+$tpl->compile_check = false;
+
+// root vars
+$tpl->assign(
+ array (
+ 'num_total' => $_STAT['TOTAL'],
+ 'num_online'=> count($_STAT['ONLINE']),
+ 'poll_title' => $_POLL['TITLE'],
+ 'poll_question' => $_POLL['QUESTION'],
+ 'poll_button' => $_POLL['BUTTON'],
+ )
+);
+
+shuffle($_ADVERTS);
+$tpl->assign_by_ref('adverts',$_ADVERTS);
+$tpl->assign_by_ref('sections',$_SECTIONS);
+$tpl->assign_by_ref('users',$_STAT['ONLINE']);
+$tpl->assign_by_ref('news',$_NEWS);
+$tpl->assign_by_ref('poll_answers',$_POLL['ANSWERS']);
+
+// out
+$tpl->assign('page','page_news');
+$tpl->display('page.tpl');
+
+?>
Added: misc/template_engines_bench/smarty_one_tpl/templates/page.tpl
===================================================================
--- misc/template_engines_bench/smarty_one_tpl/templates/page.tpl (rev 0)
+++ misc/template_engines_bench/smarty_one_tpl/templates/page.tpl 2008-02-08 15:29:56 UTC (rev 6786)
@@ -0,0 +1,81 @@
+<table width=800>
+<tr><td width=200>
+
+<table bgcolor=#000000 cellspacing=2 cellpadding=4 border=0 width=100%>
+<tr><td bgcolor=#ffffff><h1>SmartyExample</h1></td></tr>
+</table>
+</td>
+{section name=i loop=$adverts max=3}
+ <td width=200 valign=top>
+ <table bgcolor=#000000 cellspacing=2 cellpadding=2 border=0 width=100%>
+ <tr><td><font color=#ffffff><b>{$adverts[i].section}</b></font></td></tr>
+ <tr><td bgcolor=#ffffff><small><a href="{$adverts[i].url}">{$adverts[i].title}</a></small>
+ </td></tr>
+ </table>
+{/section}
+</td>
+</tr>
+
+<tr valign=top>
+<td width=200>
+<table width=100% cellpadding=3>
+{section name=i loop=$sections}
+<tr>
+<td bgcolor={if $smarty.section.i.index is odd}#eeeeee{else}#dddddd{/if}>
+<font color=#ffffff><b>
+<a href="/section.phtml?id={$sections[i].id}">{$sections[i].name}</a>
+{if $sections[i].rip }<font color=#999999>R.I.P.</font></font>{/if}
+</td>
+</tr>
+{/section}
+</table>
+
+<p><b>Users</b>: {$num_total}<br>
+
+<b>Online</b>: {$num_online}<br>
+
+<small>
+<i>
+{foreach from=$users item=i}
+<a href="/user.phtml?id={$i.id}">{$i.name}</a>
+{/foreach}
+</i>
+</small>
+
+</small>
+<p><b>{$poll_title}</b><br>
+<small>
+{$poll_question}
+<small><br>
+<form method=post>
+<table>
+{foreach item=i from=$poll_answers}
+<tr valign=center><td><small><input type=radio name=a>{$i}<br></td></tr>
+{/foreach}
+<tr><td align=center><input type=submit name="OK" value="{$poll_button}"></td></tr>
+</table>
+</form>
+</td>
+
+<td width=400 colspan=3>
+<h2>Introduction</h2>
+<p>Mr. Treehorn draws a lot of water in this town. You don't draw shit, Lebowski. Now we got a nice, quiet little beach community here, and I aim to keep it nice and quiet. So let me make something plain. I don't like you sucking around, bothering our citizens, Lebowski. I don't like your jerk-off name. I don't like your jerk-off face. I don't like your jerk-off behavior, and I don't like you, jerk-off.</p>
+<h2>News</h2>
+{foreach item=i from=$news}
+ <b>{$i.time} {$i.title}</b><br>
+ <small>{$i.short}<a href="/news.phtml?id={$i.id}">[ read full story ]</a></small>
+ <br>
+{/foreach}
+</td>
+</tr>
+<tr>
+<td colspan=4 align=center>
+<hr>
+<small>
+<i>Lebowski test (Copyleft) korchasa<br>
+based on BlitzTest (Alexey A. Rybak).<br>
+Texts are taken from IMDB.com, Memorable Quotes from "The Big Lebowski" (Ethan & Joel Coen, 1998). <br>
+</i>
+</td>
+</tr>
+</table>
More information about the limb-svn
mailing list