private function parseTemplate() { $cachename = $this->getCacheName(); $serializedName = $cachename . '.serialized'; umask(02); $cache = Settings::get(View::CACHE, true); $parsed = null; if (!$cache || !is_file($cachename) || !is_file($serializedName)) { $phtml = file_get_contents($this->getTemplateFile()); $parser = new Phtml(); $parsed = $parser->read($phtml, $this->getTemplate()); Dir::ensure(dirname($cachename)); file_put_contents($serializedName, serialize($parsed)); $parsed->toPhp($cachename); } return $parsed; }
<?php define('BASEURL',dirname($_SERVER['SCRIPT_NAME']).'/'); require_once '../bootstrap.php'; $phtml = new Phtml(); //echo '<pre>'; //$phtml->setDebug(true); $node = $phtml->read(file_get_contents('phtml.php')); //echo '</pre>'; highlight_string($node->toPHP());