Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bring the phpcr-utils import command into symfony, make dependency on…

… phpcr-utils explicit as it should be
  • Loading branch information...
commit 37d1386c743cacbb053939989adc68630edd081f 1 parent ed46ae0
@dbu dbu authored
Showing with 61 additions and 1 deletion.
  1. +59 −0 Command/ImportXmlCommand.php
  2. +2 −1  composer.json
View
59 Command/ImportXmlCommand.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 LGPL. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Bundle\PHPCRBundle\Command;
+
+use PHPCR\Util\Console\Command\ImportXmlCommand as BaseImportXmlCommand;
+
+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 ImportXmlCommand extends BaseImportXmlCommand
+{
+ protected function configure()
+ {
+ parent::configure();
+
+ $this
+ ->setName('doctrine:phpcr:import')
+ ->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);
+ }
+}
View
3  composer.json
@@ -19,7 +19,8 @@
"php": ">=5.3.2",
"symfony/framework-bundle": "2.1.*",
"symfony/doctrine-bridge": "2.1.*",
- "phpcr/phpcr-implementation": "2.1.*"
+ "phpcr/phpcr-implementation": "2.1.*",
+ "phpcr/phpcr-utils": ">=1.0-beta3"
},
"suggest": {
"doctrine/phpcr-odm": "if you want to use the odm as well. require version 1.0.*",
Please sign in to comment.
Something went wrong with that request. Please try again.