Пример #1
0
videoLog( 'postmigration', 'VARIABLE_SET', "");

echo "Purging articles including videos:";

$rows = $dbw->query( "SELECT img_name FROM image WHERE img_media_type = 'VIDEO'" );

while( $image = $dbw->fetchObject( $rows ) ) {
	$rows2 = $dbw->query( "SELECT distinct il_from FROM imagelinks WHERE il_to ='".mysql_real_escape_string($image->img_name)."'");
	while( $page = $dbw->fetchObject( $rows2 ) ) {
		global $wgTitle;
		$oTitle = Title::newFromId( $page->il_from );
		$wgTitle = $oTitle;
		if ( $oTitle instanceof Title && $oTitle->exists() && ($oArticle = new Article ( $oTitle )) instanceof Article ) {
			$oTitle->purgeSquid();
			$oArticle->doPurge();
			echo "+";
		} else {
			echo "-";
		}
	}
	$dbw->freeResult($rows2);
}


echo "\nDone\n";
videoLog( 'postmigration', 'STOP', "");

wfWaitForSlaves( 2 );

?>
Пример #2
0
		if ( $oArticle instanceof Article ){
			$sTextAfter = $sText = $oArticle->getContent();
			$sTextAfter = str_replace( '* VW:', '* ', $sTextAfter  );

			if ( $sTextAfter != $sText ) {
				echo "ARTICLE WAS CHANGED! \n";
				$status = $oArticle->doEdit( $sTextAfter, 'Changing cross-wiki links to local links', EDIT_MINOR | EDIT_UPDATE | EDIT_SUPPRESS_RC | EDIT_FORCE_BOT, false, $botUser );
				$i++;
			}
		}
	}
}

echo "Done\n";
videoLog( 'migration', 'RELATEDVIDEOS', "edits:$i");
videoLog( 'migration', 'STOP', "");


foreach ( $failures as $failure ){
	echo ( "$failure \n" );
}

wfWaitForSlaves( 2 );

/*
 * wywala nam sie upload
 * check if new name will be available
 * change in page
 * upload
 * success -> change in all backlinking articles
 */
Пример #3
0
	wfWaitForSlaves( 2 );
	echo "aTranslation[$key]=$val\n";

	$strippedNew = ( substr( $val, 0, 1 ) == ':' ) ? substr( $val, 1 ) : $val;
	$strippedOld = ( substr( $key, 0, 1 ) == ':' ) ? substr( $key, 1 ) : $key;

	$oRow = $dbw->selectRow( 'image', '*', array('img_name'=>$key) );
	$row = (array)$oRow;
	$row['img_name'] = $val;

	$res = $dbw->insert(
		'image',
		$row,
		__METHOD__
	);
	$num = $dbw->affectedRows();
	if( $num ) {
		echo "duplicated entry in image table (changes:$num, image: $val)\n";
		$i++;
	}


}

echo(": {$rowCount} videos processed.\n");
videoLog( 'sanitize', 'DUPLICATED', "duplicated:$i");

videoLog( 'sanitize', 'STOP', "");


?>
Пример #4
0
			continue;
		}

		$j++;

		// debugging info
		$timeEnd = microtime( true );
		$time = intval( $timeEnd - $timeStart);
		$vps = intval($i / ($timeEnd - $timeStart) * 60);
		$timeString = "[$time s, $vps vpm]";
		echo( "- [$i / $rowCount]\t $timeString \tVideo: {$video->img_name} \n" );


		Premigrate::ProcessVideo($video->img_name);

	}

	echo("\nDone\n");
}
else {
	echo("Nothing to do\n");
}

$dbw->freeResult($rows);
videoLog( 'premigration', 'STOP', "processed:$j,total:$i");

echo(": {$rowCount} videos processed.\n");


?>