/**
* Remove pages with only 1 revision from the MediaWiki namespace, without
* flooding recent changes, delete logs, etc.
/**
* Remove pages with only 1 revision from the MediaWiki namespace, without
* flooding recent changes, delete logs, etc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
class NukeNS extends Maintenance {
public function __construct() {
parent::__construct();
$this->mDescription = "Remove pages with only 1 revision from any namespace";
$this->addOption( 'delete', "Actually delete the page" );
$this->addOption( 'ns', 'Namespace to delete from, default NS_MEDIAWIKI', false, true );
class NukeNS extends Maintenance {
public function __construct() {
parent::__construct();
$this->mDescription = "Remove pages with only 1 revision from any namespace";
$this->addOption( 'delete', "Actually delete the page" );
$this->addOption( 'ns', 'Namespace to delete from, default NS_MEDIAWIKI', false, true );
}
public function execute() {
$ns = $this->getOption( 'ns', NS_MEDIAWIKI );
$delete = $this->getOption( 'delete', false );
}
public function execute() {
$ns = $this->getOption( 'ns', NS_MEDIAWIKI );
$delete = $this->getOption( 'delete', false );
- foreach( $res as $row ) {
- //echo "$ns_name:".$row->page_title, "\n";
+ foreach ( $res as $row ) {
+ // echo "$ns_name:".$row->page_title, "\n";
$title = Title::makeTitle( $ns, $row->page_title );
$id = $title->getArticleID();
$title = Title::makeTitle( $ns, $row->page_title );
$id = $title->getArticleID();
- //skip anything that looks modified (i.e. multiple revs)
- if ( $count == 1 ) {
- #echo $title->getPrefixedText(), "\t", $count, "\n";
+ // skip anything that looks modified (i.e. multiple revs)
+ if ( $all || $count == 1 ) {
+ # echo $title->getPrefixedText(), "\t", $count, "\n";
- //as much as I hate to cut & paste this, it's a little different, and
- //I already have the id & revs
- if( $delete ) {
+ // as much as I hate to cut & paste this, it's a little different, and
+ // I already have the id & revs
+ if ( $delete ) {