User:Leucosticte/Sandbox

From mediawiki.org

// Every log entry before this timestamp, qrc and pushbot will treat as a mirrorlogentry; every log // entry after, they will treat as a mirrormove, etc. Also, logPuller will not import anything // beyond this cutoff into the queue. $importCutoff = '20140720000000';

if ( !$pushMapping ) {

           $db->query ( "UPDATE mb_queue SET mbq_status='Ignore'"
           . " WHERE mbq_id=" . $row['mbq_id'] );
           continue;
     }

If a page that has rev_former_page fields pointing to it is deleted, then those revisions should remain with the page they've been merged with, even if that page is moved.

If a deleted page that has rev_former_page fields pointing to it is later undeleted, all the rev_former_page fields containing that page ID should be changed to the page_id of the new page. Also:

  • If the page they were merged into has since been moved, then they should be moved back to the rev_former_page.
  • If the page they were merged into has not been moved, then they should remain where they are. For one thing, this means that the page title remains the same, so where are they going to move to, and what would the page be undeleted as? It can only be undeleted into the page history of the page the history was merged into, since it's still there.

$wgHooks['LinkBegin'][] = 'onLinkBegin'; function onLinkBegin( $dummy, $target, &$html, &$customAttribs, &$query, &$options, &$ret ) { $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( 'revision', array( 'rev_id', 'rev_page', 'rev_user_text' ) );

foreach ( $res as $key => $row ) { echo $key . "\n"; } die(); }

Hi Titoxd, with regard to this edit, I was wondering whether revision.rev_parent_id should be considered as adding support for a tree, or a linked list? I guess it could be either, since a revision that's imported into pages Y and Z could still have a rev_parent_id that points to a revision in page X. Anyway, what would the Adjacency List Model that rev_parent_id adds support for be used for in MediaWiki? Thanks. Leucosticte (talk) 18:35, 24 August 2014 (UTC)

public static function onSkinTemplateNavigation( SkinTemplate &$sktemplate, array &$links ) { global $wgRequest; $action = $wgRequest->getText( 'action' ); $links['views']['chat'] = array( 'class' => ( $action == 'chat') ? 'selected' : false, 'text' => "Edit on Wikipedia", 'href' => $sktemplate->makeArticleUrlDetails( $sktemplate->getOutput()->getPageTitle(), 'action=chat' )['href'] ); return true; } public static function onSkinTemplateNavigation( SkinTemplate &$sktemplate, array &$links ) { global $wgRequest; $action = $wgRequest->getText( 'action' ); $links['views']['chat'] = array( 'class' => ( $action == 'chat') ? 'selected' : false, 'text' => "Edit on Wikipedia", 'href' => $sktemplate->makeArticleUrlDetails( $sktemplate->getTitle()->getFullText(), 'action=editremotely' )['href'] ); return true; }

  1. Check whether the performer can block users in this user's groups.

$blockGroupsStatus = self::checkBlockGroups( $user, $performer ); if ( $blockGroupsStatus ) { return array( 'badaccess-blockgroups', $wgLang->commaList( $blockGroupsStatus ), count( $blockGroupsStatus ) ); }

<?php $resource = curl_init(); curl_setopt($resource, CURLOPT_URL, $url); curl_setopt($resource, CURLOPT_HEADER, 1); curl_setopt($resource, CURLOPT_RETURNTRANSFER, 1); curl_setopt($resource, CURLOPT_BINARYTRANSFER, 1); $file = curl_exec( $resource ); curl_close( $resource ); $handle = fopen( '/var/www/html/curltest/file.txt', 'wb' ); fwrite( $handle, 'foo' );

   public $testTables = array(
       'revision' => array(
           'rev_id',
           'rev_page',
           'rev_comment',
           'rev_user',
           'rev_user_text',
           'rev_timestamp',
           'rev_minor_edit',
           'rev_deleted',
           'rev_len',
           'rev_parent_id',
           'rev_sha1',
           'rev_content_model',
           'rev_content_format'
       )
   );