'index.php', 'name' => get_lang('PlatformAdmin')); $form = new FormValidator( 'archive_cleanup_form', 'post', '', '', array(), FormValidator::LAYOUT_BOX ); $form->addButtonSend(get_lang('ArchiveDirCleanupProceedButton')); if ($form->validate()) { $archive_path = api_get_path(SYS_ARCHIVE_PATH); $htaccess = @file_get_contents($archive_path.'.htaccess'); $result = rmdirr($archive_path, true, true); try { \Chamilo\CoreBundle\Composer\ScriptHandler::dumpCssFiles(); } catch (Exception $e) { error_log($e->getMessage()); } if (!empty($htaccess)) { @file_put_contents($archive_path.'/.htaccess', $htaccess); } if (function_exists('opcache_reset')) { opcache_reset(); } if ($result) { Display::addFlash(Display::return_message(get_lang('ArchiveDirCleanupSucceeded'))); } else { Display::addFlash(Display::return_message(get_lang('ArchiveDirCleanupFailed'), 'error')); } header('Location: '.api_get_self()); exit; } Display::display_header(get_lang('ArchiveDirCleanup')); echo Display::return_message(get_lang('ArchiveDirCleanupDescr'), 'warning'); $form->display(); Display::display_footer();