3 require "../lib/Haanga.php";
6 'template_dir' => 'django-yui-layout-templates/',
9 if (is_callable('xcache_isset')) {
10 /* don't check for changes in the template for the next 5 min */
11 $config['check_ttl'] = 300;
12 $config['check_get'] = 'xcache_get';
13 $config['check_set'] = 'xcache_set';
16 Haanga
::Configure($config);
19 foreach (glob("django-yui-layout-templates/*.html") as $html) {
21 $files[basename($html)] = TRUE;
25 if (!isset($_GET['layout']) ||
!isset($files[$_GET['layout']])) {
26 $_GET['layout'] = key($files);
30 '1' => 'Content on div 1',
31 '2' => 'Content on div 2',
32 '3' => 'Content on div 3',
33 '4' => 'Content on div 4',
34 'title' => $_GET['layout']." template",
39 array('sql' => 'select * from foobar', 'time' => '1'),
40 array('sql' => 'select * from php', 'time' => '1'),
43 $files = array_keys($files);
44 $time = microtime(TRUE);
45 $mem = memory_get_usage();
47 Haanga
::Load($_GET['layout'], compact('debug', 'files', 'sql_queries'), FALSE, $blocks);
49 'memory (mb)' => (memory_get_usage()-$mem)/(1024*1024),
50 'time' => microtime(TRUE)-$time