| @@ 215-224 (lines=10) @@ | ||
| 212 | return file_put_contents($this->getSourcePath($path), $data); |
|
| 213 | } |
|
| 214 | ||
| 215 | public function unlink($path) { |
|
| 216 | if ($this->is_dir($path)) { |
|
| 217 | return $this->rmdir($path); |
|
| 218 | } else if ($this->is_file($path)) { |
|
| 219 | return unlink($this->getSourcePath($path)); |
|
| 220 | } else { |
|
| 221 | return false; |
|
| 222 | } |
|
| 223 | ||
| 224 | } |
|
| 225 | ||
| 226 | public function rename($path1, $path2) { |
|
| 227 | $srcParent = dirname($path1); |
|
| @@ 95-103 (lines=9) @@ | ||
| 92 | * @param string $path |
|
| 93 | * @return bool |
|
| 94 | */ |
|
| 95 | protected function remove($path) { |
|
| 96 | if ($this->is_dir($path)) { |
|
| 97 | return $this->rmdir($path); |
|
| 98 | } else if ($this->is_file($path)) { |
|
| 99 | return $this->unlink($path); |
|
| 100 | } else { |
|
| 101 | return false; |
|
| 102 | } |
|
| 103 | } |
|
| 104 | ||
| 105 | public function is_dir($path) { |
|
| 106 | return $this->filetype($path) === 'dir'; |
|