瀏覽代碼

Make sure htaccess is created

Jordi Boggiano 13 年之前
父節點
當前提交
f3df4772f9
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/Composer/Factory.php

+ 4 - 1
src/Composer/Factory.php

@@ -40,7 +40,10 @@ class Factory
 
         // Protect directory against web access
         if (!file_exists($home . '/.htaccess')) {
-            @mkdir($home, 0777, true) && @file_put_contents($home . '/.htaccess', 'deny from all');
+            if (!is_dir($home)) {
+                @mkdir($home, 0777, true);
+            }
+            @file_put_contents($home . '/.htaccess', 'Deny from all');
         }
 
         $config = new Config();