mirror of
https://github.com/silverstripe/silverstripe-sqlite3
synced 2024-10-22 17:05:37 +02:00
BUG Properly deprecate old 'memory' config setting
This commit is contained in:
parent
0bd9ef2904
commit
c8235c0f06
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
Deprecation::notification_version('1.3.0', 'sqlite3');
|
||||||
|
|
||||||
$classes = array('SQLiteDatabase', 'SQLite3Database', 'SQLitePDODatabase');
|
$classes = array('SQLiteDatabase', 'SQLite3Database', 'SQLitePDODatabase');
|
||||||
|
|
||||||
global $databaseConfig;
|
global $databaseConfig;
|
||||||
|
@ -63,6 +63,16 @@ class SQLite3Database extends SS_Database {
|
|||||||
function connectDatabase() {
|
function connectDatabase() {
|
||||||
$this->enum_map = array();
|
$this->enum_map = array();
|
||||||
$parameters = $this->parameters;
|
$parameters = $this->parameters;
|
||||||
|
|
||||||
|
if(!empty($parameters['memory'])) {
|
||||||
|
Deprecation::notice(
|
||||||
|
'1.4.0',
|
||||||
|
"\$databaseConfig['memory'] is deprecated. Use \$databaseConfig['path'] = ':memory:' instead.",
|
||||||
|
Deprecation::SCOPE_GLOBAL
|
||||||
|
);
|
||||||
|
$parameters['path'] = ':memory:';
|
||||||
|
}
|
||||||
|
|
||||||
$dbName = !isset($this->database) ? $parameters['database'] : $this->database;
|
$dbName = !isset($this->database) ? $parameters['database'] : $this->database;
|
||||||
$file = $parameters['path'];
|
$file = $parameters['path'];
|
||||||
|
|
||||||
|
@ -13,6 +13,16 @@ class SQLitePDODatabase extends SQLite3Database {
|
|||||||
function connectDatabase() {
|
function connectDatabase() {
|
||||||
$this->enum_map = array();
|
$this->enum_map = array();
|
||||||
$parameters = $this->parameters;
|
$parameters = $this->parameters;
|
||||||
|
|
||||||
|
if(!empty($parameters['memory'])) {
|
||||||
|
Deprecation::notice(
|
||||||
|
'1.4.0',
|
||||||
|
"\$databaseConfig['memory'] is deprecated. Use \$databaseConfig['path'] = ':memory:' instead.",
|
||||||
|
Deprecation::SCOPE_GLOBAL
|
||||||
|
);
|
||||||
|
$parameters['path'] = ':memory:';
|
||||||
|
}
|
||||||
|
|
||||||
$dbName = !isset($this->database) ? $parameters['database'] : $dbName=$this->database;
|
$dbName = !isset($this->database) ? $parameters['database'] : $dbName=$this->database;
|
||||||
$file = $parameters['path'];
|
$file = $parameters['path'];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user