Cache and Revisions Eraser

cacherevisionseraser plugin by JustBurn
Erase entire cache and/or old wiki revisions

Last updated on 2008-04-10. Provides Admin.
No compatibility info given!

Tagged with cache, cleanup, maintenance, revisions.

Current Version: 1.6.1

NOTE: planetaclix mirror has been deleted, sorry for the inconvenience

This admin plug-in allows you to erase the entire cache and/or old wiki revisions.

Only use this plug-in if you want to clean up your wiki or if the cache gets corrupted.

I won't take any responsibility for data lost due to wrong plug-in usage.

Once old revisions are erased; there's no way to restore them.

What's new?

v1.6.1

  • Plugin now report the lastest version date into the Plugins Manager (Thanks Ilya Lebedev)
  • Updated Russian Language (Thanks Alexander Zubkov)

v1.6.0

  • Changes into the design and HTML output (Valid XHTML 1.0 now)
  • Added a workaround for Plugins Manager without UTF-8 support for languages that contains UTF-8 characters.
  • Added report level (Detail on output information: Silent; Files only; All)
  • Added information of how many files & directories were deleted
  • Updated Italian Language (Thanks Diego Pierotto)
  • Updated Russian Language (Thanks Alexander Zubkov)
  • NOTE: This version have a new config file revision, you'll need to re-create config.php if you're upgrading.

v1.5.4

  • Added a hyperlink in the plug-in main page to quickly visit the website (It will open a new window)
  • Display the plug-in version in the Administration tasks lists
  • Updated German Language (Thanks alex)

v1.5.3

  • Bugfixes on writeconfigs function (Thanks Gary for the bug report)

v1.5.2

  • User now can create 'configs.php' from the plug-in instead of accepting the default one (See FAQ)
  • Fixed a bug about some configurations in 'configs.php' (Thanks Robert Riebisch)
  • Updated Russian language (v1.5.1) (Thanks Alexander Zubkov)
  • Changes into some sentences inside the languages files
  • Discarded outdated language versions (they are still available as a patch)

v1.5.1

  • Fixed old locks directory searching
  • Deleting files/directories will now show where they are being processed (cache, locks, meta or old-revis.)

v1.5.0

  • Improved security (Check directories variables & configurations file checking)
  • Added debug list for checking some internal variables (must be enabled in configs)
  • Fixed meta directory variable
  • Improved files searching engine (Thanks Jeff)
  • Many others minor changes…

v1.4.3

  • Fixed French language (v1.4.*) (From Flavien Viollet).
  • Added Brasil (Portuguese) language (v1.4.*).

v1.4.2

  • Added French language (v1.4.*) (Thanks Flavien Viollet).
  • Renamed correctly the russian language filename (Although language isn't yet updated to v1.4.*).
  • Using $conf['savedir'] when $conf['datadir'] isn't available.
  • Converting files to UNIX format (line-break: 0×10).

v1.4.1

  • Updated German language (v1.4.*) (Thanks konus).
  • Added Italian language (v1.4.*) (Thanks EndelWar).
  • Fixed “version” text that i've forgot to do multi-language support (Thanks EndelWar).
  • Fixed internal variables for paths (In case they aren't the default ones) (Thanks Christopher Smith).
  • Added a “readme.txt” into the zip with same information as the wiki.

v1.4

  • Added German language (v1.3.*) (Thanks konus).
  • Added Meta files & old lost page locks deletion (suggestion from Kibi).
  • “Old lost page locks (*.lock)” will delete expired locks that aren't deleted by DokuWiki due of creating a page and cancel it (generating a orphan .lock file).

v1.3.1

  • Updated Russian language (v1.3.*) (Thanks Kibi).

v1.3

  • Added configurations file “\plugins\cacherevisionserase\configs.php” (request from Hoberion), you should edit it after the install:
    • Position in admin menu (Default 67).
    • Enable/Disable cache erase command (Default ON).
    • Enable/Disable all old revisions erase command (Default OFF).
    • Ask/Enable/Disable delection of cache of extensions:
      • .i files (Backlinks and more???) (Default ASK).
      • .xhtml files (HTML form of a page) (Default ASK).
      • .js files (Cached Javascript) (Default ASK).
      • .css files (Cached CSS-Sheet) (Default ASK).
      • .media.* files (Cached media files) (Default ASK).
      • All other unknown formats (Default ASK).
      • Indexed-search files (Default ASK).


Thanks Hoberion for all issues.

v1.2

  • Added Russian language (Thanks Kibi).
  • Fixed bug that didn't delete cache file / revision page with “_dummy” text on it.
  • Fixed “data” path with accordance of security tips (Thanks Kibi).
  • Removed auth mechanism (Doku Wiki don't allow non-admin users to access admins plug-ins anyway), no longer “Invalid auth mechanism” error is returned.

v1.1

  • Joined the two plug-ins into a single one.
  • Added a basic GUI.
  • Plug-in will now ask the admin if he want to execute the command.
  • Absolute path of files are now hidden.

v1.0

  • First release.

Available languages

More translations are welcome.

REQUEST: To improve multi-language support of newer releases, is possible to organize a group of peoples to update languages files before a public release so that no language go outdated? — JustBurn 2007-03-13 16:45

Download & Installation

New mirrors are welcome!

Method 1:

  • Go to “Admin” and select “Manage Plugins”
  • In the URL Textbox, type one of the mirrors:
http://ph0x.drunkencoders.com/dokuwikiplugin/dokuwiki_plugin_cacherevisions_eraser.zip
http://deeplayer.com/mirror/cerase/v1.6.0/dokuwiki_plugin_cacherevisions_eraser.zip
  • Press “Download” and it will be automatically installed!
  • If you want to modify default configuration:
    • Modify “<dokuwiki directory>/lib/plugins/cacherevisionserase/configs.php” configurations file with a text editor.
  • You can update in the future by pressing “Update” over the “cacherevisionserase” plug-in.

Method 2:

  • Download the zip package provided in any of this mirrors:
  • Unzip into ‘<dokuwiki directory>/lib/plugins/’ directory (you should end up with a ‘<dokuwiki directory>/lib/plugins/cacherevisionserase’ folder).
  • Modify “<dokuwiki directory>/lib/plugins/cacherevisionserase/configs.php” configurations file with a text editor.
  • That's it! Plug-in is now installed and working!

Hash:

Well… why not? Probably useful for unix users, it mainly serve to check if the file is not corrupted or modified. Please don't modify the values :(

  • Cache and Revisions Eraser v1.6.1
    • MD5: 16a5ecef695bc41b07d3ae397f0098ea
    • SHA-1: a5558704ba4ae7488fd0d7813c07210830ec2c5f
  • Cache and Revisions Eraser v1.6.0
    • MD5: a977b7906fd558b89e54b200c1aa2e87
    • SHA-1: d7d45953b00e2defc38cb7eedf62dfb1fa286e62
  • Cache and Revisions Eraser v1.5.4
    • MD5: 6a1bdb76c012645b63ea8ec7c34b6fee
    • SHA-1: cdaccdce45f83cfc4172d12c317b4279185a0d63

FAQ (Frequently Asked Questions)

Q: Is it safe to erase DokuWiki cache?

A: Yes, but erasing indexed-search files isn't recommended.

-

Q: Is it safe to erase old revision pages?

A: Before doing that, make sure all your wiki pages are clean from spam since you can't revert back once all of them are deleted.

-

Q: Help! I don't know how to use this plug-in and I'm afraid to accidentally damage my Wiki.

A: Sorry, there isn't any newbie document available atm. Follow the “Download & Install” carefully and don't forget to modify the config.php if you aren't the only administrator using the wiki.

-

Q: How to modify “configs.php” from the web?

A: v1.5.2 and above you can modify only if “configs.php” doesn't exist.

-

Q: Is it possible to revert old revisions erasure?

A: Nope, once they are deleted, they cannot be restored or undeleted.

-

Q: Is it possible to backup old revisions into a single ZIP file for example and delete them in the wiki?

A: It isn’t possible to backup the files with this plug-in. You can try Doku Zip Backup or BackupTool for DokuWiki plug-ins for this purpose.

-

Q: Installed the plug-in correctly but I'm getting the error “ERROR: Missing or imcompatible configurations file (ERR: 1)”.

A: That's normal and always happen when you freshly install the plug-in. The error tells you that there's no configuration file, you just need to setup the configurations into that page and click “Create config.php”… Then “Re-analyze” to refresh the configurations.

-

Q: Installed a newer version of the plug-in and transfered the old config.php into that directory but I'm getting the error “ERROR: Incompatible configurations file (ERR: 2)”.

A: The newer version of the plug-in may have major changes into the configurations file and isn't recommended or safe to use with old configurations. Please delete the old config.php, run the plug-in, configure all the options and click “Create config.php”.

-

Q: Installed a newer version of DokuWiki and getting errors 3, 4, 5, 6 or 7.

A: It shouldn't happen but if it does please contact me, don't forget to tell the DokuWiki version your using!

-

More Q & A, please?

Discussion

Any problems, bugs or improvements should be posted here.


This plugin uses hard coded paths to data/attic and data/cache directories. If you have changed your installation, for example in accordance with security tips, you should change corresponding lines in cacherevisionserase/admin.php:

94:        if ($this->rmeverything(DOKU_INC.'data/cache')) {
116:       if ($this->rmeverything(DOKU_INC.'data/attic')) {
188:       if (strcmp($fileglob, DOKU_INC.'data/cache') == 0) return true;
189:       if (strcmp($fileglob, DOKU_INC.'data/attic') == 0) return true;

Kibi 2006-06-18 18:39

Thank's for the bug report, fixed in version 1.2 :) — JustBurn 2006-06-26 09:56

the plugin don't work, when I try to use it, the folowing prompt appeare

Invalid auth mechanism

What I can do, to resolve that?

Thank's for the bug report, fixed in version 1.2 :) — JustBurn 2006-06-26 09:56

I have the same Problem with it. Can anybody help with this problem ?

It's fixed in version 1.2 :) — JustBurn 2006-06-26 09:56

Is it possible to split the plugin into cache-eraser and revision-eraser or to deactivate it in a config file? I dont want an admin to clean the revisions so easely (although I can allways revert to a nightly backup) — Hoberion 2006-06-26 16:09

Yes, configurations will be inplemented in version 1.3, thank's for the idea :) — JustBurn 2006-06-27 01:12

Issue: when I delete the cache it also deletes the search files.. so there are no results after a delete (I tested it before a delete and got results for a search, right after a delete cache the results were empty. The Searchindex plugin seems to solve this — Hoberion 2006-06-28 21:08

Didn't noticed that cleaning cache also cleaned indexed search words, disabling “Indexed-search files” delection seems to fix the issue, thank's :) . — JustBurn 2006-06-30 00:59
You may install searchindex plugin and re index whole of your wiki after cleaning up. — Kibi 2006-07-04 16:41

Issue: backlinks dissapear after a cache clean, running the searchindex plugin afterwards doesnt solve this issue, an edit of a page linking to that page seems to solve it for that specific page, browsing seems to solve this :) — Hoberion 2006-06-28 21:31

It seems a complex problem, backlinks information is inside the cache himself (data inside extension ”.i”?)… although browsing fix the problem (because cache is re-generated) you can set to turn on/off delection of some commom files in v1.3, hope that helps :) . — JustBurn 2006-06-30 04:40

I found there is directory data/meta that contains a lot of “garbage”. As far as I understand, it's place where DokuWiki holds information about indexing status and something like that.

And sometimes orphan .lock files stays in data/pages directory. If you start creating page, and cancel it, orphan lock file will be created. Your utility could hunt for such files. — Kibi 2006-07-04 16:45

Thank's for the suggestions, they are implemented in v1.4 :) — JustBurn 2006-07-07 01:52

Hi, A couple of ideas for this plugin.

  • The development version of DokuWiki can now integrate plugin settings with the config plugin. In preparation for the next release you can use the same system by copying the config functions into your plugin class. For an example, refer to google maps plugin.
  • You aren't using the correct internal variables for your paths.
    • cache ⇒ $conf['cachedir'];
    • attic ⇒ $conf['olddir'];
    • wiki pages ⇒ $conf['datadir'];
    • meta data ⇒ $conf['meta'];

Christopher Smith 2006-07-07 10:46

The configurations should only be changed by the person who has access to website files (System Admin), he can allow all features to be accessed by a Wiki Admin through so a Wiki Admin really dont need to touch the configurations. NOTE: System Admin may not want the “Revisions Eraser” to be enabled, see Hoberion comment above.
Thank's for the internal variables correction, they will be supported in the next version. :) — JustBurn 2006-07-09 02:28

In latest wiki conf the 'datadir' has changed to 'savedir', So you need to edit admin.php, change line 69 from “$this→pagesdir = $conf['datadir'];” to “$this→pagesdir = $conf['savedir'];”

Added support for v1.4.2 in case the 'datadir' doesn't exist… if there's any problem regarding to this, please email me or reply in this wiki — JustBurn 2006-10-17 20:49

Deleting meta data directory gives empty page (error?) and does nothing. If one did not choose to delete meta data everything goes ok.

What dokuwiki version are you using?
Can you tell if $conf['meta'] pointing to the correct metafiles directory?
If the server is using Apache, can you provide the error log's lines when this happen?
Please email me if you can find the source of the problem and i'll short it out :) — JustBurn 2006-12-25 05:56

Publish the file better without the versionnumber in the filename, for updates with the pluginmanager

Thank's, didn't noticed that the Plugin Management allowed to automatically install from this ZIP package. — JustBurn 2007-01-18 20:02

Cool :-), thank’s for the plugin.


Downloaded 1.4.3, but when I tried to run it (to get rid oft he old versions of pages that have accumulated) the dialog box said Erasing all old revisions has been disabled

Is this a general thing or is it a limitation of my dokuwiki installation. The plugin - according to the documentation - is just what I was looking for to delete the old versions but it doesn't want to do it …

Cheers, Edward

In “<dokuwiki directory>/lib/plugins/cacherevisionserase/configs.php”, set $this→configs['allow_allrevisdel'] to true. — sfidanza 2007-01-23
Yes, why didn't I see that. Works brilliantly now, thanks, Edward

Hello JustBurner, hello every one, Trying it under Apache 2.2 on WinXP, I get this error message :

Purge Cache/Révisions version 1.4.3
Couldn't remove directory '/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*........'.
Error erasing all revisions, check file permitions.

I've found a (bad ?) trick to correct the problem.

    // ========== From this ==========
    function rmeverything_revis($fileglob, $basedir)
    {
        (......)
        } else if (is_dir($fileglob)) {
        (......)
    }
 
    // ========== To this ==========
    function rmeverything_revis($fileglob, $basedir)
    {
        (......)
        } else if (is_dir($fileglob) && (strstr($fileglob, '*') === false)  ) {
        (......)
    }

Thanks for the plugin, it's very cool. — Jeff 2007-01-25 17:07

I've updated to Apache 2.2 and PHP 5.2.0 and faced the same problem as you, I've rewrote the search engine better in v1.5.0 and now it should work perfectly for you. — JustBurn 2007-02-28 02:04

I have also observed the error noted above “Couldn't remove directory…” w/v1.4.3 on a Windows server w/IIS. If the change noted above to the “rmeverything_revis” function fixes the problem, can the fix be made official by applying the change, increment the version number and making the updated version available through the plugin manager? —GaryV 2007-02-08 21:15

Sorry for the long delay, to tell the trust i've totally forgot about this project and only remembered it today… the good news is “yes”, v1.5.0 is out! :) — JustBurn 2007-02-28 02:04

I have moved data from its default location with all default subdirs within it and changed $conf['savedir'] respectively. After applying the plugin, cache and attic were erased and meta and locks remained untouched. So I have old list of recent changes without any existing revision files. Should I change also $conf['lockdir'] and $conf['metadir']? But why if they are in their default location, that is within the data directory? Thank you for the plugin. Alexander 26.02.2007 0:29:09

Please try v1.5.0 and check if it fix all the issues, fixed the meta variable name based from the lastest DokuWiki release, this probably can fix the problem you're having — JustBurn 2007-02-28 02:04
Meta directory is OK, but locks is the same. Debugger shows correct variable values, and the deletion process is successfull, but there's no *.locks files in the list of deleted files. — Alexander 2007-03-02 03:49
Please check v1.5.1, tried to email you back because of the Russian language translation but your email seems to filter @hotmail.com accounts. :/ — JustBurn 2007-03-05 18:20
Thanks! Now it seems to work fine. I'm not Kibi who made a Russian language file, but I've updated the translation. Mail it to you? — Alexander Zubkov 2007-03-05 21:22
Oh sorry, got confused because his first real name is Alexander too (What a coincidence!)… Well, managed to get a new email account, so please send it to the new email address → — JustBurn 2007-03-07 06:08

Version 1.5.1 handles configs.php incorrectly: If you set, e.g., “cache_del_metafiles” to -2, it still shows the item checked in the admin panel. Please rewrite this code. — Robert Riebisch 2007-03-27 17:10

Thanks for the bug report, v1.5.2 should handle it correctly. — JustBurn 2007-03-30 01:58

I just manually updated this plugin, and found a small bug. I updated by deleting the existing cacherevisionserase directory and dropping the new one in place. The first time I loaded the admin page, it allowed me to create the configs.php file (nice). However, when it did, it created the line '$this→configs['allow_allcachedel'] …' twice and didn't create the line '$this→configs['allow_allrevisdel'] …' at all. This isn't a major bug since we just have to copy the line from the “configs.in.php” distribution file. — Gary 2007-05-02 19:11 EDT

Thanks for the bug report (Again! :P), although the 2nd was implemented correctly (checked for 'allow_allrevisdel'), the writing to the configs.php wasn't (wrote 'allow_allcachedel')… my bad, really did a dumb mistake :\ … anyway there's v1.5.3 that fix it. — JustBurn 2007-05-04 17:25

The first download link doesn't work at all; site not found. The second appears to work, but then I get a message “No plugins found, or there has been an unknown problem during downloading and installing.”, I could provide a mirror, if you like. I'll send you an email.

Yes, the first link seems off-line atm but the second link works fine without any error message. I've replied your e-mail. — JustBurn 2007-07-03 01:32

Fix the Update plugin version (date) in the plugin scripts.

getInfo().date ? Isn't the date of the creation of the plugin ? — JustBurn 2008/04/01 14:51
I'm not sure what do you mean, but
debugger.ru_temp_crev.jpg
debugger.ru_temp_crev_src.jpg
Ilya Lebedev 2008/04/01 16:40
then getInfo().date should be the last update date? Nobody warned me about that since version 1.0
Yes.

(eg. 'date' ⇒ '06-05-2006', to 'date' ⇒ '31-03-2008',)
I don't have anything else to change/add right now, should I release 1.6.1 with only that change made? — JustBurn 2008/04/02 18:54

It's just nice to see when the last actual update took place. Yes, please update this with the next releases. If you use CVS/SVN you could set $Date$ placeholder there to have the actual date. — Ilya Lebedev 2008/04/03 12:22
Ok, it's done on v1.6.1, from now on the getInfo().date will reflect the latest version :) — JustBurn 2008/04/10 18:43

Would it be possible to extend the plugin, so what only in a certain namespace the old revisions are deleted? Roland Spatzenegger 2008/05/26

 
plugin/cacherevisionseraser.txt · Last modified: 2008/05/26 11:13 by 82.135.102.82
 
Imprint Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
WikiForumIRCBugsTranslate