File tree Expand file tree Collapse file tree 4 files changed +69
-2
lines changed
lib/internal/Magento/Framework/Console Expand file tree Collapse file tree 4 files changed +69
-2
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © 2016 Magento. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ namespace Magento \Deploy \Console ;
7
+
8
+ use Magento \Framework \ObjectManagerInterface ;
9
+
10
+ /**
11
+ * Class CommandList
12
+ */
13
+ class CommandList implements \Magento \Framework \Console \CommandListInterface
14
+ {
15
+ /**
16
+ * Object Manager
17
+ *
18
+ * @var ObjectManagerInterface
19
+ */
20
+ private $ objectManager ;
21
+
22
+ /**
23
+ * @param ObjectManagerInterface $objectManager
24
+ */
25
+ public function __construct (ObjectManagerInterface $ objectManager )
26
+ {
27
+ $ this ->objectManager = $ objectManager ;
28
+ }
29
+
30
+ /**
31
+ * Gets list of command classes
32
+ *
33
+ * @return string[]
34
+ */
35
+ protected function getCommandsClasses ()
36
+ {
37
+ return [
38
+ 'Magento\Deploy\Console\Command\DeployStaticContentCommand '
39
+ ];
40
+ }
41
+
42
+ /**
43
+ * {@inheritdoc}
44
+ */
45
+ public function getCommands ()
46
+ {
47
+ $ commands = [];
48
+ foreach ($ this ->getCommandsClasses () as $ class ) {
49
+ if (class_exists ($ class )) {
50
+ $ commands [] = $ this ->objectManager ->get ($ class );
51
+ } else {
52
+ throw new \Exception ('Class ' . $ class . ' does not exist ' );
53
+ }
54
+ }
55
+ return $ commands ;
56
+ }
57
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © 2016 Magento. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+
7
+ if (PHP_SAPI == 'cli ' ) {
8
+ \Magento \Framework \Console \CommandLocator::register ('Magento\Deploy\Console\CommandList ' );
9
+ }
Original file line number Diff line number Diff line change 16
16
],
17
17
"autoload" : {
18
18
"files" : [
19
+ " cli_commands.php" ,
19
20
" registration.php"
20
21
],
21
22
"psr-4" : {
Original file line number Diff line number Diff line change @@ -135,8 +135,8 @@ protected function getApplicationCommands()
135
135
$ commands = array_merge ($ commands , $ setupCommandList ->getCommands ());
136
136
}
137
137
138
- if (count ( $ objectManager ->get (\Magento \Framework \App \DeploymentConfig::class)->get ( ' modules ' ) )) {
139
- /** @var \Magento\Framework\Console\CommandListInterface */
138
+ if ($ objectManager ->get (\Magento \Framework \App \DeploymentConfig::class)->isAvailable ( )) {
139
+ /** @var \Magento\Framework\Console\CommandListInterface $commandList */
140
140
$ commandList = $ objectManager ->create (\Magento \Framework \Console \CommandListInterface::class);
141
141
$ commands = array_merge ($ commands , $ commandList ->getCommands ());
142
142
}
You can’t perform that action at this time.
0 commit comments