diff --git a/main/admin/archive_cleanup.php b/main/admin/archive_cleanup.php index e73e91028b..ce88b56cbe 100644 --- a/main/admin/archive_cleanup.php +++ b/main/admin/archive_cleanup.php @@ -19,7 +19,7 @@ $this_section = SECTION_PLATFORM_ADMIN; api_protect_admin_script(true); // setting breadcrumbs -$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin')); +$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin')); $form = new FormValidator('archive_cleanup_form'); $form->addElement('style_submit_button','proceed', get_lang('ArchiveDirCleanupProceedButton'),'class="save"'); @@ -35,6 +35,11 @@ if ($form->validate()) { @file_put_contents($archive_path.'/.htaccess', $htaccess); } if ($result) { + // Creating temp folders + /** @var ChamiloLMS\Component\DataFilesystem\DataFilesystem $filesystem */ + $filesystem = $app['chamilo.filesystem']; + $filesystem->createFolders($app['temp.paths']->folders); + $message = 'ArchiveDirCleanupSucceeded'; $type = 'confirmation'; } else { diff --git a/main/inc/global.inc.php b/main/inc/global.inc.php index f7e3339297..95fc329464 100644 --- a/main/inc/global.inc.php +++ b/main/inc/global.inc.php @@ -538,14 +538,16 @@ $app->before( } // Loop in the folder array and create temp folders. - /** @var ChamiloLMS\Component\DataFilesystem\DataFilesystem $filesystem */ + /** @var ChamiloLMS\Component\DataFilesystem\DataFilesystem $filesystem */ $filesystem = $app['chamilo.filesystem']; /** @var Request $request */ $request = $app['request']; - // @todo improvement create temp folders during installation not everytime - $filesystem->createFolders($app['temp.paths']->folders); + // Creates temp folders for every request + if ($app['debug']) { + $filesystem->createFolders($app['temp.paths']->folders); + } if ($app['assetic.auto_dump_assets']) { $filesystem->copyFolders($app['temp.paths']->copyFolders); diff --git a/main/install/index.php b/main/install/index.php index 96abd8d8eb..f845be167a 100644 --- a/main/install/index.php +++ b/main/install/index.php @@ -89,11 +89,6 @@ $app->register(new ConsoleServiceProvider(), array( 'console.project_directory' => __DIR__.'/..' )); -function get_lang($variable) { - global $app; - return $app['translator']->trans($variable); -} - // Adding commands. /** @var Knp\Console\Application $console */ $console = $app['console']; @@ -430,7 +425,7 @@ $app->match('/installing', function() use($app) { $app->get('/finish', function() use($app) { $output = $app['session']->get('output'); $message = $app['translator']->trans( - 'To protect your site, make the whole %s directory read-only (chmod 0555 on Linux)', + 'To protect your site, make the whole %s directory read-only (chmod 0555 on Unix/Linux)', array('%s' => $app['root_sys'].'config') ); $app['session']->getFlashBag()->add('warning', $message); diff --git a/main/install/install.lib.php b/main/install/install.lib.php index eea3426452..15a3680840 100755 --- a/main/install/install.lib.php +++ b/main/install/install.lib.php @@ -228,12 +228,12 @@ function detect_browser_language() function check_writable($folder, $suggestion = false) { if (is_writable(api_get_path(SYS_CODE_PATH).$folder)) { - return Display::label(get_lang('Writable'), 'success'); + return Display::label(translate('Writable'), 'success'); } else { if ($suggestion) { - return Display::label(get_lang('NotWritable'), 'info'); + return Display::label(translate('NotWritable'), 'info'); } else { - return Display::label(get_lang('NotWritable'), 'important'); + return Display::label(translate('NotWritable'), 'important'); } } } @@ -244,12 +244,12 @@ function check_writable($folder, $suggestion = false) function check_writable_root_path($folder, $suggestion = false) { if (is_writable(api_get_path(SYS_PATH).$folder)) { - return Display::label(get_lang('Writable'), 'success'); + return Display::label(translate('Writable'), 'success'); } else { if ($suggestion) { - return Display::label(get_lang('NotWritable'), 'info'); + return Display::label(translate('NotWritable'), 'info'); } else { - return Display::label(get_lang('NotWritable'), 'important'); + return Display::label(translate('NotWritable'), 'important'); } } } @@ -491,15 +491,15 @@ function database_server_connect() $no = Database::errno(); $msg = Database::error(); echo '