[limb-svn] r6791 - in misc/template_engines_bench: . blitz-ctx-arr macro/cache macro_sl macro_sl/cache macro_sl_bundled macro_sl_bundled/cache quicky/cache quicky_one_tpl/cache smarty/cache smarty_one_tpl/cache
svn at limb-project.com
svn at limb-project.com
Mon Feb 11 17:44:01 MSK 2008
Author: korchasa
Date: 2008-02-11 17:44:00 +0300 (Mon, 11 Feb 2008)
New Revision: 6791
URL: http://fisheye.limb-project.com/changelog/limb/?cs=6791
Added:
misc/template_engines_bench/blitz-ctx-arr/
misc/template_engines_bench/blitz-ctx-arr/main.php
misc/template_engines_bench/blitz-ctx-arr/main.tpl
misc/template_engines_bench/macro_sl/templates
misc/template_engines_bench/macro_sl_bundled/templates
Modified:
misc/template_engines_bench/data.inc
misc/template_engines_bench/index.php
misc/template_engines_bench/macro/cache/
misc/template_engines_bench/macro_sl/cache/
misc/template_engines_bench/macro_sl_bundled/cache/
misc/template_engines_bench/quicky/cache/
misc/template_engines_bench/quicky_one_tpl/cache/
misc/template_engines_bench/smarty/cache/
misc/template_engines_bench/smarty_one_tpl/cache/
Log:
blitz-ctx-arr
Added: misc/template_engines_bench/blitz-ctx-arr/main.php
===================================================================
--- misc/template_engines_bench/blitz-ctx-arr/main.php (rev 0)
+++ misc/template_engines_bench/blitz-ctx-arr/main.php 2008-02-11 14:44:00 UTC (rev 6791)
@@ -0,0 +1,58 @@
+<?
+include_once('../data.inc');
+
+$data = array (
+ 'num_total' => & $_STAT['TOTAL'],
+ 'num_online'=> count($_STAT['ONLINE']),
+ 'poll_title' => & $_POLL['TITLE'],
+ 'poll_question' => & $_POLL['QUESTION'],
+ 'poll_button' => & $_POLL['BUTTON'],
+ 'adverts' => array(),
+ 'sections' => array(),
+ 'users' => array(),
+ 'news' => array(),
+ 'answers' => array()
+);
+
+$random_keys = array_rand($_ADVERTS, 3);
+foreach ($random_keys as $i)
+ $data['adverts'][] = $_ADVERTS[$i];
+
+foreach ($_SECTIONS as $i => $r)
+{
+ $row = array(
+ 'id' => $r['id'],
+ 'name' => $r['name']);
+ if ($r['rip'])
+ {
+ $row['rip'] = array(array());
+ }
+ if ($i % 2)
+ {
+ $row['odd'] = array(array());
+ }
+ else
+ {
+ $row['even'] = array(array());
+ }
+ $data['sections'][] = $row;
+}
+
+// users
+$data['users'] = $_STAT['ONLINE'];
+$data['news'] = $_NEWS;
+
+foreach ($_POLL['ANSWERS'] as $i => $r)
+{
+ $data['poll_answers'][] = array(
+ 'id' => $i,
+ 'answer' => $r);
+}
+
+
+$T = new Blitz('main.tpl');
+$T->set($data);
+
+echo $T->parse();
+
+?>
Added: misc/template_engines_bench/blitz-ctx-arr/main.tpl
===================================================================
--- misc/template_engines_bench/blitz-ctx-arr/main.tpl (rev 0)
+++ misc/template_engines_bench/blitz-ctx-arr/main.tpl 2008-02-11 14:44:00 UTC (rev 6791)
@@ -0,0 +1,89 @@
+<table width=800>
+<tr><td width=200>
+
+<table bgcolor=#000000 cellspacing=2 cellpadding=4 border=0 width=100%>
+<tr><td bgcolor=#ffffff><h1>BlitzExample</h1></td></tr>
+</table>
+</td>
+
+{{ BEGIN adverts }}
+
+<td width=200 valign=top>
+<table bgcolor=#000000 cellspacing=2 cellpadding=2 border=0 width=100%>
+<tr><td><font color=#ffffff><b>{{ $section }}</b></font></td></tr>
+<tr><td bgcolor=#ffffff><small><a href="{{ $url }}">{{ $title }}</a></small>
+</td></tr>
+</table>
+
+{{ END }}
+
+</td>
+</tr>
+
+<tr valign=top>
+<td width=200>
+<table width=100% cellpadding=3>
+
+{{ BEGIN sections }}
+
+<tr>
+<td bgcolor={{ BEGIN odd }}#eeeeee{{ END }}{{ BEGIN even }}#dddddd{{ END }}
+<font color=#ffffff><b>
+<a href="/section.phtml?id={{ $id }}">{{ $name }}</a>
+{{ BEGIN rip }}<font color=#999999>R.I.P.</font></font>{{ END }}
+</td>
+</tr>
+
+{{ END }}
+
+</table>
+
+<p><b>Users</b>: {{ $num_total }}<br>
+
+<b>Online</b>: {{ $num_online }}<br>
+
+<small>
+<i>
+{{ BEGIN users }}
+<a href="/user.phtml?id={{ $id }}">{{ $name }}</a>
+{{ END }}
+</i>
+</small>
+
+</small>
+<p><b>{{ $poll_title }}</b><br>
+<small>
+{{ $poll_question }}
+<small><br>
+<form method=post>
+<table>
+{{ BEGIN poll_answers }}
+<tr valign=center><td><small><input type=radio name=a>{{ $answer }}<br></td></tr>
+{{ END }}
+
+<tr><td align=center><input type=submit name="OK" value="{{ $poll_button }}"></td></tr>
+</table>
+</form>
+</td>
+
+<td width=400 colspan=3>
+{{ BEGIN news }}
+<b>{{ $time }} {{ $title }}</b><br>
+<small>{{ $short }}<a href="/news.phtml?id={{ $id }}">[ read full story ]</a></small>
+<br>
+{{ END }}
+
+</td>
+</tr>
+<tr>
+<td colspan=4 align=center>
+<hr>
+<small>
+<i>BlitzExample (Copyleft) Alexey A. Rybak, 2005.<br>
+Texts are taken from IMDB.com, Memorable Quotes from "The Big Lebowski" (Ethan & Joel Coen, 1998). <br>
+
+You are welcome to send any suggestions or comments to <b>raa at phpclub.net</b> </i>
+
+</td>
+</tr>
+</table>
Modified: misc/template_engines_bench/data.inc
===================================================================
--- misc/template_engines_bench/data.inc 2008-02-11 12:18:16 UTC (rev 6790)
+++ misc/template_engines_bench/data.inc 2008-02-11 14:44:00 UTC (rev 6791)
@@ -26,7 +26,7 @@
'ONLINE' => array(
array('id'=>0,'name'=>'true'),
array('id'=>1,'name'=>'false'),
- array('id'=>2,'name'=>'short'),
+ array('id'=>2,'name'=>'short'),
array('id'=>3,'name'=>'long'),
array('id'=>4,'name'=>'apha'),
array('id'=>5,'name'=>'omega'),
Modified: misc/template_engines_bench/index.php
===================================================================
--- misc/template_engines_bench/index.php 2008-02-11 12:18:16 UTC (rev 6790)
+++ misc/template_engines_bench/index.php 2008-02-11 14:44:00 UTC (rev 6791)
@@ -1,7 +1,7 @@
<?php
error_reporting(E_ALL);
define('BENCH_ITERATIONS_DEFAULT', 1000);
-define('BENCH_ITERATIONS_MAX', 3000);
+define('BENCH_ITERATIONS_MAX', 30000);
define('BENCH_CONCURENCY_FACTOR', 1 / 200);
define('BENCH_CONCURENCY_MIN', 1);
define('BENCH_ENGINES_DIR', dirname(__FILE__));
Property changes on: misc/template_engines_bench/macro/cache
___________________________________________________________________
Name: svn:ignore
+ filters.cache
tags.cache
*.php
Property changes on: misc/template_engines_bench/macro_sl/cache
___________________________________________________________________
Name: svn:ignore
+ filters.cache
tags.cache
*.php
Added: misc/template_engines_bench/macro_sl/templates
===================================================================
--- misc/template_engines_bench/macro_sl/templates (rev 0)
+++ misc/template_engines_bench/macro_sl/templates 2008-02-11 14:44:00 UTC (rev 6791)
@@ -0,0 +1 @@
+link /www/engine_bench/macro/templates
\ No newline at end of file
Property changes on: misc/template_engines_bench/macro_sl/templates
___________________________________________________________________
Name: svn:special
+ *
Property changes on: misc/template_engines_bench/macro_sl_bundled/cache
___________________________________________________________________
Name: svn:ignore
+ filters.cache
tags.cache
*].php
*.php
Added: misc/template_engines_bench/macro_sl_bundled/templates
===================================================================
--- misc/template_engines_bench/macro_sl_bundled/templates (rev 0)
+++ misc/template_engines_bench/macro_sl_bundled/templates 2008-02-11 14:44:00 UTC (rev 6791)
@@ -0,0 +1 @@
+link /www/engine_bench/macro/templates
\ No newline at end of file
Property changes on: misc/template_engines_bench/macro_sl_bundled/templates
___________________________________________________________________
Name: svn:special
+ *
Property changes on: misc/template_engines_bench/quicky/cache
___________________________________________________________________
Name: svn:ignore
+ *.tpl.*.php
Property changes on: misc/template_engines_bench/quicky_one_tpl/cache
___________________________________________________________________
Name: svn:ignore
+ page.tpl.*.php
Property changes on: misc/template_engines_bench/smarty/cache
___________________________________________________________________
Name: svn:ignore
+ *.tpl.php
Property changes on: misc/template_engines_bench/smarty_one_tpl/cache
___________________________________________________________________
Name: svn:ignore
+ *page.tpl.php
More information about the limb-svn
mailing list