move db-prefs shortcut functions to functions.php

This commit is contained in:
Andrew Dolgov 2021-02-22 23:25:14 +03:00
parent 77e6d589ff
commit 29ada58b4a
9 changed files with 8 additions and 16 deletions

View File

@ -12,7 +12,6 @@
define('NO_SESSION_AUTOSTART', true);
require_once "autoload.php";
require_once "db-prefs.php";
require_once "functions.php";
require_once "sessions.php";

View File

@ -26,7 +26,6 @@
require_once "autoload.php";
require_once "sessions.php";
require_once "functions.php";
require_once "db-prefs.php";
$op = (string)clean($op);
$method = (string)clean($method);

View File

@ -1,8 +0,0 @@
<?php
function get_pref($pref_name, $user_id = false, $die_on_error = false) {
return Db_Prefs::get()->read($pref_name, $user_id, $die_on_error);
}
function set_pref($pref_name, $value, $user_id = false, $strip_tags = true) {
return Db_Prefs::get()->write($pref_name, $value, $user_id, $strip_tags);
}

View File

@ -42,6 +42,14 @@
define('SUBSTRING_FOR_DATE', 'SUBSTRING');
}
function get_pref($pref_name, $user_id = false, $die_on_error = false) {
return Db_Prefs::get()->read($pref_name, $user_id, $die_on_error);
}
function set_pref($pref_name, $value, $user_id = false, $strip_tags = true) {
return Db_Prefs::get()->write($pref_name, $value, $user_id, $strip_tags);
}
function get_translations() {
$t = array(
"auto" => __("Detect automatically"),
@ -152,7 +160,6 @@
}
}
require_once 'db-prefs.php';
require_once 'controls.php';
require_once 'controls_compat.php';

View File

@ -14,7 +14,6 @@
require_once "sessions.php";
require_once "functions.php";
require_once "sanity_check.php";
require_once "db-prefs.php";
if (!init_plugins()) return;

View File

@ -6,7 +6,6 @@
require_once "sessions.php";
require_once "functions.php";
require_once "sanity_check.php";
require_once "db-prefs.php";
if (!init_plugins()) return;

View File

@ -6,7 +6,6 @@
require_once "sessions.php";
require_once "functions.php";
require_once "sanity_check.php";
require_once "db-prefs.php";
startup_gettext();

View File

@ -10,7 +10,6 @@
require_once "autoload.php";
require_once "functions.php";
require_once "sanity_check.php";
require_once "db-prefs.php";
function make_stampfile($filename) {
$fp = fopen(Config::get(Config::LOCK_DIRECTORY) . "/$filename", "w");

View File

@ -11,7 +11,6 @@
require_once "autoload.php";
require_once "functions.php";
require_once "sanity_check.php";
require_once "db-prefs.php";
if (!function_exists('pcntl_fork')) {
die("error: This script requires PHP compiled with PCNTL module.\n");