X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FdumpLinks.php;h=7139786017cddb174b2d7d399ff51420db412d56;hb=cf9fc81e9669b6c016c044de57ad2bdd5113d167;hp=dfd1959cfc47ead922c0d7115321a6b8425b22ce;hpb=b382dfd42b6fc67a8df6e4b82da982dc46940b29;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/dumpLinks.php b/maintenance/dumpLinks.php index dfd1959cfc..7139786017 100644 --- a/maintenance/dumpLinks.php +++ b/maintenance/dumpLinks.php @@ -40,11 +40,11 @@ require_once __DIR__ . '/Maintenance.php'; class DumpLinks extends Maintenance { public function __construct() { parent::__construct(); - $this->mDescription = "Quick demo hack to generate a plaintext link dump"; + $this->addDescription( 'Quick demo hack to generate a plaintext link dump' ); } public function execute() { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = $this->getDB( DB_SLAVE ); $result = $dbr->select( array( 'pagelinks', 'page' ), array( 'page_id', @@ -59,7 +59,7 @@ class DumpLinks extends Maintenance { $lastPage = null; foreach ( $result as $row ) { if ( $lastPage != $row->page_id ) { - if ( isset( $lastPage ) ) { + if ( $lastPage !== null ) { $this->output( "\n" ); } $page = Title::makeTitle( $row->page_namespace, $row->page_title ); @@ -69,7 +69,7 @@ class DumpLinks extends Maintenance { $link = Title::makeTitle( $row->pl_namespace, $row->pl_title ); $this->output( " " . $link->getPrefixedURL() ); } - if ( isset( $lastPage ) ) { + if ( $lastPage !== null ) { $this->output( "\n" ); } }