protected function _createFileOnDir(Local $adapter, $outFile)
 {
     $filesystem = new Filesystem($adapter);
     $dir = pathinfo($adapter->getPathPrefix() . $outFile, PATHINFO_DIRNAME) . '/';
     if (!is_dir($dir)) {
         $this->logger->info('Creo directory mancante: ' . $dir);
         mkdir($dir, 0700, true);
     }
     if ($filesystem->has($outFile)) {
         $filesystem->put($outFile, (string) $this->currentFile);
     } else {
         $filesystem->write($outFile, (string) $this->currentFile);
     }
     return $outFile;
     //$io->text('Outfile: '.$outFile);
 }
 /**
  * {@inheritdoc}
  */
 public function getPathPrefix()
 {
     return $this->wrapPath(parent::getPathPrefix());
 }
Exemple #3
0
 protected function createDistributedPathDirs()
 {
     $dirPath = '';
     $this->distributedPathCollection->each(function ($prefix) use(&$dirPath) {
         $dirPath .= $this->pathSeparator . $prefix;
         $fullPath = parent::getPathPrefix() . $dirPath;
         if (!is_dir($fullPath)) {
             @mkdir(parent::getPathPrefix() . $dirPath);
         }
     });
     return $this;
 }
 public function testConstructorWithLink()
 {
     $target = __DIR__ . '/files/';
     $link = __DIR__ . '/link_to_files';
     symlink($target, $link);
     $adapter = new Local($link);
     $this->assertEquals($target, $adapter->getPathPrefix());
     unlink($link);
 }