|
| __construct (Filesystem $filesystem, Repository $assetRepo, Publisher $assetPublisher, FileNameResolver $fileNameResolver, Minification $minification) |
|
| deployFile ($fileName, array $params=[]) |
|
| deleteFile ($path) |
|
| readFile ($fileName, $filePath) |
|
| openFile ($fileName, $filePath) |
|
| writeFile ($fileName, $filePath, $content) |
|
| copyFile ($fileName, $sourcePath, $targetPath) |
|
| readTmpFile ($fileName, $filePath) |
|
| writeTmpFile ($fileName, $filePath, $content) |
|
Deploy static file service
Definition at line 20 of file DeployStaticFile.php.
◆ __construct()
DeployStaticFile constructor
- Parameters
-
Filesystem | $filesystem | |
Repository | $assetRepo | |
Publisher | $assetPublisher | |
FileNameResolver | $fileNameResolver | |
Minification | $minification | |
Definition at line 63 of file DeployStaticFile.php.
70 $this->filesystem = $filesystem;
71 $this->assetRepo = $assetRepo;
72 $this->assetPublisher = $assetPublisher;
73 $this->fileNameResolver = $fileNameResolver;
75 $this->minification = $minification;
const TMP_MATERIALIZATION_DIR
◆ copyFile()
copyFile |
( |
|
$fileName, |
|
|
|
$sourcePath, |
|
|
|
$targetPath |
|
) |
| |
Copy resolved $fileName from $targetPath to $destinationPath
- Parameters
-
string | $fileName | |
string | $sourcePath | |
string | $targetPath | |
- Returns
- bool
Definition at line 165 of file DeployStaticFile.php.
168 return $this->pubStaticDir->copyFile(
169 $sourcePath . DIRECTORY_SEPARATOR . $this->resolveFile(
$fileName),
170 $targetPath . DIRECTORY_SEPARATOR . $this->resolveFile(
$fileName)
◆ deleteFile()
- Parameters
-
- Returns
- void
Definition at line 98 of file DeployStaticFile.php.
100 if ($this->pubStaticDir->isExist(
$path)) {
101 $absolutePath = $this->pubStaticDir->getAbsolutePath(
$path);
102 if (is_link($absolutePath)) {
103 $this->pubStaticDir->getDriver()->deleteFile($absolutePath);
105 if ($this->pubStaticDir->getDriver()->isFile($absolutePath)) {
106 $this->pubStaticDir->getDriver()->deleteFile($absolutePath);
108 $this->pubStaticDir->getDriver()->deleteDirectory($absolutePath);
◆ deployFile()
deployFile |
( |
|
$fileName, |
|
|
array |
$params = [] |
|
) |
| |
- Parameters
-
string | $fileName | |
array | $params | ['area' =>, 'theme' =>, 'locale' =>, 'module' =>] |
- Returns
- string
Definition at line 84 of file DeployStaticFile.php.
87 $asset = $this->assetRepo->createAsset($this->resolveFile(
$fileName),
$params);
89 $this->assetPublisher->publish($asset);
91 return $asset->getPath();
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
◆ openFile()
openFile |
( |
|
$fileName, |
|
|
|
$filePath |
|
) |
| |
- Parameters
-
string | $fileName | |
string | $filePath | |
- Returns
- WriteInterface
Definition at line 137 of file DeployStaticFile.php.
◆ readFile()
readFile |
( |
|
$fileName, |
|
|
|
$filePath |
|
) |
| |
Read resolved file from pub static directory
- Parameters
-
string | $fileName | |
string | $filePath | |
- Returns
- string|false
Definition at line 121 of file DeployStaticFile.php.
◆ readTmpFile()
readTmpFile |
( |
|
$fileName, |
|
|
|
$filePath |
|
) |
| |
Read file from tmp directory
- Parameters
-
string | $fileName | |
string | $filePath | |
- Returns
- string
Definition at line 181 of file DeployStaticFile.php.
◆ writeFile()
writeFile |
( |
|
$fileName, |
|
|
|
$filePath, |
|
|
|
$content |
|
) |
| |
Write resolved file to pub static directory
- Parameters
-
string | $fileName | |
string | $filePath | |
string | $content | |
- Returns
- int The number of bytes that were written.
Definition at line 151 of file DeployStaticFile.php.
◆ writeTmpFile()
writeTmpFile |
( |
|
$fileName, |
|
|
|
$filePath, |
|
|
|
$content |
|
) |
| |
Write file to tmp directory
- Parameters
-
string | $fileName | |
string | $filePath | |
string | $content | |
- Returns
- int The number of bytes that were written.
Definition at line 195 of file DeployStaticFile.php.
The documentation for this class was generated from the following file: