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