DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:toucher

This is an old revision of the document!


toucher Plugin

Compatible with DokuWiki

angua

plugin This plugin touches configuration file triggering reload of DokuWii editor toolbar and possibly something else...

Last updated on
2012-08-16
Provides
Admin

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Tagged with admin, config, touch

By anandr

Installation

Download the admin.php file below and copy it to your /lib/plugins/toucher folder. Refer to Plugins on how to install plugins manually.

admin.php
<?php
/**
 * DokuWiki Plugin toucher (Admin Component)
 *
 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
 * @author Andriy Nych <nych.andriy@gmail.com>
 */
 
// must be run within Dokuwiki
if (!defined('DOKU_INC')) die();
if(!defined('DOKU_BASE')) define('DOKU_BASE',getBaseURL());
if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
 
require_once DOKU_PLUGIN.'admin.php';
 
class admin_plugin_toucher extends DokuWiki_Admin_Plugin {
 
    function getInfo(){
        return array(
            'author' => 'Andriy Nych',
            'email'  => 'nych.andriy@gmail.com',
            'date'   => '2012-08-16',
            'name'   => 'Configuration toucher',
            'desc'   => 'This plugin touches configuration file triggering reload of DokuWii editor toolbar and possibly something else...',
            'url'    => 'http://www.dokuwiki.org/plugin:toucher',
        );
    }
 
    function forAdminOnly() {
        return true;
    }
 
    function touchFiles() {
        touch(DOKU_CONF."local.php"); // this is the core of this plugin
    }
 
    function handle() {
        $this->touchFiles();
    }
 
    function html() {
        global $ID;
        ptln('<h3>Toucher</h3>');
        $this->touchFiles();
        ptln('<p>Configuration files have been just touched.</p>');
    }
}

Download the admin.php file above and copy it to your /lib/plugins/toucher folder. Refer to Plugins on how to install plugins manually.

Usage

  1. Goto admin page and click the Configuration toucher link.
  2. Enjoy

Development

Change Log

  • 2012-08-16
    • Initial release
  • 2012-09-14
    • added getInfo function to fix error message saying that toucher/plugin.info.txt not found

Known Bugs and Issues

None so far.

ToDo/Wish List

Do you have one?

Discussion

From my experiments touching the local.php configuration file triggers full reloading of *.js and *.css files next time you load your wiki page. For example this is useful when

  • you install some plugin with its own javascript files and css styles
  • you are developer and tweak dokuwiki page editor toolbar (*.js files)
  • may be there are some other cases too

In all these cases you have to empty browsed cache and sometimes do more magic to ensure that those files are actually loaded. Clicking the plugin link on the admin page has the same effect. At least this works for me. — anandr 2012/08/16 16:08:20.12

plugin/toucher.1347632874.txt.gz · Last modified: 2012-09-14 16:27 by 194.44.164.133