Пример #1
0
 /**
  * Copy file to tmp theme customization path
  *
  * @param string $sourceFile
  * @return string
  */
 protected function _copyFileToTmpCustomizationPath($sourceFile)
 {
     $targetFile = $this->_helperStorage->getStorageRoot() . '/' . basename($sourceFile);
     $this->directoryTmp->create(pathinfo($targetFile, PATHINFO_DIRNAME));
     $this->directoryVar->copyFile($this->directoryVar->getRelativePath($sourceFile), $this->directoryTmp->getRelativePath($targetFile), $this->directoryTmp);
     return $targetFile;
 }
Пример #2
0
 /**
  * Copies all files in a directory recursively
  *
  * @param string $baseDir
  * @param string $sourceDir
  * @param string $targetDir
  * @return void
  */
 protected function _copyFilesRecursively($baseDir, $sourceDir, $targetDir)
 {
     foreach ($this->_directory->read($sourceDir) as $path) {
         if ($this->_directory->isDirectory($path)) {
             $this->_copyFilesRecursively($baseDir, $path, $targetDir);
         } else {
             $filePath = substr($path, strlen($baseDir) + 1);
             $this->_directory->copyFile($path, $targetDir . '/' . $filePath);
         }
     }
 }