Jelajahi Sumber

Paths changes due the new structure see #5871 (pending confirmation)

Julio Montoya 12 tahun lalu
induk
melakukan
d9e1759718

+ 25 - 7
main/inc/global.inc.php

@@ -25,7 +25,7 @@
 // This is for compatibility with MAC computers.
 //ini_set('auto_detect_line_endings', '1');
 
-//Composer autoloader
+//Autoloader
 require_once __DIR__.'../../../vendor/autoload.php';
 
 use Silex\Application;
@@ -46,8 +46,8 @@ $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';
+$configurationYMLFile = $includePath.'/../../config/configuration.yml';
+$configurationFileAppPath = $includePath.'/../../config/configuration.php';
 
 $alreadyInstalled = false;
 if (file_exists($configurationFilePath) || file_exists($configurationYMLFile)  || file_exists($configurationFileAppPath)) {
@@ -79,8 +79,6 @@ if (file_exists($configurationYMLFile)) {
 
 // End reading configuration file
 
-//Including main and internationalization libs
-
 // Include the main Chamilo platform library file.
 require_once $includePath.'/lib/main_api.lib.php';
 
@@ -358,6 +356,7 @@ $app['twig'] = $app->share(
     })
 );
 
+
 // Registering Menu extension
 $app->register(new \Knp\Menu\Silex\KnpMenuServiceProvider());
 
@@ -379,7 +378,7 @@ $app['pagerfanta.view.options'] = array(
 //$app['pagerfanta.view.router.params']
 
 //Monolog only available if cache is writable
-if (is_writable($app['cache.path'])) {
+if (is_writable($app['temp.path'])) {
 
     /*
     Adding Monolog service provider
@@ -651,7 +650,7 @@ $app['this_section'] = SECTION_GLOBAL;
 require $includePath.'/local.inc.php';
 
 //Adding web profiler
-if (is_writable($app['cache.path'])) {
+if (is_writable($app['temp.path'])) {
     //if ($app['debug']) {
 
     if (api_get_setting('allow_web_profiler') == 'true') {
@@ -977,6 +976,7 @@ $app['pages.controller'] = $app->share(function () use ($app) {
 $app['index.controller'] = $app->share(function () use ($app) {
     return new ChamiloLMS\Controller\IndexController();
 });
+
 $app['legacy.controller'] = $app->share(function () use ($app) {
     return new ChamiloLMS\Controller\LegacyController();
 });
@@ -993,6 +993,18 @@ $app['course_home.controller'] = $app->share(function () use ($app) {
     return new ChamiloLMS\Controller\CourseHomeController();
 });
 
+$app['certificate.controller'] = $app->share(function () use ($app) {
+    return new ChamiloLMS\Controller\CertificateController();
+});
+
+$app['user.controller'] = $app->share(function () use ($app) {
+    return new ChamiloLMS\Controller\UserController();
+});
+
+$app['news.controller'] = $app->share(function () use ($app) {
+    return new ChamiloLMS\Controller\NewsController();
+});
+
 /*
 class PostController
 {
@@ -1035,6 +1047,12 @@ $app->get('/logout', 'index.controller:logoutAction')->bind('logout');
 $app->match('/courses/{courseCode}/index.php', 'course_home.controller:indexAction', 'GET|POST');
 $app->match('/courses/{courseCode}', 'course_home.controller:indexAction', 'GET|POST');
 
+$app->match('/certificates/{id}', 'certificate.controller:indexAction', 'GET');
+
+$app->match('/user/{username}', 'user.controller:indexAction', 'GET');
+
+$app->match('/news/{id}', 'news.controller:indexAction', 'GET');
+
 //LP controller
 $app->match('/learnpath/subscribe_users/{lpId}', 'learnpath.controller:indexAction', 'GET|POST')->bind('subscribe_users');
 

+ 19 - 3
main/inc/lib/main_api.lib.php

@@ -227,6 +227,10 @@ define('WEB_PATH', 'WEB_PATH');
 define('WEB_PUBLIC_PATH', 'WEB_PUBLIC_PATH');
 define('SYS_PATH', 'SYS_PATH');
 define('SYS_PATH_APP', 'SYS_PATH_APP');
+define('SYS_DATA_PATH', 'SYS_DATA_PATH');
+define('SYS_LOG_PATH', 'SYS_LOG_PATH');
+
+define('SYS_CONFIG_PATH', 'SYS_CONFIG_PATH');
 define('REL_PATH', 'REL_PATH');
 define('WEB_SERVER_ROOT_PATH', 'WEB_SERVER_ROOT_PATH');
 define('SYS_SERVER_ROOT_PATH', 'SYS_SERVER_ROOT_PATH');
@@ -436,7 +440,12 @@ define('CUT_GROUP_NAME', 50);
  * api_get_path(REL_CODE_PATH)                  /chamilo/main/
  * api_get_path(SYS_SERVER_ROOT_PATH)           /var/www/ - This is the physical folder where the system Chamilo has been placed. It is not always equal to $_SERVER['DOCUMENT_ROOT'].
  * api_get_path(SYS_PATH)                       /var/www/chamilo/
- * api_get_path(SYS_ARCHIVE_PATH)               /var/www/chamilo/app/cache/
+ *
+ * api_get_path(SYS_ARCHIVE_PATH)               /var/www/chamilo/temp/
+ * api_get_path(SYS_LOG_PATH)                   /var/www/chamilo/logs/
+ * api_get_path(SYS_DATA_PATH)                  /var/www/chamilo/data/
+ * api_get_path(SYS_CONFIG_PATH)                /var/www/chamilo/config/
+
  * api_get_path(SYS_COURSE_PATH)                /var/www/chamilo/courses/
  * api_get_path(SYS_CODE_PATH)                  /var/www/chamilo/main/
  * api_get_path(SYS_CSS_PATH)                   /var/www/chamilo/main/css
@@ -481,6 +490,9 @@ function api_get_path($path_type, $path = null) {
         WEB_PATH                => '',
         SYS_PATH                => '',
         SYS_PATH_APP            => 'app/',
+        SYS_DATA_PATH           => 'data/',
+        SYS_CONFIG_PATH         => 'config/',
+        SYS_LOG_PATH            => 'logs/',
         REL_PATH                => '',
         WEB_SERVER_ROOT_PATH    => '',
         SYS_SERVER_ROOT_PATH    => '',
@@ -496,8 +508,8 @@ function api_get_path($path_type, $path = null) {
         WEB_CSS_PATH            => 'css/',
         SYS_PLUGIN_PATH         => 'plugin/',
         WEB_PLUGIN_PATH         => 'plugin/',
-        SYS_ARCHIVE_PATH        => 'app/cache/',
-        WEB_ARCHIVE_PATH        => 'app/cache/',
+        SYS_ARCHIVE_PATH        => 'temp/',
+        WEB_ARCHIVE_PATH        => 'temp/',
         INCLUDE_PATH            => 'inc/',
         LIBRARY_PATH            => 'inc/lib/',
         CONFIGURATION_PATH      => 'inc/conf/',
@@ -609,6 +621,10 @@ function api_get_path($path_type, $path = null) {
         $paths[WEB_PUBLIC_PATH]         = $root_web."web/";
         $paths[SYS_PATH]                = $root_sys;
         $paths[SYS_PATH_APP]            = $root_sys.'app/';
+        $paths[SYS_DATA_PATH]           = $root_sys.'data/';
+        $paths[SYS_LOG_PATH]            = $root_sys.'logs/';
+        $paths[SYS_CONFIG_PATH]         = $root_sys.'config/';
+
         $paths[REL_PATH]                = $root_rel;
         $paths[WEB_SERVER_ROOT_PATH]    = $server_base_web.'/';
         $paths[SYS_SERVER_ROOT_PATH]    = $server_base_sys.'/';

+ 4 - 5
main/inc/lib/search/xapian/XapianIndexer.class.php

@@ -72,9 +72,8 @@ abstract class XapianIndexer
         }
 
         if ($path == null) {
-            $path = api_get_path(SYS_PATH_APP).'data/searchdb/';
+            $path = api_get_path(SYS_PATH_DATA).'searchdb/';
         }
-
         try {
             $this->db = new XapianWritableDatabase($path, $dbMode);
             $this->indexer = new XapianTermGenerator();
@@ -297,7 +296,7 @@ abstract class XapianIndexer
             $this->connectDb();
         }
         try {
-            $this->getDb()->replace_document((int)$did, $doc);
+            $this->getDb()->replace_document((int) $did, $doc);
             $this->getDb()->flush();
         } catch (Exception $e) {
             Display::display_error_message($e->getMessage());
@@ -309,7 +308,7 @@ abstract class XapianIndexer
     /**
      * Class contructor
      */
-    function __construct()
+    public function __construct()
     {
         $this->db = null;
         $this->stemmer = null;
@@ -318,7 +317,7 @@ abstract class XapianIndexer
     /**
      * Class destructor
      */
-    function __destruct()
+    public function __destruct()
     {
         unset($this->db);
         unset($this->stemmer);

+ 1 - 1
main/inc/lib/search/xapian/XapianQuery.php

@@ -12,7 +12,7 @@ require_once dirname(__FILE__) . '/../IndexableChunk.class.php';
 //TODO: think another way without including specific fields here
 require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php';
 
-define('XAPIAN_DB', api_get_path(SYS_PATH_APP) . 'data/searchdb/');
+define('XAPIAN_DB', api_get_path(SYS_PATH_DATA) . 'data/searchdb/');
 
 /**
  * Queries the database.

+ 51 - 29
main/inc/lib/social.lib.php

@@ -728,26 +728,31 @@ class SocialManager extends UserManager {
      * Displays the information of an individual user
      * @param int $user_id
      */
-    public static function display_individual_user($user_id) {
+    public static function display_individual_user($user_id, $returnContent = false) {
         global $interbreadcrumb;
         $safe_user_id = intval($user_id);
+        $curretUserId = api_get_user_id();
 
         $user_table = Database::get_main_table(TABLE_MAIN_USER);
         $sql = "SELECT * FROM $user_table WHERE user_id = ".$safe_user_id;
         $result = Database::query($sql);
 
         $userInfo = api_get_user_info($user_id);
+        $content = null;
 
         if (Database::num_rows($result) == 1) {
             $user_object = Database::fetch_object($result);
-            $alt  = $userInfo['complete_name'].($_SESSION['_uid'] == $user_id ? ' ('.get_lang('Me').')' : '');
+            $alt  = $userInfo['complete_name'].($curretUserId == $user_id ? ' ('.get_lang('Me').')' : '');
 
             $status = get_status_from_code($user_object->status);
 
             $interbreadcrumb[] = array('url' => 'whoisonline.php', 'name' => get_lang('UsersOnLineList'));
-            Display::display_header($alt, null, $alt);
 
-            echo '<div class ="thumbnail">';
+            if ($returnContent == false) {
+                Display::display_header($alt, null, $alt);
+            }
+
+            $content = '<div class ="thumbnail">';
             if (strlen(trim($user_object->picture_uri)) > 0) {
                 $sysdir_array = UserManager::get_user_picture_path_by_id($safe_user_id, 'system');
                 $sysdir = $sysdir_array['dir'];
@@ -765,51 +770,62 @@ class SocialManager extends UserManager {
                 $big_image_height = $big_image_size['height'];
                 $url_big_image = $big_image.'?rnd='.time();
                 //echo '<a href="javascript:void()" onclick="javascript: return show_image(\''.$url_big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');" >';
-                echo '<img src="'.$fullurl.'" alt="'.$alt.'" />';
+                $content .= '<img src="'.$fullurl.'" alt="'.$alt.'" />';
             } else {
-                echo Display::return_icon('unknown.jpg', get_lang('Unknown'));
+                $content .= Display::return_icon('unknown.jpg', get_lang('Unknown'));
             }
+
             if (!empty($status)) {
-                echo '<div class="caption">'.$status.'</div>';
+                $content .= '<div class="caption">'.$status.'</div>';
             }
-            echo '</div>';
-
+            $content .= '</div>';
 
             if (api_get_setting('show_email_addresses') == 'true') {
-                echo Display::encrypted_mailto_link($user_object->email,$user_object->email).'<br />';
+                $content .= Display::encrypted_mailto_link($user_object->email,$user_object->email).'<br />';
             }
 
             if ($user_object->competences) {
-                echo Display::page_subheader(get_lang('MyCompetences'));
-                echo '<p>'.$user_object->competences.'</p>';
+                $content .= Display::page_subheader(get_lang('MyCompetences'));
+                $content .= '<p>'.$user_object->competences.'</p>';
             }
             if ($user_object->diplomas) {
-                echo Display::page_subheader(get_lang('MyDiplomas'));
-                echo '<p>'.$user_object->diplomas.'</p>';
+                $content .= Display::page_subheader(get_lang('MyDiplomas'));
+                $content .= '<p>'.$user_object->diplomas.'</p>';
             }
             if ($user_object->teach) {
-                echo Display::page_subheader(get_lang('MyTeach'));
-                echo '<p>'.$user_object->teach.'</p>';
+                $content .= Display::page_subheader(get_lang('MyTeach'));
+                $content .= '<p>'.$user_object->teach.'</p>';
             }
-            SocialManager::display_productions($user_object->user_id);
+
+            $content .= SocialManager::display_productions($user_object->user_id);
+
             if ($user_object->openarea) {
-                echo Display::page_subheader(get_lang('MyPersonalOpenArea'));
-                echo '<p>'.$user_object->openarea.'</p>';
+                $content .= Display::page_subheader(get_lang('MyPersonalOpenArea'));
+                $content .= '<p>'.$user_object->openarea.'</p>';
             }
 
         } else    {
-            Display::display_header(get_lang('UsersOnLineList'));
-            echo '<div class="actions-title">';
-            echo get_lang('UsersOnLineList');
-            echo '</div>';
+            if ($returnContent == false) {
+                Display::display_header(get_lang('UsersOnLineList'));
+            }
+            $content .= '<div class="actions-title">';
+            $content .= get_lang('UsersOnLineList');
+            $content .= '</div>';
         }
+
+        if ($returnContent) {
+            return $content;
+        } else {
+            echo $content;
+        }
+
     }
 
     /**
      * Display productions in whoisonline
      * @param int $user_id User id
      */
-    public static function display_productions($user_id) {
+    public static function display_productions($user_id, $returnContent = false) {
         $sysdir_array = UserManager::get_user_picture_path_by_id($user_id, 'system', true);
         $sysdir = $sysdir_array['dir'].$user_id.'/';
         $webdir_array = UserManager::get_user_picture_path_by_id($user_id, 'web', true);
@@ -831,27 +847,33 @@ class SocialManager extends UserManager {
             $productions[] = $file;
         }
         */
+        $content = null;
         $productions = UserManager::get_user_productions($user_id);
 
         if (count($productions) > 0) {
-            echo '<dt><strong>'.get_lang('Productions').'</strong></dt>';
-            echo '<dd><ul>';
+            $content .= '<dt><strong>'.get_lang('Productions').'</strong></dt>';
+            $content .='<dd><ul>';
             foreach ($productions as $file) {
                 // Only display direct file links to avoid browsing an empty directory
                 if (is_file($sysdir.$file) && $file != $webdir_array['file']) {
-                    echo '<li><a href="'.$webdir.urlencode($file).'" target=_blank>'.$file.'</a></li>';
+                    $content .= '<li><a href="'.$webdir.urlencode($file).'" target=_blank>'.$file.'</a></li>';
                 }
                 // Real productions are under a subdirectory by the User's id
                 if (is_dir($sysdir.$file)) {
                     $subs = scandir($sysdir.$file);
                     foreach ($subs as $my => $sub) {
                         if (substr($sub, 0, 1) != '.' && is_file($sysdir.$file.'/'.$sub)) {
-                            echo '<li><a href="'.$webdir.urlencode($file).'/'.urlencode($sub).'" target=_blank>'.$sub.'</a></li>';
+                            $content .= '<li><a href="'.$webdir.urlencode($file).'/'.urlencode($sub).'" target=_blank>'.$sub.'</a></li>';
                         }
                     }
                 }
             }
-            echo '</ul></dd>';
+            $content .= '</ul></dd>';
+        }
+        if ($returnContent) {
+            return $content;
+        } else {
+            echo $content;
         }
     }
 

+ 10 - 7
main/inc/lib/system_announcements.lib.php

@@ -71,6 +71,8 @@ class SystemAnnouncementManager {
 		$sql .= " AND access_url_id = '$current_access_url_id' ";
 		$sql .= " ORDER BY date_start DESC LIMIT 0,7";
 
+        $newsPath = api_get_path(WEB_PUBLIC_PATH).'news';
+
 		$announcements = Database::query($sql);
 		if (Database::num_rows($announcements) > 0) {
 			$query_string = ereg_replace('announcement=[1-9]+', '', $_SERVER['QUERY_STRING']);
@@ -80,14 +82,14 @@ class SystemAnnouncementManager {
 
 			echo '<h3>'.get_lang('SystemAnnouncements').'</h3>';
 
-			echo '<div style="margin:10px;text-align:right;"><a href="news_list.php">'.get_lang('More').'</a></div>';
+			echo '<div style="margin:10px;text-align:right;"><a href="'.$newsPath.'">'.get_lang('More').'</a></div>';
 
 			while ($announcement = Database::fetch_object($announcements)) {
 				if ($id != $announcement->id) {
 					if (strlen($query_string) > 0) {
-						$show_url = 'news_list.php#'.$announcement->id;
+						$show_url = $newsPath.'#'.$announcement->id;
 					} else {
-						$show_url = 'news_list.php#'.$announcement->id;
+						$show_url = $newsPath.'#'.$announcement->id;
 					}
 			        $display_date = api_convert_and_format_date($announcement->display_date, DATE_FORMAT_LONG);
 					echo '<a name="'.$announcement->id.'"></a>
@@ -209,14 +211,15 @@ class SystemAnnouncementManager {
 		$next = ((int)$_GET['start']+19);
 		$prev = ((int)$_GET['start']-19);
 		$content = '';
+        $newsPath = api_get_path(WEB_PUBLIC_PATH).'news';
 		if(!isset($_GET['start']) || $_GET['start'] == 0) {
 			if($nb_announcement > 20) {
-				$content .= '<a href="news_list.php?start='.$next.'">'.get_lang('NextBis').' >> </a>';
+				$content .= '<a href="'.$newsPath.'?start='.$next.'">'.get_lang('NextBis').' >> </a>';
 			}
 		} else {
-			echo '<a href="news_list.php?start='.$prev.'"> << '.get_lang('Prev').'</a>';
+			echo '<a href="'.$newsPath.'?start='.$prev.'"> << '.get_lang('Prev').'</a>';
 			if ($nb_announcement > 20) {
-				$content .= '<a href="news_list.php?start='.$next.'">'.get_lang('NextBis').' >> </a>';
+				$content .= '<a href="'.$newsPath.'?start='.$next.'">'.get_lang('NextBis').' >> </a>';
 			}
 		}
 		return $content;
@@ -627,7 +630,7 @@ class SystemAnnouncementManager {
 			$html .=  '<div id="container-slider" class="span6"><ul id="slider">';
 			while ($announcement = Database::fetch_object($announcements)) {
                 $content = $announcement->content;
-                $url = api_get_path(WEB_PATH).'news_list.php?id='.$announcement->id;
+                $url = api_get_path(WEB_PUBLIC_PATH).'news/'.$announcement->id;
                 if (empty($id)) {
                     if (api_strlen(strip_tags($content)) > $cut_size) {
                         $content = Text::cut($announcement->content, $cut_size).' '.Display::url(get_lang('More'), $url);

+ 1 - 1
main/inc/local.inc.php

@@ -20,7 +20,7 @@
  * The course id is stored in $_cid session variable.
  * The group  id is stored in $_gid session variable.
  *
- *    @package chamilo.include
+ * @package chamilo.include
 */
 
 // verified if exists the username and password in session current

+ 14 - 19
main/install/install.lib.php

@@ -1268,31 +1268,25 @@ function display_requirements(
 
     echo '<table class="table">
             <tr>
-                <td class="requirements-item">chamilo/app/config</td>
-                <td class="requirements-value">'.check_writable_root_path('app/config/').'</td>
+                <td class="requirements-item">chamilo/config</td>
+                <td class="requirements-value">'.check_writable_root_path('config/').'</td>
             </tr>
             <tr>
-                <td class="requirements-item">chamilo/app/data</td>
-                <td class="requirements-value">'.check_writable_root_path('app/data').'</td>
+                <td class="requirements-item">chamilo/data</td>
+                <td class="requirements-value">'.check_writable_root_path('data').'</td>
             </tr>
             <tr>
-                <td class="requirements-item">chamilo/app/logs</td>
-                <td class="requirements-value">'.check_writable_root_path('app/logs').'</td>
+                <td class="requirements-item">chamilo/logs</td>
+                <td class="requirements-value">'.check_writable_root_path('logs').'</td>
             </tr>
             <tr>
-                <td class="requirements-item">chamilo/app/cache</td>
-                <td class="requirements-value">'.check_writable_root_path('app/cache').'</td>
+                <td class="requirements-item">chamilo/temp</td>
+                <td class="requirements-value">'.check_writable_root_path('temp').'</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>
@@ -1304,8 +1298,9 @@ function display_requirements(
             <tr>
                 <td class="requirements-item">'.get_lang('PermissionsForNewFiles').'</td>
                 <td class="requirements-value">'.$file_perm.' </td>
-            </tr>
-            <tr>
+            </tr>';
+
+    /*  <tr>
                 <td class="requirements-item">chamilo/main/css/</td>
                 <td class="requirements-value">'.check_writable('css/', true).' ('.get_lang(
         'SuggestionOnlyToEnableCSSUploadFeature'
@@ -1316,7 +1311,7 @@ function display_requirements(
                 <td class="requirements-value">'.check_writable('lang/', true).' ('.get_lang(
         'SuggestionOnlyToEnableSubLanguageFeature'
     ).')</td>
-            </tr>';
+            </tr>*/
 
     echo '    </table>';
     echo '  </div>';
@@ -2607,8 +2602,8 @@ 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/',
+        $sysPath.'searchdb' => api_get_path(SYS_DATA_PATH).'searchdb',
+        $sysPath.'home' => api_get_path(SYS_DATA_PATH).'home',
     );
 
     foreach ($moveDirs as $from => $to) {

+ 6 - 8
main/install/install_files.inc.php

@@ -19,20 +19,18 @@ 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(SYS_PATH_APP).'config/configuration.php');
+    write_system_config_file(api_get_path(SYS_CONFIG_PATH).'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(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).'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');
+	copy(api_get_path(CONFIGURATION_PATH).'mail.conf.dist.php', api_get_path(SYS_CONFIG_PATH).'mail.conf.php');
+	copy(api_get_path(CONFIGURATION_PATH).'profile.conf.dist.php', api_get_path(SYS_CONFIG_PATH).'profile.conf.php');
+    copy(api_get_path(CONFIGURATION_PATH).'events.conf.dist.php', api_get_path(SYS_CONFIG_PATH).'events.conf.php');
+    copy(api_get_path(CONFIGURATION_PATH).'auth.conf.dist.php', api_get_path(SYS_CONFIG_PATH).'auth.conf.php');
+	copy(api_get_path(CONFIGURATION_PATH).'portfolio.conf.dist.php', api_get_path(SYS_CONFIG_PATH).'portfolio.conf.php');
 }

+ 7 - 7
main/install/update-configuration.inc.php

@@ -34,38 +34,38 @@ if (defined('SYSTEM_INSTALLATION')) {
     unset($_configuration['course_folder']);
 
     $yaml = $dumper->dump($_configuration, 2); //inline
-    $newConfigurationFile = api_get_path(SYS_PATH_APP).'config/configuration.yml';
+    $newConfigurationFile = api_get_path(SYS_CONFIG_PATH).'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');
+        copy(api_get_path(CONFIGURATION_PATH).'mail.conf.php', api_get_path(SYS_CONFIG_PATH).'mail.conf.php');
         unlink(api_get_path(CONFIGURATION_PATH).'mail.conf.php');
     }
 
     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');
+        copy(api_get_path(CONFIGURATION_PATH).'auth.conf.php', api_get_path(SYS_CONFIG_PATH).'auth.conf.php');
         unlink(api_get_path(CONFIGURATION_PATH).'auth.conf.php');
     }
 
     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');
+        copy(api_get_path(CONFIGURATION_PATH).'events.conf.php', api_get_path(SYS_CONFIG_PATH).'events.conf.php');
         unlink(api_get_path(CONFIGURATION_PATH).'events.conf.php');
     }
 
     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');
+        copy(api_get_path(CONFIGURATION_PATH).'mail.conf.php', api_get_path(SYS_CONFIG_PATH).'mail.conf.php');
         unlink(api_get_path(CONFIGURATION_PATH).'mail.conf.php');
     }
 
     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');
+        copy(api_get_path(CONFIGURATION_PATH).'portfolio.conf.php', api_get_path(SYS_CONFIG_PATH).'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');
+        copy(api_get_path(CONFIGURATION_PATH).'profile.conf.php', api_get_path(SYS_CONFIG_PATH).'profile.conf.php');
         unlink(api_get_path(CONFIGURATION_PATH).'profile.conf.php');
     }
 }

+ 22 - 22
src/ChamiloLMS/Resources/config/prod.php

@@ -5,51 +5,51 @@ $app['debug'] = false;
 $app['app.title'] = '';
 $app['jquery_ui_theme'] = 'smoothness';
 
-// Cache
-$app['cache.path'] = api_get_path(SYS_ARCHIVE_PATH);
+// Temp folder
+$app['temp.path'] = api_get_path(SYS_ARCHIVE_PATH);
 
-$app['cache.paths'] = new stdClass();
+$app['temp.paths'] = new stdClass();
 
 //Monolog
-$app['cache.paths']->folders[] = $app['log.path'] = api_get_path(SYS_PATH_APP).'logs';
+$app['temp.paths']->folders[] = $app['log.path'] = api_get_path(SYS_LOG_PATH);
 
 //Twig cache
-$app['cache.paths']->folders[] = $app['twig.cache.path'] = $app['cache.path'].'twig';
+$app['temp.paths']->folders[] = $app['twig.cache.path'] = $app['temp.path'].'twig';
 
 // Http cache
-$app['cache.paths']->folders[] = $app['http_cache.cache_dir'] = $app['cache.path'].'http';
+$app['temp.paths']->folders[] = $app['http_cache.cache_dir'] = $app['temp.path'].'http';
 
 // Doctrine ORM
-$app['cache.paths']->folders[] = $app['db.orm.proxies_dir'] = $app['cache.path'].'proxies_dir';
+$app['temp.paths']->folders[] = $app['db.orm.proxies_dir'] = $app['temp.path'].'proxies_dir';
 
 //Profiler
-$app['cache.paths']->folders[] = $app['profiler.cache_dir'] = $app['cache.path'].'profiler';
+$app['temp.paths']->folders[] = $app['profiler.cache_dir'] = $app['temp.path'].'profiler';
 
 //HTMLPurifier
-$app['cache.paths']->folders[] = $app['htmlpurifier.serializer'] = $app['cache.path'].'serializer';
+$app['temp.paths']->folders[] = $app['htmlpurifier.serializer'] = $app['temp.path'].'serializer';
 
 //PCLZIP temp dir
-define('PCLZIP_TEMPORARY_DIR', $app['cache.path'].'pclzip');
-$app['cache.paths']->folders[] = PCLZIP_TEMPORARY_DIR;
+define('PCLZIP_TEMPORARY_DIR', $app['temp.path'].'pclzip');
+$app['temp.paths']->folders[] = PCLZIP_TEMPORARY_DIR;
 
 //MPDF libs
-define("_MPDF_TEMP_PATH", $app['cache.path'].'/mpdf');
-define("_JPGRAPH_PATH", $app['cache.path'].'/mpdf');
-define("_MPDF_TTFONTDATAPATH", $app['cache.path'].'/mpdf');
+define("_MPDF_TEMP_PATH", $app['temp.path'].'/mpdf');
+define("_JPGRAPH_PATH", $app['temp.path'].'/mpdf');
+define("_MPDF_TTFONTDATAPATH", $app['temp.path'].'/mpdf');
 
-$app['cache.paths']->folders[] = _MPDF_TEMP_PATH;
+$app['temp.paths']->folders[] = _MPDF_TEMP_PATH;
 
 //QR code
-define('QR_CACHE_DIR', $app['cache.path'].'qr');
-define('QR_LOG_DIR', $app['cache.path'].'qr');
-$app['cache.paths']->folders[] = QR_CACHE_DIR;
+define('QR_CACHE_DIR', $app['temp.path'].'qr');
+define('QR_LOG_DIR', $app['temp.path'].'qr');
+$app['temp.paths']->folders[] = QR_CACHE_DIR;
 
-//Chamilo temp class
-$app['cache.paths']->folders[] = $app['cache.path'].'temp';
+//Chamilo Temp class
+$app['temp.paths']->folders[] = $app['temp.path'].'temp';
 
 // Assetic
 /*
-$app['assetic.path_to_cache']   = $app['cache.path'] . DIRECTORY_SEPARATOR . 'assetic' ;
+$app['assetic.path_to_cache']   = $app['temp.path'] . DIRECTORY_SEPARATOR . 'assetic' ;
 $app['assetic.path_to_web']     = api_get_path(SYS_PATH) . 'web'; //Location where to dump all generated files
 $app['assetic.input.path_to_assets'] = $app['assetic.path_to_web'].$app['app.theme'];
 
@@ -103,7 +103,7 @@ if (!is_dir($app['assetic.path_to_web'].'/js')) {
  *
  */
 
-foreach($app['cache.paths']->folders as $folder) {
+foreach ($app['temp.paths']->folders as $folder) {
     if (!is_dir($folder)) {
         @mkdir($folder, api_get_permissions_for_new_directories());
     }