Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
a6c088a1
Commit
a6c088a1
authored
Oct 29, 2014
by
Thomas Müller
Browse files
adding new config parameter for sqlite to specify the journal mode
parent
6fb2477f
Changes
4
Hide whitespace changes
Inline
Side-by-side
config/config.sample.php
View file @
a6c088a1
...
...
@@ -133,6 +133,12 @@ $CONFIG = array(
PDO
::
MYSQL_ATTR_SSL_CA
=>
'/file/path/to/ca_cert.pem'
,
),
/**
* sqlite3 journal mode can be specified using this config parameter - can be 'WAL' or 'DELETE'
* see for more details https://www.sqlite.org/wal.html
*/
'sqlite.journal_mode'
=>
'DELETE'
,
/**
* Indicates whether the ownCloud instance was installed successfully; ``true``
* indicates a successful installation, and ``false`` indicates an unsuccessful
...
...
lib/private/db/connectionfactory.php
View file @
a6c088a1
...
...
@@ -90,7 +90,8 @@ class ConnectionFactory {
$eventManager
->
addEventSubscriber
(
new
\
Doctrine\DBAL\Event\Listeners\OracleSessionInit
);
break
;
case
'sqlite3'
:
$eventManager
->
addEventSubscriber
(
new
SQLiteSessionInit
);
$journalMode
=
$additionalConnectionParams
[
'sqlite.journal_mode'
];
$eventManager
->
addEventSubscriber
(
new
SQLiteSessionInit
(
true
,
$journalMode
));
break
;
}
$connection
=
\
Doctrine\DBAL\DriverManager
::
getConnection
(
...
...
@@ -153,6 +154,7 @@ class ConnectionFactory {
}
$connectionParams
[
'tablePrefix'
]
=
$config
->
getSystemValue
(
'dbtableprefix'
,
'oc_'
);
$connectionParams
[
'sqlite.journal_mode'
]
=
$config
->
getSystemValue
(
'sqlite.journal_mode'
,
'WAL'
);
//additional driver options, eg. for mysql ssl
$driverOptions
=
$config
->
getSystemValue
(
'dbdriveroptions'
,
null
);
...
...
lib/private/db/sqlitesessioninit.php
View file @
a6c088a1
...
...
@@ -18,13 +18,20 @@ class SQLiteSessionInit implements EventSubscriber {
*/
private
$caseSensitiveLike
;
/**
* @var string
*/
private
$journalMode
;
/**
* Configure case sensitive like for each connection
*
* @param bool $caseSensitiveLike
* @param string $journalMode
*/
public
function
__construct
(
$caseSensitiveLike
=
tru
e
)
{
public
function
__construct
(
$caseSensitiveLike
,
$journalMod
e
)
{
$this
->
caseSensitiveLike
=
$caseSensitiveLike
;
$this
->
journalMode
=
$journalMode
;
}
/**
...
...
@@ -34,6 +41,7 @@ class SQLiteSessionInit implements EventSubscriber {
public
function
postConnect
(
ConnectionEventArgs
$args
)
{
$sensitive
=
(
$this
->
caseSensitiveLike
)
?
'true'
:
'false'
;
$args
->
getConnection
()
->
executeUpdate
(
'PRAGMA case_sensitive_like = '
.
$sensitive
);
$args
->
getConnection
()
->
executeUpdate
(
'PRAGMA journal_mode = '
.
$this
->
journalMode
);
}
public
function
getSubscribedEvents
()
{
...
...
tests/preseed-config.php
View file @
a6c088a1
<?php
$CONFIG
=
array
(
"appstoreenabled"
=>
false
,
'apps_paths'
=>
array
(
0
=>
array
(
'path'
=>
OC
::
$SERVERROOT
.
'/apps'
,
'url'
=>
'/apps'
,
'writable'
=>
true
,
),
1
=>
array
(
'path'
=>
OC
::
$SERVERROOT
.
'/apps2'
,
'url'
=>
'/apps2'
,
'writable'
=>
false
,
)
),
"appstoreenabled"
=>
false
,
'apps_paths'
=>
array
(
0
=>
array
(
'path'
=>
OC
::
$SERVERROOT
.
'/apps'
,
'url'
=>
'/apps'
,
'writable'
=>
true
,
),
1
=>
array
(
'path'
=>
OC
::
$SERVERROOT
.
'/apps2'
,
'url'
=>
'/apps2'
,
'writable'
=>
false
,
)
),
);
if
(
substr
(
strtolower
(
PHP_OS
),
0
,
3
)
==
"win"
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment