tips:tofromdoku
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tips:tofromdoku [2008-08-10 20:07] – added note chi | tips:tofromdoku [2011-02-10 08:11] (current) – removed 88.208.141.34 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== ToFromDoku - A dokuwiki command line utility ====== | ||
- | ^ :!: The [[devel: | ||
- | ===== Introduction ===== | ||
- | |||
- | Using dokuwiki for automatic documentations (i.e. for sys2wiki.sh etc.) can be a bit complex. The following is a command line utilit to get and post pages from/into dokuwiki using dokuwiki' | ||
- | |||
- | > Note: an alternative method, if dokuwiki lies directly on your server or you'd like to do this all using a ssh-setup, would be to use the [[: | ||
- | |||
- | ===== Warning! ===== | ||
- | |||
- | Looking at the xmlrpc-Servercode I found it in a very experimental state. So **be warned** not to do this unless you're certain, that you know what you doing! I'm serious, using the cli can result in an empty dokuwiki, a blank server or a collapsed universe. | ||
- | |||
- | Seriously, **BE CAREFUL** !!! | ||
- | |||
- | ===== A bit patching ===== | ||
- | |||
- | Dokuwiki has already got a small XMLRPC-server under / | ||
- | |||
- | The darcs patch is available here: | ||
- | |||
- | [[http:// | ||
- | |||
- | After applying that, enable the xmlrpc-server by uncommenting or removing the " | ||
- | |||
- | ===== The CLI ===== | ||
- | |||
- | Now, install a PHP-CLI on your server and don't forget PHP's curl extension, than grab the CLI here: | ||
- | |||
- | [[http:// | ||
- | |||
- | and put it somewhere you like. | ||
- | |||
- | ===== Ways ===== | ||
- | |||
- | The most important thing you'll have to specify is a way. The way says, if you gather sites from Dokuwiki (way=from) or put sites into Dokuwiki (way=to). | ||
- | |||
- | ===== Configuring ===== | ||
- | |||
- | You can configure the cli using commandline arguments or a configuration file. Let's start the cli using | ||
- | |||
- | php tofromdoku.php --help | ||
- | |||
- | This gives you the valid commandline arguments: | ||
- | |||
- | < | ||
- | Usage: tofromdoku.php [-wupfc] | ||
- | |||
- | -c --config=< | ||
- | -f --filename=< | ||
- | STDIN or to write text into rather than to STDOUT () | ||
- | -p --pagename=< | ||
- | -u --url=< | ||
- | -w --way=< | ||
- | to) (from) | ||
- | </ | ||
- | |||
- | The single options are: | ||
- | |||
- | * filename: Normally, pages retrieved (way=from) are put out to STDOUT, pages send (way=to) are read from STDIN. Alternatively you can specify a file here to be used instead. | ||
- | * pagename: The page (including namespaces) in Dokuwiki | ||
- | * url: The URL to Dokuwiki' | ||
- | * way: The default way to use. (It's " | ||
- | |||
- | You can configure this options using the commandline arguments above or put the options in a configuration file. The script tries to read a tofromdoku.ini as a default config file, but you can specify a different file using the " | ||
- | |||
- | That's all you need. Configure the script and run it to retrieve or send pages. | ||
- | |||
- | Again, please be advised, that this is dangerous. Don't blame anyone of the Dokuwiki developers or me for data loss or other bad things. | ||
- | |||
- | ===== Discussion ===== |
tips/tofromdoku.1218391630.txt.gz · Last modified: 2009-06-13 20:56 (external edit)