function deleteLock($WIKI_ID) { $wikiLockFN = wikiLockFN($WIKI_ID); if (file_exists($wikiLockFN)) { if (!unlink($wikiLockFN)) { fwrite(STDERR, "Unable to delete {$wikiLockFN}\n"); exit(1); } } } #------------------------------------------------------------------------------ $USERNAME = getUser(); $CWD = getcwd(); $SYSTEM_ID = '127.0.0.1'; #------------------------------------------------------------------------------ $OPTS = Doku_Cli_Opts::getOptions(__FILE__, 'h::fm:u:s:t', array('help==', 'user='******'system=', 'trivial')); if ($OPTS->isError()) { print $OPTS->getMessage() . "\n"; exit(1); } if ($OPTS->has('h') or $OPTS->has('help') or !$OPTS->hasArgs()) { usage(getSuppliedArgument($OPTS, 'h', 'help')); exit(0); } if ($OPTS->has('u') or $OPTS->has('user')) { $USERNAME = getSuppliedArgument($OPTS, 'u', 'user'); } if ($OPTS->has('s') or $OPTS->has('system')) { $SYSTEM_ID = getSuppliedArgument($OPTS, 's', 'system'); } #------------------------------------------------------------------------------
$exists = false; foreach ($instructions as $ins) { if ($ins[0] == 'internallink' || $conf['camelcase'] && $ins[0] == 'camelcaselink') { $mid = $ins[1][0]; resolve_pageid($cns, $mid, $exists); if (!$exists) { list($mid) = explode('#', $mid); //record pages without hashs $links[] = $mid; } } } return $links; } #------------------------------------------------------------------------------ $OPTS = Doku_Cli_Opts::getOptions(__FILE__, 'h', array('help')); if ($OPTS->isError()) { fwrite(STDERR, $OPTS->getMessage() . "\n"); exit(1); } if ($OPTS->has('h') or $OPTS->has('help')) { usage(); exit(0); } $START_DIR = $conf['datadir']; if ($OPTS->numArgs() == 1) { $START_DIR .= '/' . $OPTS->arg(0); } #------------------------------------------------------------------------------ $WANTED_PAGES = array(); foreach (dw_get_pages($START_DIR) as $WIKI_PAGE) {
#!/usr/bin/php <?php if ('cli' != php_sapi_name()) { die; } ini_set('memory_limit', '1024M'); if (!defined('DOKU_INC')) { define('DOKU_INC', realpath(dirname(__FILE__) . '/../') . '/'); } require_once DOKU_INC . 'inc/init.php'; require_once DOKU_INC . 'inc/cliopts.php'; session_write_close(); // handle options $short_opts = 'hcuq'; $long_opts = array('help', 'clear', 'update', 'quiet'); $OPTS = Doku_Cli_Opts::getOptions(__FILE__, $short_opts, $long_opts); if ($OPTS->isError()) { fwrite(STDERR, $OPTS->getMessage() . "\n"); _usage(); exit(1); } $CLEAR = false; $QUIET = false; $INDEXER = null; foreach ($OPTS->options as $key => $val) { switch ($key) { case 'h': case 'help': _usage(); exit; case 'c':