Skip to content

Commit 0f4a400

Browse files
authored
Use fully qualified theme names (#486)
Both are technically fine, this just prevents conflicts with authors where the theme name is identical
1 parent 260a3b3 commit 0f4a400

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Composer/Installers/OctoberInstaller.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class OctoberInstaller extends BaseInstaller
66
protected $locations = array(
77
'module' => 'modules/{$name}/',
88
'plugin' => 'plugins/{$vendor}/{$name}/',
9-
'theme' => 'themes/{$name}/'
9+
'theme' => 'themes/{$vendor}-{$name}/'
1010
);
1111

1212
/**
@@ -41,6 +41,7 @@ protected function inflectPluginVars($vars)
4141
protected function inflectThemeVars($vars)
4242
{
4343
$vars['name'] = preg_replace('/^oc-|-theme$/', '', $vars['name']);
44+
$vars['vendor'] = preg_replace('/[^a-z0-9_]/i', '', $vars['vendor']);
4445

4546
return $vars;
4647
}

tests/Composer/Installers/Test/InstallerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ public function dataForTestInstallPath()
395395
array('moodle-mod', 'mod/my_package/', 'shama/my_package'),
396396
array('october-module', 'modules/my_plugin/', 'shama/my_plugin'),
397397
array('october-plugin', 'plugins/shama/my_plugin/', 'shama/my_plugin'),
398-
array('october-theme', 'themes/my_theme/', 'shama/my_theme'),
398+
array('october-theme', 'themes/shama-my_theme/', 'shama/my_theme'),
399399
array('piwik-plugin', 'plugins/VisitSummary/', 'shama/visit-summary'),
400400
array('prestashop-module', 'modules/a-module/', 'vendor/a-module'),
401401
array('prestashop-theme', 'themes/a-theme/', 'vendor/a-theme'),

0 commit comments

Comments
 (0)