| @@ 199-209 (lines=11) @@ | ||
| 196 | case 'c': |
|
| 197 | case 'c+': |
|
| 198 | //emulate these |
|
| 199 | if ($useExisting and $this->file_exists($path)) { |
|
| 200 | if (!$this->isUpdatable($path)) { |
|
| 201 | return false; |
|
| 202 | } |
|
| 203 | $tmpFile = $this->getCachedFile($path); |
|
| 204 | } else { |
|
| 205 | if (!$this->isCreatable(dirname($path))) { |
|
| 206 | return false; |
|
| 207 | } |
|
| 208 | $tmpFile = \OCP\Files::tmpFile(); |
|
| 209 | } |
|
| 210 | $source = fopen($tmpFile, $mode); |
|
| 211 | return CallbackWrapper::wrap($source, null, null, function () use ($tmpFile, $fullPath) { |
|
| 212 | $this->flysystem->putStream($fullPath, fopen($tmpFile, 'r')); |
|
| @@ 238-248 (lines=11) @@ | ||
| 235 | } else { |
|
| 236 | $ext = ''; |
|
| 237 | } |
|
| 238 | if ($this->file_exists($path)) { |
|
| 239 | if (!$this->isUpdatable($path)) { |
|
| 240 | return false; |
|
| 241 | } |
|
| 242 | $tmpFile = $this->getCachedFile($path); |
|
| 243 | } else { |
|
| 244 | if (!$this->isCreatable(dirname($path))) { |
|
| 245 | return false; |
|
| 246 | } |
|
| 247 | $tmpFile = \OCP\Files::tmpFile($ext); |
|
| 248 | } |
|
| 249 | $source = fopen($tmpFile, $mode); |
|
| 250 | $share = $this->share; |
|
| 251 | return CallbackWrapper::wrap($source, null, null, function () use ($tmpFile, $fullPath, $share) { |
|