aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Setup
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-07-18 14:20:29 +0200
committerJoas Schilling <coding@schilljs.com>2017-07-25 12:47:37 +0200
commit5e04254d40b427f43ac0cf05f684812c4008aaf5 (patch)
tree008523e99ab742e7837e26e40bbabd057d5b288f /lib/private/Setup
parentf6c48b1548763e0eda66af7c2720d363e1671090 (diff)
downloadnextcloud-server-5e04254d40b427f43ac0cf05f684812c4008aaf5.tar.gz
nextcloud-server-5e04254d40b427f43ac0cf05f684812c4008aaf5.zip
Install from migrations
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Setup')
-rw-r--r--lib/private/Setup/AbstractDatabase.php5
-rw-r--r--lib/private/Setup/MySQL.php6
-rw-r--r--lib/private/Setup/OCI.php9
-rw-r--r--lib/private/Setup/PostgreSQL.php5
-rw-r--r--lib/private/Setup/Sqlite.php1
5 files changed, 3 insertions, 23 deletions
diff --git a/lib/private/Setup/AbstractDatabase.php b/lib/private/Setup/AbstractDatabase.php
index 2fbec326a5d..0e0981e0771 100644
--- a/lib/private/Setup/AbstractDatabase.php
+++ b/lib/private/Setup/AbstractDatabase.php
@@ -38,8 +38,6 @@ abstract class AbstractDatabase {
/** @var IL10N */
protected $trans;
/** @var string */
- protected $dbDefinitionFile;
- /** @var string */
protected $dbUser;
/** @var string */
protected $dbPassword;
@@ -58,9 +56,8 @@ abstract class AbstractDatabase {
/** @var ISecureRandom */
protected $random;
- public function __construct(IL10N $trans, $dbDefinitionFile, SystemConfig $config, ILogger $logger, ISecureRandom $random) {
+ public function __construct(IL10N $trans, SystemConfig $config, ILogger $logger, ISecureRandom $random) {
$this->trans = $trans;
- $this->dbDefinitionFile = $dbDefinitionFile;
$this->config = $config;
$this->logger = $logger;
$this->random = $random;
diff --git a/lib/private/Setup/MySQL.php b/lib/private/Setup/MySQL.php
index b4ca02d2e84..d03e4858b61 100644
--- a/lib/private/Setup/MySQL.php
+++ b/lib/private/Setup/MySQL.php
@@ -51,11 +51,7 @@ class MySQL extends AbstractDatabase {
//fill the database if needed
$query='select count(*) from information_schema.tables where table_schema=? AND table_name = ?';
- $result = $connection->executeQuery($query, [$this->dbName, $this->tablePrefix.'users']);
- $row = $result->fetch();
- if (!$row or $row['count(*)'] === '0') {
- \OC_DB::createDbFromStructure($this->dbDefinitionFile);
- }
+ $connection->executeQuery($query, [$this->dbName, $this->tablePrefix.'users']);
}
/**
diff --git a/lib/private/Setup/OCI.php b/lib/private/Setup/OCI.php
index 1bc6b08117f..3051987917c 100644
--- a/lib/private/Setup/OCI.php
+++ b/lib/private/Setup/OCI.php
@@ -165,14 +165,7 @@ class OCI extends AbstractDatabase {
$entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />';
$this->logger->warning( $entry, ['app' => 'setup.oci']);
}
- $result = oci_execute($stmt);
-
- if($result) {
- $row = oci_fetch_row($stmt);
- }
- if(!$result or $row[0]==0) {
- \OC_DB::createDbFromStructure($this->dbDefinitionFile);
- }
+ oci_execute($stmt);
}
/**
diff --git a/lib/private/Setup/PostgreSQL.php b/lib/private/Setup/PostgreSQL.php
index 8267b065142..dbcb94d6d7f 100644
--- a/lib/private/Setup/PostgreSQL.php
+++ b/lib/private/Setup/PostgreSQL.php
@@ -105,11 +105,6 @@ class PostgreSQL extends AbstractDatabase {
throw new \OC\DatabaseSetupException($this->trans->t('PostgreSQL username and/or password not valid'),
$this->trans->t('You need to enter details of an existing account.'));
}
-
-
- if (!$tablesSetup) {
- \OC_DB::createDbFromStructure($this->dbDefinitionFile);
- }
}
private function createDatabase(IDBConnection $connection) {
diff --git a/lib/private/Setup/Sqlite.php b/lib/private/Setup/Sqlite.php
index 87c0b82682f..d95e70c8b0c 100644
--- a/lib/private/Setup/Sqlite.php
+++ b/lib/private/Setup/Sqlite.php
@@ -41,6 +41,5 @@ class Sqlite extends AbstractDatabase {
}
//in case of sqlite, we can always fill the database
error_log("creating sqlite db");
- \OC_DB::createDbFromStructure($this->dbDefinitionFile);
}
}