Symfony\Bundle\FrameworkBundle\Console\Application::__construct PHP Method

__construct() public method

Constructor.
public __construct ( Symfony\Component\HttpKernel\KernelInterface $kernel )
$kernel Symfony\Component\HttpKernel\KernelInterface A KernelInterface instance
    public function __construct(KernelInterface $kernel)
    {
        $this->kernel = $kernel;
        parent::__construct('Symfony', Kernel::VERSION);
        $this->getDefinition()->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'The environment name', $kernel->getEnvironment()));
        $this->getDefinition()->addOption(new InputOption('--no-debug', null, InputOption::VALUE_NONE, 'Switches off debug mode'));
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Constructor.
  *
  * @param KernelInterface $kernel A KernelInterface instance
  */
 public function __construct(KernelInterface $kernel)
 {
     parent::__construct($kernel);
     $this->kernel = $kernel;
     $this->setName('Zikula');
     $this->setVersion(\Zikula_Core::VERSION_NUM . ' - ' . $kernel->getName() . '/' . $kernel->getEnvironment() . ($kernel->isDebug() ? '/debug' : ''));
 }
All Usage Examples Of Symfony\Bundle\FrameworkBundle\Console\Application::__construct