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); + } +}