<?php
/**
- * @addtogroup Maintenance
+ * @file
+ * @ingroup Maintenance
* @author Simetrical
*/
__FUNCTION__
);
if( $row ) {
- echo "Category table already populated. Use php ".
+ wfOut( "Category table already populated. Use php ".
"maintenance/populateCategory.php\n--force from the command line ".
- "to override.\n";
+ "to override.\n" );
return true;
}
}
# Use the row to update the category count
$cat = Category::newFromName( $name );
if( !is_object( $cat ) ) {
- var_dump( $cat );
- throw new MWException( "The category named $name is not valid?!" );
+ wfOut( "The category named $name is not valid?!\n" );
+ } else {
+ $cat->refreshCounts();
}
- $cat->refreshCounts();
++$i;
if( !($i % REPORTING_INTERVAL) ) {
- echo "$name\n";
+ wfOut( "$name\n" );
wfWaitForSlaves( $maxlag );
}
usleep( $throttle*1000 );
'IGNORE'
)
) {
- echo "Category population complete.\n";
+ wfOut( "Category population complete.\n" );
return true;
} else {
- echo "Could not insert category population row.\n";
+ wfOut( "Could not insert category population row.\n" );
return false;
}
}