ソースを参照

more error handling updates

Nathaniel van Diepen 11 年 前
コミット
c7b91ab01d
1 ファイル変更4 行追加8 行削除
  1. 4 8
      install/api.php

+ 4 - 8
install/api.php

@@ -139,15 +139,11 @@
 						$files = scandir(realpath(dirname(__FILE__)));
 						foreach($files as $file){
 							if($file != '.' && $file != '..'){
-								try{
-									unlink(realpath(dirname(__FILE__)).'/'.$file);
-								}catch(Exception $e){
-									echo "Couldn't remove {$file}\n";
-								}
+								@unlink(realpath(dirname(__FILE__)).'/'.$file);
 							}
-							try{
-								rmdir(realpath(dirname(__FILE__)));
-							}catch(Exception $e){
+							if(empty(scandir(realpath(dirname(__FILE__))))){
+								@rmdir(realpath(dirname(__FILE__)));
+							}else{
 								echo "Couldn't remove install directory\n";
 							}
 						}