6
6
7
7
namespace Magento \Setup \Controller ;
8
8
9
- use Magento \Framework \Composer \ComposerInformation ;
10
- use Magento \Framework \Module \ModuleList ;
11
- use Magento \Setup \Model \ObjectManagerProvider ;
12
- use Zend \Mvc \Controller \AbstractActionController ;
13
- use Zend \View \Model \JsonModel ;
14
- use Zend \View \Model \ViewModel ;
15
- use Magento \Setup \Model \ConnectManager ;
16
- use Magento \Setup \Model \UpdatePackagesCache ;
17
-
18
9
/**
19
10
* Controller for component grid tasks
20
11
*/
21
- class ComponentGrid extends AbstractActionController
12
+ class ComponentGrid extends \ Zend \ Mvc \ Controller \ AbstractActionController
22
13
{
23
14
/**
24
15
* @var \Magento\Framework\Composer\ComposerInformation
@@ -33,7 +24,7 @@ class ComponentGrid extends AbstractActionController
33
24
private $ packageInfo ;
34
25
35
26
/**
36
- * @var ConnectManager
27
+ * @var \Magento\Setup\Model\ ConnectManager
37
28
*/
38
29
private $ connectManager ;
39
30
@@ -55,16 +46,16 @@ class ComponentGrid extends AbstractActionController
55
46
private $ updatePackagesCache ;
56
47
57
48
/**
58
- * @param ComposerInformation $composerInformation
59
- * @param ObjectManagerProvider $objectManagerProvider
60
- * @param ConnectManager $connectManager
61
- * @param UpdatePackagesCache $updatePackagesCache
49
+ * @param \Magento\Framework\Composer\ ComposerInformation $composerInformation
50
+ * @param \Magento\Setup\Model\ ObjectManagerProvider $objectManagerProvider
51
+ * @param \Magento\Setup\Model\ ConnectManager $connectManager
52
+ * @param \Magento\Setup\Model\ UpdatePackagesCache $updatePackagesCache
62
53
*/
63
54
public function __construct (
64
- ComposerInformation $ composerInformation ,
65
- ObjectManagerProvider $ objectManagerProvider ,
66
- UpdatePackagesCache $ updatePackagesCache ,
67
- ConnectManager $ connectManager
55
+ \ Magento \ Framework \ Composer \ ComposerInformation $ composerInformation ,
56
+ \ Magento \ Setup \ Model \ ObjectManagerProvider $ objectManagerProvider ,
57
+ \ Magento \ Setup \ Model \ UpdatePackagesCache $ updatePackagesCache ,
58
+ \ Magento \ Setup \ Model \ ConnectManager $ connectManager
68
59
) {
69
60
$ this ->composerInformation = $ composerInformation ;
70
61
$ objectManager = $ objectManagerProvider ->get ();
@@ -78,19 +69,19 @@ public function __construct(
78
69
/**
79
70
* Index page action
80
71
*
81
- * @return ViewModel
72
+ * @return \Zend\View\Model\ ViewModel
82
73
*/
83
74
public function indexAction ()
84
75
{
85
- $ view = new ViewModel ();
76
+ $ view = new \ Zend \ View \ Model \ ViewModel ();
86
77
$ view ->setTerminal (true );
87
78
return $ view ;
88
79
}
89
80
90
81
/**
91
82
* Get Components info action
92
83
*
93
- * @return JsonModel
84
+ * @return \Zend\View\Model\ JsonModel
94
85
* @throws \RuntimeException
95
86
* @SuppressWarnings(PHPMD.NPathComplexity)
96
87
*/
@@ -105,7 +96,7 @@ public function componentsAction()
105
96
$ components [$ component ['name ' ]]['uninstall ' ] = false ;
106
97
$ components [$ component ['name ' ]]['moduleName ' ] = $ this ->packageInfo ->getModuleName ($ component ['name ' ]);
107
98
if ($ this ->composerInformation ->isPackageInComposerJson ($ component ['name ' ])
108
- && ($ component ['type ' ] !== ComposerInformation::METAPACKAGE_PACKAGE_TYPE )) {
99
+ && ($ component ['type ' ] !== \ Magento \ Framework \ Composer \ ComposerInformation::METAPACKAGE_PACKAGE_TYPE )) {
109
100
$ components [$ component ['name ' ]]['uninstall ' ] = true ;
110
101
if (isset ($ lastSyncData ['packages ' ][$ component ['name ' ]]['latestVersion ' ])
111
102
&& version_compare (
@@ -116,7 +107,7 @@ public function componentsAction()
116
107
$ components [$ component ['name ' ]]['update ' ] = true ;
117
108
}
118
109
}
119
- if ($ component ['type ' ] === ComposerInformation::MODULE_PACKAGE_TYPE ) {
110
+ if ($ component ['type ' ] === \ Magento \ Framework \ Composer \ ComposerInformation::MODULE_PACKAGE_TYPE ) {
120
111
$ components [$ component ['name ' ]]['enable ' ] =
121
112
$ this ->enabledModuleList ->has ($ components [$ component ['name ' ]]['moduleName ' ]);
122
113
$ components [$ component ['name ' ]]['disable ' ] = !$ components [$ component ['name ' ]]['enable ' ];
@@ -134,7 +125,7 @@ public function componentsAction()
134
125
isset ($ packagesForInstall ['packages ' ]) ? count ($ packagesForInstall ['packages ' ]) : 0 ;
135
126
$ lastSyncData ['countOfUpdate ' ] = isset ($ lastSyncData ['packages ' ]) ? count ($ lastSyncData ['packages ' ]) : 0 ;
136
127
137
- return new JsonModel (
128
+ return new \ Zend \ View \ Model \ JsonModel (
138
129
[
139
130
'success ' => true ,
140
131
'components ' => array_values ($ components ),
@@ -147,7 +138,7 @@ public function componentsAction()
147
138
/**
148
139
* Sync action
149
140
*
150
- * @return JsonModel
141
+ * @return \Zend\View\Model\ JsonModel
151
142
*/
152
143
public function syncAction ()
153
144
{
@@ -162,7 +153,7 @@ public function syncAction()
162
153
$ lastSyncData ['countOfUpdate ' ] = isset ($ lastSyncData ['packages ' ]) ? count ($ lastSyncData ['packages ' ]) : 0 ;
163
154
164
155
165
- return new JsonModel (
156
+ return new \ Zend \ View \ Model \ JsonModel (
166
157
[
167
158
'success ' => true ,
168
159
'lastSyncData ' => $ lastSyncData
@@ -182,7 +173,7 @@ private function getAllModules()
182
173
foreach ($ allModules as $ module ) {
183
174
$ moduleName = $ this ->packageInfo ->getPackageName ($ module );
184
175
$ modules [$ moduleName ]['name ' ] = $ moduleName ;
185
- $ modules [$ moduleName ]['type ' ] = ComposerInformation::MODULE_PACKAGE_TYPE ;
176
+ $ modules [$ moduleName ]['type ' ] = \ Magento \ Framework \ Composer \ ComposerInformation::MODULE_PACKAGE_TYPE ;
186
177
$ modules [$ moduleName ]['version ' ] = $ this ->packageInfo ->getVersion ($ module );
187
178
}
188
179
return $ modules ;
0 commit comments