Definition at line 15 of file CopyService.php.
◆ __construct()
- Parameters
-
\Magento\Framework\Filesystem | $filesystem | |
\Magento\Framework\View\Design\Theme\FileFactory | $fileFactory | |
\Magento\Widget\Model\Layout\Link | $link | |
\Magento\Widget\Model\Layout\UpdateFactory | $updateFactory | |
\Magento\Framework\Event\ManagerInterface | $eventManager | |
\Magento\Framework\View\Design\Theme\Customization\Path | $customization | |
Definition at line 55 of file CopyService.php.
64 $this->_fileFactory = $fileFactory;
66 $this->_updateFactory = $updateFactory;
67 $this->_eventManager = $eventManager;
68 $this->_customizationPath = $customization;
◆ _copyFilesRecursively()
_copyFilesRecursively |
( |
|
$baseDir, |
|
|
|
$sourceDir, |
|
|
|
$targetDir |
|
) |
| |
|
protected |
Copies all files in a directory recursively
- Parameters
-
string | $baseDir | |
string | $sourceDir | |
string | $targetDir | |
- Returns
- void
Definition at line 180 of file CopyService.php.
182 foreach ($this->_directory->read($sourceDir) as
$path) {
183 if ($this->_directory->isDirectory(
$path)) {
187 $this->_directory->copyFile(
$path, $targetDir .
'/' . $filePath);
_copyFilesRecursively($baseDir, $sourceDir, $targetDir)
◆ _copyFilesystemCustomization()
Copy customizations stored in a file system from one theme to another, overriding existing data
- Parameters
-
ThemeInterface | $source | |
ThemeInterface | $target | |
- Returns
- void
Definition at line 156 of file CopyService.php.
158 $sourcePath = $this->_customizationPath->getCustomizationPath(
$source);
159 $targetPath = $this->_customizationPath->getCustomizationPath(
$target);
161 if (!$sourcePath || !$targetPath) {
167 if ($this->_directory->isDirectory($sourcePath)) {
_copyFilesRecursively($baseDir, $sourceDir, $targetDir)
_deleteFilesRecursively($targetDir)
◆ _deleteFilesRecursively()
_deleteFilesRecursively |
( |
|
$targetDir | ) |
|
|
protected |
Delete all files in a directory recursively
- Parameters
-
- Returns
- void
Definition at line 198 of file CopyService.php.
200 if ($this->_directory->isExist($targetDir)) {
201 foreach ($this->_directory->read($targetDir) as
$path) {
202 $this->_directory->delete(
$path);
◆ copy()
Copy customizations from one theme to another
- Parameters
-
ThemeInterface | $source | |
ThemeInterface | $target | |
- Returns
- void
Definition at line 78 of file CopyService.php.
_copyFilesystemCustomization(ThemeInterface $source, ThemeInterface $target)
◆ $_customizationPath
◆ $_directory
◆ $_eventManager
◆ $_fileFactory
◆ $_link
◆ $_updateFactory
The documentation for this class was generated from the following file: