DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:toucher

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
plugin:toucher [2012-08-16 18:14] – created 194.44.164.133plugin:toucher [2018-05-28 19:59] – [Installation] Klap-in
Line 1: Line 1:
-====== toucher Plugin ======+====== Toucher Plugin ======
  
 ---- plugin ---- ---- plugin ----
-description: This plugin touches configuration file triggering reload of DokuWii editor toolbar and possibly something else... +description: touching configuration files without changing DokuWiki settings 
-author     : anandr+author     : Andriy Nych
 email      : nych.andriy@gmail.com email      : nych.andriy@gmail.com
 type       : admin type       : admin
-lastupdate : 2012-08-16 +lastupdate : 2012-09-16 
-compatible : angua+compatible : Rincewind,angua,adora belle,weatherwax,Binky,"Ponder Stibbons",Hrun,Detritus,2016-06-26+
 depends    :  depends    : 
 conflicts  conflicts 
Line 13: Line 13:
 tags       : admin, config, touch tags       : admin, config, touch
  
 +downloadurl: https://github.com/anandr/dokuwiki-plugin-toucher/zipball/master
 +bugtracker : https://github.com/anandr/dokuwiki-plugin-toucher/issues
 +sourcerepo : https://github.com/anandr/dokuwiki-plugin-toucher/
 +donationurl: 
 ---- ----
  
 ===== Installation ===== ===== Installation =====
  
-Download the ''admin.php'' file below and copy it to your ''/lib/plugins/toucher'' folder. +Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
-Refer to [[:Plugins]] on how to install plugins manually.+
  
-<file php admin.php> +===== Examples/Usage =====
-<?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 +The only purpose of this plugin is to [[wp>Touch_(Unix)|touch]] ''conf/local.php'' configuration file. 
-if (!defined('DOKU_INC')) die(); +This procedure invalidates DokuWiki cache files as described here: [[doku>caching]].
-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';+This is useful, for example, to reload CSS, JavaScript files after update, plugin/template installation, tweaking editor toolbar, etc.
  
-class admin_plugin_toucher extends DokuWiki_Admin_Plugin {+===== Configuration and Settings =====
  
-    function forAdminOnly() +The plugin has only one setting: it can be set available only to [[doku>config:superuser|superusers]] (the defaultor to anyone who has access to admin page (usually superusers and [[doku>config:manager|managers]]).
-        return true; +
-    }+
  
-    function touchFiles() { +=== Change Log ===
-        touch(DOKU_CONF."local.php"); // this is the core of this plugin +
-    }+
  
-    function handle() { +Plugin was lying around here and there, even as a simple downloadable code block on this page. On 2012/09/16 it was moved to github so this date is its official birthday ((actually by moving it to GitHub I learned how to use git, but he is not aware of that so do not tell him)).
-        $this->touchFiles()+
-    }+
  
-    function html() { +{{rss>https://github.com/anandr/dokuwiki-plugin-toucher/commits/master.atom 10 author date 1d }}
-        global $ID; +
-        ptln('<h3>Toucher</h3>'); +
-        $this->touchFiles(); +
-        ptln('<p>Configuration files have been just touched.</p>'); +
-    } +
-+
-</file> +
- +
-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 ===== +
- +
-  Goto ''admin'' page and click the ''Configuration toucher'' link. +
-  - Enjoy +
- +
-===== Development ===== +
- +
-=== Change Log === +
- +
-  * **2012-08-16** +
-    * Initial release+
  
 === Known Bugs and Issues === === Known Bugs and Issues ===
Line 80: Line 46:
 === ToDo/Wish List === === ToDo/Wish List ===
  
-Do you have one?+Any ideas?
  
 ===== Discussion ===== ===== 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 +Is it worth to include this functionality into core dokuwiki admin/config plugin? \\ //Andriy//, 2012/09/16
- +
-  * 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.txt · Last modified: 2022-07-29 23:37 by Klap-in

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki