public function writeStream($path, $resource, Config $config) { $location = $this->applyPathPrefix($path); if (!$this->ensureDirectory(dirname($location))) { return false; } return parent::writeStream($path, $resource, $config); }
/** * Write a file using stream * * @param string $path * @param resource $resource * @param FSConfig $config * * @return array|bool */ public function writeStream($path, $resource, FSConfig $config) { $location = $this->applyPathPrefix($path); $this->ensureDirectory(dirname($location)); $result = parent::writeStream($path, $resource, $config); $chmodFiles = $this->backendConfig['chmodFiles']; $oldUmask = umask(0); chmod($location, $chmodFiles); umask($oldUmask); return $result; }
public function testFailingStreamCalls() { $this->assertFalse($this->adapter->writeStream('false', tmpfile(), new Config())); $this->assertFalse($this->adapter->writeStream('dummy', tmpfile(), new Config())); }