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()
3333 }
3434
3535 /**
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
3737 * @return SQLiteDB|null
38+ * @throws Exception
3839 */
3940 public function getDB ($ throw = true )
4041 {
4142 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+
4248 try {
4349 $ this ->init ();
4450 } catch (\Exception $ exception ) {
45- if (defined ('DOKU_UNITTEST ' )) throw new \RuntimeException ('Could not load SQLite ' , 0 , $ exception );
4651 ErrorHandler::logException ($ exception );
47- if ($ throw ) throw new StructException ( ' no sqlite ' ) ;
52+ if ($ throw ) throw $ exception ;
4853 return null ;
4954 }
5055 }
You can’t perform that action at this time.
0 commit comments