Project

General

Profile

Feature #6104

Remove root_sys from configuration.php

Added by Yannick Warnier about 6 years ago. Updated over 3 years ago.

Status:
Bug resolved
Priority:
Normal
Assignee:
Category:
System
Target version:
Start date:
20/04/2013
Due date:
% Done:

0%

Estimated time:
Spent time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

I don't think the $_configuration['root_sys'] is really necessary in configuration.php anymore.
We can now get it by checking the DIR (available since PHP 5.3.0) in global.inc.php.

I'm trying to figure out why it was used in the first place, and the only things that come to mind are:
  • there was no dirname() in PHP 3, and maybe Claroline started with v3? (although PHP4 appeared in May 2000, which is before Claroline started, maybe there was some considerable delay before it was adopted)
  • there was no FILE in PHP < 4.0.2 (see http://php.net/manual/en/language.constants.predefined.php)
  • there might be a problem with dirname(FILE) with symbolic links and the fact that we would require (from global.inc.php) to do: $_configuration['root_sys'] = DIR.'/../../'; (and sometimes ".." is not translated well in symbolic links contexts.

Either way, we could just make $_configuration['root_sys'] optional in configuration.php, by leaving a commented line and adding some information for this inside the same file and inside the installation guide.

The rationale behind removing/commenting this setting is:
  • it blocks the possibility to move the chamilo directory (it just fails unless you change the setting)
  • we don't really need it anymore (let's build an easier configuration file)

Agree/disagree?


Related issues

Related to Chamilo LMS - Bug #6116: Remove $_configuration['system_stable'], $_configuration['software_name'], $_configuration['software_url'] settings in configuration.phpNew24/04/2013

Actions
Related to Chamilo LMS - Feature #5906: Remove $_configuration['db_admin_path'] and $_configuration['code_append']New25/01/2013

Actions

Associated revisions

Revision 0d464060 (diff)
Added by Julio Montoya about 6 years ago

Replacing $_configuration['root_sys'] with api_get_path(SYS_PATH) see #6104

Revision 4f503297 (diff)
Added by Julio Montoya about 6 years ago

Replacing root_sys with api_get_path(SYS_PATH), setting sys path in global inc instead of api_get_path() changing some other paths due the new "data" folder see #6104

Revision 96a244b1 (diff)
Added by Julio Montoya about 6 years ago

More changes in the configuration.file see #6104

History

#1

Updated by Julio Montoya about 6 years ago

  • Assignee changed from Julio Montoya to Yannick Warnier

I agree, the first step should be to replace all calls of "$_configuration['root_sys']" with "api_get_path(SYS_PATH)".
I think we could just remove the $_configuration['root_sys'] from everywhere.

#2

Updated by Julio Montoya about 6 years ago

  • Status changed from Needs more info to Assigned
  • Assignee changed from Yannick Warnier to Julio Montoya

Taking this task to replace all $_configuration['root_sys'] with api_get_path(SYS_PATH)

#3

Updated by Julio Montoya over 3 years ago

  • Status changed from Assigned to Bug resolved

we use now parameters.yml the "root_sys" can be found using this in a controller:


$container->get('kernel')->getRealRootDir()

Also available in: Atom PDF