summaryrefslogtreecommitdiff
path: root/app/Models/DatabaseDAO.php
diff options
context:
space:
mode:
authorGravatar Alexis Degrugillier <aledeg@users.noreply.github.com> 2020-12-28 18:11:34 -0500
committerGravatar GitHub <noreply@github.com> 2020-12-29 00:11:34 +0100
commit3f4c86f80f7cf7fd0ba9260d46eafc55d46fe9af (patch)
tree9730db83d5d216566b38899a195ba3f92c50f418 /app/Models/DatabaseDAO.php
parent0a2d9b3b54ee51a3965d79c68409ef045ad5834b (diff)
Add a file for each PDO class (#3301)
Before, we had 5 classes in the ModelPdo file. It was bad for 2 reasons. The first reason is that it is considered bad practice to have multiple class in one file. This is especially true when using autoloading. On top of that it is less readable considering the size of the file. The second reason is that so far we were lucky. Everytime we needed to access the database, it was through the ModelPdo class which loads all the other classes. If we want to access directly the connection, it wont be loaded. On top of that, the system is configured to work on a single database, but as we have every connection definition in a single file, all classes were loaded at the same time. Thus using memory and processing time for nothing. Now, we have a file for each class. To work with autoloading, classes were slightly renamed to match autoloading rules.
Diffstat (limited to 'app/Models/DatabaseDAO.php')
-rw-r--r--app/Models/DatabaseDAO.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/Models/DatabaseDAO.php b/app/Models/DatabaseDAO.php
index 9d762a615..45049e8d7 100644
--- a/app/Models/DatabaseDAO.php
+++ b/app/Models/DatabaseDAO.php
@@ -241,7 +241,7 @@ class FreshRSS_DatabaseDAO extends Minz_ModelPdo {
$sqlite = null;
try {
- $sqlite = new MinzPDOSQLite('sqlite:' . $filename);
+ $sqlite = new Minz_PdoSqlite('sqlite:' . $filename);
} catch (Exception $e) {
$error = 'Error while initialising SQLite copy: ' . $e->getMessage();
return self::stdError($error);