Permalink
Browse files

added command to export xml

  • Loading branch information...
1 parent 52b6c83 commit 5947d66cfcb84a306835118bda3c7b81d4a7a8aa @lsmith77 lsmith77 committed Sep 19, 2012
Showing with 59 additions and 0 deletions.
  1. +59 −0 Command/ExportXmlCommand.php
@@ -0,0 +1,59 @@
+<?php
+
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+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 <david@liip.ch>
+ */
+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);
+ }
+}

0 comments on commit 5947d66

Please sign in to comment.