Asset.php
[Pman.Core] / Asset.php
index 6a8126e..0346e34 100644 (file)
--- a/Asset.php
+++ b/Asset.php
@@ -123,12 +123,31 @@ class Pman_Core_Asset extends Pman {
         die('invalid');
     }
      
-    static function getAssetDir($type)
+    static function getCompileDir($type)
     {
-        if(!in_array($type, array(
-            
-        ))) {
+        if(empty($type)) {
             return false;
         }
+        
+        $ui = posix_getpwuid(posix_geteuid());
+        
+        $ff = HTML_FlexyFramework::get();
+        
+        $compile_dir = session_save_path() . '/' . implode("-", array(
+            $ui['name'],
+            $ff->project,
+            $ff->version,
+            "{$type}compile"
+        ));
+        
+        if (file_exists($compile_dir)) {
+            return $compile_dir;
+        }
+        
+        if(mkdir($compile_dir, 0700, true)) {
+            return $compile_dir;
+        }
+        
+        return false;
     }
 }