本文整理汇总了PHP中Backend::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Backend::create方法的具体用法?PHP Backend::create怎么用?PHP Backend::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Backend
的用法示例。
在下文中一共展示了Backend::create方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: installations
<?php
require_once '../backend/modules/Backend.php';
$backend = Backend::create('pgkbot', 'A python bot by <a href="//en.wikipedia.org/wiki/user:pgk" title="pgk\'s Wikipedia userpage">pgk</a> that processes and filters IRC change feeds for wiki installations (see the <a href="//meta.wikimedia.org/wiki/CVN/Bots" title="online documentation">onwiki documentation</a>).')->link('/pgkbot/stylesheet.css')->header();
?>
<p class="neutral">The <a href="//meta.wikimedia.org/wiki/Pgkbot" title="pgkbot package">pgkbot package</a> is obsolete and no longer actively maintained. This mirror is maintained for historical interest.</p>
<h3>Download</h3>
<ul>
<li><a href="pgkbot_1.7.zip" title="pgkbot archive">pgkbot 1.7</a> (2007-03-11, 381kB)</li>
<li><a href="pgkbot_1.6.zip" title="pgkbot archive">pgkbot 1.6</a> (2006-11-22, 393kB)</li>
<li><a href="pgkbot_1.5.zip" title="pgkbot archive">pgkbot 1.5</a> (unknown date, 373kB)</li>
<li><a href="pgkbot_1.4.zip" title="pgkbot archive">pgkbot 1.4</a> (unknown date, 373kB)</li>
<li><a href="pgkbot_1.3.zip" title="pgkbot archive">pgkbot 1.3</a> (unknown date, 493kB)</li>
<li><a href="pgkbot_1.2.zip" title="pgkbot archive">pgkbot 1.2</a> (unknown date, 481kB)</li>
<li><a href="pgkbot_1.1.zip" title="pgkbot archive">pgkbot 1.1</a> (unknown date, 452kB)</li>
<li><s><a href="svn://hemlock.knams.wikimedia.org/pgk/svnCVUBot/" title="Get pgkbot from Wikimedia subversion">development version</a></s></li>
</ul>
<?php
$backend->footer();
示例2: array
<?php
require_once '../backend/modules/Backend.php';
$backend = Backend::create('A template\'s magic redirect', 'Redirects to an arbitrary URL with tokens based on user and wiki filled in. This is primarily intended for Wikimedia templates such as {{<a href="//meta.wikimedia.org/wiki/Template:sr-request" title="template:sr-request on Meta">sr-request</a>}} (see <a href="?url=//{wiki.domain}/wiki/Special:UserRights/{user.name}@{wiki.name}&wiki=metawiki&user=Pathoschild" title="reload with example values">example</a>).')->link('/magicredirect/stylesheet.css')->link('/content/jquery.collapse/jquery.collapse.js')->link('/content/jquery.collapse/jquery.cookie.js')->addScript('
$(document).ready(function() {
$("#token-documentation").collapse({head:"span", group:"ul"});
});
');
$tokens = array('wiki' => array('name' => 'The simplified database name, like \'enwiki\'.', 'dbName' => 'The database name, like \'enwiki\'.', 'lang' => 'The ISO 639 language associated with the wiki. (A few wikis have invalid codes like \'zh-classical\' or \'noboard-chapters\'.)', 'family' => 'The project name, like \'wikibooks\'.', 'domain' => 'The domain portion of the URL, like \'fr.wikisource.org\'.', 'size' => 'The number of articles on the wiki.', 'isClosed' => 'Whether the wiki is locked and no longer publicly editable.', 'serverNumber' => 'The number of the server on which the wiki\'s <em>replicated</em> database is located.', 'host' => 'The host name of the server on which the wiki\'s <em>replicated</em> database is located.'), 'user' => array('id' => 'The user\'s global identifier number.', 'name' => 'The unique name of the user.', 'registration' => 'The date on which the global account was registered.', 'locked' => 'Whether the global account has been <a href="//meta.wikimedia.org/wiki/Steward_handbook#Managing_global_accounts" title="about account locking">locked</a>.', 'hidden' => 'Whether the global account has been <a href="//meta.wikimedia.org/wiki/Steward_handbook#Managing_global_accounts" title="about account hiding">hidden</a>.'));
##########
## Handle request
##########
/* get input */
$url = $backend->get('url');
$redirect = $backend->get('redirect', false);
$wiki = $backend->get('wiki');
$user = $backend->get('user');
/* apply data */
$error = '';
$target = $url;
if ($target) {
$db = $backend->GetDatabase();
$db->Connect('metawiki');
/* apply wiki */
if ($wiki && strpos($target, '{wiki.') !== false) {
$dbname = preg_replace('/_p$/', '', $wiki);
$domain = preg_replace('/^(?:https?:\\/\\/|\\/\\/)?(?:www\\.)?(.+?)(?:\\.org.*)?$/', '$1.org', $wiki);
$found = false;
foreach ($db->getWikis() as $data) {
if ($data->name == $dbname || $data->domain == $domain) {
$found = true;
示例3:
<?php
require_once '../backend/modules/Backend.php';
$backend = Backend::create('CrossActivity', 'Measures a user\'s latest edit, bureaucrat, or sysop activity on all wikis.')->link('/content/dataTables/jquery.dataTables.min.js')->link('/content/dataTables/jquery.dataTables.plain.css')->addScript('
$(function() {
$("#activity-table").dataTable({
"bPaginate": false,
"bAutoWidth": false,
"aaSorting": [[2, "desc"]]
});
});
')->header();
/***************
* Get data
***************/
$user = $backend->get('user', $backend->getRouteValue());
if ($user != null) {
$user = $backend->formatUsername($user);
}
$user_form = $backend->formatValue($user);
$show_all = $backend->get('show_all', false);
/***************
* Input form
***************/
echo '<form action="', $backend->url('/crossactivity'), '" method="get">
<label for="user">User name:</label>
<input type="text" name="user" id="user" value="', $backend->formatValue($user), '" />', $user == 'Shanel' ? '♥' : '', '<br />
<input type="checkbox" id="show_all" name="show_all" ', $show_all ? 'checked="checked" ' : '', '/> <label
for="show_all">Show wikis with no activity</label><br />
<input type="submit" value="Analyze »" />
</form>';
示例4: name
<?php
require_once '../backend/modules/Backend.php';
require_once '../backend/modules/IP.php';
require_once '../backend/modules/Form.php';
require_once 'Stalktoy.php';
$backend = Backend::create('Stalk toy', 'View global details about a user across all Wikimedia wikis. You can provide an account name (like <a href="/meta/stalktoy/Pathoschild" title="view result for Pathoschild"><tt>Pathoschild</tt></a>), an IPv4 address (like <a href="/meta/stalktoy/127.0.0.1" title="view result for 127.0.0.1"><tt>127.0.0.1</tt></a>), an IPv6 address (like <a href="/meta/stalktoy/2001:db8:1234::" title="view result for 2001:db8:1234::"><tt>2001:db8:1234::</tt></a>), or a CIDR block (like <a href="/meta/stalktoy/212.75.0.1/16" title="view result for 212.75.0.1/16"><tt>212.75.0.1/16</tt></a> or <a href="/meta/stalktoy/2600:3C00::/48" title="view result for 2600:3C00::/48"><tt>2600:3C00::/48</tt></a>).')->link('/stalktoy/stylesheet.css')->link('/content/jquery.tablesorter.js')->link('https://www.google.com/jsapi', 'js')->link('/stalktoy/scripts.js')->header();
/**
* Implements logic for the Stalktoy tool.
*/
class StalktoyScript extends Base
{
#############################
## Properties
#############################
public $target;
public $target_wiki_url;
public $target_url;
/**
* A lookup hash of wiki data.
* @var Wiki[]
*/
public $wikis;
/**
* A lookup hash of wiki domains.
* @var string[]
*/
public $domains;
public $wiki;
public $show_all_wikis = false;
// in account mode, display wikis the user isn't on?
示例5: array
<?php
require_once '../backend/modules/Backend.php';
$backend = Backend::create('AccountEligibility', 'Analyzes a given user account to determine whether it\'s eligible to vote in the specified event.')->link('/accounteligibility/stylesheet.css')->link('/content/jquery.tablesorter.js')->addScript('$(document).ready(function() { $("#local-accounts").tablesorter({sortList:[[1,1]]}); });')->header();
############################
## Script engine
############################
class Script extends Base
{
############################
## Configuration
############################
const DEFAULT_EVENT = 36;
public $events = array(36 => array('year' => 2015, 'name' => 'Wikimedia Foundation elections', 'url' => '//meta.wikimedia.org/wiki/Wikimedia_Foundation_elections_2015', 'autoselect_min_editcount' => 300, 'more_reqs' => array('Your account must not be used by a bot.'), 'exceptions' => array('You are a Wikimedia server administrator with shell access.', 'You have commit access and have made at least one merged commit in git to Wikimedia Foundation utilized repos between 15 October 2014 and 15 April 2015.', 'You are a current Wikimedia Foundation staff member or contractor employed by the Foundation as of 15 April 2015.', 'You are a current or former member of the Wikimedia Board of Trustees, Advisory Board or Funds Dissemination Committee.')), 35 => array('year' => 2015, 'name' => 'steward elections', 'url' => '//meta.wikimedia.org/wiki/Stewards/Elections_2015'), 34 => array('year' => 2015, 'name' => 'steward elections (candidates)', 'url' => '//meta.wikimedia.org/wiki/Stewards/Elections_2015', 'action' => '<strong>be a candidate</strong>', 'more_reqs' => array('You must be 18 years old, and at the age of majority in your country.', 'You must agree to abide by the policies governing <a href="//meta.wikimedia.org/wiki/Stewards_policy" title="Steward policy">steward access</a>, <a href="//meta.wikimedia.org/wiki/CheckUser_policy" title="checkuser policy">checkuser access</a>, <a href="//meta.wikimedia.org/wiki/Oversight_policy" title="oversight policy">oversight access</a>, and <a href="//wikimediafoundation.org/wiki/privacy_policy" title="privacy policy">privacy</a>.', 'You must <a href="//meta.wikimedia.org/wiki/Steward_handbook/email_templates" title="instructions for providing ID">provide your full name and proof of identity</a> to the Wikimedia Foundation before 08 February 2015.')), 33 => array('year' => 2015, 'name' => 'Commons Picture of the Year for 2014', 'url' => '//commons.wikimedia.org/wiki/Commons:Picture_of_the_Year/2014'), 32 => array('year' => 2014, 'name' => 'Commons Picture of the Year for 2013', 'url' => '//commons.wikimedia.org/wiki/Commons:Picture_of_the_Year/2013'), 31 => array('year' => 2014, 'name' => 'steward elections', 'url' => '//meta.wikimedia.org/wiki/Stewards/Elections_2014'), 30 => array('year' => 2014, 'name' => 'steward elections (candidates)', 'url' => '//meta.wikimedia.org/wiki/Stewards/Elections_2014', 'action' => '<strong>be a candidate</strong>', 'more_reqs' => array('You must be 18 years old, and at the age of majority in your country.', 'You must agree to abide by the policies governing <a href="//meta.wikimedia.org/wiki/Stewards_policy" title="Steward policy">steward access</a>, <a href="//meta.wikimedia.org/wiki/CheckUser_policy" title="checkuser policy">checkuser access</a>, <a href="//meta.wikimedia.org/wiki/Oversight_policy" title="oversight policy">oversight access</a>, and <a href="//wikimediafoundation.org/wiki/privacy_policy" title="privacy policy">privacy</a>.', 'You must <a href="//meta.wikimedia.org/wiki/Steward_handbook/email_templates" title="instructions for providing ID">provide your full name and proof of identity</a> to the Wikimedia Foundation before 08 February 2014.')), 29 => array('year' => 2013, 'name' => 'steward elections', 'url' => '//meta.wikimedia.org/wiki/Stewards/Elections_2013'), 28 => array('year' => 2013, 'name' => 'steward elections (candidates)', 'url' => '//meta.wikimedia.org/wiki/Stewards/Elections_2013', 'action' => '<strong>be a candidate</strong>', 'more_reqs' => array('You must be 18 years old, and at the age of majority in your country.', 'You must agree to abide by the policies governing <a href="//meta.wikimedia.org/wiki/Stewards_policy" title="Steward policy">steward access</a>, <a href="//meta.wikimedia.org/wiki/CheckUser_policy" title="checkuser policy">checkuser access</a>, <a href="//meta.wikimedia.org/wiki/Oversight_policy" title="oversight policy">oversight access</a>, and <a href="//wikimediafoundation.org/wiki/privacy_policy" title="privacy policy">privacy</a>.', 'You must <a href="//meta.wikimedia.org/wiki/Steward_handbook/email_templates" title="instructions for providing ID">provide your full name and proof of identity</a> to the Wikimedia Foundation before 08 February 2013.')), 27 => array('year' => 2013, 'name' => 'Commons Picture of the Year for 2012', 'url' => '//commons.wikimedia.org/wiki/Commons:Picture_of_the_Year/2012'), 26 => array('year' => 2012, 'name' => 'enwiki arbcom elections (voters)', 'url' => '//en.wikipedia.org/wiki/Wikipedia:Arbitration_Committee_Elections_December_2012', 'only_db' => 'enwiki_p'), 25 => array('year' => 2012, 'name' => 'enwiki arbcom elections (candidates)', 'url' => '//en.wikipedia.org/wiki/Wikipedia:Arbitration_Committee_Elections_December_2012', 'only_db' => 'enwiki_p', 'action' => '<strong>be a candidate</strong>', 'more_reqs' => array('You must be in good standing and not subject to active blocks or site-bans.', 'You must meet the Wikimedia Foundation\'s <a href="//wikimediafoundation.org/w/index.php?title=Access_to_nonpublic_data_policy&oldid=47490" title="Access to nonpublic data policy">criteria for access to non-public data</a> and must identify with the Foundation if elected.', 'You must have disclosed any alternate accounts in your election statement (legitimate accounts which have been declared to the Arbitration Committee before the close of nominations need not be publicly disclosed).')), 24 => array('year' => 2012, 'name' => 'Commons Picture of the Year for 2011', 'url' => '//commons.wikimedia.org/wiki/Commons:Picture_of_the_Year/2011'), 23 => array('year' => 2012, 'name' => 'steward elections', 'url' => '//meta.wikimedia.org/wiki/Stewards/Elections_2012'), 22 => array('year' => 2012, 'name' => 'steward elections (candidates)', 'url' => '//meta.wikimedia.org/wiki/Stewards/Elections_2012', 'action' => '<strong>be a candidate</strong>', 'more_reqs' => array('You must be 18 years old, and at the age of majority in your country.', 'You must agree to abide by the <a href="//meta.wikimedia.org/wiki/Stewards_policy" title="Steward policy">Steward policy</a> and <a href="//wikimediafoundation.org/wiki/Template:Policy" title="Wikimedia Foundation policies">Foundation policies</a>.', 'You must <a href="//meta.wikimedia.org/wiki/Steward_handbook/email_templates" title="instructions for providing ID">provide your full name and proof of identity</a> to the Wikimedia Foundation before 08 February 2012.')), 21 => array('year' => 2011, 'name' => 'enwiki arbcom elections', 'url' => '//en.wikipedia.org/wiki/Wikipedia:Arbitration_Committee_Elections_December_2011', 'only_db' => 'enwiki_p'), 20 => array('year' => 2011, 'name' => 'enwiki arbcom elections (candidates)', 'url' => '//en.wikipedia.org/wiki/Wikipedia:Arbitration_Committee_Elections_December_2011', 'only_db' => 'enwiki_p', 'action' => '<strong>be a candidate</strong>', 'more_reqs' => array('You must be in good standing and not subject to active blocks or site-bans.', 'You must meet the Wikimedia Foundation\'s criteria for access to non-public data and must identify with the Foundation if elected.', 'You must have disclosed any alternate accounts in your election statement (legitimate accounts which have been declared to the Arbitration Committee prior to the close of nominations need not be publicly disclosed).')), 19 => array('year' => 2011, 'name' => '2011-09 steward elections', 'url' => '//meta.wikimedia.org/wiki/Stewards/elections_2011-2'), 18 => array('year' => 2011, 'name' => '2011-09 steward elections (candidates)', 'url' => '//meta.wikimedia.org/wiki/Stewards/elections_2011-2', 'action' => '<strong>be a candidate</strong>', 'more_reqs' => array('You must be 18 years old, and at the age of majority in your country.', 'You must agree to abide by the <a href="//meta.wikimedia.org/wiki/Stewards_policy" title="Steward policy">Steward policy</a> and <a href="//wikimediafoundation.org/wiki/Template:Policy" title="Wikimedia Foundation policies">Foundation policies</a>.', 'You must <a href="//meta.wikimedia.org/wiki/Steward_handbook/email_templates" title="instructions for providing ID">provide your full name and proof of identity</a> to the Wikimedia Foundation before 07 February 2011.')), 17 => array('year' => 2011, 'name' => 'Board elections', 'url' => '//meta.wikimedia.org/wiki/Board elections/2011', 'autoselect_min_editcount' => 300, 'more_reqs' => array('Your account must not be used by a bot.'), 'exceptions' => array('You are a Wikimedia server administrator with shell access.', 'You have MediaWiki commit access and made at least one commit between 15 May 2010 and 15 May 2011.', 'You are a Wikimedia Foundation staff or contractor employed by Wikimedia between 15 February 2011 and 15 May 2011.', 'You are a current or former member of the Wikimedia Board of Trustees or Advisory Board.')), 16 => array('year' => 2011, 'name' => 'Commons Picture of the Year for 2010', 'url' => '//commons.wikimedia.org/wiki/Commons:Picture_of_the_Year/2010'), 15 => array('year' => 2011, 'name' => 'steward confirmations', 'url' => '//meta.wikimedia.org/wiki/Stewards/confirm/2011', 'action' => 'comment'), 14 => array('year' => 2011, 'name' => '2011-01 steward elections', 'url' => '//meta.wikimedia.org/wiki/Stewards/elections_2011'), 13 => array('year' => 2011, 'name' => '2011-01 steward elections (candidates)', 'url' => '//meta.wikimedia.org/wiki/Stewards/elections_2011', 'action' => '<strong>be a candidate</strong>', 'more_reqs' => array('You must be 18 years old, and at the age of majority in your country.', 'You must agree to abide by the <a href="//meta.wikimedia.org/wiki/Stewards_policy" title="Steward policy">Steward policy</a> and <a href="//wikimediafoundation.org/wiki/Template:Policy" title="Wikimedia Foundation policies">Foundation policies</a>.', 'You must <a href="//meta.wikimedia.org/wiki/Steward_handbook/email_templates" title="instructions for providing ID">provide your full name and proof of identity</a> to the Wikimedia Foundation before 07 February 2011.')), 12 => array('year' => 2010, 'name' => 'enwiki arbcom elections', 'url' => '//en.wikipedia.org/wiki/Wikipedia:Arbitration_Committee_Elections_December_2010', 'only_db' => 'enwiki_p'), 11 => array('year' => 2010, 'name' => '2010-09 steward elections', 'url' => '//meta.wikimedia.org/wiki/Stewards/elections_2010-2'), 10 => array('year' => 2010, 'name' => '2010-09 steward elections (candidates)', 'url' => '//meta.wikimedia.org/wiki/Stewards/elections_2010-2', 'action' => '<strong>be a candidate</strong>', 'more_reqs' => array('You must be 18 years old, and at the age of majority in your country.', 'You must agree to abide by the <a href="//meta.wikimedia.org/wiki/Stewards_policy" title="Steward policy">Steward policy</a> and <a href="//wikimediafoundation.org/wiki/Template:Policy" title="Wikimedia Foundation policies">Foundation policies</a>.', 'You must <a href="//meta.wikimedia.org/wiki/Steward_handbook/email_templates" title="instructions for providing ID">provide your full name and proof of identity</a> to the Wikimedia Foundation before 01 February 2010.')), 9 => array('year' => 2010, 'name' => 'Commons Picture of the Year for 2009', 'url' => '//commons.wikimedia.org/wiki/Commons:Picture_of_the_Year/2009'), 8 => array('year' => 2010, 'name' => '2010-02 steward elections', 'url' => '//meta.wikimedia.org/wiki/Stewards/elections_2010', 'more_reqs' => array('Your account must not be primarily used for automated (bot) tasks.')), 7 => array('year' => 2010, 'name' => '2010-02 steward elections (candidates)', 'url' => '//meta.wikimedia.org/wiki/Stewards/elections_2010', 'action' => '<strong>be a candidate</strong>', 'more_reqs' => array('You must be 18 years old, and at the age of majority in your country.', 'You must agree to abide by the <a href="//meta.wikimedia.org/wiki/Stewards_policy" title="Steward policy">Steward policy</a>.', 'You must <a href="//meta.wikimedia.org/wiki/Steward_handbook/email_templates" title="instructions for providing ID">provide your full name and proof of identity</a> to the Wikimedia Foundation before 01 February 2010.')), 6 => array('year' => 2010, 'name' => 'create global sysops vote', 'url' => '//meta.wikimedia.org/wiki/Global_sysops/Vote'), 5 => array('year' => 2009, 'name' => 'enwiki arbcom elections', 'url' => '//en.wikipedia.org/wiki/Wikipedia:Arbitration_Committee_Elections_December_2009', 'only_db' => 'enwiki_p'), 4 => array('year' => 2009, 'name' => 'Commons Picture of the Year for 2008', 'url' => '//commons.wikimedia.org/wiki/Commons:Picture_of_the_Year/2008'), 3 => array('year' => 2009, 'name' => 'steward elections (candidates)', 'url' => '//meta.wikimedia.org/wiki/Stewards/elections_2009', 'action' => '<strong>be a candidate</strong>', 'more_reqs' => array('You must be 18 years old, and at the age of majority in your country.', 'You must agree to abide by the <a href="//meta.wikimedia.org/wiki/Stewards_policy" title="Steward policy">Steward policy</a>.', 'You must <a href="//meta.wikimedia.org/wiki/Steward_handbook/email_templates" title="instructions for providing ID">provide your full name and proof of identity</a> to the Wikimedia Foundation.')), 2 => array('year' => 2009, 'name' => 'steward elections', 'url' => '//meta.wikimedia.org/wiki/Stewards/elections_2009', 'autoselect_min_editcount' => 600), 1 => array('year' => 2008, 'name' => 'enwiki arbcom elections', 'url' => '//en.wikipedia.org/wiki/Wikipedia:Arbitration_Committee_Elections_December_2008', 'only_db' => 'enwiki_p'), 0 => array('year' => 2008, 'name' => 'Board elections', 'url' => '//meta.wikimedia.org/wiki/Board elections/2008', 'autoselect_min_editcount' => 600));
############################
## Properties
############################
/**
* The underlying database manager.
* @var Toolserver
*/
public $db = NULL;
public $profiler = NULL;
protected $backend = NULL;
private $_userName = NULL;
protected $eventID = NULL;
/**
* Whether the user must select a wiki manually, because there is no matching global account.
*/
public $selectManually = false;
public $wiki = NULL;
示例6: pages
<?php
require_once '../backend/modules/Backend.php';
$backend = Backend::create('GlobalGroups', 'A review of extra permissions assigned to <a href="//meta.wikimedia.org/wiki/Steward_handbook#Globally_and_wiki_sets" title="global groups">global groups</a> on Wikimedia Foundation wikis.')->link('/globalgroups/stylesheet.css')->header();
/*########
## Flag descriptions
########*/
// taken from MediaWiki localization files
// TODO: rethink how this is done
$flagBlurbs = array('right-read' => 'Read pages', 'right-edit' => 'Edit pages', 'right-createpage' => 'Create pages (which are not discussion pages)', 'right-createtalk' => 'Create discussion pages', 'right-createaccount' => 'Create new user accounts', 'right-minoredit' => 'Mark edits as minor', 'right-move' => 'Move pages', 'right-move-subpages' => 'Move pages with their subpages', 'right-move-rootuserpages' => 'Move root user pages', 'right-movefile' => 'Move files', 'right-suppressredirect' => 'Not create redirects from source pages when moving pages', 'right-upload' => 'Upload files', 'right-reupload' => 'Overwrite existing files', 'right-reupload-own' => 'Overwrite existing files uploaded by oneself', 'right-reupload-shared' => 'Override files on the shared media repository locally', 'right-upload_by_url' => 'Upload files from a URL', 'right-purge' => 'Purge the site cache for a page without confirmation', 'right-autoconfirmed' => 'Edit semi-protected pages', 'right-bot' => 'Be treated as an automated process', 'right-nominornewtalk' => 'Not have minor edits to discussion pages trigger the new messages prompt', 'right-apihighlimits' => 'Use higher limits in API queries', 'right-writeapi' => 'Use of the write API', 'right-delete' => 'Delete pages', 'right-bigdelete' => 'Delete pages with large histories', 'right-deleterevision' => 'Delete and undelete specific revisions of pages', 'right-deletedhistory' => 'View deleted history entries, without their associated text', 'right-deletedtext' => 'View deleted text and changes between deleted revisions', 'right-browsearchive' => 'Search deleted pages', 'right-undelete' => 'Undelete a page', 'right-suppressrevision' => 'Review and restore revisions hidden from administrators', 'right-suppressionlog' => 'View private logs', 'right-block' => 'Block other users from editing', 'right-blockemail' => 'Block a user from sending e-mail', 'right-hideuser' => 'Block a username, hiding it from the public', 'right-ipblock-exempt' => 'Bypass IP blocks, auto-blocks and range blocks', 'right-proxyunbannable' => 'Bypass automatic blocks of proxies', 'right-unblockself' => 'Unblock themselves', 'right-protect' => 'Change protection levels and edit protected pages', 'right-editprotected' => 'Edit protected pages (without cascading protection)', 'right-editinterface' => 'Edit the user interface', 'right-editusercssjs' => "Edit other users' CSS and JavaScript files", 'right-editusercss' => "Edit other users' CSS files", 'right-edituserjs' => "Edit other users' JavaScript files", 'right-rollback' => 'Quickly rollback the edits of the last user who edited a particular page', 'right-markbotedits' => 'Mark rolled-back edits as bot edits', 'right-noratelimit' => 'Not be affected by rate limits', 'right-import' => 'Import pages from other wikis', 'right-importupload' => 'Import pages from a file upload', 'right-patrol' => "Mark others' edits as patrolled", 'right-autopatrol' => "Have one's own edits automatically marked as patrolled", 'right-patrolmarks' => 'View recent changes patrol marks', 'right-unwatchedpages' => 'View a list of unwatched pages', 'right-mergehistory' => 'Merge the history of pages', 'right-userrights' => 'Edit all user rights', 'right-userrights-interwiki' => 'Edit user rights of users on other wikis', 'right-siteadmin' => 'Lock and unlock the database', 'right-override-export-depth' => 'Export pages including linked pages up to a depth of 5', 'right-sendemail' => 'Send e-mail to other users', 'right-passwordreset' => 'View password reset e-mails', 'right-abusefilter-modify' => 'Modify abuse filters', 'right-abusefilter-view' => 'View abuse filters', 'right-abusefilter-log' => 'View the abuse log', 'right-abusefilter-log-detail' => 'View detailed abuse log entries', 'right-abusefilter-private' => 'View private data in the abuse log', 'right-abusefilter-modify-restricted' => 'Modify abuse filters with restricted actions', 'right-abusefilter-revert' => 'Revert all changes by a given abuse filter', 'right-abusefilter-view-private' => 'View abuse filters marked as private', 'right-abusefilter-hide-log' => 'Hide entries in the abuse log', 'right-abusefilter-hidden-log' => 'View hidden abuse log entries', 'right-override-antispoof' => 'Override the spoofing checks', 'right-aftv5-hide-feedback' => 'Hide feedback', 'right-aftv5-delete-feedback' => 'Delete feedback', 'right-aftv5-see-deleted-feedback' => 'View deleted feedback', 'right-aftv5-see-hidden-feedback' => 'View hidden feedback', 'right-globalgroupmembership' => 'Edit membership to global groups', 'right-centralauth-autoaccount' => 'Automatically login with global account', 'right-centralauth-unmerge' => 'Unmerge global account', 'right-centralauth-lock' => 'Lock or hide global account', 'right-centralauth-oversight' => 'Suppress global account', 'right-centralauth-merge' => 'Merge their account', 'right-globalgrouppermissions' => 'Manage global groups', 'right-centralnotice-admin' => 'Manage central notices', 'right-checkuser' => "Check user's IP addresses and other information", 'right-checkuser-log' => 'View the checkuser log', 'right-skipcaptcha' => 'Perform CAPTCHA-triggering actions without having to go through the CAPTCHA', 'right-globalblock' => 'Make global blocks', 'right-globalunblock' => 'Remove global blocks', 'right-globalblock-whitelist' => 'Disable global blocks locally', 'right-globalblock-exempt' => 'Bypass global blocks', 'right-oversight' => 'View a previously hidden revision with Extension:Oversight', 'right-hiderevision' => 'Hide revisions from administrators with Extension:Oversight', 'right-moodbar-view' => 'View and export MoodBar feedback', 'right-moodbar-admin' => 'Alter visibility on the feedback dashboard', 'right-nuke' => 'Mass delete pages', 'right-renameuser' => 'Rename users', 'right-tboverride' => 'Override the title blacklist', 'right-tboverride-account' => 'Override the username blacklist', 'right-torunblocked' => 'Bypass automatic blocks of tor exit nodes', 'right-centralnotice-translate' => '(obsolete)', 'right-centralauth-admin' => '(obsolete)', 'right-moodbar-admin' => '(obsolete)', 'right-prefstats' => '(obsolete)', 'right-uboverride' => '(obsolete)');
/*########
## Query group details
########*/
$db = $backend->GetDatabase('metawiki');
$db->Connect('metawiki');
$groups = array();
foreach ($db->Query('SELECT DISTINCT ggp_group FROM centralauth_p.global_group_permissions')->fetchAllAssoc() as $groupRow) {
/* group name */
$groupKey = $groupRow['ggp_group'];
$group = array('key' => $groupKey, 'name' => $backend->formatInitialCapital(str_replace('_', ' ', $groupKey)), 'anchor' => $backend->formatAnchor($groupKey), 'rights' => array(), 'members' => 0, 'wikis' => 0, 'wikiset' => array());
/* rights */
foreach ($db->Query('SELECT ggp_permission FROM centralauth_p.global_group_permissions WHERE ggp_group = ?', array($groupKey))->fetchAllAssoc() as $rightsRow) {
$group['rights'][] = $rightsRow['ggp_permission'];
}
sort($group['rights']);
if (!count($group['rights'])) {
continue;
}
// groups with no rights are deleted (but still in the database)
/* member count */
$group['members'] = $db->Query('SELECT COUNT(*) FROM centralauth_p.global_user_groups LEFT JOIN centralauth_p.globaluser ON gug_user = gu_id WHERE gug_group = ? AND gu_id IS NOT NULL', array($groupKey))->fetchValue();
示例7: urlencode
<?php
require_once '../backend/modules/Backend.php';
$backend = Backend::create('User pages', 'Find your user pages on all Wikimedia wikis.')->link('/userpages/scripts.js')->link('/userpages/stylesheet.css')->header();
/***************
* Get data
***************/
$user = $backend->get('user', $backend->getRouteValue());
if ($user) {
$user = $backend->formatUsername($user);
}
$user_form = $backend->formatValue($user);
$show_all = $backend->get('all', false);
/***************
* Input form
***************/
echo '<form action="', $backend->url('/userpages'), '" method="get">
<label for="user">User name:</label>
<input type="text" name="user" id="user" value="', $backend->formatValue($user), '" />', $user == 'Shanel' ? '♥' : '', '<br />
<input type="checkbox" id="all" name="all" ', $show_all ? 'checked="checked" ' : '', '/> <label
for="all">Show wikis with no user pages</label><br />
<input type="submit" value="Analyze »" />
</form>';
if (!empty($user)) {
echo '<div class="result-box">';
echo 'See also <a href="', $backend->url('/stalktoy/' . urlencode($user)), '" title="Global account details">global account details</a>, <a href="', $backend->url('/crossactivity/' . urlencode($user)), '" title="Crosswiki activity">recent activity</a>, <a href="//meta.wikimedia.org/?title=Special:CentralAuth/', urlencode($user), '" title="Special:CentralAuth">Special:CentralAuth</a>.';
}
if ($user) {
echo '<hr />Filters: <a href="#" class="selected filter" data-filter="misc">wikitext</a> <a href="#" class="selected filter" data-filter="css">CSS</a> <a href="#" class="selected filter" data-filter="js">JS</a>';
}
/***************
示例8: category
<?php
require_once '../backend/modules/Backend.php';
require_once '../backend/modules/Form.php';
$backend = Backend::create('Catanalysis', 'Analyzes edits to pages in the category tree rooted at the specified category (or pages rooted at a prefix). This is primarily intended for test project analysis by the Wikimedia Foundation <a href="//meta.wikimedia.org/wiki/Language_committee" title="language committee">language committee</a>.')->link('/catanalysis/stylesheet.css')->header();
/***************
* Variables
***************/
/* configuration */
$USEREDIT_LIMIT_FOR_INACTIVITY = 10;
// users with <= this are marked inactive (in given month)
$USERCOUNT_LIMIT_FOR_INACTIVITY = 3;
// months with <= users are marked inactive
/* input */
$fullTitle = $backend->formatInitialCapital($backend->get('title'));
$database = $backend->get('wiki', $backend->get('db', 'incubatorwiki'));
$cat = !!$backend->get('cat', true);
$listpages = $backend->get('listpages');
/* normalise database */
if ($database && substr($database, -2) == '_p') {
$database = substr($database, 0, -2);
}
/* parse title */
$i = strpos($fullTitle, ':');
if ($i) {
$namespace = substr($fullTitle, 0, $i);
$title = substr($fullTitle, $i + 1);
} else {
$namespace = null;
$title = $fullTitle;
}