chamilo / chamilo-lms

Chamilo is a learning management system focused on ease of use and accessibility
https://chamilo.org
GNU General Public License v3.0
798 stars 480 forks source link

Move settings from configuration.php to .env or to the Database #2682

Closed jmontoyaa closed 1 year ago

jmontoyaa commented 6 years ago

Specifications by @ywarnier:

There are chances this requires more than 100h of work because there are currently 497 settings in configuration.dist.php (cat main/install/configuration.dist.php | grep \$_configuration | wc).

Status

Settings removed:

configuration.php Comment
session_stored_in_db
root_web
$extAuthSource["cas"]
$extAuthSource["extldap"]
$_configuration['facebook_auth']
$extAuthSource["external_login"]
memcache_server
session_stored_after_n_times
aspell_bin
aspell_opts
aspell_temp_dir

Settings moved to .env

configuration.php v1 .env name v2
db_host DATABASE_HOST
db_port DATABASE_PORT
main_database DATABASE_NAME
db_user DATABASE_USER
db_password DATABASE_PASSWORD

Settings moved in the Database

configuration.php in v1 Setting in the database v2
default_template display.default_template
session_hide_tab_list session.hide_tab_list
lp_fixed_encoding lp.fixed_encoding
show_invisible_exercise_in_lp_list lp.show_invisible_exercise_in_lp_toc
force_edit_exercise_in_lp lp.allow_edit_exercise_in_lp
announcements_hide_send_to_hrm_users announcement.hide_send_to_hrm_users
hide_my_certificate_link certificate.hide_my_certificate_link
hide_header_footer_in_certificate certificate.hide_header_footer
22phuber commented 4 years ago

So memcache_server will be removed? And using memcache_server configuration is only in the php.ini then?

ywarnier commented 4 years ago

@22phuber Not really, you can configure that setting in your Apache vhost (or the php-fpm config for your pool if using nginx). Do you actually use the memcache_server setting from Chamilo?

22phuber commented 4 years ago

@ywarnier Well i configured it at least. But i never checked if it does what it should:

$_configuration['memcache_server'] = array(
    0 => array(
        'host' => getenv('MEMCACHED_HOSTNAME'),
        'port' => '11211',
    )
);

I also configured memcache inside the php.ini

session.save_handler    = "memcached"
session.save_path       = "MEMCACHED_HOSTNAME:11211"

I can see values in memcached so i thought that it is working properly.

ywarnier commented 4 years ago

Note so self: make a list of settings in configuration.php to either .env or the database. Each has to be analysed.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

jmontoyaa commented 3 years ago

The DB settings are now in .env file. We will still use configuration.php for the rest of settings, we can move this issue to v3

christianbeeznest commented 1 year ago

Hi @ywarnier , it is moved settings from configuration.php to database and .env in this PR https://github.com/chamilo/chamilo-lms/pull/4613

Thanks for confirmation.