| @@ 84-94 (lines=11) @@ | ||
| 81 | * @param string $pathToFile |
|
| 82 | * @return string |
|
| 83 | */ |
|
| 84 | public function read($filename, $pathToFile = null) |
|
| 85 | { |
|
| 86 | if(!$this->fileExists($filename, $pathToFile)) |
|
| 87 | throw new \Exception("File, '{$filename}', does not exist."); |
|
| 88 | ||
| 89 | if ($pathToFile==null) { |
|
| 90 | return file_get_contents($this->_filePath."/".$filename); |
|
| 91 | } else { |
|
| 92 | return file_get_contents($pathToFile."/".$filename); |
|
| 93 | } |
|
| 94 | } |
|
| 95 | ||
| 96 | /** |
|
| 97 | * Delete a file |
|
| @@ 103-113 (lines=11) @@ | ||
| 100 | * @param string $pathToFile |
|
| 101 | * @return bool |
|
| 102 | */ |
|
| 103 | public function delete($filename, $pathToFile = null) |
|
| 104 | { |
|
| 105 | if ($pathToFile==null) { |
|
| 106 | $pathToFile=$this->_filePath; |
|
| 107 | } |
|
| 108 | if (file_exists($pathToFile."/".$filename)) { |
|
| 109 | return unlink($pathToFile."/".$filename); |
|
| 110 | } else { |
|
| 111 | return false; |
|
| 112 | } |
|
| 113 | } |
|
| 114 | ||
| 115 | /** |
|
| 116 | * Move a file |
|