Exemplo n.º 1
0
 /**
  * @param $source
  * @param $path
  * @param $target
  * @return array
  */
 protected function resolvePath($source, $path, $target)
 {
     if (!$this->filesystem->exists($source . DIRECTORY_SEPARATOR . $path)) {
         return array();
     }
     return array($path => $target);
 }
Exemplo n.º 2
0
 /**
  * @param $source
  * @param $target
  */
 protected function mirror($source, $target)
 {
     $isDir = $this->filesystem->isDir($source);
     $targetDir = $isDir ? $target : dirname($target);
     if (!$this->filesystem->exists($targetDir)) {
         $this->filesystem->mkdir($targetDir);
     }
     if ($isDir) {
         $this->filesystem->mirror($source, $target);
     } else {
         $this->filesystem->copy($source, $target);
     }
 }
Exemplo n.º 3
0
 /**
  * @param $sourceDir
  * @throws PackageSourceException
  */
 protected function checkSourceExists($sourceDir)
 {
     if (!$this->filesystem->exists($sourceDir)) {
         throw new PackageSourceException(sprintf("Source directory %s does not exist", $sourceDir));
     }
 }