Skip to content

Commit

Permalink
auto-cleanup is now working correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
dom-mel committed Jan 23, 2010
1 parent bd94655 commit 062ba3b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
20 changes: 13 additions & 7 deletions action.php
Expand Up @@ -61,17 +61,23 @@ function register(&$controller) {
*/
function cleanup(&$event, $param) {
global $conf;
$onlySmall = $this->getConf('autoclearonlysmall');
$onlyNoComment = $this->getConf('autoclearonlynocomment');
if ($this->run) return;
$this->run = true;
$hdl = plugin_load('admin','clearhistory');

if ($this->run) return;
$this->run = true;
echo 'clearhistory: started'.NL;

$onlySmall = $this->getConf('autoclearonlysmall');
$onlyNoComment = $this->getConf('autoclearonlynocomment');

//$hdl = plugin_load('admin','clearhistory');
$hdl = new admin_plugin_clearhistory();
$hdl->_scanRecents($onlySmall , $onlyNoComment);

$hdl->_scanRecents(30, $onlySmall , $onlyNoComment);

echo 'clearhistory: ' . $hdl->delcounter . ' deleted'.NL;
touch($conf['cachedir'].'/lastclean');
}


}


Expand Down
2 changes: 1 addition & 1 deletion admin.php
Expand Up @@ -11,7 +11,7 @@
/**
* This plugin is used to cleanup the history
*
* @see http://dokuwiki.org/plugin:clearhistory
* @see http://dokuwiki.org/plugin:clearhistory
* @author Dominik Eckelmann <deckelmann@gmail.com>
*/
class admin_plugin_clearhistory extends DokuWiki_Admin_Plugin {
Expand Down

0 comments on commit 062ba3b

Please sign in to comment.