コード例 #1
0
ファイル: AbstractFileGenerator.php プロジェクト: yoghi/madda
 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);
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function getPathPrefix()
 {
     return $this->wrapPath(parent::getPathPrefix());
 }
コード例 #3
0
ファイル: Adapter.php プロジェクト: garrinar/laravel
 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;
 }
コード例 #4
0
 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);
 }