本文整理汇总了PHP中Haanga::Configure方法的典型用法代码示例。如果您正苦于以下问题:PHP Haanga::Configure方法的具体用法?PHP Haanga::Configure怎么用?PHP Haanga::Configure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Haanga
的用法示例。
在下文中一共展示了Haanga::Configure方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Init
public static function Init()
{
$config = array('cache_dir' => 'tmp/', 'template_dir' => '.', 'debug' => TRUE, 'use_hash_filename' => FALSE, 'compiler' => array('allow_exec' => TRUE, 'global' => array('test_global', 'global1')));
Haanga::Configure($config);
}
示例2: array
<?php
require "../lib/Haanga.php";
$config = array('cache_dir' => 'tmp/', 'template_dir' => 'django-yui-layout-templates/');
if (is_callable('xcache_isset')) {
/* don't check for changes in the template for the next 5 min */
$config['check_ttl'] = 300;
$config['check_get'] = 'xcache_get';
$config['check_set'] = 'xcache_set';
}
Haanga::Configure($config);
$files = array();
foreach (glob("django-yui-layout-templates/*.html") as $html) {
if (is_file($html)) {
$files[basename($html)] = TRUE;
}
}
if (!isset($_GET['layout']) || !isset($files[$_GET['layout']])) {
$_GET['layout'] = key($files);
}
$blocks = array('1' => 'Content on div 1', '2' => 'Content on div 2', '3' => 'Content on div 3', '4' => 'Content on div 4', 'title' => $_GET['layout'] . " template");
$debug = TRUE;
$sql_queries = array(array('sql' => 'select * from foobar', 'time' => '1'), array('sql' => 'select * from php', 'time' => '1'));
$files = array_keys($files);
$time = microtime(TRUE);
$mem = memory_get_usage();
Haanga::Load($_GET['layout'], compact('debug', 'files', 'sql_queries'), FALSE, $blocks);
var_dump(array('memory (mb)' => (memory_get_usage() - $mem) / (1024 * 1024), 'time' => microtime(TRUE) - $time));