File tree Expand file tree Collapse file tree 4 files changed +57
-23
lines changed Expand file tree Collapse file tree 4 files changed +57
-23
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Glob patterns relative to this files parent directory, used by
4
+ * registration.php to generate a list of includes.
5
+ */
6
+ return [
7
+ 'code/*/*/cli_commands.php ' ,
8
+ 'code/*/*/registration.php ' ,
9
+ 'design/*/*/*/registration.php ' ,
10
+ 'i18n/*/*/registration.php ' ,
11
+ '../lib/internal/*/*/registration.php ' ,
12
+ '../lib/internal/*/*/*/registration.php ' ,
13
+ ];
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Register components (via a list of glob patterns)
4
+ *
5
+ * Copyright © 2013-2017 Magento, Inc. All rights reserved.
6
+ * See COPYING.txt for license details.
7
+ */
8
+
9
+ namespace Magento \NonComposerComponentRegistration ;
10
+
11
+ use RuntimeException ;
12
+
13
+ /**
14
+ * Include files from a list of glob patterns
15
+ *
16
+ * @throws RuntimeException
17
+ * @return void
18
+ */
19
+ function main ()
20
+ {
21
+ $ globPatterns = require __DIR__ . '/etc/registration_globlist.php ' ;
22
+ $ baseDir = __DIR__ . '/ ' ;
23
+
24
+ foreach ($ globPatterns as $ globPattern ) {
25
+ // Sorting is disabled intentionally for performance improvement
26
+ $ files = glob ($ baseDir . $ globPattern , GLOB_NOSORT );
27
+ if ($ files === false ) {
28
+ throw new RuntimeException ("glob(): error with ' $ baseDir$ globPattern' " );
29
+ }
30
+ array_map (__NAMESPACE__ . '\file ' , $ files );
31
+ }
32
+ }
33
+
34
+ /**
35
+ * Isolated include with it's own variable scope
36
+ *
37
+ * @return void
38
+ */
39
+ function file () {
40
+ include func_get_arg (0 );
41
+ }
42
+
43
+ main ();
Original file line number Diff line number Diff line change 242
242
]
243
243
},
244
244
"files" : [
245
- " app/etc/NonComposerComponentRegistration .php"
245
+ " app/registration .php"
246
246
],
247
247
"exclude-from-classmap" : [
248
248
" **/dev/**" ,
You can’t perform that action at this time.
0 commit comments