Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class skytemplate_withdaddy {
- var $tplRoot;
- var $webRoot;
- var $debug;
- var $tplRewrite;
- var $preFilter;
- var $postFilter;
- var $version;
- var $timeOffset;
- var $File;
- var $Src;
- var $Code;
- var $Target;
- public function skytemplate_withdaddy($obj = null) {
- $this->tplRoot = $Template_Config["Config"]["tplRoot"];
- $this->webRoot = $Template_Config["Config"]["webRoot"];
- $this->debug = $Template_Config["Config"]["debug"];
- if ($obj) {
- $this->setinfo($obj);
- }
- return;
- }
- public function setinfo($obj) {
- if (is_object($obj)) {
- $this->tplRoot = $obj->tplRoot;
- $this->webRoot = $obj->webRoot;
- $this->debug = $obj->debug;
- $this->tplRewrite = $obj->tplRewrite;
- $this->preFilter = $obj->preFilter;
- $this->postFilter = $obj->postFilter;
- $this->version = $obj->version;
- $this->timeOffset = $obj->timeOffset;
- }
- else {
- $this->error("setInfo : No SkyTemplate Object!!", true);
- exit();
- }
- if (!is_dir($this->tplRoot) || $this->makedir($dir)) {
- $this->error("setInfo : Directory Not Exists! (" . $dir . ")", true);
- exit();
- }
- return;
- }
- public function compile($var, $file, $cfile) {
- if ($this->File[$var]) {
- return true;
- }
- if ($fp = fopen($file, "r")) {
- $this->Src[$var] = "";
- $this->Src[$var] .= fread($fp, 100000);
- if (!feof($fp)) {
- continue;
- }
- fclose($fp);
- if ($Template_Config["SourceCheck"]["use"] === true || 0 < sizeof($Template_Config["SourceCheck"]["filter"])) {
- foreach ($Template_Config["SourceCheck"]["filter"] as $filter => $changeText) {
- if (!strpos($this->Src[$var], $filter) !== false) {
- continue;
- }
- $this->Src[$var] = str_replace($filter, $changeText, $this->Src[$var]);
- if (!$Template_Config["SourceCheck"]["log_use"] === true) {
- continue;
- }
- $HackOption = $Template_Config["HackCheckLog"];
- $HackOption["log_type"] = $Template_Config["SourceCheck"]["log_type"];
- hack_check_log($HackOption);
- continue;
- }
- }
- $this->File[$var] = $file;
- $this->Target[$var] = $cfile;
- if ($this->preFilter) {
- $this->filter($var, "pre");
- }
- if ($this->tplRewrite) {
- $this->tplrewrite($var);
- }
- $this->comment($var);
- $this->parse($var);
- if ($this->postFilter) {
- $this->filter($var, "post");
- }
- return $this->save($var, filemtime($file) + $this->timeOffset);
- }
- return $this->error("compile : File Not Exists! (" . $file . ")", true);
- }
- public function filter($var, $mode) {
- static $filters;
- static $filterList;
- if (!is_array($filters)) {
- $filters = parse_ini_file(dirname("/var/www/html/decoding/fc7/60b/fc760bb2a7d04f61acc9615ffc045e72-22209.txt") . "/SkyTpl/plugin.ini.masterFilter.php", false);
- $filters["pre"] .= trim($this->preFilter);
- $filters["post"] .= trim($this->postFilter);
- }
- if ($filterList[$mode]) {
- foreach ($filterList[$mode] as $func => $args) {
- $args[1] = $var;
- call_user_func_array($func, $args);
- continue;
- }
- return;
- }
- $tmp1 = $this->parsequote(trim($filters[$mode]), false, false);
- $tmp = array();
- $z = 0;
- $i = 0;
- $c1 = count($tmp1);
- for (/**/; $i < $c1; $i += 2) {
- $tmp2 = preg_split("/([,\\(\\);])/i", $tmp1[$i], -1, PREG_SPLIT_DELIM_CAPTURE);
- $j = 0;
- $c2 = count($tmp2);
- for (/**/; $j < $c2; ++$j) {
- $tmp2[$j] = trim($tmp2[$j]);
- if (!$tmp2[$j] != "") {
- continue;
- }
- if ($tmp2[$j] == ";") {
- ++$z;
- continue;
- }
- $this[$tmp[$z]] = $tmp2[$j];
- continue;
- }
- !isset($tmp1[$i + 1]) ? true : null {
- continue;
- }
- $this[$tmp[$z]] = $tmp1[$i + 1];
- continue;
- }
- $filterList[$mode] = array();
- $i = 0;
- .........................................................................
- ...............................
- .......
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement