Skip to content

Commit

Permalink
module hot fixes;
Browse files Browse the repository at this point in the history
  • Loading branch information
m1roff committed Jan 15, 2016
1 parent 4eaafd2 commit d1e3ed2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
9 changes: 5 additions & 4 deletions DbexBootstrapClass.php → Module.php
@@ -1,19 +1,20 @@
<?php

namespace mirkhamidov;
namespace mirkhamidov\dbex;

use yii\base\BootstrapInterface;

class DbexBootstrapClass implements BootstrapInterface
class Module extends \yii\base\Module implements BootstrapInterface
{
public $controllerNamespace = 'mirkhamidov\dbex\console\controllers';

public function bootstrap($app)
{
if ($app instanceof \yii\console\Application) {
$app->controllerMap[$this->id] = [
'class' => 'mirkhamidov\console\controllers\DbexController',
'class' => 'mirkhamidov\dbex\console\controllers\DbexController',
'module' => $this,
];
// $app->controllerNamespace = 'mirkhamidov\console\controllers';
}
}
}
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -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
Expand Down
8 changes: 2 additions & 6 deletions composer.json
Expand Up @@ -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"
}
}
7 changes: 6 additions & 1 deletion console/controllers/DbexController.php
@@ -1,12 +1,17 @@
<?php

namespace mirkhamidov\console\controllers;
namespace mirkhamidov\dbex\console\controllers;

use Yii;
use yii\helpers\Console;

class DbexController extends \yii\console\Controller
{
/**
* @var \mirkhamido\dbex\Module
*/
public $module;

private $db=null;

public $interactive = true;
Expand Down

0 comments on commit d1e3ed2

Please sign in to comment.