From 5947d66cfcb84a306835118bda3c7b81d4a7a8aa Mon Sep 17 00:00:00 2001 From: Lukas Kahwe Smith Date: Wed, 19 Sep 2012 20:52:06 +0200 Subject: [PATCH] added command to export xml --- Command/ExportXmlCommand.php | 59 ++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 Command/ExportXmlCommand.php diff --git a/Command/ExportXmlCommand.php b/Command/ExportXmlCommand.php new file mode 100644 index 00000000..2d196e7d --- /dev/null +++ b/Command/ExportXmlCommand.php @@ -0,0 +1,59 @@ +. + */ + +namespace Doctrine\Bundle\PHPCRBundle\Command; + +use PHPCR\Util\Console\Command\ExportXmlCommand as BaseExportXmlCommand; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * @author David Buchmann + */ +class ExportXmlCommand extends BaseExportXmlCommand +{ + protected function configure() + { + parent::configure(); + + $this + ->setName('doctrine:phpcr:export') + ->addOption('session', null, InputOption::VALUE_OPTIONAL, 'The session to use for this command') + ; + } + + /** + * Executes the current command. + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * + * @return integer 0 if everything went fine, or an error code + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + DoctrineCommandHelper::setApplicationPHPCRSession($this->getApplication(), $input->getOption('session')); + + return parent::execute($input, $output); + } +}