3 * Copyright (C) 2005 Brion Vibber <brion@pobox.com>
4 * http://www.mediawiki.org/
6 * Quick demo hack to generate a plaintext link dump,
7 * per the proposed wiki link database standard:
8 * http://www.usemod.com/cgi-bin/mb.pl?LinkDatabase
10 * Includes all (live and broken) intra-wiki links.
11 * Does not include interwiki or URL links.
12 * Dumps ASCII text to stdout; command-line.
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 * http://www.gnu.org/copyleft/gpl.html
30 * @subpackage SpecialPage
33 require_once 'commandLine.inc';
35 $dbr =& wfGetDB( DB_SLAVE
);
36 $result = $dbr->select( array( 'pagelinks', 'page' ),
43 array( 'page_id=pl_from' ),
45 array( 'ORDER BY page_id' ) );
48 while( $row = $dbr->fetchObject( $result ) ) {
49 if( $lastPage != $row->page_id
) {
50 if( isset( $lastPage ) ) {
53 $page = Title
::makeTitle( $row->page_namespace
, $row->page_title
);
54 print $page->getPrefixedUrl();
55 $lastPage = $row->page_id
;
57 $link = Title
::makeTitle( $row->pl_namespace
, $row->pl_title
);
58 print " " . $link->getPrefixedUrl();
60 if( isset( $lastPage ) )