123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace StatsBundle\Command;
- use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- use RedisBundle\Services\RedisService;
- class RedisCommand extends ContainerAwareCommand
- {
- protected function configure()
- {
- $this
- ->setName('redis:test')
- ->setDescription('Test Redis')
- ->setHelp('This command allows test redis')
- ;
- }
- /**
- * @param InputInterface $input
- * @param OutputInterface $output
- */
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- /* @var $statsDeviceManager DeviceManager */
- $redis = $this->getContainer()->get('redis');
-
- //$parameters = ['tcp://127.0.0.1:6379'];
- //$redis->setOptions($options);
- //$redis->setConnection($parameters);
- $value = $redis->getString('clave',true);
- $output->writeln($value);
-
- }
- }
|