Browse Source

more error handling updates

Nathaniel van Diepen 11 years ago
parent
commit
c7b91ab01d
1 changed files with 4 additions and 8 deletions
  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";
 							}
 						}