Skip to content

Commit c42b0e3

Browse files
authored
Merge pull request #53 from ByteInternet/add-option-to-individually-set-magento-themes-in-magento-applicationtemplate
Add option to individually set magento themes in Magento ApplicationTemplate
2 parents f75c29a + a06cd03 commit c42b0e3

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
},
1818
"require": {
1919
"deployer/deployer": "7.0 - 7.4",
20-
"psr/log": "^1.0||^2.0||^3.0"
20+
"psr/log": "^1.0||^2.0||^3.0",
21+
"symfony/polyfill-php81": "^1.33"
2122
}
2223
}

src/ApplicationTemplate/Magento2.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,19 @@ private function initializeDefaultConfiguration(array $locales): void
5353
$this->addDeployExclude('dev/');
5454
$this->addDeployExclude('deploy/');
5555
}
56+
57+
/**
58+
* Set Magento themes and optionally allow split static deployment
59+
*
60+
* @param string[]|array<string, string[]> $themes Array of themes as ['vendor/theme', 'vendor/theme']
61+
* or as ['vendor/theme' => ['nl_NL', 'en_US'], 'vendor/theme' => ['nl_NL', 'en_US']]
62+
* @param bool $allowSplitStaticDeployment
63+
*/
64+
public function setMagentoThemes(array $themes, bool $allowSplitStaticDeployment = true): void
65+
{
66+
$this->setVariable('magento_themes', $themes);
67+
if (!array_is_list($themes) && $allowSplitStaticDeployment) {
68+
$this->setVariable('split_static_deployment', true);
69+
}
70+
}
5671
}

0 commit comments

Comments
 (0)