Symfony\Bundle\FrameworkBundle\Console\Application::__construct PHP Méthode

__construct() public méthode

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

Exemple #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