Cache and Revisions Eraser

https://github.com/justburn/DokuWiki_CacheRevisionsEraser にアクセス

[Clone or download] [Download ZIP]

DokuWiki_CacheRevisionsEraser-master.zip を解凍
  解凍したフォルダーが DokuWiki_CacheRevisionsEraser-master となっていること

DokuWiki_CacheRevisionsEraser-mastercacherevisionserase にリネーム

アップロード前に、cacherevisionserase フォルダーに対してカスタマイズを行う

configs.in.phpconfigs.php としてコピー

configs.php を編集

$this->configs['cache_delext_css'] = -1;     // Delete extension ".css"?  4 states option (Default: -1)
$this->configs['cache_delext_mediaP'] = -1;  // Delete extension ".media.*"?  4 states option (Default: -1)
$this->configs['cache_delext_UNK'] = -1;     // Delete all other unknown extensions?  4 states option (Default: -1)
$this->configs['cache_del_oldlocks'] = -1;   // Delete old lost page locks?  4 states option (Default: -1)
$this->configs['cache_del_indexing'] = -2;   // Delete Indexing-search?  4 states option (Default: -2)
$this->configs['cache_del_metafiles'] = -2;  // Delete meta files?  4 states option (Default: -1)
$this->configs['cache_del_revisfiles'] = -1; // Delete old revisions files?  4 states option (Default: -1)

$this->configs['allow_outputinfo'] = true;  // Allow to change verbose level? false=No true=Yes (Default: true)
$this->configs['level_outputinfo'] = 2;     // Default verbose level... 0=Silent, 1=Filenames Only, 2=All (Default: 2)

?>

function getInfo(){
    return array(
        'author' => 'JustBurn',
        'email'  => 'justburner@armail.pt',
        'date'   => CACHEREVISIONSERASER_DATE,
        'name'   => html_entity_decode($this->lang['title']),
        'desc'   => html_entity_decode($this->lang['desc']),
        'url'    => 'https://www.dokuwiki.org/plugin:cacherevisionseraser',
    );
}
 
/**
* Return prompt for admin menu
*/
            ptln('<br /><br /><p class="centeralign"><input type="submit" class="button" value="'.$this->lang['eraserevisionsbtn'].'" /></p>');
            ptln('<div class="centeralign"><em>'.$this->lang['revisionswarn'].'</em></div>');
            ptln('</form>');
        } else {
            ptln($this->lang['revisdisabled'].'<br />');
        }
        ptln('</th></tr></table>');
    }
    ptln('<br /><a href="https://www.dokuwiki.org/plugin:cacherevisionseraser" class="urlextern" target="_blank">'.$this->lang['searchyounewversionurl'].'</a> [English only]<br />');
}
 
/**
* Delete all files into cache directory
*/
function rmeverything_cache($fileglob, $basedir, $params, $outputinfo)

lang フォルダー配下に ja フォルダーを作成

ja フォルダー配下に lang.php ファイルを作成

<?php
/**
 * Japanese language file
 */

$lang['encoding']                      = 'utf-8';
$lang['direction']                     = 'ltr';
$lang['utf8supportrequired']           = false;
$lang['language']                      = 'Japanese'; // Debug only, leave it untranslated
$lang['menu']                          = 'Erase cache/revisions';
$lang['title']                         = 'Cache/Revisions Eraser';
$lang['desc']                          = 'Erase wiki\'s cache and/or old revisions';
$lang['successcache']                  = 'キャッシュ削除が完了しました。';
$lang['successrevisions']              = '更新履歴削除が完了しました。';
$lang['failedcache']                   = 'ファイル削除でエラーが発生しました。パーミッションを確認してください。';
$lang['failedrevisions']               = 'フォルダー削除でエラーが発生しました。パーミッションを確認してください。';
$lang['deletefile']                    = 'ファイル削除成功';
$lang['deletefileerr']                 = 'ファイル削除失敗';
$lang['deletedir']                     = 'フォルダー削除成功';
$lang['deletedirerr']                  = 'フォルダー削除失敗';
$lang['erasecachebtn']                 = 'キャッシュ削除開始';
$lang['eraserevisionsbtn']             = '更新履歴削除開始';
$lang['askcache']                      = 'キャッシュ削除を開始してもよろしいですか?';
$lang['askrevisions']                  = '更新履歴削除を開始してもよろしいですか?';
$lang['cachedesc']                     = '<<<< キャッシュ削除オプション >>>>';
$lang['revisionsdesc']                 = '<<<< 更新履歴削除オプション >>>>';
$lang['revisionswarn']                 = '!!警告!! 削除すると元に戻せません!!';
$lang['backbtn']                       = '戻る';
$lang['cachedisabled']                 = 'キャッシュ削除が無効になっています。';
$lang['revisdisabled']                 = '更新履歴削除が無効になっています。';
$lang['extdesc_i']                     = '.i files (Backlinks and more???)';
$lang['extdesc_xhtml']                 = '.xhtml files (Cached HTML form of a wiki page)';
$lang['extdesc_js']                    = '.js files (Cached Javascript)';
$lang['extdesc_css']                   = '.css files (Cached CSS-Sheet)';
$lang['extdesc_mediaP']                = '.media.* files (Cached media files)';
$lang['extdesc_UNK']                   = 'All other unknown formats';
$lang['delindexingdesc']               = 'Indexed-search files (not recommended)';
$lang['delmetadesc']                   = 'History of old revisions (meta/*)';
$lang['deloldlockdesc']                = 'Old lost page locks (*.lock)';
$lang['lockexpirein']                  = 'Lock will expire in';
$lang['seconds']                       = 'seconds';
$lang['version']                       = 'version';
$lang['delrevisdesc']                  = 'Old revisions files (attic/*)';
$lang['pathclasserror']                = 'Cannot detect path class of';
$lang['analyze_confmissingfailed']     = 'ERROR: Missing or imcompatible configurations file';
$lang['analyze_confrevisionfailed']    = 'ERROR: Incompatible configurations file';
$lang['analyze_cachedirfailed']        = 'ERROR: Plug-in failed to get the cache directory<br />Use the debugger to check the cachedir variable';
$lang['analyze_revisdirfailed']        = 'ERROR: Plug-in failed to get the revisions directory<br />Use the debugger to check the revisdir variable';
$lang['analyze_pagesdirfailed']        = 'ERROR: Plug-in failed to get the pages directory<br />Use the debugger to check the pagesdir variable';
$lang['analyze_metadirfailed']         = 'ERROR: Plug-in failed to get the meta directory<br />Use the debugger to check the metadir variable';
$lang['analyze_locksdirfailed']        = 'ERROR: Plug-in failed to get the locks directory<br />Use the debugger to check the locksdir variable';
$lang['analyze_checkreadme']           = 'Please check readme.txt file or the official plug-in webpage for more information about this error';
$lang['analyze_creatingdefconfs']      = 'Creating configurations file...';
$lang['analyze_creatingdefconfs_x']    = 'failed (C/R Erase plug-in directory doesn\'t allow writing)';
$lang['analyze_creatingdefconfs_o']    = 'success (Please reanalyze)';
$lang['yesbtn']                        = 'Yes';
$lang['nobtn']                         = 'No';
$lang['reanalyzebtn']                  = 'Reanalyze';
$lang['cache_word']                    = 'cache';
$lang['lock_word']                     = 'lock';
$lang['meta_word']                     = 'meta';
$lang['oldrevis_word']                 = 'old revis.';
$lang['delxcacheclass']                = 'Display cache class';
$lang['delxrevisclass']                = 'Display revisions class';
$lang['delxdebugmode']                 = 'Debug mode';
$lang['delxverbose']                   = 'Report level while processing the cleanup';
$lang['wordb_enable']                  = 'Enable';
$lang['wordb_option']                  = 'Option';
$lang['wordb_optiondesc']              = 'Option description';
$lang['wordb_allowuserchag']           = 'Allow change';
$lang['wordb_checkedasdef']            = 'Default checked';
$lang['createconfbtn']                 = 'Create config.php';
$lang['searchyounewversionurl']        = 'Visit Cache and Revisions Eraser Website (Open new window)';
$lang['outputinfo_text']               = 'レポート:';
$lang['outputinfo_lvl0']               = '表示なし';
$lang['outputinfo_lvl1']               = 'ファイル名';
$lang['outputinfo_lvl2']               = '全て';
$lang['numfilesdel']                   = '削除ファイル数:';
$lang['numdirsdel']                    = '削除フォルダー数:';
$lang['cfgdesc_menusort']              = 'Menu position inside the Admin list (Def: 67)';

?>

ローカルの cacherevisionserase フォルダーを /site_root/lib/plugins/ 配下にアップロード

DokuWik に管理者権限のユーザーでログイン

[管理]
  追加プラグインに Erase cache/revisions (v1.6.6) が表示されていること

拡張機能管理上では「プラグインは正しくインストールされませんでした」と表示されていますが無視してください。

DokuWik に管理者権限のユーザーでログイン

[管理] [Erase cache/revisions (v1.6.6)]

コメントを入力:
 
  • dokuwiki/extension/plugin/cacherevisionseraser
  • 最終更新: 2019/10/17
  • (外部編集)