From 69049acef2ee593d65af7bcb62055dae6c9615b4 Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Tue, 20 Oct 2020 21:53:28 +0200 Subject: Remove some unused DB functions / globals Now it begins to pay off, that (nearly) all model classes were updated to use the new Database class :) --- ratatoeskr/sys/db.php | 34 +--------------------------------- ratatoeskr/sys/models.php | 2 -- 2 files changed, 1 insertion(+), 35 deletions(-) (limited to 'ratatoeskr/sys') diff --git a/ratatoeskr/sys/db.php b/ratatoeskr/sys/db.php index a2ccc13..9272256 100644 --- a/ratatoeskr/sys/db.php +++ b/ratatoeskr/sys/db.php @@ -20,24 +20,6 @@ if (!defined("SETUP")) { require_once(dirname(__FILE__) . "/utils.php"); -// The global database connection. -// It's usage is deprecated, use the Database object supplied by Env::database() instead. -/** @var PDO|null $db_con */ -$db_con = null; - -/** - * Establish the global connection to the MySQL database. - * This sets the global {@see $db_con}. - * - * @deprecated Use the {@see Database} object supplied by {@see Env::database()} instead. - */ -function db_connect(): void -{ - global $db_con; - - $db_con = Env::getGlobal()->database()->getPdo(); -} - /** * Substitutes "PREFIX_" in the input string with the prefix from the config. * @@ -51,21 +33,7 @@ function sub_prefix($q): string } /** - * Prepares a SQL statement using the global DB connection. - * This will also replace "PREFIX_" with the prefix defined in 'config.php'. - * - * @param mixed|string $q The query / statement to prepare. - * @return PDOStatement - * - * @deprecated Use {@see Database::prepStmt()} instead. - */ -function prep_stmt($q): PDOStatement -{ - return Env::getGlobal()->database()->prepStmt((string)$q); -} - -/** - * Prepares statement (1st argument) with {@see prep_stmt()} and executes it with the remaining arguments. + * Prepares statement (1st argument) like {@see Database::prepStmt()} and executes it with the remaining arguments. * * @param mixed ...$args * @return PDOStatement diff --git a/ratatoeskr/sys/models.php b/ratatoeskr/sys/models.php index 6a90a8d..7f5cb4c 100644 --- a/ratatoeskr/sys/models.php +++ b/ratatoeskr/sys/models.php @@ -20,8 +20,6 @@ require_once(dirname(__FILE__) . "/utils.php"); require_once(dirname(__FILE__) . "/textprocessors.php"); require_once(dirname(__FILE__) . "/pluginpackage.php"); -db_connect(); - /* * Array: $imagetype_file_extensions * Array of default file extensions for most IMAGETYPE_* constants -- cgit v1.2.3-70-g09d2