Пример #1
0
 protected function registerCommands()
 {
     if ($this->kernel->getContainer()->getParameter('installed') !== true) {
         // composer is called, the system may not be installed yet
         return parent::registerCommands();
     }
     // ensure that we have admin access
     $this->bootstrap();
     if ($this->kernel->getContainer()->getParameter('installed') === true) {
         // don't attempt to login if the Core needs an upgrade
         \Zikula_Core::defineCurrentInstalledCoreVersion($this->kernel->getContainer());
         if (defined('ZIKULACORE_CURRENT_INSTALLED_VERSION') && version_compare(ZIKULACORE_CURRENT_INSTALLED_VERSION, \Zikula_Core::VERSION_NUM, '==')) {
             try {
                 $this->loginAsAdministrator();
             } catch (\Exception $e) {
                 $output = new \Symfony\Component\Console\Output\ConsoleOutput();
                 $this->renderException($e, $output);
             }
         }
     }
     return parent::registerCommands();
 }