| @@ 140-158 (lines=19) @@ | ||
| 137 | /** |
|
| 138 | * {@inheritDoc} |
|
| 139 | */ |
|
| 140 | public function rename(/*# string */ $from, /*# string */ $to)/*# : bool */ |
|
| 141 | { |
|
| 142 | $real_from = $this->realPath($from); |
|
| 143 | $real_to = $this->realPath($to); |
|
| 144 | ||
| 145 | if ($this->fixPath($real_from, $real_to)) { |
|
| 146 | if ($this->isDir($real_from)) { |
|
| 147 | $res = $this->renameDir($real_from, $real_to); |
|
| 148 | } else { |
|
| 149 | $res = $this->renameFile($real_from, $real_to); |
|
| 150 | } |
|
| 151 | ||
| 152 | return $res ?: $this->setError( |
|
| 153 | Message::get(Message::STR_RENAME_FAIL, $real_from, $real_to), |
|
| 154 | Message::STR_RENAME_FAIL |
|
| 155 | ); |
|
| 156 | } |
|
| 157 | return false; |
|
| 158 | } |
|
| 159 | ||
| 160 | /** |
|
| 161 | * {@inheritDoc} |
|
| @@ 163-181 (lines=19) @@ | ||
| 160 | /** |
|
| 161 | * {@inheritDoc} |
|
| 162 | */ |
|
| 163 | public function copy(/*# string */ $from, /*# string */ $to)/*# : bool */ |
|
| 164 | { |
|
| 165 | $real_from = $this->realPath($from); |
|
| 166 | $real_to = $this->realPath($to); |
|
| 167 | ||
| 168 | if ($this->fixPath($real_from, $real_to)) { |
|
| 169 | if ($this->isDir($real_from)) { |
|
| 170 | $res = $this->copyDir($real_from, $real_to); |
|
| 171 | } else { |
|
| 172 | $res = $this->copyFile($real_from, $real_to); |
|
| 173 | } |
|
| 174 | ||
| 175 | return $res ?: $this->setError( |
|
| 176 | Message::get(Message::STR_COPY_FAIL, $real_from, $real_to), |
|
| 177 | Message::STR_COPY_FAIL |
|
| 178 | ); |
|
| 179 | } |
|
| 180 | return false; |
|
| 181 | } |
|
| 182 | ||
| 183 | /** |
|
| 184 | * {@inheritDoc} |
|