From bb06ed902bfb7a11028f688dcf26b1929c146bdc Mon Sep 17 00:00:00 2001 From: TheAlluringCO <153435853+TheAlluringCO@users.noreply.github.com> Date: Thu, 10 Jul 2025 00:21:08 +0200 Subject: [PATCH] Refactor project --- .gitignore | 1 + ENV_TEMPLATE | 1 + config.php | 12 +++++--- home.php | 23 ++------------- style.css => inc/css/style.css | 0 inc/js/theme.js | 9 ++++++ inc/php/footer.php | 3 ++ inc/php/header.php | 7 +++++ inc/php/resources.php | 31 ++++++++++++++++++++ index.php | 52 ++++++---------------------------- process.php | 28 ++++++------------ 11 files changed, 81 insertions(+), 86 deletions(-) create mode 100644 .gitignore create mode 100644 ENV_TEMPLATE rename style.css => inc/css/style.css (100%) create mode 100644 inc/js/theme.js create mode 100644 inc/php/footer.php create mode 100644 inc/php/header.php create mode 100644 inc/php/resources.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2eea525 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env \ No newline at end of file diff --git a/ENV_TEMPLATE b/ENV_TEMPLATE new file mode 100644 index 0000000..f77e5d7 --- /dev/null +++ b/ENV_TEMPLATE @@ -0,0 +1 @@ +APIKEY=123 diff --git a/config.php b/config.php index 5776db7..f28fb96 100644 --- a/config.php +++ b/config.php @@ -1,7 +1,11 @@ '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', - -]; +function getApi(){ + $api_key = getenv('APIKEY'); + if($api_key){ + return array('openai_api_key' => $api_key); + }else{ + return false; + } +} ?> \ No newline at end of file diff --git a/home.php b/home.php index e199301..3319270 100644 --- a/home.php +++ b/home.php @@ -1,26 +1,9 @@ - - - -
- -