Asset.php
[Pman.Core] / Asset.php
index bc0475f..88937fa 100644 (file)
--- a/Asset.php
+++ b/Asset.php
@@ -100,8 +100,7 @@ class Pman_Core_Asset extends Pman {
             $content = gzencode( file_get_contents($fn) , 9);
             
             header('Content-Encoding: gzip');
-                header('Vary: Accept-Encoding');
-
+            header('Vary: Accept-Encoding');
             header('Content-Length: '. strlen($content));
             
             echo $content;
@@ -124,5 +123,42 @@ class Pman_Core_Asset extends Pman {
         die('invalid');
     }
      
+    static function getCompileDir($type)
+    {
+        $ui = posix_getpwuid(posix_geteuid());
+        
+        $ff = HTML_FlexyFramework::get();
+        
+        $compile_dir = session_save_path() . "/";
+        
+        switch($type) {
+            case 'js':
+            case 'css':
+                $compile_dir .= implode("-", array(
+                    $ui['name'],
+                    $ff->project,
+                    $ff->version,
+                    "{$type}compile"
+                ));
+                break;
+            // template
+            default:
+                return false;
+        }
+        
+        if (file_exists($compile_dir)) {
+            return $compile_dir;
+        }
+        
+        if(mkdir($compile_dir, 0700, true)) {
+            return $compile_dir;
+        }
+        
+        return false;
+    }
     
+    function clearCompiledFilesCache()
+    {
+        exit('testing');
+    }
 }