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

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:toucher [2012-09-16 13:30] – old revision restored (2012/09/14 16:27) achplugin:toucher [2022-07-29 23:37] (current) 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, Elenor of Tsort, Frusterick Manners
 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: 
 ---- ----
 +
 +> This plugin [[https://github.com/anandr/dokuwiki-plugin-toucher/pull/2#issuecomment-809981442|is dead]], see the new substitute: [[plugin:stale]]
  
 ===== 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 getInfo()+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 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() { +=== Change Log ===
-        return true; +
-    }+
  
-    function touchFiles() { +Plugin was lying around here and there, even as a simple downloadable code block on this pageOn 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)).
-        touch(DOKU_CONF."local.php"); // this is the core of this plugin +
-    }+
  
-    function handle() { +{{rss>https://github.com/anandr/dokuwiki-plugin-toucher/commits/master.atom 10 author date 1d }}
-        $this->touchFiles(); +
-    }+
  
-    function html() { +=== Known Bugs and Issues ===
-        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. +It seems to have a problem under PHP 7.2.19 on Ubuntu.  I get the message ''Warning: Use of undefined constant isadmin - assumed 'isadmin(this will throw an Error in a future version of PHP) in .../lib/plugins/toucher/admin.php on line 36'' If I change the line
-Refer to [[:Plugins]] on how to install plugins manually.+
  
-===== Usage =====+    if (!$INFO[isadmin]) { 
 +     
 +to read
  
-  - Goto ''admin'' page and click the ''Configuration toucher'' link. +    if (!$INFO['isadmin']) { 
-  - Enjoy +     
- +everything works okay.
-===== 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 === === 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 
- +>> After 10 years of intense use of Toucher plugin, my answer is: a strong **YES*for thousands of reasons! --- [[user>florious|florious]] //2022-01-17 15:04//
-  * 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.1347795004.txt.gz · Last modified: 2012-09-16 13:30 by ach

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