PHP

Php code posted by nnwebdesign
created at 05 Jul 16:15, updated at 02 Aug 16:22

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
 * A multiline comment
 */

if ($this->commandsRegistered) {
  return;
}

$this->commandsRegistered = true;

$this->kernel->boot();

$container = $this->kernel->getContainer();

foreach ($this->kernel->getBundles() as $bundle) {
  if ($bundle instanceof Bundle) {
    try {
      $bundle->registerCommands($this);
    } catch (\Exception $e) {
      $this->registrationErrors[] = $e;
    } catch (\Throwable $e) {
      $this->registrationErrors[] = new FatalThrowableError($e);
    }
  }
}

if ($container->has('console.command_loader')) {
  $this->setCommandLoader($container->get('console.command_loader'));
}

if ($container->hasParameter('console.command.ids')) {
  $lazyCommandIds = $container->hasParameter('console.lazy_command.ids') ? $container->getParameter('console.lazy_command.ids') : array();
  foreach ($container->getParameter('console.command.ids') as $id) {
    if (!isset($lazyCommandIds[$id])) {
      try {
        $this->add($container->get($id));
      } catch (\Exception $e) {
        $this->registrationErrors[] = $e;
      } catch (\Throwable $e) {
        $this->registrationErrors[] = new FatalThrowableError($e);
      }
    }
  }
}
1.13 KB in 5 ms with coderay