You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.1 KiB
PHP

<?php
/*
* This file is part of the Cilex framework.
*
* (c) Mike van Riel <mike.vanriel@naenius.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Cilex\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command as BaseCommand;
/**
* Example command for testing purposes.
*/
class DemoInfoCommand extends BaseCommand
{
protected function configure()
{
$this
->setName('demo:info')
->setDescription('Get Application Information');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
// This is a contrived example to show accessing services
// from the container without needing the command itself
// to extend from anything but Symfony Console's base Command.
$app = $this->getApplication()->getService('console');
$output->writeln('Name: ' . $app->getName());
$output->writeln('Version: ' . $app->getVersion());
}
}