Pārlūkot izejas kodu

Moving configuration files in the app/config folder, removing *.conf files from all scripts, conf files should be called in global.inc

Julio Montoya 12 gadi atpakaļ
vecāks
revīzija
2b25fd7a02

+ 0 - 24
app/console-config.php

@@ -7,7 +7,6 @@ $config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache);
 
 use Doctrine\Common\Annotations\AnnotationReader;
 use Doctrine\Common\Annotations\AnnotationRegistry;
-use Symfony\Component\Yaml\Parser;
 
 $sysPath = __DIR__."../../";
 
@@ -22,29 +21,6 @@ $config->setProxyNamespace('Proxies');
 
 $courseList = CourseManager::get_real_course_list();
 
-$configurationPath = $sysPath.'main/inc/conf/';
-$newConfigurationFile = $configurationPath.'configuration.yml';
-
-//Including configuration.php
-$configurationFile = $configurationPath.'configuration.php';
-
-if (is_file($configurationFile) && file_exists($configurationFile)) {
-    require $configurationFile;
-}
-
-//Merge with the configuration.yml file, if exits
-if (is_file($newConfigurationFile) && file_exists($newConfigurationFile)) {
-    $yaml = new Parser();
-    $_configurationYML = $yaml->parse(file_get_contents($newConfigurationFile));
-    if (!empty($_configurationYML)) {
-        if (isset($_configuration)) {
-            $_configuration = array_merge($_configuration, $_configurationYML);
-        } else {
-            $_configuration = $_configurationYML;
-        }
-    }
-}
-
 $app['chamilo.log'] = $app['cache.path'].'chamilo-cli.log';
 
 // Loading db connections

+ 0 - 8
app/data/searchdb/index.html

@@ -1,8 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-</head>
-<body>
-<br />
-</body>
-</html>

+ 1 - 2
custompages/registration.php

@@ -12,8 +12,7 @@
  */
 require_once('language.php');
 require_once('../inc/global.inc.php');
-require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
-require_once api_get_path(CONFIGURATION_PATH).'profile.conf.php';
+
 /**
  * Removes some unwanted elementend of the form object
  */

+ 0 - 2
main/admin/configure_inscription.php

@@ -12,8 +12,6 @@ require_once '../inc/global.inc.php';
 
 api_protect_admin_script();
 
-require_once api_get_path(CONFIGURATION_PATH).'profile.conf.php';
-
 // Load terms & conditions from the current lang
 if (get_setting('allow_terms_conditions') == 'true') {
     $get = array_keys($_GET);

+ 33 - 34
main/admin/event_type.php

@@ -12,7 +12,6 @@ $language_file = array('admin');
 $cidReset = true;
 
 require_once '../inc/global.inc.php';
-require_once '../inc/conf/events.conf.php';
 $this_section = SECTION_PLATFORM_ADMIN;
 
 api_protect_admin_script();
@@ -35,10 +34,10 @@ if ($action == 'modEventType') {
         $users = explode(';', $eventUsers);
     } else {
         $users = array();
-    }        
+    }
     if (!empty($event_name)) {
         $eventName = $event_name;
-    }    
+    }
     save_event_type_message($eventName, $users, $eventMessage, $eventSubject, $eventMessageLanguage, $activated);
     header('location: event_controller.php');
     exit;
@@ -64,7 +63,7 @@ foreach ($users as $user) {
 
 /**
  * Header definition
- */ 
+ */
 $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
 $interbreadcrumb[] = array('url' => 'event_controller.php', 'name' => get_lang('Events'));
 $tool_name = get_lang('EventMessageManagement');
@@ -84,16 +83,16 @@ echo Display::actions($action_array);
     var eventsConfig = <?php echo json_encode($event_config) ?>;
     var currentLanguage = <?php echo json_encode(api_get_interface_language()) ?>;
     var flagContentHasChanged = false;
-    var key_lang = "<?php echo $key_lang ?>";    
+    var key_lang = "<?php echo $key_lang ?>";
     var event_type_name = "<?php echo $event_name ?>";
-    
-    $(document).ready(function() {        
+
+    $(document).ready(function() {
         confirmMessage("eventList");
         if (event_type_name != 0) {
             $("#event_list_group").hide();
         }
     });
-    
+
     function ajax(params,func) {
         $.ajax({
             url: "<?php echo $ajaxPath ?>",
@@ -103,27 +102,27 @@ echo Display::actions($action_array);
         });
     }
 
-    function refreshUsersList() {    
+    function refreshUsersList() {
         removeAllOption($('#usersList'));
-        $.each(usersList, function(ind,item) {              
+        $.each(usersList, function(ind,item) {
             addOption($('#usersList'), item.user_id, item.firstname + ' '+item.lastname);
-        });        
+        });
     }
 
     function getCurrentEventTypeName() {
         var name = false;
-        
+
         if (event_type_name != 0) {
             return event_type_name;
         } else {
             return $('#eventList option:selected').first().attr('value');
         }
-        
+
     }
-    
+
     function self_sent_lock(self_sent) {
         if (self_sent == true) {
-            $(".registration_case").show();        
+            $(".registration_case").show();
             $("#usersList").attr('disabled', 'true');
             $("#usersSubList").attr('disabled', 'true');
             removeAllOption($('#usersSubList'));
@@ -135,17 +134,17 @@ echo Display::actions($action_array);
     }
 
     function showEventType() {
-        cleanInput();        
+        cleanInput();
         currentEventName = getCurrentEventTypeName();
-        
+
         $("span#activated_checkbox").css("display", "inline"); // make checkbox visible
         $('input[name=activated]').attr('checked', false);
-        
-        var self_sent = false;        
+
+        var self_sent = false;
 
         if (typeof(eventsConfig[currentEventName])!='undefined') {
             // if registration, only sent to self_user
-            if (eventsConfig[currentEventName].self_sent == true) {                
+            if (eventsConfig[currentEventName].self_sent == true) {
                 self_sent = true;
             }
         }
@@ -180,9 +179,9 @@ echo Display::actions($action_array);
                 $('#keys').append('<li>'+key+'</li>');
             });
         }
-        
+
         if (self_sent == false ) {
-        
+
             $.ajax({
                 url: '<?php echo $ajaxPath ?>?action=get_event_users&eventName=' +currentEventName,
                 dataType: 'json',
@@ -190,8 +189,8 @@ echo Display::actions($action_array);
                     removeAllOption($('#usersSubList'));
                     refreshUsersList();
                     usersIds = new Array();
-                    var json = jQuery.parseJSON(data);                
-                    $.each(json, function(ind,item) {                    
+                    var json = jQuery.parseJSON(data);
+                    $.each(json, function(ind,item) {
                         addOption($('#usersSubList'),item.user_id, item.firstname + ' '+item.lastname);
                         usersIds[ind] = item.value;
                         removeOption($('#usersList'),item.user_id);
@@ -224,7 +223,7 @@ echo Display::actions($action_array);
         select.find('option[value='+value+']').remove();
     }
 
-    function removeAllOption(select) {          
+    function removeAllOption(select) {
         select.find('option').remove();
     }
 
@@ -267,8 +266,8 @@ echo Display::actions($action_array);
     /**
      * Asks if user want to abandon the changes he's done
      */
-    function confirmMessage(sender) {   
-        
+    function confirmMessage(sender) {
+
         if (flagContentHasChanged == true) {
             if (confirm(key_lang)) {
                 flagContentHasChanged = false;
@@ -308,23 +307,23 @@ echo Display::actions($action_array);
 
 <form method="POST" onSubmit="return submitForm(); ">
     <div class="row">
-        
+
     <div class="span12" id="event_list_group">
-        <h4><?php echo get_lang('Events'); ?></h4>       
+        <h4><?php echo get_lang('Events'); ?></h4>
         <select class="span6" multiple="1" id="eventList" onchange="confirmMessage(this.name); return false;" name="eventList">
         <?php
         foreach ($event_config as $key => $config) {
             echo '<option value="' . $key . '">' . $config['name_lang_var'] . '</option>';
         }
         ?>
-        </select>        
+        </select>
     </div>
-        
+
     <div class="span4">
         <h4><?php echo get_lang('Users'); ?></h4>
         <select multiple="1" id="usersList" class="span3 registration_case"></select>
     </div>
-    <div class="span4">          
+    <div class="span4">
         <div class="registration_case">
             <button class="arrowr" onclick='moveUsers($("#usersList"),$("#usersSubList")); return false;'></button>
             <br />
@@ -336,13 +335,13 @@ echo Display::actions($action_array);
         <h4><?php echo get_lang('ToBeWarnedUserList'); ?></h4>
         <select class="span3" multiple="1" id="usersSubList" class="registration_case"></select>
     </div>
-    </div>    
+    </div>
 
     <br />
     <h2 id="eventNameTitle"></h2>
         <span id="activated_checkbox">
             <input type="checkbox" name="activated" value="1" />
-            <label for="activated" style="display:inline;"><?php echo get_lang('ActivateEvent'); ?></label>        
+            <label for="activated" style="display:inline;"><?php echo get_lang('ActivateEvent'); ?></label>
         </span>
     <br />
     <select id="languages" name="languages" style="margin-top:20px;" onclick='confirmMessage(this.name); return false;'>

+ 1 - 1
main/auth/external_login/facebook.inc.php

@@ -1,7 +1,7 @@
 <?php
 
 /**
- * Licence: GPL 
+ * Licence: GPL
  * Please contact CBlue regarding any licences issues.
  * Author: noel@cblue.be
  *  Copyright: CBlue SPRL, 20XX

+ 5 - 2
main/auth/external_login/facebook.init.php

@@ -8,18 +8,21 @@
  *
  * External login module : FACEBOOK
  *
- * Configuration file 
+ * Configuration file
  * Please edit this file to match with your FACEBOOK settings
  * */
 /**
  * Facebook application setting
  * */
+
+require_once dirname(__FILE__) . '/../../inc/global.inc.php';
+
 require_once dirname(__FILE__) . '/facebook-php-sdk/src/facebook.php';
 
 global $facebook_config;
 
 //Loads the portal facebook settings
-$conf = dirname(__FILE__) . '../../inc/conf/auth.conf.php';
+//$conf = dirname(__FILE__) . '../../inc/conf/auth.conf.php';
 
 /**
  * See facebook section of the auth.conf.php file

+ 6 - 7
main/auth/external_login/ldap.inc.php

@@ -1,19 +1,18 @@
 <?php
 
-// External login module : LDAP 
+// External login module : LDAP
 /**
  * This files is included by newUser.ldap.php and login.ldap.php
  * It implements the functions nedded by both files
  * */
 //Includes the configuration file
 require_once dirname(__FILE__) . '/../../inc/global.inc.php';
-require_once dirname(__FILE__) . '/../../inc/conf/auth.conf.php';
 
 /**
  * Returns a transcoded and trimmed string
  *
- * @param string 
- * @return string 
+ * @param string
+ * @return string
  * @author ndiechburg <noel@cblue.be>
  * */
 function extldap_purify_string($string) {
@@ -76,9 +75,9 @@ function extldap_connect() {
  *
  * @return mixed false if user cannot authenticate on ldap, user ldap entry if tha succeeds
  * @author ndiechburg <noel@cblue.be>
- * Modified by hubert.borderiou@grenet.fr 
+ * Modified by hubert.borderiou@grenet.fr
  * Add possibility to get user info from LDAP without check password (if CAS auth and LDAP profil update)
- * 
+ *
  * */
 function extldap_authenticate($username, $password, $in_auth_with_no_password = false) {
     global $extldap_config;
@@ -182,7 +181,7 @@ function extldap_get_chamilo_user($ldap_user, $cor = null) {
 
 /**
  * Please declare here all the function you use in extldap_user_correspondance
- * All these functions must have an $ldap_user parameter. This parameter is the 
+ * All these functions must have an $ldap_user parameter. This parameter is the
  * array returned by the ldap for the user
  * */
 

+ 2 - 2
main/auth/external_login/ldap_import_all_users.php

@@ -2,7 +2,7 @@
 /* For licensing terms, see /license.txt */
 /**
  * This script executes the importation of all users in the LDAP repository
- * into Chamilo 
+ * into Chamilo
  * @package chamilo.auth.ldap
  */
 /**
@@ -15,7 +15,7 @@ use \ChamiloSession as Session;
 
 require dirname(__FILE__) . '/../../inc/global.inc.php';
 require dirname(__FILE__) . '/ldap.inc.php';
-require dirname(__FILE__) . '/../../inc/conf/auth.conf.php';
+
 /**
  * Code execution
  */

+ 0 - 1
main/auth/inscription.php

@@ -14,7 +14,6 @@ if (!empty($_POST['language'])) { //quick hack to adapt the registration form re
     $_GET['language'] = $_POST['language'];
 }
 require_once '../inc/global.inc.php';
-require_once api_get_path(CONFIGURATION_PATH).'profile.conf.php';
 
 if (api_get_setting('allow_registration') === 'false') {
     api_not_allowed(true);

+ 5 - 7
main/auth/openid/login.php

@@ -13,8 +13,6 @@
 /**
  * Initialisation
  */
-require_once api_get_path(CONFIGURATION_PATH) . 'auth.conf.php';
-
 require_once 'openid.lib.php';
 require_once 'xrds.lib.php';
 
@@ -28,7 +26,7 @@ function openid_form() {
       return '<label for="openid_url">'.get_lang('OpenIDURL').' <a href="main/auth/openid/whatis.php" title="'.get_lang('OpenIDWhatIs').'">'.Display::return_icon('info3.gif',get_lang('Info')).'</a></label>
       <input type="text" id="openid_url" name="openid_url" style="background: url(main/img/openid_small_logo.png) no-repeat; background-color: #fff; background-position: 0 50%; padding-left:18px;" value="http://"></input>
      * <input type="submit" name="openid_login" value="'.get_lang('Enter').'" /><br /><br /></form></div>';
-     * 
+     *
      */
 }
 
@@ -45,7 +43,7 @@ function openid_form() {
 function openid_begin($claimed_id, $return_to = '', $form_values = array()) {
 
     $claimed_id = _openid_normalize($claimed_id);
-    $services = openid_discovery($claimed_id);    
+    $services = openid_discovery($claimed_id);
     if (count($services) == 0) {
         echo 'Sorry, that is not a valid OpenID. Please ensure you have spelled your ID correctly.';
         return;
@@ -63,14 +61,14 @@ function openid_begin($claimed_id, $return_to = '', $form_values = array()) {
     $assoc_handle = '';
     if (function_exists('bcadd')) {
         $assoc_handle = openid_association($op_endpoint);
-    }    
+    }
     // Now that there is an association created, move on
     // to request authentication from the IdP
     $identity = (!empty($services[0]['delegate'])) ? $services[0]['delegate'] : $claimed_id;
     if (isset($services[0]['types']) && is_array($services[0]['types']) && in_array(OPENID_NS_2_0 . '/server', $services[0]['types'])) {
         $identity = 'http://openid.net/identifier_select/2.0';
     }
-    $authn_request = openid_authentication_request($claimed_id, $identity, $return_to, $assoc_handle, $services[0]['version']);    
+    $authn_request = openid_authentication_request($claimed_id, $identity, $return_to, $assoc_handle, $services[0]['version']);
     if ($services[0]['version'] == 2) {
         echo openid_redirect($op_endpoint, $authn_request);
     } else {
@@ -185,7 +183,7 @@ function openid_discovery($claimed_id) {
  * @return $assoc_handle The association handle.
  */
 function openid_association($op_endpoint) {
-    //@todo Remove Old Associations:  
+    //@todo Remove Old Associations:
     $openid_association = Database::get_main_table(TABLE_MAIN_OPENID_ASSOCIATION);
     $sql = "DELETE FROM $openid_association WHERE created + expires_in < '" . api_get_utc_datetime() . "'";
     Database::query($sql);

+ 0 - 3
main/auth/profile.php

@@ -94,9 +94,6 @@ if (api_get_setting('allow_message_tool') == 'true') {
 EOF;
 }
 
-//	Configuration file
-require_once api_get_path(CONFIGURATION_PATH).'profile.conf.php';
-
 // Libraries
 $tool_name = is_profile_editable() ? get_lang('ModifProfile') : get_lang('ViewProfile');
 $table_user = Database :: get_main_table(TABLE_MAIN_USER);

+ 0 - 3
main/course_info/infocours.php

@@ -5,9 +5,6 @@
  *	Code to display the course settings form (for the course admin)
  *	and activate the changes.
  *
- *	See ./inc/conf/course_info.conf.php for settings
- * @todo Move $canBeEmpty from course_info.conf.php to config-settings
- * @todo Take those config settings into account in this script
  * @author Patrick Cool <patrick.cool@UGent.be>
  * @author Roan Embrechts, refactoring and improved course visibility|subscribe|unsubscribe options
  * @author Julio Montoya <gugli100@gmail.com> Jquery support + lots of fixes

+ 62 - 42
main/inc/global.inc.php

@@ -18,35 +18,12 @@
  *
  */
 
-// Determine the directory path for this file.
-$includePath = dirname(__FILE__);
-
-// Include the main Chamilo platform configuration file.
-$configurationFilePath = $includePath.'/conf/configuration.php';
-$configurationYMLFile = $includePath.'/conf/configuration.yml';
-
-$alreadyInstalled = false;
-if (file_exists($configurationFilePath) || file_exists($configurationYMLFile)) {
-    if (file_exists($configurationFilePath)) {
-        require_once $configurationFilePath;
-    }
-    $alreadyInstalled = true;
-} else {
-    $_configuration = array();
-}
-
-// Include the main Chamilo platform library file.
-require_once $includePath.'/lib/main_api.lib.php';
-
-// Do not over-use this variable. It is only for this script's local use.
-$libPath = $includePath.'/lib/';
-
 // Fix bug in IIS that doesn't fill the $_SERVER['REQUEST_URI'].
 //@todo not sure if this is needed any more
 //api_request_uri();
 
 // This is for compatibility with MAC computers.
-ini_set('auto_detect_line_endings', '1');
+//ini_set('auto_detect_line_endings', '1');
 
 //Composer autoloader
 require_once __DIR__.'../../../vendor/autoload.php';
@@ -55,12 +32,35 @@ require_once __DIR__.'../../../vendor/autoload.php';
 use Silex\Application;
 use Symfony\Component\HttpFoundation\RedirectResponse;
 use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\HttpKernel\Exception\HttpException;
 use Symfony\Component\Yaml\Parser;
 
 $app = new Application();
 
 //@todo add a helper to read the configuration file once!
+// Reading configuration file from main/inc/conf or app/config
+
+// Determine the directory path for this file.
+$includePath = dirname(__FILE__);
+
+// Include the main Chamilo platform configuration file.
+$configurationFilePath = $includePath.'/conf/configuration.php';
+$configurationYMLFile = $includePath.'/../../app/config/configuration.yml';
+$configurationFileAppPath = $includePath.'/../../app/config/configuration.php';
+
+$alreadyInstalled = false;
+if (file_exists($configurationFilePath) || file_exists($configurationYMLFile)  || file_exists($configurationFileAppPath)) {
+    if (file_exists($configurationFilePath)) {
+        require_once $configurationFilePath;
+    }
+
+    if (file_exists($configurationFileAppPath)) {
+        $configurationFilePath = $configurationFileAppPath;
+        require_once $configurationFileAppPath;
+    }
+    $alreadyInstalled = true;
+} else {
+    $_configuration = array();
+}
 
 //Overwriting $_configuration
 if (file_exists($configurationYMLFile)) {
@@ -75,6 +75,40 @@ if (file_exists($configurationYMLFile)) {
     }
 }
 
+// End reading configuration file
+
+// Loading config files
+
+if ($alreadyInstalled) {
+    $configPath = $includePath.'../../app/config/';
+
+    $confFiles = array(
+        'auth.conf.php',
+        'events.conf.php',
+        'mail.conf.php',
+        'portfolio.conf.php',
+        'profile.conf.php'
+    );
+
+    foreach ($confFiles as $confFile) {
+        if (file_exists($configPath.$confFile)) {
+            require $configPath.$confFile;
+        }
+    }
+
+    //Fixes bug in Chamilo 1.8.7.1 array was not set
+    $administrator['email'] = isset($administrator['email']) ? $administrator['email'] : 'admin@example.com';
+    $administrator['name'] = isset($administrator['name']) ? $administrator['name'] : 'Admin';
+
+}
+
+// Include the main Chamilo platform library file.
+require_once $includePath.'/lib/main_api.lib.php';
+
+// Do not over-use this variable. It is only for this script's local use.
+$libPath = $includePath.'/lib/';
+
+
 /*
 $settingsFile = __DIR__."/../../app/config/settings.yml";
 $app->register(new Igorw\Silex\ConfigServiceProvider($settingsFile, array(
@@ -84,14 +118,14 @@ $app->register(new Igorw\Silex\ConfigServiceProvider($settingsFile, array(
 
 // Ensure that _configuration is in the global scope before loading
 // main_api.lib.php. This is particularly helpful for unit tests
-if (!isset($GLOBALS['_configuration'])) {
+/*if (!isset($GLOBALS['_configuration'])) {
     $GLOBALS['_configuration'] = $_configuration;
-}
+}*/
 
 // Add the path to the pear packages to the include path
 ini_set('include_path', api_create_include_path_setting());
 
-// Code for trnasitional purposes, it can be removed right before the 1.8.7 release.
+// Code for transitional purposes, it can be removed right before the 1.8.7 release.
 if (empty($_configuration['system_version'])) {
     $_configuration['system_version'] = (!empty($_configuration['dokeos_version']) ? $_configuration['dokeos_version'] : '');
     $_configuration['system_stable'] = (!empty($_configuration['dokeos_stable']) ? $_configuration['dokeos_stable'] : '');
@@ -586,20 +620,6 @@ $app['this_section'] = SECTION_GLOBAL;
 // include the local (contextual) parameters of this course or section
 require $includePath.'/local.inc.php';
 
-//Include Chamilo Mail conf this is added here because the api_get_setting works
-
-//Fixes bug in Chamilo 1.8.7.1 array was not set
-$administrator['email'] = isset($administrator['email']) ? $administrator['email'] : 'admin@example.com';
-$administrator['name'] = isset($administrator['name']) ? $administrator['name'] : 'Admin';
-
-//Including mail settings
-if ($alreadyInstalled) {
-    $mail_conf = api_get_path(CONFIGURATION_PATH).'mail.conf.php';
-    if (file_exists($mail_conf)) {
-        require_once $mail_conf;
-    }
-}
-
 //Adding web profiler
 if (is_writable($app['cache.path'])) {
     //if ($app['debug']) {

+ 10 - 11
main/inc/lib/events_dispatcher.class.php

@@ -1,22 +1,21 @@
 <?php
-include_once api_get_path(CONFIGURATION_PATH).'events.conf.php';
 
 /**
- * 
- * Entry point for every event in the application. 
+ *
+ * Entry point for every event in the application.
  * Fires the functions linked to the events according to the event's conf.
  * Every function got its own filter, it's fired inside the functiones fired
  * by this class. The filter config is next to the event config, in conf/events.conf.php
- *  
+ *
  */
-class EventsDispatcher 
+class EventsDispatcher
 {
     public static function events($event_name, $event_data = array())
     {
         global $event_config;
         // get the config for the event passed in parameter ($event_name)
         // and execute every actions with the values
-        
+
         foreach ($event_config[$event_name]["actions"] as $func) {
             $execute = true;
             if (!function_exists($func)) // if the function doesn't exist, we log
@@ -24,12 +23,12 @@ class EventsDispatcher
                 error_log("EventsDispatcher warning : ".$func." does not exist.");
                 $execute = false;
             }
-            
+
             // check if the event's got a filter
-            if (function_exists($event_name."_".$func."_filter_func")) 
+            if (function_exists($event_name."_".$func."_filter_func"))
             {
                 $filter = $event_name."_".$func."_filter_func";
-                // if it does, we execute the filter (which changes the data 
+                // if it does, we execute the filter (which changes the data
                 // in-place and returns true on success or false on error)
                 $execute = $filter($event_data);
             }
@@ -42,8 +41,8 @@ class EventsDispatcher
             {
                 return false;
             }
-            // finally, if the filter says yes (or the filter doesn't exist), 
-            // we execute the in-between function that will call the needed 
+            // finally, if the filter says yes (or the filter doesn't exist),
+            // we execute the in-between function that will call the needed
             // function
             $func($event_name, $event_data);
         }

+ 1 - 4
main/inc/lib/group_portal_manager.lib.php

@@ -705,7 +705,7 @@ class GroupPortalManager
 
 	/**
 	 * Creates new group pictures in various sizes of a user, or deletes user pfotos.
-	 * Note: This method relies on configuration setting from dokeos/main/inc/conf/profile.conf.php
+	 * Note: This method relies on configuration setting from main/inc/conf/profile.conf.php
 	 * @param	int	The group id
 	 * @param	string $file			The common file name for the newly created pfotos. It will be checked and modified for compatibility with the file system.
 	 * If full name is provided, path component is ignored.
@@ -725,9 +725,6 @@ class GroupPortalManager
 			$source_file = $file;
 		}
 
-		// Configuration options about user photos.
-		require_once api_get_path(CONFIGURATION_PATH).'profile.conf.php';
-
 		// User-reserved directory where photos have to be placed.
 		$path_info = self::get_group_picture_path_by_id($group_id, 'system', true);
 		$path = $path_info['dir'];

+ 6 - 1
main/inc/lib/main_api.lib.php

@@ -595,6 +595,7 @@ function api_get_path($path_type, $path = null) {
         $paths[WEB_PATH]                = $root_web;
         $paths[WEB_PUBLIC_PATH]         = $root_web."web/";
         $paths[SYS_PATH]                = $root_sys;
+        $paths[SYS_PATH_APP]            = $root_sys.'app/';
         $paths[REL_PATH]                = $root_rel;
         $paths[WEB_SERVER_ROOT_PATH]    = $server_base_web.'/';
         $paths[SYS_SERVER_ROOT_PATH]    = $server_base_sys.'/';
@@ -1487,7 +1488,7 @@ function api_format_course_array($course_data) {
     //@todo should be deprecated
     $_course['dbName'       ]         = $course_data['db_name'        ]; // Use as key in db list.
     $_course['db_name'      ]         = $course_data['db_name'         ];
-    $_course['dbNameGlu'    ]         = $_configuration['table_prefix'] . $course_data['db_name'] . $_configuration['db_glue']; // Use in all queries.
+    //$_course['dbNameGlu'    ]         = $_configuration['table_prefix'] . $course_data['db_name'] . $_configuration['db_glue']; // Use in all queries.
 
     $_course['titular'      ]         = $course_data['tutor_name'     ];
     $_course['language'     ]         = $course_data['course_language'];
@@ -6808,6 +6809,10 @@ function api_get_language_interface() {
     return $language_interface;
 }
 
+function getConfigurationArray($confPath) {
+
+
+}
 
 function api_get_default_course_document()
 {

+ 68 - 68
main/inc/lib/portfolio.class.php

@@ -2,8 +2,8 @@
 /* For licensing terms, see /license.txt */
 /*
  * This file contains several classes related to portfolios management to avoid
- * having too much files under the lib/. 
- * 
+ * having too much files under the lib/.
+ *
  * Once external libraries are moved to their own directory it would be worth
  * moving them to their own files under a common portfolio directory.
  * @package chamilo.portfolio
@@ -16,19 +16,19 @@ use Model\Course;
 
 /**
  * A portfolio is used to present content to other people. In most cases it is
- * an external application. 
- * 
+ * an external application.
+ *
  * From the application point of view it is an end point to which the user can send
  * content.
- * 
+ *
  * Available portfolios are configured in /main/inc/config/portfolio.conf.php
- * 
+ *
  * The Portfolio class serves as an entry point to other portfolio components:
- * 
+ *
  *      - portfolio controller
  *      - portfolio share button
  *      - portfolio action
- * 
+ *
  * Note:
  * @author Laurent Opprecht <laurent@opprecht.info> for the Univesity of Geneva
  */
@@ -38,12 +38,12 @@ class Portfolio
 
     /**
      * Returns all portfolios available
-     * 
+     *
      * @return array
      */
     public static function all()
     {
-        $conf = Chamilo::path('/main/inc/conf/portfolio.conf.php');
+        $conf = Chamilo::path('/app/config/portfolio.conf.php');
         if (!is_readable($conf)) {
             return array();
         }
@@ -53,7 +53,7 @@ class Portfolio
 
     /**
      * Returns a portfolio from its name.
-     * 
+     *
      * @param string $name
      * @return Portfolio\Portfolio
      */
@@ -70,8 +70,8 @@ class Portfolio
 
     /**
      * True if portfolios are enabled. False otherwise.
-     * 
-     * @return boolean 
+     *
+     * @return boolean
      */
     public static function is_enabled()
     {
@@ -91,8 +91,8 @@ class Portfolio
 
     /**
      * The controller for portfolio.
-     * 
-     * @return \PortfolioController 
+     *
+     * @return \PortfolioController
      */
     public static function controller()
     {
@@ -101,11 +101,11 @@ class Portfolio
 
     /**
      * Returns a share component/button.
-     * 
+     *
      * @param string $tool
      * @param int $id
      * @param array $attributes
-     * @return \PortfolioShare 
+     * @return \PortfolioShare
      */
     public static function share($tool, $id, $attributes = array())
     {
@@ -114,8 +114,8 @@ class Portfolio
 
     /**
      * Returns the list of actions.
-     * 
-     * @return array 
+     *
+     * @return array
      */
     public static function actions()
     {
@@ -124,9 +124,9 @@ class Portfolio
 
     /**
      * Returns a temporary url to download files and/or folders.
-     * 
+     *
      * @param string|array $ids
-     * @return string 
+     * @return string
      */
     public static function download_url($ids, $tool)
     {
@@ -143,14 +143,14 @@ class Portfolio
 
 /**
  * The portfolio controller. Responsible to dispatch/process portfolio actions.
- * 
+ *
  * Usage:
- * 
+ *
  *      if(Porfolio::contoller()->accept()){
  *          Portfolio::controller()->run();
  *      }
- * 
- * 
+ *
+ *
  */
 class PortfolioController
 {
@@ -166,7 +166,7 @@ class PortfolioController
 
     /**
      *
-     * @return \PortfolioController 
+     * @return \PortfolioController
      */
     static function instance()
     {
@@ -181,7 +181,7 @@ class PortfolioController
 
     protected function __construct()
     {
-        
+
     }
 
     public static function portfolios()
@@ -190,9 +190,9 @@ class PortfolioController
     }
 
     /**
-     * List of actions for the SortableTable. 
-     * 
-     * @return array 
+     * List of actions for the SortableTable.
+     *
+     * @return array
      */
     public static function actions()
     {
@@ -216,10 +216,10 @@ class PortfolioController
     }
 
     /**
-     * Returns true if the controller accept to process the current request. 
+     * Returns true if the controller accept to process the current request.
      * Returns false otherwise.
-     * 
-     * @return boolean 
+     *
+     * @return boolean
      */
     function accept()
     {
@@ -249,8 +249,8 @@ class PortfolioController
 
     /**
      * Returns the value of the current controller request parameters. That is
-     * the name of the controller which shall handle the current request. 
-     * 
+     * the name of the controller which shall handle the current request.
+     *
      * @return string
      */
     function get_controller()
@@ -261,8 +261,8 @@ class PortfolioController
     /**
      * Returns the value of the action parameter. That is which action shall be
      * performed. That is share to send an object to a portfolio.
-     * 
-     * @return string 
+     *
+     * @return string
      */
     function get_action()
     {
@@ -272,7 +272,7 @@ class PortfolioController
 
     /**
      * Returns the value of the id parameter: id of object to send.
-     * 
+     *
      * @return int
      */
     function get_id()
@@ -282,7 +282,7 @@ class PortfolioController
 
     /**
      * The course code (id) to which the object belongs.
-     * 
+     *
      * @return string
      */
     function course_code()
@@ -292,8 +292,8 @@ class PortfolioController
 
     /**
      * The name of the porfolio where to send.
-     * 
-     * @return type 
+     *
+     * @return type
      */
     function get_portfolio()
     {
@@ -302,9 +302,9 @@ class PortfolioController
 
     /**
      * Name of the tool: document, work, etc. Defaults to current_course_tool.
-     * 
+     *
      * @global string $current_course_tool
-     * @return string 
+     * @return string
      */
     function get_tool()
     {
@@ -322,12 +322,12 @@ class PortfolioController
     }
 
     /**
-     * Execute the controller action as required. If a registered action accept 
+     * Execute the controller action as required. If a registered action accept
      * the current request the controller calls it.
-     * 
+     *
      * If not action is accept the current request and current action is "share"
      * the controller execute the "send to portfolio" action
-     * 
+     *
      * @return PortfolioController
      */
     function run()
@@ -373,28 +373,28 @@ class PortfolioController
 
 /**
  * This component is used to display a "send to portfolio" button for a specific
- * object. 
- * 
- * Note that the component implement the __toString() magic method and can be 
+ * object.
+ *
+ * Note that the component implement the __toString() magic method and can be
  * therefore used in situation where a string is expected: for ex echo $button.
- * 
+ *
  * Usage
- * 
+ *
  *      $button = Portfolio::share(...);
  *      echo $button;
- * 
+ *
  */
 class PortfolioShare
 {
 
     /**
      * Create a "send to portfolio" button
-     * 
+     *
      * @param string $tool          The name of the tool: document, work.
      * @param int $c_id             The id of the course
-     * @param int $id               The id of the object 
+     * @param int $id               The id of the object
      * @param array $attributes     Html attributes
-     * @return \PortfolioShare  
+     * @return \PortfolioShare
      */
     static function factory($tool, $id, $attributes = array())
     {
@@ -404,8 +404,8 @@ class PortfolioShare
 
     /**
      * Returns the current secuirty token. Used to avoid see surfing attacks.
-     * 
-     * @return type 
+     *
+     * @return type
      */
     static function security_token()
     {
@@ -446,8 +446,8 @@ class PortfolioShare
     }
 
     /**
-     * Html attributes. 
-     * 
+     * Html attributes.
+     *
      * @return array
      */
     function get_attributes()
@@ -457,7 +457,7 @@ class PortfolioShare
 
     /**
      * Name of the tool. I.e. the type of the id parameter. Can be document, work.
-     * 
+     *
      * @return string
      */
     function get_tool()
@@ -467,8 +467,8 @@ class PortfolioShare
 
     /**
      * Display the component.
-     * 
-     * @return string 
+     *
+     * @return string
      */
     function display()
     {
@@ -522,15 +522,15 @@ class PortfolioShare
 }
 
 /**
- * A "send to this portfolio" action. Actions are used by the SortableTable to 
+ * A "send to this portfolio" action. Actions are used by the SortableTable to
  * perform actions on a set of objects. An action is composed of
- * 
+ *
  *      - a name
  *      - a title (displayed to the user)
  *      - code to execute
- * 
+ *
  * Usage:
- * 
+ *
  *       $form_actions = array();
  *       $form_action['...'] = get_lang('...');
  *       $portfolio_actions = Portfolio::actions();
@@ -538,7 +538,7 @@ class PortfolioShare
  *           $form_action[$action->get_name()] = $action->get_title();
  *       }
  *       $table->set_form_actions($form_action, 'path');
- * 
+ *
  * @see SortableTable
  */
 class PortfolioBulkAction
@@ -560,7 +560,7 @@ class PortfolioBulkAction
 
     /**
      *
-     * @param \Portfolio\Portfolio $portfolio 
+     * @param \Portfolio\Portfolio $portfolio
      */
     public function __construct($portfolio)
     {

+ 2 - 5
main/inc/lib/usermanager.lib.php

@@ -1251,7 +1251,7 @@ class UserManager {
 
     /**
      * Creates new user pfotos in various sizes of a user, or deletes user pfotos.
-     * Note: This method relies on configuration setting from dokeos/main/inc/conf/profile.conf.php
+     * Note: This method relies on configuration setting from main/inc/conf/profile.conf.php
      * @param     int $user_id        The user internal identitfication number.
      * @param     string $file        The common file name for the newly created pfotos.
      *                                 It will be checked and modified for compatibility with the file system.
@@ -1271,9 +1271,6 @@ class UserManager {
             $source_file = $file;
         }
 
-        // Configuration options about user photos.
-        require_once api_get_path(CONFIGURATION_PATH).'profile.conf.php';
-
         // User-reserved directory where photos have to be placed.
         $path_info = self::get_user_picture_path_by_id($user_id, 'system', true);
         $path = $path_info['dir'];
@@ -1348,7 +1345,7 @@ class UserManager {
 
     /**
      * Deletes user pfotos.
-     * Note: This method relies on configuration setting from dokeos/main/inc/conf/profile.conf.php
+     * Note: This method relies on configuration setting from main/inc/conf/profile.conf.php
      * @param int $user_id            The user internal identitfication number.
      * @return string/bool            Returns empty string on success, FALSE on error.
      */

+ 5 - 27
main/install/index.php

@@ -27,8 +27,6 @@ define('MAX_FORM_FIELD_LENGTH', 80);
 
 require_once '../inc/global.inc.php';
 
-require_once __DIR__.'../../../vendor/autoload.php';
-
 require_once __DIR__.'/version.php';// A protection measure for already installed systems.
 
 require_once 'install.lib.php';
@@ -131,13 +129,12 @@ if (!empty($_POST['old_version'])) {
 } elseif (!empty($dokeos_version)) { //variable coming from installedVersion, normally
     $my_old_version = $dokeos_version;
 }
-
-
+/*
 if (is_already_installed_system()) {
     // The system has already been installed, so block re-installation.
     header("Location: ".api_get_path(WEB_PATH));
     exit;
-}
+}*/
 
 /*		STEP 1 : INITIALIZES FORM VARIABLES IF IT IS THE FIRST VISIT */
 
@@ -211,7 +208,7 @@ if (@$_POST['step2_install'] || @$_POST['step2_update_8'] || @$_POST['step2_upda
 
 if ($installType == 'update' && in_array($my_old_version, $update_from_version_8)) {
     // This is the main configuration file of the system before the upgrade.
-    include api_get_path(CONFIGURATION_PATH).'configuration.php'; // Don't change to include_once
+    //include api_get_path(CONFIGURATION_PATH).'configuration.php'; // Don't change to include_once
 }
 
 if (!isset($_GET['running'])) {
@@ -773,27 +770,7 @@ if (@$_POST['step2']) {
         <?php echo get_lang('MainDB').' : <strong>'.$dbNameForm; ?></strong>
 
     <?php
-    if (!$singleDbForm) {
-        //Showing this data only in case a user migrates from a 3 main databases (main, user, tracking)
-        //@todo should be removed
-        if ($installType == 'update') {
-            echo '<br />';
-            echo get_lang('StatDB').' : <strong>'.$dbStatsForm.'</strong>';
-            if ($installType == 'new') {
-                echo ' (<font color="#cc0033">'.get_lang('ReadWarningBelow').'</font>)';
-            }
-            echo '<br />';
-            echo get_lang('UserDB').' : <strong>'.$dbUserForm.'</strong>';
-            if ($installType == 'new') {
-                echo ' (<font color="#cc0033">'.get_lang('ReadWarningBelow').'</font>)';
-            }
-            echo '<br />';
-        }
-    }
-
-    //echo get_lang('EnableTracking').' : '.($enableTrackingForm ? get_lang('Yes') : get_lang('No')); ?>
-    <?php //echo get_lang('SingleDb').' : '.($singleDbForm ? get_lang('One') : get_lang('Several')); ?><br/><br/>
-    <?php echo get_lang('AllowSelfReg').' : '.($allowSelfReg ? get_lang('Yes') : get_lang('No')); ?><br/>
+    echo get_lang('AllowSelfReg').' : '.($allowSelfReg ? get_lang('Yes') : get_lang('No')); ?><br/>
     <?php echo get_lang('EncryptMethodUserPass').' : ';
     echo $encryptPassForm;
     ?>
@@ -968,6 +945,7 @@ if (@$_POST['step2']) {
             default:
                 break;
         }
+        movingFilesInAppFolder();
     } else {
         set_file_folder_permissions();
         database_server_connect();

+ 51 - 172
main/install/install.lib.php

@@ -34,14 +34,12 @@ function is_already_installed_system()
         return true; // Must be initialized.
     }
 
-    $current_config_file = api_get_path(CONFIGURATION_PATH).'configuration.php';
-
-    if (!file_exists($current_config_file) && !file_exists(api_get_path(CONFIGURATION_PATH).'configuration.yml')) {
-        return false; // Configuration file does not exist, install the system.
+    if (empty($_configuration)) {
+        return false;
     }
-    require $current_config_file;
 
     $current_version = null;
+
     if (isset($_configuration['dokeos_version'])) {
         $current_version = trim($_configuration['dokeos_version']);
     }
@@ -364,19 +362,21 @@ function write_system_config_file($path)
     $fp = @ fopen($path, 'w');
 
     if (!$fp) {
-        echo '<strong><font color="red">Your script doesn\'t have write access to the config directory</font></strong><br />
-                        <em>('.str_replace('\\', '/', realpath($path)).')</em><br /><br />
-                        You probably do not have write access on Chamilo root directory,
-                        i.e. you should <em>CHMOD 777</em> or <em>755</em> or <em>775</em>.<br /><br />
-                        Your problems can be related on two possible causes:<br />
-                        <ul>
-                          <li>Permission problems.<br />Try initially with <em>chmod -R 777</em> and increase restrictions gradually.</li>
-                          <li>PHP is running in <a href="http://www.php.net/manual/en/features.safe-mode.php" target="_blank">Safe-Mode</a>. If possible, try to switch it off.</li>
-                        </ul>
-                        <a href="http://forum.chamilo.org/" target="_blank">Read about this problem in Support Forum</a><br /><br />
-                        Please go back to step 5.
-                        <p><input type="submit" name="step5" value="&lt; Back" /></p>
-                        </td></tr></table></form></body></html>';
+        echo '<strong>
+        <font color="red">Your script doesn\'t have write access to the config directory</font></strong>
+        <br />
+        <em>('.str_replace('\\', '/', realpath($path)).')</em><br /><br />
+        You probably do not have write access on Chamilo root directory,
+        i.e. you should <em>CHMOD 777</em> or <em>755</em> or <em>775</em>.<br /><br />
+        Your problems can be related on two possible causes:<br />
+        <ul>
+          <li>Permission problems.<br />Try initially with <em>chmod -R 777</em> and increase restrictions gradually.</li>
+          <li>PHP is running in <a href="http://www.php.net/manual/en/features.safe-mode.php" target="_blank">Safe-Mode</a>. If possible, try to switch it off.</li>
+        </ul>
+        <a href="http://forum.chamilo.org/" target="_blank">Read about this problem in Support Forum</a><br /><br />
+        Please go back to step 5.
+        <p><input type="submit" name="step5" value="&lt; Back" /></p>
+        </td></tr></table></form></body></html>';
         exit;
     }
 
@@ -448,154 +448,12 @@ function my_directory_to_array($directory)
  */
 function get_config_param($param, $updatePath = '')
 {
-    global $configFile, $updateFromConfigFile;
-
-    // Look if we already have the queried parameter.
-    if (is_array($configFile) && isset($configFile[$param])) {
-        return $configFile[$param];
-    }
-    if (empty($updatePath) && !empty($_POST['updatePath'])) {
-        $updatePath = $_POST['updatePath'];
-    }
-    if (empty($updatePath)) {
-        $updatePath = api_get_path(SYS_PATH);
-    }
-    $updatePath = api_add_trailing_slash(str_replace('\\', '/', realpath($updatePath)));
-    $updateFromInstalledVersionFile = '';
-
-    if (empty($updateFromConfigFile)) {
-        // If update from previous install was requested,
-        // try to recover old config file from dokeos 1.8.x.
-        if (file_exists($updatePath.'main/inc/conf/configuration.php')) {
-            $updateFromConfigFile = 'main/inc/conf/configuration.php';
-        } elseif (file_exists($updatePath.'claroline/inc/conf/claro_main.conf.php')) {
-            $updateFromConfigFile = 'claroline/inc/conf/claro_main.conf.php';
-        } else {
-            // Give up recovering.
-            //error_log('Chamilo Notice: Could not find previous config file at '.$updatePath.'main/inc/conf/configuration.php nor at '.$updatePath.'claroline/inc/conf/claro_main.conf.php in get_config_param(). Will start new config (in '.__FILE__.', line '.__LINE__.')', 0);
-            return null;
-        }
-    }
-
-    if (file_exists($updatePath.$updateFromConfigFile) && !is_dir($updatePath.$updateFromConfigFile)) {
-
-        // The parameter was not found among the global variables, so look into the old configuration file.
-
-        // Make sure the installedVersion file is read first so it is overwritten
-        // by the config file if the config file contains the version (from 1.8.4).
-        $config_data_2 = array();
-        if (file_exists($updatePath.$updateFromInstalledVersionFile)) {
-            $config_data_2 = file_to_array($updatePath.$updateFromInstalledVersionFile);
-        }
-        $configFile = array();
-        $config_data = file_to_array($updatePath.$updateFromConfigFile);
-        $config_data = array_merge($config_data, $config_data_2);
-        $val = '';
-
-        // Parse the configuration file, statement by statement (line by line, actually).
-        foreach ($config_data as $php_statement) {
-
-            if (strpos($php_statement, '=') !== false) {
-                // Variable assignment statement have been detected (probably).
-                // It is expected to be as follows:
-                // $variable = 'some_value'; // A comment that is not mandatory.
+    global $configFile, $updateFromConfigFile, $_configuration;
 
-                // Split the statement into its left and right sides.
-                $php_statement = explode('=', $php_statement);
-                $variable = trim($php_statement[0]);
-                $value = $php_statement[1];
-
-                if (substr($variable, 0, 1) == '$') {
-                    // We have for sure a php variable assignment detected.
-
-                    // On the left side: Retrieve the pure variable's name
-                    $variable = trim(str_replace('$', '', $variable));
-
-                    // On the right side: Remove the comment, if it exists.
-                    list($value) = explode(' //', $value);
-                    // Remove extra whitespace, if any. Remove the trailing semicolon (;).
-                    $value = substr(trim($value), 0, -1);
-                    // Remove surroundig quotes, restore escaped quotes.
-                    $value = str_replace('\"', '"', preg_replace('/^"|"$/', '', $value));
-                    $value = str_replace('\'', '"', preg_replace('/^\'|\'$/', '', $value));
-
-                    if (strtolower($value) == 'true') {
-
-                        // A boolean true value have been recognized.
-                        $value = 1;
-
-                    } elseif (strtolower($value) == 'false') {
-
-                        // A boolean false value have been recognized.
-                        $value = 0;
-
-                    } else {
-
-                        // Probably we have a string value, but also we have to check
-                        // possible string concatenations that may include string values
-                        // and other configuration variables. I this case we have to
-                        // get the calculated result of the concatenation.
-                        $implode_string = ' ';
-                        if (!strstr($value, '." ".') && strstr($value, '.$')) {
-                            // Yes, there is concatenation, insert a special separator string.
-                            $value = str_replace('.$', '." ".$', $value);
-                            $implode_string = '';
-                        }
-
-                        // Split the concatenated values, if they are more than one.
-                        $sub_strings = explode('." ".', $value);
-
-                        // Seek for variables and retrieve their values.
-                        foreach ($sub_strings as $key => & $sub_string) {
-                            if (preg_match('/^\$[a-zA-Z_][a-zA-Z0-9_]*$/', $sub_string)) {
-                                // A variable has been detected, read it by recursive call.
-                                $sub_string = get_config_param(str_replace('$', '', $sub_string));
-                            }
-                        }
-
-                        // Concatenate everything into the final, the calculated string value.
-                        $value = implode($implode_string, $sub_strings);
-                    }
-
-                    // Cache the result value.
-                    $configFile[$variable] = $value;
-
-                    $a = explode("'", $variable);
-                    $key_tmp = isset($a[1]) ? $a[1] : null;
-                    if ($key_tmp == $param) {
-                        $val = $value;
-                    }
-                }
-            }
-        }
-    }
-
-    if ($param == 'dbGlu' && empty($val)) {
-        return '`.`';
-    }
-    //Special treatment for dokeos_version parameter due to Dokeos 1.8.3 have the dokeos_version in the main/inc/installedVersion.inc.php file
-    if ($param == 'dokeos_version') {
-        //dokeos_version from configuration.php if empty
-        $dokeos_version = $val;
-
-        if (empty($dokeos_version)) {
-            //checking the dokeos_version value exists in main/inc/installedVersion.inc.php
-            if (file_exists($updatePath.'main/inc/installedVersion.inc.php')) {
-                $updateFromInstalledVersionFile = $updatePath.'main/inc/installedVersion.inc.php';
-                require ($updateFromInstalledVersionFile); //there are only 2 variables here: $stable & $dokeos_version
-                $stable = false;
-            }
-        }
-
-        return $dokeos_version;
+    if (isset($_configuration[$param])) {
+        return $_configuration[$param];
     } else {
-        if (file_exists($updatePath.$updateFromConfigFile)) {
-            return $val;
-        } else {
-            error_log('Config array could not be found in get_config_param()', 0);
-
-            return null;
-        }
+        return null;
     }
 }
 
@@ -732,6 +590,7 @@ function fill_track_countries_table($track_countries_table)
  */
 function load_main_database($installation_settings, $db_script = '')
 {
+    $sql_text = null;
     if (!empty($db_script)) {
         if (file_exists($db_script)) {
             $sql_text = file_get_contents($db_script);
@@ -1424,12 +1283,16 @@ function display_requirements(
                 <td class="requirements-item">chamilo/app/cache</td>
                 <td class="requirements-value">'.check_writable_root_path('app/cache').'</td>
             </tr>
-
             <tr>
                 <td class="requirements-item">chamilo/main/default_course_document/images/</td>
                 <td class="requirements-value">'.check_writable('default_course_document/images/').'</td>
             </tr>
 
+            <tr>
+                <td class="requirements-item">chamilo/courses/</td>
+                <td class="requirements-value">'.check_writable('../courses/').' </td>
+            </tr>
+
             <tr>
                 <td class="requirements-item">'.get_lang('CourseTestWasCreated').'</td>
                 <td class="requirements-value">'.$course_test_was_created.' </td>
@@ -1902,12 +1765,12 @@ function display_database_settings_form(
             $dbUsernameForm = $_configuration['db_user'];
             $dbPassForm = $_configuration['db_password'];
             $dbPrefixForm = $_configuration['db_prefix'];
-            $enableTrackingForm = $_configuration['tracking_enabled'];
-            $singleDbForm = $_configuration['single_database'];
+            $enableTrackingForm = isset($_configuration['tracking_enabled']) ? $_configuration['tracking_enabled'] : null;
+            $singleDbForm = isset($_configuration['single_database']) ? $_configuration['single_database'] : null;
             $dbNameForm = $_configuration['main_database'];
-            $dbStatsForm = $_configuration['statistics_database'];
-            $dbScormForm = $_configuration['scorm_database'];
-            $dbUserForm = $_configuration['user_personal_database'];
+            $dbStatsForm = isset($_configuration['statistics_database']) ? $_configuration['statistics_database'] : null;
+            $dbScormForm = isset($_configuration['scorm_database']) ? $_configuration['scorm_database'] : null;
+            $dbUserForm = isset($_configuration['user_personal_database']) ? $_configuration['user_personal_database'] : null;
             $dbScormExists = true;
         }
 
@@ -2006,7 +1869,7 @@ function display_database_settings_form(
 
             //Only for updates we show this options
             if ($installType == INSTALL_TYPE_UPDATE) {
-                display_database_parameter(
+                /*display_database_parameter(
                     $installType,
                     get_lang('StatDB'),
                     'dbStatsForm',
@@ -2034,7 +1897,7 @@ function display_database_settings_form(
                     '&nbsp;',
                     null,
                     'id="optional_param4" '.$style
-                );
+                );*/
             }
             ?>
         <tr>
@@ -2740,3 +2603,19 @@ function drop_course_tables()
     }
 }
 
+function movingFilesInAppFolder()
+{
+    $sysPath = api_get_path(SYS_PATH);
+    $moveDirs = array(
+        $sysPath.'searchdb' => api_get_path(SYS_PATH_APP).'data/searchdb/',
+        $sysPath.'home' => api_get_path(SYS_PATH_APP).'data/home/',
+    );
+
+    foreach ($moveDirs as $from => $to) {
+        if (is_dir($from)) {
+            $copy = "cp -r $from/* $to";
+            system($copy);
+        }
+    }
+}
+

+ 1 - 7
main/install/install_db.inc.php

@@ -115,7 +115,6 @@ $installation_settings['{PLATFORM_AUTH_SOURCE}']            = PLATFORM_AUTH_SOUR
 $installation_settings['{ADMINLANGUAGE}']                   = $languageForm;
 $installation_settings['{HASHFUNCTIONMODE}']                = $encryptPassForm;
 
-
 load_main_database($installation_settings);
 
 $app['monolog']->addInfo("drop_course_tables");
@@ -124,17 +123,12 @@ drop_course_tables();
 $app['monolog']->addInfo("create_course_tables");
 load_database_script($new_version.'/db_course.sql');
 
-$app['monolog']->addInfo("loading db_stats.sql");
-load_database_script($new_version.'/db_stats.sql');
-
 $track_countries_table = "track_c_countries";
 
 $app['monolog']->addInfo("fill_track_countries_table");
 fill_track_countries_table($track_countries_table);
 
-load_database_script($new_version.'/db_user.sql');
-
 $app['monolog']->addInfo("locking_settings");
 locking_settings();
 
-update_dir_and_files_permissions();
+update_dir_and_files_permissions();

+ 12 - 12
main/install/install_files.inc.php

@@ -17,22 +17,22 @@
 if (defined('SYSTEM_INSTALLATION')) {
 
 	// Write the system config file
-	write_system_config_file(api_get_path(CONFIGURATION_PATH).'configuration.php');
+	//write_system_config_file(api_get_path(CONFIGURATION_PATH).'configuration.php');
+
+    write_system_config_file(api_get_path(SYS_PATH_APP).'config/configuration.php');
 
 	// Write a distribution file with the config as a backup for the admin
-	write_system_config_file(api_get_path(CONFIGURATION_PATH).'configuration.dist.php');
+	//write_system_config_file(api_get_path(CONFIGURATION_PATH).'configuration.dist.php');
+
+    //write_system_config_file(api_get_path(SYS_PATH_APP).'config/configuration.dist.php');
 
 	// Write a .htaccess file in the course repository
 	write_courses_htaccess_file($urlAppendPath);
 
 	// Copy distribution files with renaming for being the actual system configuration files.
-	//copy(api_get_path(CONFIGURATION_PATH).'add_course.conf.dist.php', api_get_path(CONFIGURATION_PATH).'add_course.conf.php');
-	//copy(api_get_path(CONFIGURATION_PATH).'course_info.conf.dist.php', api_get_path(CONFIGURATION_PATH).'course_info.conf.php');
-	copy(api_get_path(CONFIGURATION_PATH).'mail.conf.dist.php', api_get_path(CONFIGURATION_PATH).'mail.conf.php');
-	copy(api_get_path(CONFIGURATION_PATH).'profile.conf.dist.php', api_get_path(CONFIGURATION_PATH).'profile.conf.php');
-    copy(api_get_path(CONFIGURATION_PATH).'events.conf.dist.php', api_get_path(CONFIGURATION_PATH).'events.conf.php');
-    copy(api_get_path(CONFIGURATION_PATH).'auth.conf.dist.php', api_get_path(CONFIGURATION_PATH).'auth.conf.php');
-	copy(api_get_path(CONFIGURATION_PATH).'portfolio.conf.dist.php', api_get_path(CONFIGURATION_PATH).'portfolio.conf.php');
-} else {
-	echo 'You are not allowed here !' . __FILE__;
-}
+	copy(api_get_path(CONFIGURATION_PATH).'mail.conf.dist.php', api_get_path(SYS_PATH_APP).'config/mail.conf.php');
+	copy(api_get_path(CONFIGURATION_PATH).'profile.conf.dist.php', api_get_path(SYS_PATH_APP).'config/profile.conf.php');
+    copy(api_get_path(CONFIGURATION_PATH).'events.conf.dist.php', api_get_path(SYS_PATH_APP).'config/events.conf.php');
+    copy(api_get_path(CONFIGURATION_PATH).'auth.conf.dist.php', api_get_path(SYS_PATH_APP).'config/auth.conf.php');
+	copy(api_get_path(CONFIGURATION_PATH).'portfolio.conf.dist.php', api_get_path(SYS_PATH_APP).'config/portfolio.conf.php');
+}

+ 50 - 54
main/install/update-configuration.inc.php

@@ -8,68 +8,64 @@
  * Only updates the  main/inc/conf/configuration.php  file with the new version use only from 1.8.8.1 to 1.8.8.2 (with no DB changes)
  * @package chamilo.install
  */
+
+use Symfony\Component\Yaml\Dumper;
+
 if (defined('SYSTEM_INSTALLATION')) {
 
     $app['monolog']->addInfo("Starting " . basename(__FILE__));
 
-    // Edit the configuration file
-    $file   = file(api_get_path(CONFIGURATION_PATH) . 'configuration.php');
-    $fh     = fopen(api_get_path(CONFIGURATION_PATH) . 'configuration.php', 'w');
-
-    $found_version_old      = false;
-    $found_stable_old       = false;
-    $found_version          = false;
-    $found_stable           = false;
-    $found_software_name    = false;
-    $found_software_url     = false;
-
-    foreach ($file as $line) {
-        $ignore = false;
-        if (stripos($line, '$_configuration[\'dokeos_version\']') !== false) {
-            $found_version_old = true;
-            $line = '$_configuration[\'dokeos_version\'] = \'' . $new_version . '\';' . "\r\n";
-            $ignore = true;
-        } elseif (stripos($line, '$_configuration[\'system_version\']') !== false) {
-            $found_version = true;
-            $line = '$_configuration[\'system_version\'] = \'' . $new_version . '\';' . "\r\n";
-        } elseif (stripos($line, '$_configuration[\'dokeos_stable\']') !== false) {
-            $found_stable_old = true;
-            $line = '$_configuration[\'dokeos_stable\'] = ' . ($new_version_stable ? 'true' : 'false') . ';' . "\r\n";
-            $ignore = true;
-        } elseif (stripos($line, '$_configuration[\'system_stable\']') !== false) {
-            $found_stable = true;
-            $line = '$_configuration[\'system_stable\'] = ' . ($new_version_stable ? 'true' : 'false') . ';' . "\r\n";
-        } elseif (stripos($line, '$_configuration[\'software_name\']') !== false) {
-            $found_software_name = true;
-            $line = '$_configuration[\'software_name\'] = \'' . $software_name . '\';' . "\r\n";
-        } elseif (stripos($line, '$_configuration[\'software_url\']') !== false) {
-            $found_software_url = true;
-            $line = '$_configuration[\'software_url\'] = \'' . $software_url . '\';' . "\r\n";
-        } elseif (stripos($line, '$userPasswordCrypted') !== false) {
-            //$line = '$userPasswordCrypted = \'' . ($userPasswordCrypted) . '\';' . "\r\n";
-            $line = '$_configuration[\'password_encryption\'] = \'' .$userPasswordCrypted.'\';' . "\r\n";
-        } elseif (stripos($line, '?>') !== false) {
-            $ignore = true;
-        }
-        if (!$ignore) {
-            fwrite($fh, $line);
-        }
+    //Creating app/config/configuration.yml
+    global $_configuration;
+
+    $_configuration['system_version'] = $new_version;
+    $_configuration['system_stable'] = $new_version_stable ? 'true' : 'false';
+    $_configuration['software_name'] = isset($software_name) ? $software_name : 'chamilo';
+    $_configuration['software_url'] = isset($software_url) ? $software_url : 'chamilo';
+    $_configuration['password_encryption'] = isset($userPasswordCrypted) ? $userPasswordCrypted : $_configuration['password_encryption'];
+
+    $dumper = new Dumper();
+
+    //removing useless indexes before saving in the configuration file
+
+    unset($_configuration['dokeos_version']);
+    unset($_configuration['dokeos_stable']);
+    unset($_configuration['code_append']);
+    unset($_configuration['course_folder']);
+
+    $yaml = $dumper->dump($_configuration, 2); //inline
+    $newConfigurationFile = api_get_path(SYS_PATH_APP).'config/configuration.yml';
+    file_put_contents($newConfigurationFile, $yaml);
+
+    //Moving files in app/config
+
+    if (file_exists(api_get_path(CONFIGURATION_PATH).'mail.conf.php')) {
+        copy(api_get_path(CONFIGURATION_PATH).'mail.conf.php', api_get_path(SYS_PATH_APP).'config/mail.conf.php');
+        unlink(api_get_path(CONFIGURATION_PATH).'mail.conf.php');
     }
 
-    if (!$found_version) {
-        fwrite($fh, '$_configuration[\'system_version\'] = \'' . $new_version . '\';' . "\r\n");
+    if (file_exists(api_get_path(CONFIGURATION_PATH).'auth.conf.php')) {
+        copy(api_get_path(CONFIGURATION_PATH).'auth.conf.php', api_get_path(SYS_PATH_APP).'config/auth.conf.php');
+        unlink(api_get_path(CONFIGURATION_PATH).'auth.conf.php');
     }
-    if (!$found_stable) {
-        fwrite($fh, '$_configuration[\'system_stable\'] = ' . ($new_version_stable ? 'true' : 'false') . ';' . "\r\n");
+
+    if (file_exists(api_get_path(CONFIGURATION_PATH).'events.conf.php')) {
+        copy(api_get_path(CONFIGURATION_PATH).'events.conf.php', api_get_path(SYS_PATH_APP).'config/events.conf.php');
+        unlink(api_get_path(CONFIGURATION_PATH).'events.conf.php');
     }
-    if (!$found_software_name) {
-        fwrite($fh, '$_configuration[\'software_name\'] = \'' . $software_name . '\';' . "\r\n");
+
+    if (file_exists(api_get_path(CONFIGURATION_PATH).'mail.conf.php')) {
+        copy(api_get_path(CONFIGURATION_PATH).'mail.conf.php', api_get_path(SYS_PATH_APP).'config/mail.conf.php');
+        unlink(api_get_path(CONFIGURATION_PATH).'mail.conf.php');
     }
-    if (!$found_software_url) {
-        fwrite($fh, '$_configuration[\'software_url\'] = \'' . $software_url . '\';' . "\r\n");
+
+    if (file_exists(api_get_path(CONFIGURATION_PATH).'portfolio.conf.php')) {
+        copy(api_get_path(CONFIGURATION_PATH).'portfolio.conf.php', api_get_path(SYS_PATH_APP).'config/portfolio.conf.php');
+        unlink(api_get_path(CONFIGURATION_PATH).'portfolio.conf.php');
+    }
+
+    if (file_exists(api_get_path(CONFIGURATION_PATH).'profile.conf.php')) {
+        copy(api_get_path(CONFIGURATION_PATH).'profile.conf.php', api_get_path(SYS_PATH_APP).'config/profile.conf.php');
+        unlink(api_get_path(CONFIGURATION_PATH).'profile.conf.php');
     }
-    fwrite($fh, '?>');
-    fclose($fh);
-} else {
-    echo 'You are not allowed here !'. __FILE__;
 }

+ 2 - 5
main/install/update-db-1.9.0-1.10.0.inc.php

@@ -23,8 +23,8 @@ $new_file_version = '1.10.0';
 if (defined('SYSTEM_INSTALLATION')) {
 
     // Check if the current Chamilo install is eligible for update
-    if (!file_exists('../inc/conf/configuration.php')) {
-        echo '<strong>'.get_lang('Error').' !</strong> Chamilo '.implode('|', $updateFromVersion).' '.get_lang('HasNotBeenFound').'.<br /><br />
+    if (empty($_configuration)) {
+        echo '<strong>'.get_lang('Error').' !</strong> Chamilo '.get_lang('HasNotBeenFound').'.<br /><br />
                                 '.get_lang('PleasGoBackToStep1').'.
                                 <p><button type="submit" class="back" name="step1" value="&lt; '.get_lang('Back').'">'.get_lang('Back').'</button></p>
                                 </td></tr></table></form></body></html>';
@@ -188,7 +188,4 @@ if (defined('SYSTEM_INSTALLATION')) {
             }
         }
     }
-} else {
-    echo 'You are not allowed here !'.__FILE__;
 }
-

+ 0 - 1
main/social/friends.php

@@ -11,7 +11,6 @@
 $language_file = array('userInfo');
 $cidReset = true;
 require_once '../inc/global.inc.php';
-require_once api_get_path(CONFIGURATION_PATH).'profile.conf.php';
 
 api_block_anonymous_users();
 if (api_get_setting('allow_social_tool') != 'true') {

+ 68 - 0
src/ChamiloLMS/Command/Database/CommonCommand.php

@@ -1,6 +1,8 @@
 <?php
 
 namespace ChamiloLMS\Command\Database;
+use Symfony\Component\Yaml\Dumper;
+use Symfony\Component\Yaml\Parser;
 use Doctrine\DBAL\Migrations\Tools\Console\Command\AbstractCommand;
 
 class CommonCommand extends AbstractCommand
@@ -128,4 +130,70 @@ class CommonCommand extends AbstractCommand
         return $versionList;
     }
 
+
+    /**
+     * Gets the Doctrine configuration file path
+     * @return string
+     */
+    public function getMigrationConfigurationFile()
+    {
+        return api_get_path(SYS_PATH).'src/ChamiloLMS/Migrations/migrations.yml';
+    }
+
+
+    /**
+     * Writes the configuration file a yml file
+     * @param $newConfigurationArray
+     * @param $version
+     */
+    public function writeConfiguration($newConfigurationArray, $version)
+    {
+        $configurationPath = $this->getHelper('configuration')->getConfigurationPath();
+
+        $newConfigurationArray['system_version'] = $version;
+        $newConfigurationArray['db_glue'] = '`.`';
+        $newConfigurationArray['db_prefix'] = '';
+
+        $dumper = new Dumper();
+        $yaml = $dumper->dump($newConfigurationArray, 2); //inline
+        $newConfigurationFile = $configurationPath.'../../../app/config/configuration.yml';
+        file_put_contents($newConfigurationFile, $yaml);
+
+        return file_exists($newConfigurationFile);
+    }
+
+
+    /**
+     * Updates the configuration.yml file
+     * @param string $version
+     *
+     * @return bool
+     */
+    public function updateConfiguration($version)
+    {
+        global $userPasswordCrypted, $storeSessionInDb;
+
+        $_configuration = $this->getHelper('configuration')->getConfiguration();
+
+        $configurationPath = $this->getHelper('configuration')->getConfigurationPath();
+
+        $dumper = new Dumper();
+
+        $_configuration['system_version'] = $version;
+
+        if (!isset($_configuration['password_encryption'])) {
+            $_configuration['password_encryption']      = $userPasswordCrypted;
+        }
+
+        if (!isset($_configuration['session_stored_in_db'])) {
+            $_configuration['session_stored_in_db']     = $storeSessionInDb;
+        }
+
+        $yaml = $dumper->dump($_configuration, 2); //inline
+        $newConfigurationFile = $configurationPath.'../../../app/config/configuration.yml';
+        file_put_contents($newConfigurationFile, $yaml);
+
+        return file_exists($newConfigurationFile);
+    }
+
 }

+ 3 - 20
src/ChamiloLMS/Command/Database/InstallCommand.php

@@ -81,7 +81,9 @@ class InstallCommand extends CommonCommand
                             'name' => 'chamilo',
                             'sql' => array(
                                 'db_course.sql',
-                                'db_main.sql'
+                                'db_main.sql',
+                                'db_stats.sql',
+                                'db_user.sql'
                             ),
                         ),
                     ),
@@ -353,26 +355,7 @@ class InstallCommand extends CommonCommand
         return '1.10';
     }
 
-    /**
-     * Writes the configuration file a yml file
-     * @param $newConfigurationArray
-     * @param $version
-     */
-    public function writeConfiguration($newConfigurationArray, $version)
-    {
-        $configurationPath = $this->getHelper('configuration')->getConfigurationPath();
-
-        $newConfigurationArray['system_version'] = $version;
-        $newConfigurationArray['db_glue'] = '`.`';
-        $newConfigurationArray['db_prefix'] = '';
 
-        $dumper = new Dumper();
-        $yaml = $dumper->dump($newConfigurationArray, 2); //inline
-        $newConfigurationFile = $configurationPath.'configuration.yml';
-        file_put_contents($newConfigurationFile, $yaml);
-
-        return file_exists($newConfigurationFile);
-    }
 
     private function setDatabaseSettings($configuration, $databaseName)
     {

+ 0 - 116
src/ChamiloLMS/Command/Database/InstallExtendCommand.php

@@ -23,120 +23,4 @@ class InstallExtendCommand extends InstallCommand
             ->setDescription('Execute a Chamilo installation to a specified version')
             ->addArgument('version', InputArgument::REQUIRED, 'The version to migrate to.', null);
     }
-
-    /**
-     * Executes a command via CLI
-     *
-     * @param Console\Input\InputInterface $input
-     * @param Console\Output\OutputInterface $output
-     *
-     * @return int|null|void
-     */
-    protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output)
-    {
-        $path = $input->getOption('path');
-        $configurationPath = $this->getHelper('configuration')->getConfigurationPath($path);
-
-        $dialog = $this->getHelperSet()->get('dialog');
-
-        $version = $input->getArgument('version');
-
-        $defaultVersion = $this->getLatestVersion();
-
-        if (empty($version)) {
-            $version = $defaultVersion;
-        }
-
-        $output->writeln("<comment>Welcome to the Chamilo $version installation process.</comment>");
-
-        if (!is_writable($configurationPath)) {
-            $output->writeln("<comment>Folder ".$configurationPath." must be writable</comment>");
-            exit;
-        }
-
-        $sqlFolder = $this->getInstallationPath($version);
-
-        if (!is_dir($sqlFolder)) {
-            $output->writeln("<comment>Sorry you can't install that version of Chamilo :( Supported versions:</comment> <info>".implode(', ', $this->getAvailableVersions()));
-            exit;
-        }
-
-        if (file_exists($configurationPath.'configuration.php') || file_exists($configurationPath.'configuration.yml')) {
-            $output->writeln("<comment>There's a Chamilo portal here ".$configurationPath." you must run</comment> <info>chamilo:setup </info><comment>if you want a fresh install.</comment>");
-            exit;
-            /*
-            if (!$dialog->askConfirmation(
-                $output,
-                '<question>There is a Chamilo installation located here:</question> '.$configurationPath.' <question>Are you sure you want to continue?</question>(y/N)',
-                false
-            )
-            ) {
-                return;
-            }
-
-            if (!$dialog->askConfirmation(
-                $output,
-                '<comment>This will be a fresh installation. Old databases and config files will be deleted. </comment></info> <question>Are you sure?</question>(y/N)',
-                false
-            )
-            ) {
-                return;
-            }
-            $this->cleanInstallation($output);*/
-        }
-
-        //Getting default configuration parameters
-        require_once api_get_path(SYS_PATH).'main/install/configuration.dist.yml.php';
-
-        $avoidVariables = array(
-            'main_database', //default is chamilo
-            'db_glue',
-            'table_prefix',
-            'code_append',
-            'course_folder',
-            'db_admin_path',
-            'cdn_enable',
-            'verbose_backup',
-            'session_stored_in_db',
-            'session_lifetime',
-            'software_name',
-            'software_url',
-            'deny_delete_users',
-            'system_version',
-            'system_stable'
-        );
-
-        $newConfigurationArray = array();
-        foreach ($_configuration as $key => $value) {
-            if (in_array($key, $avoidVariables)) {
-                $newConfigurationArray[$key] = $value;
-                continue;
-            }
-            if (!is_array($value)) {
-                $data = $dialog->ask(
-                    $output,
-                    "Please enter the value of the $key ($value): ",
-                    $value
-                );
-                $newConfigurationArray[$key] = $data;
-            } else {
-                $newConfigurationArray[$key] = $value;
-            }
-        }
-
-        $configurationWasSaved = $this->writeConfiguration($newConfigurationArray, $version);
-
-        if ($configurationWasSaved) {
-
-            //Installing database
-            $result = $this->install($version, $newConfigurationArray, $output);
-
-            if ($result) {
-                $this->createAdminUser($newConfigurationArray, $output);
-
-                $output->writeln("<comment>Chamilo was successfully installed. Go to your browser and enter:</comment> <info>".$newConfigurationArray['root_web']);
-            }
-        }
-    }
-
 }

+ 0 - 43
src/ChamiloLMS/Command/Database/UpgradeCommand.php

@@ -359,49 +359,6 @@ class UpgradeCommand extends CommonCommand
         }
     }
 
-
-    /**
-     * Updates the configuration.yml file
-     * @param string $version
-     *
-     * @return bool
-     */
-    public function updateConfiguration($version)
-    {
-        global $userPasswordCrypted, $storeSessionInDb;
-
-        $_configuration = $this->getHelper('configuration')->getConfiguration();
-
-        $configurationPath = $this->getHelper('configuration')->getConfigurationPath();
-
-        $dumper = new Dumper();
-
-        $_configuration['system_version'] = $version;
-
-        if (!isset($_configuration['password_encryption'])) {
-            $_configuration['password_encryption']      = $userPasswordCrypted;
-        }
-
-        if (!isset($_configuration['session_stored_in_db'])) {
-            $_configuration['session_stored_in_db']     = $storeSessionInDb;
-        }
-
-        $yaml = $dumper->dump($_configuration, 2); //inline
-        $newConfigurationFile = $configurationPath.'configuration.yml';
-        file_put_contents($newConfigurationFile, $yaml);
-
-        return file_exists($newConfigurationFile);
-    }
-
-    /**
-     * Gets the Doctrine configuration file path
-     * @return string
-     */
-    public function getMigrationConfigurationFile()
-    {
-        return api_get_path(SYS_PATH).'src/ChamiloLMS/Migrations/migrations.yml';
-    }
-
     /**
      * @param $queryList
      * @param $section