From 03bade9bc66610ad28026ef9376b8b4f01377026 Mon Sep 17 00:00:00 2001 From: Banana Date: Wed, 6 Jan 2021 16:08:14 +0100 Subject: [PATCH] config merge into one file. missing changelog. start of develop branch --- CHANGELOG | 12 +++++ VERSION | 8 +-- upgrade/from-version-1.0.txt | 3 ++ webclient/api.php | 35 +++++++++--- ...{system.php.default => config.php.default} | 53 +++++++++---------- webclient/config/database.php.default | 24 --------- webclient/config/path.php.default | 23 -------- webclient/index.php | 35 +++++++++--- 8 files changed, 94 insertions(+), 99 deletions(-) create mode 100644 CHANGELOG rename webclient/config/{system.php.default => config.php.default} (53%) delete mode 100644 webclient/config/database.php.default delete mode 100644 webclient/config/path.php.default diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..fb0425b --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,12 @@ +1.1 - Vortex Rikers () + * Cleanup and merge to one config file. Read upgrade + * Missing changelog file + * api has its own log file now. + +1.0 - Castle - (20210106) + * First usable version + * Using as a collection management software will work + * Rights management needs tweeking, so use the admin account for a start + * Documentation covers the basics + * Use it and give feedback. + * Also, make backups. diff --git a/VERSION b/VERSION index 07e97bc..bcff852 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1 @@ -1.0 - Castle - (20210106) - * First usable version - * Using as a collection management software will work - * Rights management needs tweeking, so use the admin account for a start - * Documentation covers the basics - * Use it and give feedback. - * Also, make backups. +1.1 - Vortex Rikers () diff --git a/upgrade/from-version-1.0.txt b/upgrade/from-version-1.0.txt index e69de29..36e2785 100644 --- a/upgrade/from-version-1.0.txt +++ b/upgrade/from-version-1.0.txt @@ -0,0 +1,3 @@ +# Migration of the config files into one config file +Please copy the new config/config.php.default to config/config.php and adapt the settings which you +have on the old config files. After that you can delete config/database|path|system files. diff --git a/webclient/api.php b/webclient/api.php index 506369b..cce16fd 100644 --- a/webclient/api.php +++ b/webclient/api.php @@ -2,7 +2,7 @@ /** * Bibliotheca webclient * - * Copyright 2018-2020 Johannes Keßler + * Copyright 2018-2021 Johannes Keßler * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,14 +16,33 @@ * limitations under the License. */ -# set to true if you need debug messages in error log file -define('DEBUG',false); -# set to ture if you need query log messages in error log file. -define('QUERY_DEBUG',false); +require_once './config/config.php'; -require_once './config/path.php'; -require_once './config/system.php'; -require_once './config/database.php'; +mb_http_output('UTF-8'); +mb_internal_encoding('UTF-8'); +ini_set('error_reporting',-1); // E_ALL & E_STRICT + +# check request +$_urlToParse = filter_var($_SERVER['QUERY_STRING'],FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW); +if(!empty($_urlToParse)) { + # see http://de2.php.net/manual/en/regexp.reference.unicode.php + if(preg_match('/[\p{C}\p{M}\p{Sc}\p{Sk}\p{So}\p{Zl}\p{Zp}]/u',$_urlToParse) === 1) { + die('Malformed request. Make sure you know what you are doing.'); + } +} + +# set the error reporting +ini_set('log_errors',true); +ini_set('error_log',PATH_SYSTEMOUT.'/api.log'); +if(DEBUG === true) { + ini_set('display_errors',true); +} +else { + ini_set('display_errors',false); +} + +# time settings +date_default_timezone_set(TIMEZONE); # static helper class require_once 'lib/summoner.class.php'; diff --git a/webclient/config/system.php.default b/webclient/config/config.php.default similarity index 53% rename from webclient/config/system.php.default rename to webclient/config/config.php.default index 1acc399..edea87b 100644 --- a/webclient/config/system.php.default +++ b/webclient/config/config.php.default @@ -2,7 +2,7 @@ /** * Bibliotheca webclient * - * Copyright 2018-2020 Johannes Keßler + * Copyright 2018-2021 Johannes Keßler * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,34 +16,29 @@ * limitations under the License. */ -mb_http_output('UTF-8'); -mb_internal_encoding('UTF-8'); -ini_set('error_reporting',-1); // E_ALL & E_STRICT - -## check request -$_urlToParse = filter_var($_SERVER['QUERY_STRING'],FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW); -if(!empty($_urlToParse)) { - # see http://de2.php.net/manual/en/regexp.reference.unicode.php - if(preg_match('/[\p{C}\p{M}\p{Sc}\p{Sk}\p{So}\p{Zl}\p{Zp}]/u',$_urlToParse) === 1) { - die('Malformed request. Make sure you know what you are doing.'); - } -} - -## set the error reporting -ini_set('log_errors',true); -ini_set('error_log',PATH_SYSTEMOUT.'/error.log'); -if(DEBUG === true) { - ini_set('display_errors',true); -} -else { - ini_set('display_errors',false); -} - -# time settings -date_default_timezone_set('Europe/Berlin'); - -# theme support -# fallback support to default +# set to true if you need debug messages in error log file +define('DEBUG',true); +# set to ture if you need query log messages in error log file. +define('QUERY_DEBUG',true); + +# timezone settings +define('TIMEZONE','Europe/Berlin'); + +# path settings +define('PATH_ABSOLUTE','/home/some/path/bibliotheca/webclient'); +define('PATH_SYSTEMOUT',PATH_ABSOLUTE.'/systemout'); +define('PATH_STORAGE',PATH_ABSOLUTE.'/storage'); +define('PATH_WEB_STORAGE','storage'); + +# database config +define('DB_HOST','127.0.0.1'); +define('DB_USERNAME','user'); +define('DB_PASSWORD','test'); +define('DB_NAME','bibliotheca'); +define('DB_PREFIX','bib'); # a _ is added automatically as seperation + +## theme support +# fallback is default theme define('UI_THEME', 'default'); # session diff --git a/webclient/config/database.php.default b/webclient/config/database.php.default deleted file mode 100644 index 0c827f3..0000000 --- a/webclient/config/database.php.default +++ /dev/null @@ -1,24 +0,0 @@ -