move db-prefs shortcut functions to functions.php

master
Andrew Dolgov 2 years ago
parent 77e6d589ff
commit 29ada58b4a
  1. 1
      api/index.php
  2. 1
      backend.php
  3. 8
      include/db-prefs.php
  4. 9
      include/functions.php
  5. 1
      index.php
  6. 1
      prefs.php
  7. 1
      public.php
  8. 1
      update.php
  9. 1
      update_daemon2.php

@ -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";

@ -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);

@ -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);
}

@ -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';

@ -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;

@ -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;

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

@ -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");

@ -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");

Loading…
Cancel
Save