mirror of
https://github.com/diocloid/LinkTitles.git
synced 2025-07-13 01:39:30 +02:00
Fix CLI script to work with namespaces.
This commit is contained in:
@ -76,7 +76,7 @@ class Extension {
|
|||||||
public static function processPage( \Title $title, \RequestContext $context ) {
|
public static function processPage( \Title $title, \RequestContext $context ) {
|
||||||
$config = new Config();
|
$config = new Config();
|
||||||
$source = Source::createFromTitle( $title, $config );
|
$source = Source::createFromTitle( $title, $config );
|
||||||
if ( $source->hasContent ) {
|
if ( $source->hasContent() ) {
|
||||||
$linker = new Linker( $config );
|
$linker = new Linker( $config );
|
||||||
$result = $linker->linkContent( $source );
|
$result = $linker->linkContent( $source );
|
||||||
if ( $result ) {
|
if ( $result ) {
|
||||||
|
@ -197,7 +197,7 @@ class Source {
|
|||||||
* @return boolean True if the source page has content.
|
* @return boolean True if the source page has content.
|
||||||
*/
|
*/
|
||||||
public function hasContent() {
|
public function hasContent() {
|
||||||
return $this->content != null;
|
return $this->getContent() != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -155,7 +155,7 @@ class Cli extends \Maintenance {
|
|||||||
|
|
||||||
// Retrieve page names from the database.
|
// Retrieve page names from the database.
|
||||||
$dbr = $this->getDB( DB_SLAVE );
|
$dbr = $this->getDB( DB_SLAVE );
|
||||||
$namespacesClause = str_replace( '_', ' ','(' . implode( ', ', $config->namespaces ) . ')' );
|
$namespacesClause = str_replace( '_', ' ','(' . implode( ', ', $config->sourceNamespaces ) . ')' );
|
||||||
$res = $dbr->select(
|
$res = $dbr->select(
|
||||||
'page',
|
'page',
|
||||||
array( 'page_title', 'page_namespace' ),
|
array( 'page_title', 'page_namespace' ),
|
||||||
|
Reference in New Issue
Block a user