Skip to content
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

[C2] Remove config/configuration.php #5702

Open
ywarnier opened this issue Aug 1, 2024 · 2 comments
Open

[C2] Remove config/configuration.php #5702

ywarnier opened this issue Aug 1, 2024 · 2 comments

Comments

@ywarnier
Copy link
Member

ywarnier commented Aug 1, 2024

config/configuration.php is a remnant of Chamilo 1.11 and only contains a few settings that are not yet supported with the new C2 (but that should be reintegrated in the future, so we don't want to loose them).

This is what configuration.php currently looks like on a newly-installed Chamilo 2.0 setup (I'm removing documentation for the purpose of synthesis in the code below):

$_configuration['db_manager_enabled'] = false;
$_configuration[1]['hosting_limit_users'] = 0;
$_configuration[1]['hosting_limit_teachers'] = 0;
$_configuration[1]['hosting_limit_courses'] = 0;
$_configuration[1]['hosting_limit_sessions'] = 0;
$_configuration[1]['hosting_limit_disk_space'] = 0;
$_configuration[1]['hosting_limit_active_courses'] = 0;
$_configuration['hosting_total_size_limit'] = 0;
$_configuration['security_key'] = 'abcdefabcdef123456';
$_configuration['software_name'] = 'Chamilo';
$_configuration['software_url'] = 'https://chamilo.org/';
$_configuration['deny_delete_users'] = false;

The settings without a URL prefix ([1] in this example) can safely be moved to .env. Just change them to uppercase:

DB_MANAGER_ENABLED='0'
SECURITY_KEY='abcdefabcdef123456'     # not sure this one is still used...
SOFTWARE_NAME='Chamilo'
SOFTWARE_URL='https://chamilo.org/';
DENY_DELETE_USERS='0'

(make sure these are converted correctly from any place in the code).

The settings related to hosting limits can be stored in a new file called config/hosting_limits.yml.dist, which will be copied to config/hosting_limits.yml manually if anyone needs to define values there:

hosting_limits:
    urls:
        1:
            - hosting_limit_users: 0
            - hosting_limit_teachers: 0
            - hosting_limit_courses: 0
            - hosting_limit_sessions: 0
            - hosting_limit_disk_space: 0
            - hosting_limit_active_courses: 0
            - hosting_total_size_limit: 0
        2:
            - hosting_limit_users: 0
            - hosting_limit_teachers: 0
            - hosting_limit_courses: 0
            - hosting_limit_sessions: 0
            - hosting_limit_disk_space: 0
            - hosting_limit_active_courses: 0
            - hosting_total_size_limit: 0

This requires a migration (to move the remaining settings from configuration.php to the .env and .yml files, and a review of the code in search for the use of those settings, to replace them.

@christianbeeznest
Copy link
Contributor

It is implemented in this PR #5711

christianbeeznest added a commit to christianbeeznest/chamilo-lms that referenced this issue Aug 8, 2024
christianbeeznest added a commit to christianbeeznest/chamilo-lms that referenced this issue Aug 8, 2024
christianbeeznest added a commit to christianbeeznest/chamilo-lms that referenced this issue Aug 9, 2024
@christianbeeznest
Copy link
Contributor

Hi @ywarnier ,

Refactored installation logic to remove dependency on configuration.php and updated isUpdateAvailable to use APP_INSTALLED env variable. Please test fresh installs. Let me know if you find something to fix, please. I have tested locally and seems ok for me.

Thanks for confirmation.

christianbeeznest added a commit to christianbeeznest/chamilo-lms that referenced this issue Aug 12, 2024
christianbeeznest added a commit to christianbeeznest/chamilo-lms that referenced this issue Aug 28, 2024
christianbeeznest added a commit to christianbeeznest/chamilo-lms that referenced this issue Aug 28, 2024
christianbeeznest added a commit that referenced this issue Aug 28, 2024
Internal: Migrate and improve settings from configuration.php to .env and hosting_limits.yml - refs #5702
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants