User:Leucosticte/IWSandbox

special
 * @copyright GPL

if ( !defined( 'MEDIAWIKI' ) ) { die( 'This file is a MediaWiki extension. It is not a valid entry point' ); }

class SpecialInterwikiExistence extends SpecialPage { function __construct { parent::__construct( 'InterwikiExistence', 'interwikiexistence' ); }

public function userCanExecute( User $user ) { return true; }

function execute( $par ) { global $wgInterwikiExistenceNewSeconds, $wgInterwikiExistenceDeleteSeconds, $wgInterwikiExistenceNewOdds, $wgInterwikiExistenceDeleteOdds, $wgInterwikiExistenceRemoteWikiUrl, $wgInterwikiExistenceApiNewArgs, $wgInterwikiExistenceApiDeleteArgs, $wgInterwikiExistenceUserAgent, $wgInterwikiExistenceMinimumNewSeconds, $wgInterwikiExistenceMinimumDeleteSeconds; $user = $this->getUser; if ( !$user->isAllowed( 'interwikiexistence' ) ) { throw new PermissionsError( null, array( array(                               'interwikiexistence-notallowed' ) ) ); }		$this->setHeaders; $output = $this->getOutput; $context = $this->getContext; $isNotExempt = !$user->isAllowed( 'interwikiexistencenoratelimit' ); // Don't roll dice or check time SpecialInterwikiExistence::reaction (			InterwikiExistenceHooks::interwikiExistenceUpdate ( INTERWIKIEXISTENCE_ROLLDICE | INTERWIKIEXISTENCE_CHECKMINIMUMTIME, $wgInterwikiExistenceNewOdds, 'interwikiexistencenewtimestamp', 'interwikiexistencenewconttimestamp', $wgInterwikiExistenceRemoteWikiUrl, $wgInterwikiExistenceApiNewArgs, 'recentchanges', 'iwe_page_created', 'rccontinue', $wgInterwikiExistenceNewSeconds, $wgInterwikiExistenceMinimumNewSeconds, $wgInterwikiExistenceUserAgent ), $output,				'interwikiexistence-creation',				$wgInterwikiExistenceMinimumNewSeconds ); SpecialInterwikiExistence::reaction (			InterwikiExistenceHooks::interwikiExistenceUpdate ( INTERWIKIEXISTENCE_ROLLDICE | INTERWIKIEXISTENCE_CHECKMINIMUMTIME, $wgInterwikiExistenceDeleteOdds, 'interwikiexistencedeletetimestamp', 'interwikiexistencedeleteconttimestamp', false, $wgInterwikiExistenceRemoteWikiUrl, $wgInterwikiExistenceApiDeleteArgs, 'logevents', 'iwe_page_deleted', 'lecontinue', $wgInterwikiExistenceDeleteSeconds, $wgInterwikiExistenceMinimumDeleteSeconds, true, $wgInterwikiExistenceUserAgent ), $output,				'interwikiexistence-deletion',				$wgInterwikiExistenceMinimumDeleteSeconds ); }

public static function reaction ( $input, $output, $action, $seconds ) { if ( is_array ( $input ) ) { if ( $input['status'] == INTERWIKIEXISTENCE_NORETRIEVE ) { $output->addWikiMsg ( 'interwikiexistence-trigger-noretrieve',                                       $result['url']); }                       if ( $input['status'] == INTERWIKIEXISTENCE_NODECODE ) { $output->addWikiMsg ( 'interwikiexistence-trigger-nodecode',                                       $result['url'] ); }               } else switch ( $input ) { case INTERWIKIEXISTENCE_SUCCESS: $output->addWikiMsg ( 'interwikiexistence-trigger-success',					wfMessage ( $action ) ); break; case INTERWIKIEXISTENCE_CONTINUING: $output->addWikiMsg ( 'interwikiexistence-trigger-continuing',					wfMessage ( $action ) ); break; case INTERWIKIEXISTENCE_THROTTLED: $output->addWikiMsg ( 'interwikiexistence-trigger-throttled',					$seconds, wfMessage ( $action ) ); break; case INTERWIKIEXISTENCE_NOTIMESTAMP: $output->addWikiMsg ( 'interwikiexistence-trigger-notimestamp',					wfMessage ( $action ) ); break; }		return; } }