DokuWiki

It's better when it's simple

User Tools

Site Tools


cli

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
cli [2012-09-23 01:15] – [striplangs.php] 174.113.149.247cli [2024-01-31 23:58] (current) – [Finding more CLI plugins] Klap-in
Line 1: Line 1:
 ====== Command Line Tools ====== ====== Command Line Tools ======
  
-[[DokuWiki]] comes with a few PHP scripts meant to be executed from the (UNIX) commandline of the DokuWiki server. **All those scripts are located in the ''<yourWiki>/bin/'' directory.**+[[DokuWiki]] comes with a few PHP scripts meant to be executed from the (UNIX) commandline of the DokuWiki server. **All the scripts are located in the ''<yourWiki>/bin/'' directory.**
  
 **Note:** In order to be able to use these scripts you need the PHP CLI interpreter installed on the system. **Note:** In order to be able to use these scripts you need the PHP CLI interpreter installed on the system.
Line 8: Line 8:
  
 <code> <code>
-$> chmod +x <script>.php +$> chmod +x ./bin/<script>.php 
-$> ./<script>.php+$> ./bin/<script>.php
 </code> </code>
  
Line 15: Line 15:
  
 <code> <code>
-$> /path/to/php <script>.php+$> /path/to/php bin/<script>.php
 </code> </code>
- 
 ===== dwpage.php ===== ===== dwpage.php =====
 **Note:** There have been problems reported with some plugins that rely on ACLs and authentication or the DokuWiki [[:devel:events|event system]]. **Note:** There have been problems reported with some plugins that rely on ACLs and authentication or the DokuWiki [[:devel:events|event system]].
Line 33: Line 32:
         commit: see $ dwpage.php --help=commit         commit: see $ dwpage.php --help=commit
         lock: see $ dwpage.php --help=lock         lock: see $ dwpage.php --help=lock
 +        gmeta: see $ dwpage.php --help=gmeta
 +            Displays metadata about a page. There is no ability to write 
 +            metadata, only read them. 
 +            e.g. $ dwpage.php -u <user> gmeta [page] <meta tag>. Where <meta tag>
 +            can be "date modified" (in quotes) or "last_change date" an empty 
 +            <meta tag> returns all metadata.
          
     OPTIONS     OPTIONS
Line 38: Line 43:
             e.g. $ ./dwpage.php -hcommit             e.g. $ ./dwpage.php -hcommit
             e.g. $ ./dwpage.php --help=commit             e.g. $ ./dwpage.php --help=commit
 +
 +
  
 ===== indexer.php ===== ===== indexer.php =====
Line 48: Line 55:
     when the -c option is given the index is cleared first.     when the -c option is given the index is cleared first.
          
-    OPTIONS+    OPTIONS 
         -h, --help     show this help and exit         -h, --help     show this help and exit
         -c, --clear    clear the index before updating         -c, --clear    clear the index before updating
         -q, --quiet    don't produce any output         -q, --quiet    don't produce any output
  
-This needs to be run as the appropriate user and possibly the right directory to work. e.g. www-data in ~www-data Under debian lenny+This needs to be run as the appropriate user and possibly the right directory to work. e.g. www-data in ~www-data under debian lenny. So for example, if your wiki is in ''/var/www/wiki''
 + 
 +  sudo -u www-data /var/www/wiki/bin/indexer.php 
 + 
 +If you experience errors, please firstly check that you are calling the script in the //bin// path and not in the ///lib/exe//
 + 
 +When working with farms, you can define the animal variable while calling the script. Please note that this is on single command line. 
 +  animal=example ./bin/indexer.php 
 ===== wantedpages.php ===== ===== wantedpages.php =====
  
Line 83: Line 98:
         -k, --keep     comma separated list of languages, -e is always implied         -k, --keep     comma separated list of languages, -e is always implied
         -e, --english  keeps english, dummy to use without -k         -e, --english  keeps english, dummy to use without -k
 +
 +===== gittool.php =====
 +
 +Helps with maintaining DokuWiki and plugins installed via [[devel:git]].
 +
 +<code>
 +Usage: gittool.php <command> [parameters]
 +
 +Manage git repositories for DokuWiki and its plugins and templates.
 +
 +EXAMPLE
 +
 +$> ./bin/gittool.php clone gallery template:ach
 +$> ./bin/gittool.php repos
 +$> ./bin/gittool.php origin -v
 +
 +COMMANDS
 +
 +help
 +    This help screen
 +
 +clone <extensions>
 +    Tries to install a known plugin or template (prefix with template:) via
 +    git. Uses the DokuWiki.org plugin repository to find the proper git
 +    repository. Multiple extensions can be given as parameters
 +
 +install <extensions>
 +    The same as clone, but when no git source repository can be found, the
 +    extension is installed via download
 +
 +repos
 +    Lists all git repositories found in this DokuWiki installation
 +
 +<any>
 +    Any unknown commands are assumed to be arguments to git and will be
 +    executed in all repositories found within this DokuWiki installation
 +</code>
 +
 +===== plugin.php =====
 +
 +This tool gives access to all installed [[devel:CLI Plugins]]. Call it without any arguments to get a list of installed plugins:
 +
 +  ./bin/plugin.php
 +
 +Call the plugin's help screen to learn more
 +
 +  ./bin/plugin.php <pluginname> -h
 +
 +
 +====Finding more CLI plugins====
 +Use [[plugintype>256#extension__table|CLI Plugins]] to add other functionality to command line. 
 +
 +A summary of plugins which indicate CLI support:
 +
 +---- pluginquery -----
 +SELECT: name, description
 +WHERE:  (type > ? AND type < ?) AND (bestcompatible LIKE ? OR bestcompatible LIKE ? OR compatible = ?)
 +VALUES: 255, 512, @DATEMOSTRECENT@, @DATESECONDMOSTRECENT@, (bundled)
 +headline: CLI plugins compatible with last two releases
 +-----
  
  
 +To implement such a plugin please have a look at the [[devel:cli plugins|CLI plugins development documentation]].
cli.1348355704.txt.gz · Last modified: 2012-09-23 01:15 by 174.113.149.247

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