]> git.andy128k.dev Git - ipf-template.git/commitdiff
separate project related template stuff
authorAndrey Kutejko <andy128k@gmail.com>
Tue, 30 Jul 2013 21:10:32 +0000 (00:10 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Tue, 30 Jul 2013 21:10:32 +0000 (00:10 +0300)
ipf/template/environment/filesystem.php
ipf/template/tag/sql.php [deleted file]
ipf/template/tag/url.php [deleted file]

index 42c3aa5b8f0c36a4750d6484d01474d2397b056c..8eb8d6581c87b80a3f450f32f30be29877f08a64 100644 (file)
@@ -3,15 +3,9 @@
 class IPF_Template_Environment_FileSystem extends IPF_Template_Environment
 {
     public $folders = array();
-    public $cache = '';
+    public $cache = '/tmp';
     public $debug = false;
 
-    public function __construct($folders, $cache)
-    {
-        $this->folders = $folders;
-        $this->cache = $cache;
-    }
-
     public function loadTemplateFile($filename)
     {
         // FIXME: Very small security check, could be better.
diff --git a/ipf/template/tag/sql.php b/ipf/template/tag/sql.php
deleted file mode 100644 (file)
index 4039581..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-
-class IPF_Template_Tag_Sql extends IPF_Template_Tag
-{
-    function start()
-    {
-        $profiler = IPF_Project::getInstance()->sqlProfiler;
-        if ($profiler !== null) {
-            echo '<div style="padding:10px; margin:10px; background:#eee; border:1px dashed #888;"><h3>Sql Debug</h3><div style="color:#888">set <i>debug</i> to false in settings project for disable sql profiler</div>';
-            $time = 0;
-            foreach ($profiler->events as $event) {
-                $time += $event->getElapsedSecs();
-                $name = $event->getName();
-                if ($name=='fetch' || $name=='prepare' || $name=='connect')
-                    continue;
-                echo "<br>\n<b>" . $name . "</b> " . sprintf("%f", $event->getElapsedSecs()) . "<br>\n";
-                echo $event->getQuery() . "<br>\n";
-                $params = $event->getParams();
-                if( ! empty($params)) {
-                    var_dump($params);
-                    print "<br>\n";
-                }
-            }
-            echo "<br>\n<b>Total time:</b> " . $time  . " (without prepare and fetch event)<br>\n";
-            echo '</div>';
-        }
-    }
-}
diff --git a/ipf/template/tag/url.php b/ipf/template/tag/url.php
deleted file mode 100644 (file)
index 7619f9d..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-
-class IPF_Template_Tag_Url extends IPF_Template_Tag
-{
-    function start()
-    {
-        $args = func_get_args();
-        $count = count($args);
-        if ($count === 0)
-            throw new IPF_Exception('No view specified');
-
-        $view = array_shift($args);
-
-        if ($count === 2 && is_array($args[0])) {
-            echo IPF_HTTP_URL::urlForView($view, $args[0]);
-        } elseif ($count === 3 && is_array($args[0]) && is_array($args[1])) {
-            echo IPF_HTTP_URL::urlForView($view, $args[0], $args[1]);
-        } else {
-            echo IPF_HTTP_URL::urlForView($view, $args);
-        }
-    }
-}
-