@@ -51,6 +51,11 @@ class ExtensionsTerJsonCreateCommand extends \Symfony\Component\Console\Command\
51
51
*/
52
52
const JSON_FILE = 'packages-TYPO3Extensions-{type}.json ' ;
53
53
54
+ /**
55
+ * @var string
56
+ */
57
+ private const ALIASES_FILE = 'aliases.json ' ;
58
+
54
59
/**
55
60
* @var array
56
61
*/
@@ -69,7 +74,7 @@ class ExtensionsTerJsonCreateCommand extends \Symfony\Component\Console\Command\
69
74
* prefered over the package created here.
70
75
*
71
76
* Do not create pull requests for this list, simply provide a
72
- * composer.json for your extension.
77
+ * composer.json and register the composer name at TER for your extension.
73
78
*
74
79
* @var array
75
80
*/
@@ -79,6 +84,66 @@ class ExtensionsTerJsonCreateCommand extends \Symfony\Component\Console\Command\
79
84
];
80
85
81
86
/**
87
+ * Core extensions
88
+ *
89
+ * @var array
90
+ */
91
+ protected static $ coreExtensions = [
92
+ 'about ' => 'typo3/cms-about ' ,
93
+ 'adminpanel ' => 'typo3/cms-adminpanel ' ,
94
+ 'backend ' => 'typo3/cms-backend ' ,
95
+ 'belog ' => 'typo3/cms-belog ' ,
96
+ 'beuser ' => 'typo3/cms-beuser ' ,
97
+ 'context_help ' => 'typo3/cms-context-help ' ,
98
+ 'core ' => 'typo3/cms-core ' ,
99
+ 'cshmanual ' => 'typo3/cms-cshmanual ' ,
100
+ 'css_styled_content ' => 'typo3/cms-css-styled-content ' ,
101
+ 'documentation ' => 'typo3/cms-documentation ' ,
102
+ 'dashboard ' => 'typo3/cms-dashboard ' ,
103
+ 'extbase ' => 'typo3/cms-extbase ' ,
104
+ 'extensionmanager ' => 'typo3/cms-extensionmanager ' ,
105
+ 'feedit ' => 'typo3/cms-feedit ' ,
106
+ 'felogin ' => 'typo3/cms-felogin ' ,
107
+ 'filelist ' => 'typo3/cms-filelist ' ,
108
+ 'filemetadata ' => 'typo3/cms-filemetadata ' ,
109
+ 'fluid ' => 'typo3/cms-fluid ' ,
110
+ 'fluid_styled_content ' => 'typo3/cms-fluid-styled-content ' ,
111
+ 'form ' => 'typo3/cms-form ' ,
112
+ 'frontend ' => 'typo3/cms-frontend ' ,
113
+ 'func ' => 'typo3/cms-func ' ,
114
+ 'impexp ' => 'typo3/cms-impexp ' ,
115
+ 'indexed_search ' => 'typo3/cms-indexed-search ' ,
116
+ 'info ' => 'typo3/cms-info ' ,
117
+ 'info_pagetsconfig ' => 'typo3/cms-info-pagetsconfig ' ,
118
+ 'install ' => 'typo3/cms-install ' ,
119
+ 'lang ' => 'typo3/cms-lang ' ,
120
+ 'linkvalidator ' => 'typo3/cms-linkvalidator ' ,
121
+ 'lowlevel ' => 'typo3/cms-lowlevel ' ,
122
+ 'opendocs ' => 'typo3/cms-opendocs ' ,
123
+ 'recordlist ' => 'typo3/cms-recordlist ' ,
124
+ 'recycler ' => 'typo3/cms-recycler ' ,
125
+ 'redirects ' => 'typo3/cms-redirects ' ,
126
+ 'reports ' => 'typo3/cms-reports ' ,
127
+ 'rsaauth ' => 'typo3/cms-rsaauth ' ,
128
+ 'rte_ckeditor ' => 'typo3/cms-rte-ckeditor ' ,
129
+ 'saltedpasswords ' => 'typo3/cms-saltedpasswords ' ,
130
+ 'scheduler ' => 'typo3/cms-scheduler ' ,
131
+ 'seo ' => 'typo3/cms-seo ' ,
132
+ 'setup ' => 'typo3/cms-setup ' ,
133
+ 'sv ' => 'typo3/cms-sv ' ,
134
+ 'sys_action ' => 'typo3/cms-sys-action ' ,
135
+ 'sys_note ' => 'typo3/cms-sys-note ' ,
136
+ 't3editor ' => 'typo3/cms-t3editor ' ,
137
+ 'taskcenter ' => 'typo3/cms-taskcenter ' ,
138
+ 'tstemplate ' => 'typo3/cms-tstemplate ' ,
139
+ 'version ' => 'typo3/cms-version ' ,
140
+ 'viewpage ' => 'typo3/cms-viewpage ' ,
141
+ 'wizard_crpages ' => 'typo3/cms-wizard-crpages ' ,
142
+ 'wizard_sortpages ' => 'typo3/cms-wizard-sortpages ' ,
143
+ 'workspaces ' => 'typo3/cms-workspaces ' ,
144
+ ];
145
+
146
+ /**
82
147
* Location where to output built files.
83
148
*
84
149
* @var string
@@ -109,6 +174,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
109
174
$ this ->outputDir = realpath ($ input ->getArgument ('output-dir ' ));
110
175
111
176
$ this ->fetchComposerNames ();
177
+ $ this ->saveAliases ();
112
178
$ extensions = $ this ->getExtensions ();
113
179
$ packages = $ this ->getPackages ($ extensions );
114
180
@@ -119,6 +185,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
119
185
return 0 ;
120
186
}
121
187
188
+ protected function registerComposerAlias (array $ extensionKeys , string $ composerName )
189
+ {
190
+ foreach ($ extensionKeys as $ extKey ) {
191
+ if (!isset (self ::$ abandonedExtensionKeys [$ extKey ])) {
192
+ self ::$ abandonedExtensionKeys [$ extKey ] = $ composerName ;
193
+ }
194
+ }
195
+ }
196
+
122
197
protected function fetchComposerNames ()
123
198
{
124
199
$ client = new Client ();
@@ -139,12 +214,34 @@ protected function fetchComposerNames()
139
214
}
140
215
141
216
if (\is_array ($ json ['data ' ])) {
217
+ // Assign core extensions
218
+ foreach (self ::$ coreExtensions as $ extKey => $ composerName ) {
219
+ $ json ['data ' ][$ extKey ]['composer_name ' ] = $ composerName ;
220
+ }
221
+
142
222
foreach ($ json ['data ' ] as $ extKey => $ settings ) {
143
223
self ::$ abandonedExtensionKeys [$ extKey ] = $ settings ['composer_name ' ];
224
+
225
+ if (strpos ($ extKey , '_ ' ) !== false ) {
226
+ $ this ->registerComposerAlias ([
227
+ \str_replace ('_ ' , '- ' , $ extKey ),
228
+ \str_replace ('_ ' , '' , $ extKey ),
229
+ ], $ settings ['composer_name ' ]);
230
+ }
144
231
}
232
+
233
+ ksort (self ::$ abandonedExtensionKeys , SORT_STRING );
145
234
}
146
235
}
147
236
237
+ protected function saveAliases ()
238
+ {
239
+ $ fileName = $ this ->outputDir . '/ ' . self ::ALIASES_FILE ;
240
+ file_put_contents ($ fileName , json_encode (self ::$ abandonedExtensionKeys ));
241
+
242
+ return $ fileName ;
243
+ }
244
+
148
245
/**
149
246
* @return \SimpleXMLElement[]
150
247
*/
0 commit comments