mirror of
https://github.com/diocloid/LinkTitles.git
synced 2025-07-12 17:29: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 ) {
|
||||
$config = new Config();
|
||||
$source = Source::createFromTitle( $title, $config );
|
||||
if ( $source->hasContent ) {
|
||||
if ( $source->hasContent() ) {
|
||||
$linker = new Linker( $config );
|
||||
$result = $linker->linkContent( $source );
|
||||
if ( $result ) {
|
||||
|
@ -197,7 +197,7 @@ class Source {
|
||||
* @return boolean True if the source page has content.
|
||||
*/
|
||||
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.
|
||||
$dbr = $this->getDB( DB_SLAVE );
|
||||
$namespacesClause = str_replace( '_', ' ','(' . implode( ', ', $config->namespaces ) . ')' );
|
||||
$namespacesClause = str_replace( '_', ' ','(' . implode( ', ', $config->sourceNamespaces ) . ')' );
|
||||
$res = $dbr->select(
|
||||
'page',
|
||||
array( 'page_title', 'page_namespace' ),
|
||||
|
Reference in New Issue
Block a user