Asset.php
[Pman.Core] / Asset.php
index d98a5be..7b0a3ea 100644 (file)
--- a/Asset.php
+++ b/Asset.php
@@ -123,8 +123,42 @@ class Pman_Core_Asset extends Pman {
         die('invalid');
     }
      
-    static function getAssetDir($type)
+    static function getCompileDir($type)
     {
-        if(empty($type))
+        $ui = posix_getpwuid(posix_geteuid());
+        
+        $ff = HTML_FlexyFramework::get();
+        
+        switch($type) {
+            case 'js':
+            case 'css':
+                $compile_dir = session_save_path() . '/' . implode("-", array(
+                    $ui['name'],
+                    $ff->project,
+                    $ff->version,
+                    "{$type}compile"
+                ));
+                break;
+            case 'template':
+                break;
+            default:
+                return false;
+        }
+        
+        exit;
+        
+        
+        
+        
+        
+        if (file_exists($compile_dir)) {
+            return $compile_dir;
+        }
+        
+        if(mkdir($compile_dir, 0700, true)) {
+            return $compile_dir;
+        }
+        
+        return false;
     }
 }