Fix extends with dynamic blocks

This commit is contained in:
bzick
2013-05-17 22:20:29 +04:00
parent 5a1097d5a6
commit 12a0c9589f
8 changed files with 81 additions and 108 deletions

View File

@ -45,7 +45,7 @@ class Benchmark {
public static function cytro($tpl, $data, $double, $message) {
$cytro = Cytro::factory(__DIR__.'/../templates', __DIR__."/../compile/");
$cytro = Cytro::factory(__DIR__.'/../templates', __DIR__."/../compile");
if($double) {
$cytro->fetch($tpl, $data);
@ -55,6 +55,27 @@ class Benchmark {
printf(self::$t, __FUNCTION__, $message, round(microtime(true)-$start, 4), round(memory_get_peak_usage()/1024/1024, 2));
}
public static function volt($tpl, $data, $double, $message) {
$view = new \Phalcon\Mvc\View();
//$view->setViewsDir(__DIR__.'/../templates');
$volt = new \Phalcon\Mvc\View\Engine\Volt($view);
$volt->setOptions(array(
"compiledPath" => __DIR__.'/../compile',
"compiledExtension" => __DIR__."/../.compile"
));
if($double) {
$volt->render($tpl, $data);
}
$start = microtime(true);
var_dump($tpl);
$volt->render(__DIR__.'/../templates/'.$tpl, $data);
printf(self::$t, __FUNCTION__, $message, round(microtime(true)-$start, 4), round(memory_get_peak_usage()/1024/1024, 2));
}
public static function run($engine, $template, $data, $double, $message) {
passthru(sprintf("php -dmemory_limit=512M -dxdebug.max_nesting_level=1024 %s/run.php --engine '%s' --template '%s' --data '%s' --message '%s' %s", __DIR__, $engine, $template, $data, $message, $double ? '--double' : ''));
}