File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -33,18 +33,23 @@ protected function init()
33
33
}
34
34
35
35
/**
36
- * @param bool $throw throw an Exception when sqlite not available
36
+ * @param bool $throw throw an Exception when sqlite not available or fails to load
37
37
* @return SQLiteDB|null
38
+ * @throws Exception
38
39
*/
39
40
public function getDB ($ throw = true )
40
41
{
41
42
if ($ this ->sqlite === null ) {
43
+ if (!class_exists (SQLiteDB::class)) {
44
+ if ($ throw || defined ('DOKU_UNITTEST ' )) throw new StructException ('no sqlite ' );
45
+ return null ;
46
+ }
47
+
42
48
try {
43
49
$ this ->init ();
44
50
} catch (\Exception $ exception ) {
45
- if (defined ('DOKU_UNITTEST ' )) throw new \RuntimeException ('Could not load SQLite ' , 0 , $ exception );
46
51
ErrorHandler::logException ($ exception );
47
- if ($ throw ) throw new StructException ( ' no sqlite ' ) ;
52
+ if ($ throw ) throw $ exception ;
48
53
return null ;
49
54
}
50
55
}
You can’t perform that action at this time.
0 commit comments