aboutsummaryrefslogtreecommitdiff
path: root/ratatoeskr/sys
diff options
context:
space:
mode:
authorLaria Carolin Chabowski <laria@laria.me>2020-10-20 21:53:28 +0200
committerLaria Carolin Chabowski <laria@laria.me>2020-10-20 21:53:28 +0200
commit69049acef2ee593d65af7bcb62055dae6c9615b4 (patch)
tree6bccc459bc98467587615466de5db6bab6bbc108 /ratatoeskr/sys
parentc0c84e12383641ee7ad14153a036c6317414ac70 (diff)
downloadratatoeskr-cms-69049acef2ee593d65af7bcb62055dae6c9615b4.tar.gz
ratatoeskr-cms-69049acef2ee593d65af7bcb62055dae6c9615b4.tar.bz2
ratatoeskr-cms-69049acef2ee593d65af7bcb62055dae6c9615b4.zip
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 :)
Diffstat (limited to 'ratatoeskr/sys')
-rw-r--r--ratatoeskr/sys/db.php34
-rw-r--r--ratatoeskr/sys/models.php2
2 files changed, 1 insertions, 35 deletions
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