From e1ee58816ba76734e4115fc12898b13de665b220 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Mon, 28 Dec 2020 10:44:08 -0500 Subject: Add a file for each PDO class (#3297) 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. --- docs/en/developers/Minz/migrations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/en/developers/Minz/migrations.md') diff --git a/docs/en/developers/Minz/migrations.md b/docs/en/developers/Minz/migrations.md index 6cc985c22..0f9628d70 100644 --- a/docs/en/developers/Minz/migrations.md +++ b/docs/en/developers/Minz/migrations.md @@ -18,7 +18,7 @@ Example: // File: app/migrations/2020_01_11_CreateFooTable.php class FreshRSS_Migration_2020_01_11_CreateFooTable { public static function migrate() { - $pdo = new MinzPDOSQLite('sqlite:/some/path/db.sqlite'); + $pdo = new Minz_PdoSqlite('sqlite:/some/path/db.sqlite'); $result = $pdo->exec('CREATE TABLE foos (bar TEXT)'); if ($result === false) { $error = $pdo->errorInfo(); -- cgit v1.2.3