Permalink
Browse files

Add proxies to all the Doctrine CouchDB commands

  • Loading branch information...
1 parent 1b1ba6b commit b6402dc9bd0e4b8a9f1ac73747e82a166411bc2d @beberlei beberlei committed Jun 23, 2011
@@ -0,0 +1,46 @@
+<?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\CouchDBBundle\Command;
+
+use Symfony\Component\Console\Input\InputArgument,
+ Symfony\Component\Console\Input\InputOption,
+ Symfony\Component\Console\Input\InputInterface,
+ Symfony\Component\Console\Output\OutputInterface,
+ Symfony\Component\Console\Command\Command,
+ Doctrine\CouchDB\Tools\Console\Command\CompactDatabaseCommand AS DoctrineCompactDatabaseCommand;
+
+class CompactDatabaseCommand extends DoctrineCompactDatabaseCommand
+{
+ protected function configure()
+ {
+ parent::configure();
+
+ $this->setName('doctrine:couchdb:maintenance:compact-database')
+ ->addOption('conn', null, InputOption::VALUE_OPTIONAL, 'The connection to use for this command');
+
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ DoctrineCommandHelper::setApplicationCouchDBClient($this->getApplication(), $input->getOption('conn'));
+
+ return parent::execute($input, $output);
+ }
+}
@@ -0,0 +1,45 @@
+<?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\CouchDBBundle\Command;
+
+use Symfony\Component\Console\Input\InputArgument,
+ Symfony\Component\Console\Input\InputOption,
+ Symfony\Component\Console\Input\InputInterface,
+ Symfony\Component\Console\Output\OutputInterface,
+ Symfony\Component\Console\Command\Command,
+ Doctrine\CouchDB\Tools\Console\Command\CompactViewCommand AS DoctrineCompactViewCommand;
+
+class CompactViewCommand extends DoctrineCompactViewCommand
+{
+ protected function configure()
+ {
+ parent::configure();
+
+ $this->setName('doctrine:couchdb:maintenance:compact-view')
+ ->addOption('conn', null, InputOption::VALUE_OPTIONAL, 'The connection to use for this command');
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ DoctrineCommandHelper::setApplicationCouchDBClient($this->getApplication(), $input->getOption('conn'));
+
+ return parent::execute($input, $output);
+ }
+}
@@ -0,0 +1,46 @@
+<?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\CouchDBBundle\Command;
+
+
+use Symfony\Component\Console\Input\InputArgument,
+ Symfony\Component\Console\Input\InputOption,
+ Symfony\Component\Console\Input\InputInterface,
+ Symfony\Component\Console\Output\OutputInterface,
+ Symfony\Component\Console\Command\Command,
+ Doctrine\CouchDB\Tools\Console\Command\MigrationCommand AS DoctrineMigrationCommand;
+
+class MigrationCommand extends DoctrineMigrationCommand
+{
+ protected function configure()
+ {
+ parent::configure();
+
+ $this->setName('doctrine:couchdb:migrate')
+ ->addOption('conn', null, InputOption::VALUE_OPTIONAL, 'The connection to use for this command');
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ DoctrineCommandHelper::setApplicationCouchDBClient($this->getApplication(), $input->getOption('conn'));
+
+ return parent::execute($input, $output);
+ }
+}
@@ -0,0 +1,45 @@
+<?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\CouchDBBundle\Command;
+
+use Symfony\Component\Console\Input\InputArgument,
+ Symfony\Component\Console\Input\InputOption,
+ Symfony\Component\Console\Input\InputInterface,
+ Symfony\Component\Console\Output\OutputInterface,
+ Symfony\Component\Console\Command\Command,
+ Doctrine\CouchDB\Tools\Console\Command\ReplicationCancelCommand AS DoctrineReplicationCancelCommand;
+
+class ReplicationCancelCommand extends DoctrineReplicationCancelCommand
+{
+ protected function configure()
+ {
+ parent::configure();
+
+ $this->setName('doctrine:couchdb:replication:cancel')
+ ->addOption('conn', null, InputOption::VALUE_OPTIONAL, 'The connection to use for this command');
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ DoctrineCommandHelper::setApplicationCouchDBClient($this->getApplication(), $input->getOption('conn'));
+
+ return parent::execute($input, $output);
+ }
+}
@@ -0,0 +1,45 @@
+<?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\CouchDBBundle\Command;
+
+use Symfony\Component\Console\Input\InputArgument,
+ Symfony\Component\Console\Input\InputOption,
+ Symfony\Component\Console\Input\InputInterface,
+ Symfony\Component\Console\Output\OutputInterface,
+ Symfony\Component\Console\Command\Command,
+ Doctrine\CouchDB\Tools\Console\Command\ReplicationStartCommand AS DoctrineReplicationStartCommand;
+
+class ReplicationStartCommand extends DoctrineReplicationStartCommand
+{
+ protected function configure()
+ {
+ parent::configure();
+
+ $this->setName('doctrine:couchdb:replication:start')
+ ->addOption('conn', null, InputOption::VALUE_OPTIONAL, 'The connection to use for this command');
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ DoctrineCommandHelper::setApplicationCouchDBClient($this->getApplication(), $input->getOption('conn'));
+
+ return parent::execute($input, $output);
+ }
+}
@@ -0,0 +1,45 @@
+<?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\CouchDBBundle\Command;
+
+use Symfony\Component\Console\Input\InputArgument,
+ Symfony\Component\Console\Input\InputOption,
+ Symfony\Component\Console\Input\InputInterface,
+ Symfony\Component\Console\Output\OutputInterface,
+ Symfony\Component\Console\Command\Command,
+ Doctrine\CouchDB\Tools\Console\Command\ViewCleanupCommand AS DoctrineViewCleanupCommand;
+
+class ViewCleanupCommand extends DoctrineViewCleanupCommand
+{
+ protected function configure()
+ {
+ parent::configure();
+
+ $this->setName('doctrine:couchdb:maintenance:view-cleanup')
+ ->addOption('conn', null, InputOption::VALUE_OPTIONAL, 'The connection to use for this command');
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ DoctrineCommandHelper::setApplicationCouchDBClient($this->getApplication(), $input->getOption('conn'));
+
+ return parent::execute($input, $output);
+ }
+}

2 comments on commit b6402dc

@stof
Member
stof commented on b6402dc Jun 23, 2011

You should maybe move these class in a Proxy subnamespace to be consistent with DoctrineBundle

@beberlei
Member

This kind of consitency is nitpicking imho, MongoDB doen't do it aswell.

Please sign in to comment.