-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch cypht config hm3.* to dotenv #823
Conversation
faf567b
to
24182cd
Compare
should i perhaps call
in index.php ? after this:
|
The #813 requests the ability to load config variables through env variables. We don't need dotenv package or .env file to do this. We just need to look at the ENV array or getenv function first before falling back to hm3.ini ones loaded in site config. |
24182cd
to
7f91960
Compare
dee9f5a
to
c9c7a65
Compare
7dd7fb5
to
14f11a3
Compare
14f11a3
to
23ef7cd
Compare
I created a folder config with *.php returning each file an array, and migrated all hm3.ini with comments inside to keep the same structure as requested, we keep the same behavior (for example to enable a module we just have to uncomment it inside config/app.php, no need to re-run the config_gen.php script). All configurations have been switched to dotenv. INSTALL file not yet updated to support new changes. |
Wow, quite a refactor! I like the approach but can we streamline 2 issues here?
|
This commit addresses two key issues in the current codebase to enhance the configuration handling process. The proposed changes aim to improve code organization, eliminate redundancy, and promote consistency in the configuration structure. ChangesIssue 1: Duplicated Config Folder LocationThe repeated calls to Issue 2: Standardizing Module .ini FilesAll module Constructor Parameter for PHPUnit TestsIn the public function __construct($all_configs = []) {
$this->load(empty($all_configs) ? merge_config_files(APP_PATH.'config') : $all_configs, false);
} This parameter allows for handling PHPUnit tests that use custom config files other than those found in config/*.php. It provides flexibility for testing scenarios where alternative configurations are necessary. |
28aba2a
to
ad2ca85
Compare
ad2ca85
to
6007f80
Compare
Looks good to me code-wise. Can maybe @josaphatim or somebody from the team test it a bit more - enable/disable some modules, regenerate config, change config/.env settings, etc. Also, @Shadow243 once this is merged, the first thing we should do with Tiki integration master branch is get the latest Cypht and update the integration to use the latest .env setup. |
@kroky I will test this |
@kroky I tested this and It is working. I enabled/disabled modules and also ran php unit tests. @Shadow243 Just one more thing, there was a hm3.sample.ini file and hm3.ini that we used for our own configurations and present in .gitignore file. But in this new architecture there is only .env.dist. I think we should have a .env.example and then change the INSTALL file according to this. |
Task Description: Integrate Symfony Dotenv Package into Cypht Project
Details:
In response to GitHub Issue #813, the Symfony Dotenv package has been added to the Cypht project. This integration is part of an effort to standardize the handling of environment variables across different projects, including Cypht, Tiki, and Tiki Manager.
Next Steps: