@@ -98,8 +98,12 @@ discard block |
||
| 98 | 98 | * @return boolean |
| 99 | 99 | */ |
| 100 | 100 | function exists($file = null) { |
| 101 | - if(!$file) $file = $this->path; |
|
| 102 | - if($file == '@self') return true; |
|
| 101 | + if(!$file) { |
|
| 102 | + $file = $this->path; |
|
| 103 | + } |
|
| 104 | + if($file == '@self') { |
|
| 105 | + return true; |
|
| 106 | + } |
|
| 103 | 107 | |
| 104 | 108 | if($this->server) { |
| 105 | 109 | $result = $this->exec("if [ -e " . escapeshellarg($file) . " ]; then echo yes; fi"); |
@@ -128,7 +132,9 @@ discard block |
||
| 128 | 132 | * @param string $file The file to remove |
| 129 | 133 | */ |
| 130 | 134 | function unlink($file) { |
| 131 | - if(!$file || $file == '/' || $file == '.') throw new Exception("Can't unlink file '$file'"); |
|
| 135 | + if(!$file || $file == '/' || $file == '.') { |
|
| 136 | + throw new Exception("Can't unlink file '$file'"); |
|
| 137 | + } |
|
| 132 | 138 | $this->exec(array('rm', '-rf', $file)); |
| 133 | 139 | return true; |
| 134 | 140 | } |