@@ -17,20 +17,31 @@ class ModuleController extends Controller
17
17
{
18
18
public $ db = 'db ' ;
19
19
20
+ /**
21
+ *
22
+ */
20
23
public function actionIndex ()
21
24
{
22
25
$ this ->run ('/help ' , ['module ' ]);
23
26
}
24
27
25
28
/**
26
29
* Run installation
30
+ *
27
31
* @param $name
32
+ * @throws \yii\base\InvalidConfigException
28
33
*/
29
34
public function actionInstall ($ name )
30
35
{
31
36
$ this ->runInstallerCommand ($ name , 'install ' , 'Module module was installed successfully. ' );
32
37
}
33
38
39
+ /**
40
+ * @param $name
41
+ * @param $method
42
+ * @param string $message
43
+ * @throws \yii\base\InvalidConfigException
44
+ */
34
45
protected function runInstallerCommand ($ name , $ method , $ message = '' )
35
46
{
36
47
if ($ this ->moduleExists ($ name )) {
@@ -90,6 +101,9 @@ protected function getInstaller($name)
90
101
}
91
102
}
92
103
104
+ /**
105
+ *
106
+ */
93
107
public function actionMigrate ()
94
108
{
95
109
$ changes = $ this ->getChanges ();
@@ -99,16 +113,21 @@ public function actionMigrate()
99
113
Console::output ('Migrate successfully. ' );
100
114
}
101
115
116
+ /**
117
+ * @return array|mixed
118
+ * @throws \yii\base\InvalidConfigException
119
+ */
102
120
protected function getChanges ()
103
121
{
104
122
/** @var Installer $installer */
105
- $ installer = \Yii::createObject (Installer::className () , ['db ' => $ this ->db ]);
123
+ $ installer = \Yii::createObject (Installer::class , ['db ' => $ this ->db ]);
106
124
107
125
return $ installer ->getChanges ();
108
126
}
109
127
110
128
/**
111
129
* @param $name
130
+ * @throws \yii\base\InvalidConfigException
112
131
*/
113
132
public function actionUninstall ($ name )
114
133
{
@@ -130,6 +149,7 @@ public function actionUninstall($name)
130
149
131
150
/**
132
151
* @param $name
152
+ * @throws \yii\base\InvalidConfigException
133
153
*/
134
154
public function actionReinstall ($ name )
135
155
{
@@ -146,7 +166,7 @@ public function actionBindModels($modelName1, $modelName2)
146
166
$ model2 = new $ modelName2 ();
147
167
148
168
if ($ this ->confirm ('Generate migration? ' )) {
149
-
169
+ //@TODO
150
170
}
151
171
}
152
172
}
0 commit comments