| @@ 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')); |
|
| @@ 217-227 (lines=11) @@ | ||
| 214 | } else { |
|
| 215 | $ext = ''; |
|
| 216 | } |
|
| 217 | if ($this->file_exists($path)) { |
|
| 218 | if (!$this->isUpdatable($path)) { |
|
| 219 | return false; |
|
| 220 | } |
|
| 221 | $tmpFile = $this->getCachedFile($path); |
|
| 222 | } else { |
|
| 223 | if (!$this->isCreatable(dirname($path))) { |
|
| 224 | return false; |
|
| 225 | } |
|
| 226 | $tmpFile = \OCP\Files::tmpFile($ext); |
|
| 227 | } |
|
| 228 | $source = fopen($tmpFile, $mode); |
|
| 229 | $share = $this->share; |
|
| 230 | return CallBackWrapper::wrap($source, null, null, function () use ($tmpFile, $fullPath, $share) { |
|