add bridge to call DokuWiki functions from Python
This commit is contained in:
parent
e2c88692f0
commit
2643fe5d35
2 changed files with 64 additions and 0 deletions
33
doku.php
Executable file
33
doku.php
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/php
|
||||
<?php
|
||||
# -*- coding: utf-8 -*-
|
||||
# Setup VIM: ex: et ts=2 sw=2 :
|
||||
# Bridge for Python code to invoke DokuWiki functions.
|
||||
#
|
||||
# Author: Elan Ruusamäe <glen@pld-linux.org>
|
||||
#
|
||||
# You should probably adjust path to DOKU_INC.
|
||||
|
||||
if ('cli' != php_sapi_name()) die();
|
||||
|
||||
define('DOKU_INC', '/usr/share/dokuwiki/');
|
||||
require_once DOKU_INC.'inc/init.php';
|
||||
require_once DOKU_INC.'inc/common.php';
|
||||
require_once DOKU_INC.'inc/cliopts.php';
|
||||
|
||||
switch ($argv[1]) {
|
||||
case 'cleanID':
|
||||
echo cleanID($argv[2]);
|
||||
break;
|
||||
case 'wikiFn':
|
||||
echo wikiFn($argv[2]);
|
||||
break;
|
||||
case 'mediaFn':
|
||||
echo mediaFn($argv[2]);
|
||||
break;
|
||||
case 'getNS':
|
||||
echo getNS($argv[2]);
|
||||
break;
|
||||
default:
|
||||
die("Unknown knob: {$argv[1]}");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue