Skip to content

Commit e91dfff

Browse files
committed
MAGETWO-52660: Improve performance of static assets deployment
1 parent d53b0a0 commit e91dfff

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

app/code/Magento/Deploy/Model/Deploy/LocaleDeploy.php

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -268,13 +268,7 @@ private function deployAppFiles($area, $themePath, $locale)
268268
continue;
269269
}
270270

271-
if (($fileArea == $area || $fileArea == 'base') &&
272-
($fileTheme == '' || $fileTheme == $themePath ||
273-
in_array(
274-
$fileArea . Theme::THEME_PATH_SEPARATOR . $fileTheme,
275-
$this->findAncestors($area . Theme::THEME_PATH_SEPARATOR . $themePath)
276-
))
277-
) {
271+
if ($this->isCanBeDeployed($fileArea, $fileTheme, $area, $themePath)) {
278272
$compiledFile = $this->deployFile(
279273
$filePath,
280274
$area,
@@ -290,6 +284,24 @@ private function deployAppFiles($area, $themePath, $locale)
290284
}
291285
}
292286

287+
/**
288+
* @param string $fileArea
289+
* @param string $fileTheme
290+
* @param string $area
291+
* @param string $themePath
292+
* @return bool
293+
*/
294+
private function isCanBeDeployed($fileArea, $fileTheme, $area, $themePath)
295+
{
296+
return ($fileArea == $area || $fileArea == 'base')
297+
&& ($fileTheme == '' || $fileTheme == $themePath
298+
|| in_array(
299+
$fileArea . Theme::THEME_PATH_SEPARATOR . $fileTheme,
300+
$this->findAncestors($area . Theme::THEME_PATH_SEPARATOR . $themePath)
301+
)
302+
);
303+
}
304+
293305
/**
294306
* @param string $area
295307
* @param string $themePath

0 commit comments

Comments
 (0)