From b6f048d81c4bfba579cf70697d9e22b4de470849 Mon Sep 17 00:00:00 2001 From: Guillermo Pages Date: Wed, 14 Jan 2026 14:15:02 +0100 Subject: [PATCH] refactor: remove hardcoded credentials from config - Strip configuration.local.php to logger-only defaults - Remove db, solr, session, checkfile_url, worker IDs (unused legacy) - Clean credential comments from logger config files - Add .env.example template - Add .env to .gitignore --- .env.example | 6 ++++++ .gitignore | 1 + config/configuration.local.php | 15 +++++++++++++++ config/configuration.logger.normal.php | 13 +++++++++++++ config/configuration.logger.quiet.php | 13 +++++++++++++ config/configuration.logger.verbose.php | 13 +++++++++++++ 6 files changed, 61 insertions(+) create mode 100644 .env.example create mode 100644 config/configuration.local.php create mode 100644 config/configuration.logger.normal.php create mode 100644 config/configuration.logger.quiet.php create mode 100644 config/configuration.logger.verbose.php diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..27f24d1 --- /dev/null +++ b/.env.example @@ -0,0 +1,6 @@ +# php-bsrutils environment variables +# This library only needs logging configuration if you override the defaults. +# Most applications define their own logging config, making this optional. + +# Optional: Override default log file location +# LOG_FILE=/var/log/app/log.txt diff --git a/.gitignore b/.gitignore index 7c5d29b..ab30ff7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ vendor/ *.swp output composer.lock +.env diff --git a/config/configuration.local.php b/config/configuration.local.php new file mode 100644 index 0000000..f91b5aa --- /dev/null +++ b/config/configuration.local.php @@ -0,0 +1,15 @@ + array( + 'file' => realpath(dirname(__FILE__) . '/..') . '/log/log.txt', + 'format' => '%ip% - [%date%] - %status% %error% - %time% - %func%', + 'verbosity' => Logger::NORMAL, + ), +); diff --git a/config/configuration.logger.normal.php b/config/configuration.logger.normal.php new file mode 100644 index 0000000..f042047 --- /dev/null +++ b/config/configuration.logger.normal.php @@ -0,0 +1,13 @@ + array( + 'file' => realpath(dirname(__FILE__) . '/..') . '/log/log.txt', + 'format' => '%ip% - [%date%] - %status% %error% - %time% - %func%', + 'verbosity' => Logger::NORMAL, + ), + ); diff --git a/config/configuration.logger.quiet.php b/config/configuration.logger.quiet.php new file mode 100644 index 0000000..14399ab --- /dev/null +++ b/config/configuration.logger.quiet.php @@ -0,0 +1,13 @@ + array( + 'file' => realpath(dirname(__FILE__) . '/..') . '/log/log.txt', + 'format' => '%ip% - [%date%] - %status% %error% - %time% - %func%', + 'verbosity' => Logger::QUIET, + ), + ); diff --git a/config/configuration.logger.verbose.php b/config/configuration.logger.verbose.php new file mode 100644 index 0000000..8a42d11 --- /dev/null +++ b/config/configuration.logger.verbose.php @@ -0,0 +1,13 @@ + array( + 'file' => realpath(dirname(__FILE__) . '/..') . '/log/log.txt', + 'format' => '%ip% - [%date%] - %status% %error% - %time% - %func%', + 'verbosity' => Logger::VERBOSE, + ), + );