mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-29 23:32:54 +09:00
Add admin screen to delete unnecessary core files from older versions
This commit is contained in:
parent
e97f44826d
commit
ba107a6abf
7 changed files with 488 additions and 3 deletions
|
|
@ -95,7 +95,7 @@ class AdminAdminController extends Admin
|
|||
|
||||
public function procAdminRecompileCacheFile()
|
||||
{
|
||||
return Rhymix\Modules\Admin\Controllers\CacheReset::getInstance()->procAdminRecompileCacheFile();
|
||||
return Rhymix\Modules\Admin\Controllers\Maintenance\CacheReset::getInstance()->procAdminRecompileCacheFile();
|
||||
}
|
||||
|
||||
public function _insertFavorite($site_srl, $module, $type = 'module')
|
||||
|
|
|
|||
|
|
@ -5,7 +5,10 @@
|
|||
<!-- Dashboard -->
|
||||
<action name="dispAdminIndex" class="Controllers\Dashboard" index="true" />
|
||||
<action name="procAdminLogout" class="Controllers\Dashboard" method="GET|POST" />
|
||||
<action name="procAdminRecompileCacheFile" class="Controllers\CacheReset" />
|
||||
<!-- Maintenance -->
|
||||
<action name="procAdminRecompileCacheFile" class="Controllers\Maintenance\CacheReset" />
|
||||
<action name="dispAdminCleanupList" class="Controllers\Maintenance\Cleanup" />
|
||||
<action name="procAdminCleanupFiles" class="Controllers\Maintenance\Cleanup" />
|
||||
<!-- Server Env -->
|
||||
<action name="dispAdminViewServerEnv" class="Controllers\ServerEnv" />
|
||||
<action name="dispAdminRewriteTest" class="Controllers\ServerEnv" standalone="true" />
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Rhymix\Modules\Admin\Controllers;
|
||||
namespace Rhymix\Modules\Admin\Controllers\Maintenance;
|
||||
|
||||
use FileHandler;
|
||||
use ModuleModel;
|
||||
|
|
@ -8,6 +8,7 @@ use ModuleObject;
|
|||
use Rhymix\Framework\Cache;
|
||||
use Rhymix\Framework\Config;
|
||||
use Rhymix\Framework\Storage;
|
||||
use Rhymix\Modules\Admin\Controllers\Base;
|
||||
|
||||
class CacheReset extends Base
|
||||
{
|
||||
375
modules/admin/controllers/maintenance/Cleanup.php
Normal file
375
modules/admin/controllers/maintenance/Cleanup.php
Normal file
|
|
@ -0,0 +1,375 @@
|
|||
<?php
|
||||
|
||||
namespace Rhymix\Modules\Admin\Controllers\Maintenance;
|
||||
|
||||
use Context;
|
||||
use Rhymix\Framework\Security;
|
||||
use Rhymix\Framework\Storage;
|
||||
use Rhymix\Modules\Admin\Controllers\Base;
|
||||
|
||||
class Cleanup extends Base
|
||||
{
|
||||
/**
|
||||
* Cleanup list screen.
|
||||
*/
|
||||
public function dispAdminCleanupList()
|
||||
{
|
||||
// Get the list of files to clean up.
|
||||
$cleanup_list = $this->checkFiles();
|
||||
Context::set('cleanup_list', $cleanup_list);
|
||||
|
||||
// Check previous errors.
|
||||
Context::set('cleanup_errors', $_SESSION['admin_cleanup_errors'] ?? []);
|
||||
unset($_SESSION['admin_cleanup_errors']);
|
||||
|
||||
// Set the template file.
|
||||
$this->setTemplateFile('cleanup');
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleanup action.
|
||||
*/
|
||||
public function procAdminCleanupFiles()
|
||||
{
|
||||
// Cleanup!
|
||||
$result = self::deleteFiles();
|
||||
if (!count($result))
|
||||
{
|
||||
$this->setMessage('success_deleted');
|
||||
}
|
||||
|
||||
// If there were errors, set information in session.
|
||||
else
|
||||
{
|
||||
$this->setMessage('msg_cleanup_manually');
|
||||
$_SESSION['admin_cleanup_errors'] = $result;
|
||||
}
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirectUrl(Context::get('success_return_url') ?: getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdminCleanupList'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for files to clean up.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function checkFiles(): array
|
||||
{
|
||||
$result = [];
|
||||
foreach (self::CLEANUP_LIST as $name => $reason)
|
||||
{
|
||||
// Skip if file/directory distinction doesn't match.
|
||||
if (str_ends_with($name, '/') && !Storage::isDirectory(\RX_BASEDIR . rtrim($name, '/')))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (!str_ends_with($name, '/') && !Storage::isFile(\RX_BASEDIR . $name))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check for case difference and moved target.
|
||||
if ($reason === 'case')
|
||||
{
|
||||
if ($this->checkCaseSensitiveFilesystem())
|
||||
{
|
||||
$result[$name] = $reason;
|
||||
}
|
||||
}
|
||||
elseif (preg_match('/^moved:(.+)$/', $reason, $matches))
|
||||
{
|
||||
if (Storage::exists(\RX_BASEDIR . $matches[1]))
|
||||
{
|
||||
$result[$name] = $reason;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$result[$name] = $reason;
|
||||
}
|
||||
}
|
||||
|
||||
ksort($result);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the filesystem is case-sensitive.
|
||||
*
|
||||
* This method generally returns true on Linux, and false on Windows and Mac OS,
|
||||
* but the result may differ if tested on an unusual filesystem.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function checkCaseSensitiveFilesystem(): bool
|
||||
{
|
||||
// Don't check more than once on the same platform.
|
||||
static $cache = null;
|
||||
if ($cache !== null)
|
||||
{
|
||||
return $cache;
|
||||
}
|
||||
|
||||
// Create two files that differ only in case, and check if they overwrite each other.
|
||||
$file1 = \RX_BASEDIR . 'files/cache/caseTest.php';
|
||||
$file2 = \RX_BASEDIR . 'files/cache/caseTEST.php';
|
||||
Storage::write($file1, '#1:' . Security::getRandom(36) . \PHP_EOL);
|
||||
Storage::write($file2, '#2:' . Security::getRandom(36) . \PHP_EOL);
|
||||
$result = (Storage::read($file1) !== Storage::read($file2));
|
||||
|
||||
// Clean up test files and return the result.
|
||||
Storage::delete($file1);
|
||||
Storage::delete($file2);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete files.
|
||||
*
|
||||
* If a name is given, only that file or directory will be deleted.
|
||||
* Otherwise, all files in the cleanup list will be deleted.
|
||||
*
|
||||
* This method returns the list of files that could not be deleted,
|
||||
* with reasons for each file.
|
||||
*
|
||||
* @param ?string $name
|
||||
* @return array
|
||||
*/
|
||||
public function deleteFiles($name = null): array
|
||||
{
|
||||
// Compile the list of files to delete.
|
||||
$list = [];
|
||||
if ($name !== null)
|
||||
{
|
||||
if (array_key_exists($name, self::CLEANUP_LIST))
|
||||
{
|
||||
$list[$name] = 'deleted';
|
||||
}
|
||||
else
|
||||
{
|
||||
return [$name => 'INVALID'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$list = $this->checkFiles();
|
||||
}
|
||||
|
||||
// Delete each file or directory.
|
||||
$result = [];
|
||||
foreach ($list as $name => $reason)
|
||||
{
|
||||
$normalized_path = \RX_BASEDIR . rtrim($name, '/');
|
||||
if (str_ends_with($name, '/'))
|
||||
{
|
||||
$success = Storage::deleteDirectory($normalized_path, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$success = Storage::delete($normalized_path);
|
||||
}
|
||||
|
||||
if (!$success && Storage::exists($normalized_path))
|
||||
{
|
||||
if (!Storage::isWritable($normalized_path) || !Storage::isWritable(dirname($normalized_path)))
|
||||
{
|
||||
$result[$name] = 'PERMISSION';
|
||||
}
|
||||
elseif (Storage::isSymlink($normalized_path))
|
||||
{
|
||||
$result[$name] = 'SYMLINK';
|
||||
}
|
||||
else
|
||||
{
|
||||
$result[$name] = 'UNKNOWN';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of files and directories to clean up.
|
||||
*/
|
||||
public const CLEANUP_LIST = [
|
||||
|
||||
// Unnecessary files in the root directory
|
||||
'composer.json' => 'moved:common/composer.json',
|
||||
'composer.lock' => 'moved:common/composer.lock',
|
||||
'Gruntfile.js' => 'deleted:xe',
|
||||
'gulpfile.babel.js' => 'deleted:xe',
|
||||
'package.json' => 'deleted:xe',
|
||||
'.babelrc' => 'deleted:xe',
|
||||
'.jshintignore' => 'deleted:xe',
|
||||
'.jshintrc' => 'deleted:xe',
|
||||
'.travis.yml' => 'deleted:xe',
|
||||
|
||||
// Deleted files and directories
|
||||
'classes/cache/CacheApc.class.php' => 'deleted:xe',
|
||||
'classes/cache/CacheFile.class.php' => 'deleted:xe',
|
||||
'classes/cache/CacheMemcache.class.php' => 'deleted:xe',
|
||||
'classes/cache/CacheWincache.class.php' => 'deleted:xe',
|
||||
'classes/db/DBCubrid.class.php' => 'deleted:xe',
|
||||
'classes/db/DBMssql.class.php' => 'deleted:xe',
|
||||
'classes/db/DBMysql.class.php' => 'deleted:xe',
|
||||
'classes/db/DBMysql_innodb.class.php' => 'deleted:xe',
|
||||
'classes/db/DBMysqli.class.php' => 'deleted:xe',
|
||||
'classes/db/DBMysqli_innodb.class.php' => 'deleted:xe',
|
||||
'classes/db/queryparts/' => 'deleted:xe',
|
||||
'classes/object/BaseObject.class.php' => 'deleted:xe',
|
||||
'classes/xml/XmlQueryParser.class.php' => 'deleted:xe',
|
||||
'classes/xml/xmlquery/' => 'deleted:xe',
|
||||
'common/img/flvplayer.swf' => 'deleted:xe',
|
||||
'common/js/jquery-1.12.4.min.js' => 'deleted',
|
||||
'common/js/jquery-1.12.4.js' => 'deleted',
|
||||
'common/js/plugins/jquery.migrate/jquery-migrate-1.4.1.js' => 'deleted',
|
||||
'common/js/plugins/spectrum/bower.json' => 'deleted',
|
||||
'common/js/plugins/spectrum/Gruntfile.js' => 'deleted',
|
||||
'common/js/plugins/spectrum/index.html' => 'deleted',
|
||||
'common/js/plugins/spectrum/package.json' => 'deleted',
|
||||
'common/js/plugins/spectrum/build/' => 'deleted',
|
||||
'common/js/plugins/spectrum/docs/' => 'deleted',
|
||||
'common/js/plugins/spectrum/example/' => 'deleted',
|
||||
'common/js/plugins/spectrum/test/' => 'deleted',
|
||||
'common/libraries/bmp.php' => 'deleted',
|
||||
'common/manual/server_config/rhymix-nginx-help.md' => 'deleted',
|
||||
'config/func.inc.php' => 'deleted:xe',
|
||||
'config/package.inc.php' => 'deleted:xe',
|
||||
'doxygen/' => 'deleted:xe',
|
||||
'libs/' => 'deleted:xe',
|
||||
'modules/admin/ruleset/toggleFavorite.xml' => 'deleted',
|
||||
'modules/admin/tpl/config_ftp.html' => 'deleted',
|
||||
'modules/admin/tpl/img/faviconSample.png' => 'deleted',
|
||||
'modules/admin/tpl/img/mobiconSample.png' => 'deleted',
|
||||
'modules/counter/queries/deleteSiteCounter.xml' => 'deleted:xe',
|
||||
'modules/counter/queries/deleteSiteCounterLog.xml' => 'deleted:xe',
|
||||
'modules/counter/queries/getSiteCounterStatus.xml' => 'deleted:xe',
|
||||
'modules/counter/queries/getSiteCounterStatusDays.xml' => 'deleted:xe',
|
||||
'modules/counter/queries/getSiteStartLogDate.xml' => 'deleted:xe',
|
||||
'modules/counter/queries/getSiteTodayStatus.xml' => 'deleted:xe',
|
||||
'modules/counter/queries/insertSiteTodayStatus.xml' => 'deleted:xe',
|
||||
'modules/counter/queries/updateSiteCounterPageview.xml' => 'deleted:xe',
|
||||
'modules/counter/queries/updateSiteCounterUnique.xml' => 'deleted:xe',
|
||||
'modules/counter/queries/updateSiteTotalCounterUnique.xml' => 'deleted:xe',
|
||||
'modules/editor/skins/xpresseditor/' => 'deleted:xe',
|
||||
'modules/editor/styles/' => 'deleted:xe',
|
||||
'modules/spamfilter/ruleset/' => 'deleted',
|
||||
'phpDoc/' => 'deleted:xe',
|
||||
'tools/' => 'deleted:xe',
|
||||
|
||||
// Deleted lang.xml
|
||||
'common/lang/lang.xml' => 'deleted:xmllang',
|
||||
'layouts/xedition/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/addon/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/admin/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/advanced_mailer/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/autoinstall/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/board/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/comment/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/communication/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/counter/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/document/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/editor/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/editor/skins/ckeditor/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/file/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/importer/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/install/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/integration_search/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/krzip/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/layout/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/member/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/menu/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/message/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/module/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/ncenterlite/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/page/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/point/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/poll/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/rss/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/session/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/spamfilter/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/syndication/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/trash/lang/lang.xml' => 'deleted:xmllang',
|
||||
'modules/widget/lang/lang.xml' => 'deleted:xmllang',
|
||||
|
||||
// Lowercase version of case-sensitive filenames
|
||||
'common/framework/cache.php' => 'case',
|
||||
'common/framework/calendar.php' => 'case',
|
||||
'common/framework/config.php' => 'case',
|
||||
'common/framework/db.php' => 'case',
|
||||
'common/framework/datetime.php' => 'case',
|
||||
'common/framework/debug.php' => 'case',
|
||||
'common/framework/exception.php' => 'case',
|
||||
'common/framework/formatter.php' => 'case',
|
||||
'common/framework/image.php' => 'case',
|
||||
'common/framework/korea.php' => 'case',
|
||||
'common/framework/lang.php' => 'case',
|
||||
'common/framework/mime.php' => 'case',
|
||||
'common/framework/mail.php' => 'case',
|
||||
'common/framework/pagination.php' => 'case',
|
||||
'common/framework/password.php' => 'case',
|
||||
'common/framework/push.php' => 'case',
|
||||
'common/framework/router.php' => 'case',
|
||||
'common/framework/sms.php' => 'case',
|
||||
'common/framework/security.php' => 'case',
|
||||
'common/framework/session.php' => 'case',
|
||||
'common/framework/storage.php' => 'case',
|
||||
'common/framework/timer.php' => 'case',
|
||||
'common/framework/ua.php' => 'case',
|
||||
'common/framework/url.php' => 'case',
|
||||
'common/framework/drivers/cacheinterface.php' => 'case',
|
||||
'common/framework/drivers/mailinterface.php' => 'case',
|
||||
'common/framework/drivers/pushinterface.php' => 'case',
|
||||
'common/framework/drivers/smsinterface.php' => 'case',
|
||||
'common/framework/exceptions/dberror.php' => 'case',
|
||||
'common/framework/exceptions/featuredisabled.php' => 'case',
|
||||
'common/framework/exceptions/invalidrequest.php' => 'case',
|
||||
'common/framework/exceptions/mustlogin.php' => 'case',
|
||||
'common/framework/exceptions/notpermitted.php' => 'case',
|
||||
'common/framework/exceptions/queryerror.php' => 'case',
|
||||
'common/framework/exceptions/securityviolation.php' => 'case',
|
||||
'common/framework/exceptions/targetnotfound.php' => 'case',
|
||||
'common/framework/filters/filecontentfilter.php' => 'case',
|
||||
'common/framework/filters/filenamefilter.php' => 'case',
|
||||
'common/framework/filters/htmlfilter.php' => 'case',
|
||||
'common/framework/filters/ipfilter.php' => 'case',
|
||||
'common/framework/filters/mediafilter.php' => 'case',
|
||||
'common/framework/helpers/confighelper.php' => 'case',
|
||||
'common/framework/helpers/dbhelper.php' => 'case',
|
||||
'common/framework/helpers/dbresulthelper.php' => 'case',
|
||||
'common/framework/helpers/dbstmthelper.php' => 'case',
|
||||
'common/framework/helpers/sessionhelper.php' => 'case',
|
||||
'common/framework/parsers/baseparser.php' => 'case',
|
||||
'common/framework/parsers/configparser.php' => 'case',
|
||||
'common/framework/parsers/dbqueryparser.php' => 'case',
|
||||
'common/framework/parsers/dbtableparser.php' => 'case',
|
||||
'common/framework/parsers/editorcomponentparser.php' => 'case',
|
||||
'common/framework/parsers/langparser.php' => 'case',
|
||||
'common/framework/parsers/moduleactionparser.php' => 'case',
|
||||
'common/framework/parsers/moduleinfoparser.php' => 'case',
|
||||
'common/framework/parsers/xmlrpcparser.php' => 'case',
|
||||
'common/framework/parsers/dbquery/columnread.php' => 'case',
|
||||
'common/framework/parsers/dbquery/columnwrite.php' => 'case',
|
||||
'common/framework/parsers/dbquery/condition.php' => 'case',
|
||||
'common/framework/parsers/dbquery/conditiongroup.php' => 'case',
|
||||
'common/framework/parsers/dbquery/emptystring.php' => 'case',
|
||||
'common/framework/parsers/dbquery/groupby.php' => 'case',
|
||||
'common/framework/parsers/dbquery/indexhint.php' => 'case',
|
||||
'common/framework/parsers/dbquery/navigation.php' => 'case',
|
||||
'common/framework/parsers/dbquery/nullvalue.php' => 'case',
|
||||
'common/framework/parsers/dbquery/orderby.php' => 'case',
|
||||
'common/framework/parsers/dbquery/query.php' => 'case',
|
||||
'common/framework/parsers/dbquery/table.php' => 'case',
|
||||
'common/framework/parsers/dbquery/variablebase.php' => 'case',
|
||||
'common/framework/parsers/dbtable/column.php' => 'case',
|
||||
'common/framework/parsers/dbtable/constraint.php' => 'case',
|
||||
'common/framework/parsers/dbtable/index.php' => 'case',
|
||||
'common/framework/parsers/dbtable/table.php' => 'case',
|
||||
'modules/member/controllers/device.php' => 'case',
|
||||
|
||||
// Vendor directory
|
||||
'vendor/' => 'moved:common/vendor/',
|
||||
];
|
||||
}
|
||||
|
|
@ -411,3 +411,22 @@ $lang->opcache_reset_function_not_found = 'opcache is disabled on this server.';
|
|||
$lang->unsupported_php_version_notice = 'The minimum PHP version for using Rhymix will change in 2023. Please upgrade your PHP version, and check if all the modules and widgets you added are compatible with the new version.';
|
||||
$lang->unsupported_php_version_required = 'Requirement: minimum PHP 7.2 or higher, recommended PHP 7.4 or higher';
|
||||
$lang->unsupported_php_version_current = 'Your version: PHP %s';
|
||||
$lang->admin_cleanup_unnecessary_core_files = 'Clean up unnecessary core files';
|
||||
$lang->about_cleanup_unnecessary_core_files = 'Your site map contain unnecessary files from older versions of Rhymix or XE.<br>This feature will help you clean them up.<br>All of the following files and directories are safe to delete if you have updated to the current version in the normal way.';
|
||||
$lang->cmd_cleanup_filename = 'Filename to delete';
|
||||
$lang->cmd_cleanup_filetype = 'Type';
|
||||
$lang->cmd_cleanup_filetype_file = 'file';
|
||||
$lang->cmd_cleanup_filetype_directory = 'directory';
|
||||
$lang->cmd_cleanup_filetype_symlink = 'symbolic link';
|
||||
$lang->cmd_cleanup_reason = 'Reason to delete';
|
||||
$lang->cmd_cleanup_reason_deleted = 'Not used anymore';
|
||||
$lang->cmd_cleanup_reason_deleted_xe = 'This %s was only used in XE';
|
||||
$lang->cmd_cleanup_reason_deleted_xmllang = 'This is an XML lang file only used in XE';
|
||||
$lang->cmd_cleanup_reason_moved = 'Moved';
|
||||
$lang->cmd_cleanup_reason_case = 'Changed case';
|
||||
$lang->cmd_cleanup_error_reason = 'Reason for failure';
|
||||
$lang->msg_cleanup_list_empty = 'There is no file to clean up.';
|
||||
$lang->msg_cleanup_manually = 'Some files and/or directories could not be cleaned up. Please check them and delete them manually.';
|
||||
$lang->cmd_cleanup_error_permission = 'Permissions';
|
||||
$lang->cmd_cleanup_error_symlink = 'Symbolic link';
|
||||
$lang->cmd_cleanup_error_other = 'Other';
|
||||
|
|
|
|||
|
|
@ -407,3 +407,22 @@ $lang->opcache_reset_function_not_found = 'opcache를 사용하지 않는 서버
|
|||
$lang->unsupported_php_version_notice = '2023년부터 라이믹스가 지원하는 PHP 버전이 변경됩니다. PHP 버전을 업그레이드하시고, 추가로 설치하신 모듈과 위젯 등이 새로운 PHP 버전에서 정상 작동하는지 미리 확인하시기 바랍니다.';
|
||||
$lang->unsupported_php_version_required = '필요한 버전: 최소 PHP 7.2 이상, 권장 PHP 7.4 이상';
|
||||
$lang->unsupported_php_version_current = '사용중인 버전: PHP %s';
|
||||
$lang->admin_cleanup_unnecessary_core_files = '불필요한 코어 파일 삭제';
|
||||
$lang->about_cleanup_unnecessary_core_files = '오래된 버전의 라이믹스나 XE에서 업그레이드한 경우 불필요한 파일이 남아 있거나 파일명이 변경되었을 수 있습니다.<br>이 기능을 사용하면 불필요한 코어 파일을 일괄 삭제할 수 있습니다.<br>정상적인 방법으로 코어를 업그레이드하셨다면 아래의 파일과 디렉토리들은 모두 삭제해도 무방합니다.';
|
||||
$lang->cmd_cleanup_filename = '삭제할 파일명';
|
||||
$lang->cmd_cleanup_filetype = '유형';
|
||||
$lang->cmd_cleanup_filetype_file = '파일';
|
||||
$lang->cmd_cleanup_filetype_directory = '디렉토리';
|
||||
$lang->cmd_cleanup_filetype_symlink = '심볼릭 링크';
|
||||
$lang->cmd_cleanup_reason = '삭제 이유';
|
||||
$lang->cmd_cleanup_reason_deleted = '단순 삭제';
|
||||
$lang->cmd_cleanup_reason_deleted_xe = 'XE에서 사용하던 %s';
|
||||
$lang->cmd_cleanup_reason_deleted_xmllang = 'XE에서 사용하던 XML 언어 파일';
|
||||
$lang->cmd_cleanup_reason_moved = '이동';
|
||||
$lang->cmd_cleanup_reason_case = '대소문자 구분 변경';
|
||||
$lang->cmd_cleanup_error_reason = '삭제 실패 이유';
|
||||
$lang->msg_cleanup_list_empty = '삭제할 파일이 없습니다.';
|
||||
$lang->msg_cleanup_manually = '일부 파일이나 디렉토리를 삭제할 수 없습니다. 서버에서 직접 삭제해 주시기 바랍니다.';
|
||||
$lang->cmd_cleanup_error_permission = '퍼미션';
|
||||
$lang->cmd_cleanup_error_symlink = '심볼릭 링크';
|
||||
$lang->cmd_cleanup_error_other = '기타';
|
||||
|
|
|
|||
68
modules/admin/tpl/cleanup.html
Normal file
68
modules/admin/tpl/cleanup.html
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
<config autoescape="on" />
|
||||
|
||||
<div class="x_page-header">
|
||||
<h1>{$lang->admin_cleanup_unnecessary_core_files}</h1>
|
||||
</div>
|
||||
|
||||
<div cond="!empty($XE_VALIDATOR_MESSAGE) && $XE_VALIDATOR_ID == 'modules/admin/tpl/cleanup/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||
</div>
|
||||
|
||||
<section class="section">
|
||||
<form action="./" method="post" class="x_form-horizontal">
|
||||
<input type="hidden" name="module" value="admin" />
|
||||
<input type="hidden" name="act" value="procAdminCleanupFiles" />
|
||||
<input type="hidden" name="xe_validator_id" value="modules/admin/tpl/cleanup/1" />
|
||||
<p>{$lang->about_cleanup_unnecessary_core_files}</p>
|
||||
<table class="x_table x_table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="nowr">{$lang->no}</th>
|
||||
<th scope="col" class="nowr">{$lang->cmd_cleanup_filename}</th>
|
||||
<th scope="col" class="nowr">{$lang->cmd_cleanup_filetype}</th>
|
||||
<th scope="col" class="nowr">{$lang->cmd_cleanup_reason}</th>
|
||||
<!--@if($cleanup_errors)-->
|
||||
<th scope="col" class="nowr">{$lang->cmd_cleanup_error_reason}</th>
|
||||
<!--@endif-->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{@ $no = 1}
|
||||
<!--@foreach($cleanup_list as $file => $reason)-->
|
||||
{@ $filetype = str_ends_with($file, '/') ? $lang->cmd_cleanup_filetype_directory : $lang->cmd_cleanup_filetype_file}
|
||||
<tr>
|
||||
<td class="nowr">{$no++}</td>
|
||||
<td class="nowr">{rtrim($file, '/')}</td>
|
||||
<td class="nowr">{$filetype}</td>
|
||||
<td class="nowr">
|
||||
<!--@if($reason === 'deleted')-->{$lang->cmd_cleanup_reason_deleted}<!--@endif-->
|
||||
<!--@if($reason === 'deleted:xe')-->{sprintf($lang->cmd_cleanup_reason_deleted_xe, $filetype)}<!--@endif-->
|
||||
<!--@if($reason === 'deleted:xmllang')-->{$lang->cmd_cleanup_reason_deleted_xmllang}<!--@endif-->
|
||||
<!--@if($reason === 'case')-->{$lang->cmd_cleanup_reason_case}<!--@endif-->
|
||||
<!--@if(preg_match('/^moved:(.+)$/', $reason, $matches))-->{$lang->cmd_cleanup_reason_moved}: {$matches[1]}<!--@endif-->
|
||||
</td>
|
||||
<!--@if($cleanup_errors)-->
|
||||
<td scope="col" class="nowr" style="color:red">
|
||||
<!--@if(isset($cleanup_errors[$file]))-->
|
||||
<!--@if($cleanup_errors[$file] === 'PERMISSION')-->{$lang->cmd_cleanup_error_permission}<!--@endif-->
|
||||
<!--@if($cleanup_errors[$file] === 'SYMLINK')-->{$lang->cmd_cleanup_error_symlink}<!--@endif-->
|
||||
<!--@if($cleanup_errors[$file] === 'UNKNOWN')-->{$lang->cmd_cleanup_error_other}<!--@endif-->
|
||||
<!--@endif-->
|
||||
</th>
|
||||
<!--@endif-->
|
||||
</tr>
|
||||
<!--@endforeach-->
|
||||
<!--@if(!$cleanup_list)-->
|
||||
<tr>
|
||||
<td class="nowr" colspan="4">{$lang->msg_cleanup_list_empty}</td>
|
||||
</tr>
|
||||
<!--@endif-->
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="x_clearfix btnArea">
|
||||
<div class="x_pull-right">
|
||||
<button type="submit" class="x_btn x_btn-primary">{$lang->cmd_delete}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
Loading…
Add table
Add a link
Reference in a new issue