summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2023-09-28 15:28:06 +0200
committerSimon Rettberg2023-09-28 15:28:06 +0200
commit6aae1d1aba21231d4418ba1878158e985fe938d8 (patch)
treead9597f97a502a451ebcf05e38f640a211c2261a
parent[sysconfig] PHP Warning: Private methods cannot be final as they are never o... (diff)
downloadslx-admin-6aae1d1aba21231d4418ba1878158e985fe938d8.tar.gz
slx-admin-6aae1d1aba21231d4418ba1878158e985fe938d8.tar.xz
slx-admin-6aae1d1aba21231d4418ba1878158e985fe938d8.zip
Disable deprecated warnings when not in debug mode
-rw-r--r--api.php6
-rw-r--r--index.php5
2 files changed, 10 insertions, 1 deletions
diff --git a/api.php b/api.php
index a40a0a1c..4c58687b 100644
--- a/api.php
+++ b/api.php
@@ -1,9 +1,13 @@
<?php
-error_reporting(E_ALL);
chdir(dirname($_SERVER['SCRIPT_FILENAME']));
require_once 'config.php';
+if (CONFIG_DEBUG) {
+ error_reporting(E_ALL);
+} else {
+ error_reporting(E_ALL & ~E_DEPRECATED);
+}
define('API', true);
define('AJAX', false);
diff --git a/index.php b/index.php
index d5364306..78d23111 100644
--- a/index.php
+++ b/index.php
@@ -1,6 +1,11 @@
<?php
require_once 'config.php';
+if (CONFIG_DEBUG) {
+ error_reporting(E_ALL);
+} else {
+ error_reporting(E_ALL & ~E_DEPRECATED);
+}
if (CONFIG_SQL_PASS === '%MYSQL_OPENSLX_PASS%') {
Header('Content-Type: text/plain; charset=utf-8');