mirror of
https://github.com/silverstripe/silverstripe-sqlite3
synced 2024-10-22 17:05:37 +02:00
Merge pull request #4 from tractorcow/pulls/deprecate-memory
BUG Properly deprecate old 'memory' config setting
This commit is contained in:
commit
400920f8de
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
Deprecation::notification_version('1.3.0', 'sqlite3');
|
||||
|
||||
$classes = array('SQLiteDatabase', 'SQLite3Database', 'SQLitePDODatabase');
|
||||
|
||||
global $databaseConfig;
|
||||
|
@ -63,6 +63,16 @@ class SQLite3Database extends SS_Database {
|
||||
function connectDatabase() {
|
||||
$this->enum_map = array();
|
||||
$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;
|
||||
$file = $parameters['path'];
|
||||
|
||||
|
@ -13,6 +13,16 @@ class SQLitePDODatabase extends SQLite3Database {
|
||||
function connectDatabase() {
|
||||
$this->enum_map = array();
|
||||
$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;
|
||||
$file = $parameters['path'];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user