本文整理匯總了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));