core/console/Bootstrap.php
public function run($app)
    {
        foreach ($app->getApplicationModules() as $id => $module) {
            $folder = $module->basePath . DIRECTORY_SEPARATOR . 'commands';
            if (file_exists($folder) && is_dir($folder)) {
                foreach (FileHelper::findFiles($folder) as $file) {
                    $module->controllerNamespace = $module->namespace . '\commands';
                    
                    $className = '\\'.$module->getNamespace().'\\commands\\' . pathinfo($file, PATHINFO_FILENAME);

                    $command = str_replace('-controller', '', $module->id . '/' . Inflector::camel2id(pathinfo($file, PATHINFO_FILENAME)));
                    
                    Yii::$app->controllerMap[$command] = ['class' => $className];
                }
            }
        }
    }
public function run($app)
    {
        foreach ($app->getApplicationModules() as $id => $module) {
            $folder = $module->basePath . DIRECTORY_SEPARATOR . 'commands';
            if (file_exists($folder) && is_dir($folder)) {
                foreach (FileHelper::findFiles($folder) as $file) {
                    $module->controllerNamespace = $module->namespace . '\commands';
                    
                    $className = '\\'.$module->getNamespace().'\\commands\\' . pathinfo($file, PATHINFO_FILENAME);

                    $command = str_replace('-controller', '', $module->id . '/' . Inflector::camel2id(pathinfo($file, PATHINFO_FILENAME)));
                    
                    Yii::$app->controllerMap[$command] = ['class' => $className];
                }
            }
        }
    }
public function run ( $ app ) { foreach ( $ app -> getApplicationModules ( ) as $ id => $ module ) { $ folder = $ module -> basePath . DIRECTORY_SEPARATOR . 'commands' ; if ( file_exists ( $ folder ) && is_dir ( $ folder ) ) { foreach ( FileHelper :: findFiles ( $ folder ) as $ file ) { $ module -> controllerNamespace = $ module -> namespace . '\commands' ; $ className = '\\' . $ module -> getNamespace ( ) . '\\commands\\' . pathinfo ( $ file , PATHINFO_FILENAME ) ; $ command = str_replace ( '-controller' , '' , $ module -> id . '/' . Inflector :: camel2id ( pathinfo ( $ file , PATHINFO_FILENAME ) ) ) ; Yii :: $ app -> controllerMap [ $ command ] = [ 'class' => $ className ] ; } } } }
The run method must be implemented by defintion.

@see \luya\base\BaseBootstrap::run()
The run method must be implemented by defintion .