summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2005-10-22 13:25:10 +0200
committerAndreas Gohr <andi@splitbrain.org>2005-10-22 13:25:10 +0200
commit840583dccde3ec4ca0a5a947d29b63a19fc3fbad (patch)
treea7fd05c16a90066ea7e73d92002d81711062d9e1 /bin
parent17ee7f669c94439a8c4526e5aba6c021922a9868 (diff)
downloadrpg-840583dccde3ec4ca0a5a947d29b63a19fc3fbad.tar.gz
rpg-840583dccde3ec4ca0a5a947d29b63a19fc3fbad.tar.bz2
fixes for wantedpages.php #558
darcs-hash:20051022112510-7ad00-1c24508af8f2b8a1a075aa0f6e8691b8107e81a0.gz
Diffstat (limited to 'bin')
-rwxr-xr-xbin/wantedpages.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/wantedpages.php b/bin/wantedpages.php
index caa88dc78..b75b2baa3 100755
--- a/bin/wantedpages.php
+++ b/bin/wantedpages.php
@@ -1,6 +1,7 @@
#!/usr/bin/php -d short_open_tag=on
<?php
#------------------------------------------------------------------------------
+ini_set('memory_limit','128M');
if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');
require_once DOKU_INC.'inc/init.php';
require_once DOKU_INC.'inc/common.php';
@@ -18,7 +19,7 @@ function usage() {
defaults to the root wiki namespace
OPTIONS
- -h, --help=<action>: get help
+ -h, --help get help
";
}
@@ -67,8 +68,8 @@ function dw_get_pages($dir) {
$pages = array_merge($pages, dw_get_pages($dir . '/' . $entry));
} else {
$page = array(
- 'id'=>substr(pathID($dir . '/' . $entry),$trunclen),
- 'file'=>$dir . '/' . $entry,
+ 'id' => pathID(substr($dir.'/'.$entry,$trunclen)),
+ 'file'=> $dir.'/'.$entry,
);
$pages[] = $page;
}
@@ -89,6 +90,7 @@ function dw_internal_links($page) {
$mid = $ins[1][0];
resolve_pageid($cns,$mid,$exists);
if ( !$exists ) {
+ list($mid) = explode('#',$mid); //record pages without hashs
$links[] = $mid;
}
}
@@ -117,6 +119,7 @@ if ( $OPTS->numArgs() == 1 ) {
#------------------------------------------------------------------------------
$WANTED_PAGES = array();
+
foreach ( dw_get_pages($START_DIR) as $WIKI_PAGE ) {
$WANTED_PAGES = array_merge($WANTED_PAGES,dw_internal_links($WIKI_PAGE));
}