diff --git a/DbexBootstrapClass.php b/Module.php similarity index 50% rename from DbexBootstrapClass.php rename to Module.php index dabfbee..e20bcae 100644 --- a/DbexBootstrapClass.php +++ b/Module.php @@ -1,19 +1,20 @@ controllerMap[$this->id] = [ - 'class' => 'mirkhamidov\console\controllers\DbexController', + 'class' => 'mirkhamidov\dbex\console\controllers\DbexController', 'module' => $this, ]; - // $app->controllerNamespace = 'mirkhamidov\console\controllers'; } } } \ No newline at end of file diff --git a/README.md b/README.md index 3e838b2..c3c651f 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,15 @@ in a console ./yii dbex/drop-all-tables ``` +after that, in console config file +``` +'modules' => [ + ... + 'dbex' => 'mirkhamidov\DbexBootstrapClass', + ... +], +``` + ## Connections Packagist: https://packagist.org/packages/mirkhamidov/yii2-console-dbextend diff --git a/composer.json b/composer.json index ecf40a2..11eb753 100644 --- a/composer.json +++ b/composer.json @@ -13,15 +13,11 @@ } ], "require": { - "yiisoft/yii2": "*" + "yiisoft/yii2": ">=2.0.5" }, "autoload": { "psr-4": { - "mirkhamidov\\console\\controllers\\": "console/controllers", - "mirkhamidov\\": "" + "mirkhamidov\\dbex\\": "" } } - , "extra": { - "bootstrap": "mirkhamidov\\DbexBootstrapClass" - } } diff --git a/console/controllers/DbexController.php b/console/controllers/DbexController.php index c17a767..bb7d7fc 100644 --- a/console/controllers/DbexController.php +++ b/console/controllers/DbexController.php @@ -1,12 +1,17 @@