Merge pull request #3246 from nextcloud/fix-sqlite-dependency
Remove useless dependency on SQLite (non-PDO)
This commit is contained in:
commit
e21170bd1a
|
@ -125,8 +125,8 @@ class Setup {
|
||||||
public function getSupportedDatabases($allowAllDatabases = false) {
|
public function getSupportedDatabases($allowAllDatabases = false) {
|
||||||
$availableDatabases = array(
|
$availableDatabases = array(
|
||||||
'sqlite' => array(
|
'sqlite' => array(
|
||||||
'type' => 'class',
|
'type' => 'pdo',
|
||||||
'call' => 'SQLite3',
|
'call' => 'sqlite',
|
||||||
'name' => 'SQLite'
|
'name' => 'SQLite'
|
||||||
),
|
),
|
||||||
'mysql' => array(
|
'mysql' => array(
|
||||||
|
@ -163,9 +163,7 @@ class Setup {
|
||||||
$type = $availableDatabases[$database]['type'];
|
$type = $availableDatabases[$database]['type'];
|
||||||
$call = $availableDatabases[$database]['call'];
|
$call = $availableDatabases[$database]['call'];
|
||||||
|
|
||||||
if($type === 'class') {
|
if ($type === 'function') {
|
||||||
$working = $this->class_exists($call);
|
|
||||||
} elseif ($type === 'function') {
|
|
||||||
$working = $this->is_callable($call);
|
$working = $this->is_callable($call);
|
||||||
} elseif($type === 'pdo') {
|
} elseif($type === 'pdo') {
|
||||||
$working = in_array($call, $this->getAvailableDbDriversForPdo(), TRUE);
|
$working = in_array($call, $this->getAvailableDbDriversForPdo(), TRUE);
|
||||||
|
|
|
@ -53,10 +53,6 @@ class SetupTest extends \Test\TestCase {
|
||||||
->will($this->returnValue(
|
->will($this->returnValue(
|
||||||
array('sqlite', 'mysql', 'oci')
|
array('sqlite', 'mysql', 'oci')
|
||||||
));
|
));
|
||||||
$this->setupClass
|
|
||||||
->expects($this->once())
|
|
||||||
->method('class_exists')
|
|
||||||
->will($this->returnValue(true));
|
|
||||||
$this->setupClass
|
$this->setupClass
|
||||||
->expects($this->once())
|
->expects($this->once())
|
||||||
->method('is_callable')
|
->method('is_callable')
|
||||||
|
@ -64,7 +60,7 @@ class SetupTest extends \Test\TestCase {
|
||||||
$this->setupClass
|
$this->setupClass
|
||||||
->expects($this->any())
|
->expects($this->any())
|
||||||
->method('getAvailableDbDriversForPdo')
|
->method('getAvailableDbDriversForPdo')
|
||||||
->will($this->returnValue([]));
|
->will($this->returnValue(['sqlite']));
|
||||||
$result = $this->setupClass->getSupportedDatabases();
|
$result = $this->setupClass->getSupportedDatabases();
|
||||||
$expectedResult = array(
|
$expectedResult = array(
|
||||||
'sqlite' => 'SQLite'
|
'sqlite' => 'SQLite'
|
||||||
|
@ -80,10 +76,6 @@ class SetupTest extends \Test\TestCase {
|
||||||
->will($this->returnValue(
|
->will($this->returnValue(
|
||||||
array('sqlite', 'mysql', 'oci', 'pgsql')
|
array('sqlite', 'mysql', 'oci', 'pgsql')
|
||||||
));
|
));
|
||||||
$this->setupClass
|
|
||||||
->expects($this->any())
|
|
||||||
->method('class_exists')
|
|
||||||
->will($this->returnValue(false));
|
|
||||||
$this->setupClass
|
$this->setupClass
|
||||||
->expects($this->any())
|
->expects($this->any())
|
||||||
->method('is_callable')
|
->method('is_callable')
|
||||||
|
@ -104,10 +96,6 @@ class SetupTest extends \Test\TestCase {
|
||||||
->will($this->returnValue(
|
->will($this->returnValue(
|
||||||
array('sqlite', 'mysql', 'pgsql', 'oci')
|
array('sqlite', 'mysql', 'pgsql', 'oci')
|
||||||
));
|
));
|
||||||
$this->setupClass
|
|
||||||
->expects($this->any())
|
|
||||||
->method('class_exists')
|
|
||||||
->will($this->returnValue(true));
|
|
||||||
$this->setupClass
|
$this->setupClass
|
||||||
->expects($this->any())
|
->expects($this->any())
|
||||||
->method('is_callable')
|
->method('is_callable')
|
||||||
|
@ -115,7 +103,7 @@ class SetupTest extends \Test\TestCase {
|
||||||
$this->setupClass
|
$this->setupClass
|
||||||
->expects($this->any())
|
->expects($this->any())
|
||||||
->method('getAvailableDbDriversForPdo')
|
->method('getAvailableDbDriversForPdo')
|
||||||
->will($this->returnValue(['mysql', 'pgsql']));
|
->will($this->returnValue(['sqlite', 'mysql', 'pgsql']));
|
||||||
$result = $this->setupClass->getSupportedDatabases();
|
$result = $this->setupClass->getSupportedDatabases();
|
||||||
$expectedResult = array(
|
$expectedResult = array(
|
||||||
'sqlite' => 'SQLite',
|
'sqlite' => 'SQLite',
|
||||||
|
|
Loading…
Reference in New Issue