[Pkg-owncloud-commits] [owncloud] 12/153: Allow converting from any db type

David Prévot taffit at moszumanska.debian.org
Tue May 27 03:05:27 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 3abcd13979660309f9a6d672d3dc64a7c6d784ab
Author: Bart Visscher <bartv at thisnet.nl>
Date:   Tue Feb 11 18:01:41 2014 +0100

    Allow converting from any db type
---
 .../command/db/{convertfromsqlite.php => converttype.php} | 15 ++++-----------
 core/register_command.php                                 |  2 +-
 2 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/core/command/db/convertfromsqlite.php b/core/command/db/converttype.php
similarity index 92%
rename from core/command/db/convertfromsqlite.php
rename to core/command/db/converttype.php
index 7170658..38527d3 100644
--- a/core/command/db/convertfromsqlite.php
+++ b/core/command/db/converttype.php
@@ -15,7 +15,7 @@ use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Output\OutputInterface;
 
-class ConvertFromSqlite extends Command {
+class ConvertType extends Command {
 	/**
 	 * @var \OC\Config $config
 	 */
@@ -31,8 +31,8 @@ class ConvertFromSqlite extends Command {
 
 	protected function configure() {
 		$this
-			->setName('db:convert-from-sqlite')
-			->setDescription('Convert the owncloud sqlite database to the newly configured one')
+			->setName('db:convert-type')
+			->setDescription('Convert the owncloud database to the newly configured one')
 			->addArgument(
 				'type',
 				InputArgument::REQUIRED,
@@ -82,14 +82,7 @@ class ConvertFromSqlite extends Command {
 	);
 	protected function execute(InputInterface $input, OutputInterface $output) {
 		// connect 'from' database
-		$datadir = $this->config->getValue( "datadirectory", \OC::$SERVERROOT.'/data' );
-		$name = $this->config->getValue( "dbname", "owncloud" );
-		$dbfile = $datadir.'/'.$name.'.db';
-		$connectionParams = array(
-				'path' => $dbfile,
-				'driver' => 'pdo_sqlite',
-		);
-		$fromDB = \Doctrine\DBAL\DriverManager::getConnection($connectionParams);
+		$fromDB = \OC_DB::getConnection();
 
 		// connect 'to' database
 		$type = $input->getArgument('type');
diff --git a/core/register_command.php b/core/register_command.php
index 7369530..a383321 100644
--- a/core/register_command.php
+++ b/core/register_command.php
@@ -9,7 +9,7 @@
 /** @var $application Symfony\Component\Console\Application */
 $application->add(new OC\Core\Command\Status);
 $application->add(new OC\Core\Command\Db\GenerateChangeScript());
-$application->add(new OC\Core\Command\Db\ConvertFromSqlite(OC_Config::getObject()));
+$application->add(new OC\Core\Command\Db\ConvertType(OC_Config::getObject()));
 $application->add(new OC\Core\Command\Upgrade());
 $application->add(new OC\Core\Command\Maintenance\SingleUser());
 $application->add(new OC\Core\Command\App\Disable());

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list