Example #1
0
 /**
  * Enable a module
  * 
  * @param   string  $module
  * @param   boolean $recollect  (optional)
  * 
  * @return  boolean
  */
 public function enable($module, $recollect = true)
 {
     $module = $this->toModuleId($module);
     if (!$this->canBeEnabled($module)) {
         return false;
     }
     $this->app->config()->write('modules.enabled.' . $module, true);
     $this->registerAssets($module);
     $this->app->loadModule($module);
     $this->executeInstallerAction($module, 'enable');
     if ($recollect) {
         $this->app->recollect();
     }
     $this->app->emit('module.enabled.' . $module);
     return true;
 }