From 073619b4616b80dbe8ea8791f819b7ef4af00e8d Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 13 Sep 2023 16:35:02 +0300 Subject: [PATCH] add multi-environment configuration support --- .gitignore | 4 +++- README.md | 5 ++++- src/config/bootstrap.php | 21 +++++++++++++++++++ .../{app.php.example => env.default.php} | 14 ++++++++----- src/crontab/export/feed.php | 5 ++--- src/crontab/export/push.php | 3 +++ src/crontab/scrape.php | 6 ++---- src/crontab/sitemap.php | 5 ++--- src/public/action.php | 6 ++---- src/public/download.php | 6 ++---- src/public/edit.php | 6 ++---- src/public/faq.php | 6 ++---- src/public/index.php | 8 ++----- src/public/magnet.php | 8 ++----- src/public/node.php | 7 ++----- src/public/welcome.php | 6 ++---- 16 files changed, 62 insertions(+), 54 deletions(-) create mode 100644 src/config/bootstrap.php rename src/config/{app.php.example => env.default.php} (92%) diff --git a/.gitignore b/.gitignore index 23d0c29..8c3ae97 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,9 @@ /database/yggtracker.mwb.bak -/src/config/app.php +/src/config/*.php +!/src/config/bootstrap.php +!/src/config/env.default.php /src/public/api/manifest.json /src/public/api/users.json diff --git a/README.md b/README.md index a8c1ad8..bf7dd37 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,10 @@ Open trackers defined in [trackers.json](https://github.com/YGGverse/YGGtracker/ php8^ php-pdo php-mysql +php-curl +php-memcached sphinxsearch +memcached ``` #### Installation @@ -37,7 +40,7 @@ sphinxsearch * The web root dir is `/src/public` * Deploy the database using [MySQL Workbench](https://www.mysql.com/products/workbench) project presented in the `/database` folder * Install [Sphinx Search Server](https://sphinxsearch.com) -* Configuration examples presented at `/config` folder +* Configuration examples presented at `/config` folder. When server environment not provided, setup `env.default.php` * Make sure `/src/api` folder writable * Set up the `/src/crontab` by following [example](https://github.com/YGGverse/YGGtracker/blob/main/example/environment/crontab) diff --git a/src/config/bootstrap.php b/src/config/bootstrap.php new file mode 100644 index 0000000..e3703a8 --- /dev/null +++ b/src/config/bootstrap.php @@ -0,0 +1,21 @@ +