Example #1
0
 public function write($path, $contents, Config $config)
 {
     $location = $this->applyPathPrefix($path);
     if (!$this->ensureDirectory(dirname($location))) {
         return false;
     }
     return parent::write($path, $contents, $config);
 }
Example #2
0
 public function write($path, $contents, Config $config)
 {
     $this->cleanModel(['path' => $path])->makeDistributedName()->createDistributedPathDirs();
     $file = collect(parent::write($this->getModel()->path, $contents, $config));
     if (!$file->isEmpty()) {
         $this->model->savedFile = $file;
         $this->model->save();
         return $this->getModel();
     }
     return false;
 }
 public function testVisibilityPrivate()
 {
     if (IS_WINDOWS) {
         $this->markTestSkipped("Visibility not supported on Windows.");
     }
     $this->adapter->write('path.txt', 'contents', new Config());
     $this->adapter->setVisibility('path.txt', 'private');
     $output = $this->adapter->getVisibility('path.txt');
     $this->assertInternalType('array', $output);
     $this->assertArrayHasKey('visibility', $output);
     $this->assertEquals('private', $output['visibility']);
 }
Example #4
0
 /**
  * Write a file
  *
  * @param string   $path
  * @param string   $contents
  * @param FSConfig $config
  *
  * @return array|bool
  */
 public function write($path, $contents, FSConfig $config)
 {
     $location = $this->applyPathPrefix($path);
     $this->ensureDirectory(dirname($location));
     $result = parent::write($path, $contents, $config);
     $chmodFiles = $this->backendConfig['chmodFiles'];
     $oldUmask = umask(0);
     chmod($location, $chmodFiles);
     umask($oldUmask);
     return $result;
 }