);
	
	foreach(  $aTablesMove as $table => $actions ){
		if( $dbw->tableExists($table)) {
			$res = $dbw->update(
				$table,
				$actions['update'],
				$actions['where'],
				__METHOD__
			);
			$num = $dbw->affectedRows();
			if( $num ) {
				echo "updated $table (changes:$num)\n";
			}
			// ad error handling
		} else {
			echo "table $table does not exist on this wiki\n";
		}
	}

	$sanitizeHelper->logVideoTitle($val, $key, 'UNDO');
	$i++;
}

echo(": {$rowCount} videos processed.\n");
videoLog( 'unsanitize', 'RENAMED', "renamed:$i");


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

?>
Beispiel #2
0
		if ( $oTitle instanceof Title && $oTitle->exists() ){
			global $wgTitle;
			// in some cases hooks depend on wgTitle (hook for article edit)
			// but normally it wouldn't be set for maintenance script
			$wgTitle = $oTitle;
			$oArticle = new Article ( $oTitle );
			if ( $oArticle instanceof Article ){
				$sTextAfter = $sText = $oArticle->getContent();
				echo "\n ={$count}/{$current}==== ART:" .$oTitle." =======\n";

				$sTextAfter = title_replacer( substr( $key, 1 ), substr( $val, 1), $sTextAfter  );

				if ( $sTextAfter != $sText ) {
					echo "ARTICLE WAS CHANGED! \n";
					$allChangesArticleURLs[ str_replace('localhost',$wgDBname.'.'.str_replace('dev-','', $devboxuser).'.wikia-dev.com',$oTitle->getFullURL()) ] = true;
					$sanitizeHelper->logVideoTitle($key, $val, 'OK', $oTitle);
					// isolating doEdit, because it's possible it will result in Fatal Error for some articles
					// in case of misconfiguration (doEdit running from maintenance scripts instead of directly
					// in context of browser web request is not used much so it's not very reliable)
					$pid = pcntl_fork();
					if ($pid == -1) {
						echo "I think I'm gonna die\n";
						die('Could not fork');
					} else if ($pid) {
						// we are the parent
						echo "Parent waiting for edit to finish\n";
						$status = null;
						pcntl_wait($status); //Protect against Zombie children
						$st = pcntl_wexitstatus($status);
						if ($st != 0) {
							// need to log those fatal errors here