used for action=upload's 'file' and 'chunk' parameters. This type will raise
an error during parameter validation if the parameter is given but not
recognized as an uploaded file.
+* (bug 44244) prop=info may now return the number of people watching each page.
=== API internal changes in 1.21 ===
* For debugging only, a new global $wgDebugAPI removes many API restrictions when true.
$wgUseTagFilter = true;
/**
- * If set to an integer, pages that are watched by more users than this
- * threshold will not require the unwatchedpages permission to view the
- * number of watchers.
+ * If set to an integer, pages that are watched by this many users or more
+ * will not require the unwatchedpages permission to view the number of
+ * watchers.
*
* @since 1.21
*/
public function getImageLimitsFromOption( $user, $optionName ) {
global $wgImageLimits;
- $option = intval( $user->getOption( $optionName ) );
+ $option = $user->getIntOption( $optionName );
if ( !isset( $wgImageLimits[$option] ) ) {
$option = User::getDefaultOption( $optionName );
}
$this->mOffset = $this->mRequest->getText( 'offset' );
# Use consistent behavior for the limit options
- $this->mDefaultLimit = intval( $this->getUser()->getOption( 'rclimit' ) );
+ $this->mDefaultLimit = $this->getUser()->getIntOption( 'rclimit' );
if ( !$this->mLimit ) {
// Don't override if a subclass calls $this->setLimit() in its constructor.
list( $this->mLimit, /* $offset */ ) = $this->mRequest->getLimitOffset();
*/
public function getStubThreshold() {
global $wgMaxArticleSize; # Maximum article size, in Kb
- $threshold = intval( $this->getOption( 'stubthreshold' ) );
+ $threshold = $this->getIntOption( 'stubthreshold' );
if ( $threshold > $wgMaxArticleSize * 1024 ) {
# If they have set an impossible value, disable the preference
# so we can use the parser cache again.
$limit = 0;
}
if( ( $limit == 0 ) && ( $optionname != '' ) ) {
- $limit = (int)$wgUser->getOption( $optionname );
+ $limit = $wgUser->getIntOption( $optionname );
}
if( $limit <= 0 ) {
$limit = $deflimit;
? 'watchdefault' : 'watchcreations';
}
# Watch the article based on the user preference
- return (bool)$this->getUser()->getOption( $userOption );
+ return $this->getUser()->getBoolOption( $userOption );
case 'nochange':
return $userWatching;
}
public function getHelpUrls() {
- return 'https://www.mediawiki.org/wiki/API:E-mail';
+ return 'https://www.mediawiki.org/wiki/API:Email';
}
}
private $fld_protection = false, $fld_talkid = false,
$fld_subjectid = false, $fld_url = false,
- $fld_readable = false, $fld_watched = false, $fld_notificationtimestamp = false,
+ $fld_readable = false, $fld_watched = false, $fld_watchers = false,
+ $fld_notificationtimestamp = false,
$fld_preload = false, $fld_displaytitle = false;
private $params, $titles, $missing, $everything, $pageCounter;
private $pageRestrictions, $pageIsRedir, $pageIsNew, $pageTouched,
$pageLatest, $pageLength;
- private $protections, $watched, $notificationtimestamps, $talkids, $subjectids, $displaytitles;
+ private $protections, $watched, $watchers, $notificationtimestamps, $talkids, $subjectids, $displaytitles;
+ private $showZeroWatchers = false;
private $tokenFunctions;
$prop = array_flip( $this->params['prop'] );
$this->fld_protection = isset( $prop['protection'] );
$this->fld_watched = isset( $prop['watched'] );
+ $this->fld_watchers = isset( $prop['watchers'] );
$this->fld_notificationtimestamp = isset( $prop['notificationtimestamp'] );
$this->fld_talkid = isset( $prop['talkid'] );
$this->fld_subjectid = isset( $prop['subjectid'] );
$this->getWatchedInfo();
}
+ if ( $this->fld_watchers ) {
+ $this->getWatcherInfo();
+ }
+
// Run the talkid/subjectid query if requested
if ( $this->fld_talkid || $this->fld_subjectid ) {
$this->getTSIDs();
$pageInfo['watched'] = '';
}
+ if ( $this->fld_watchers ) {
+ if ( isset( $this->watchers[$ns][$dbkey] ) ) {
+ $pageInfo['watchers'] = $this->watchers[$ns][$dbkey];
+ } elseif ( $this->showZeroWatchers ) {
+ $pageInfo['watchers'] = 0;
+ }
+ }
+
if ( $this->fld_notificationtimestamp ) {
$pageInfo['notificationtimestamp'] = '';
if ( isset( $this->notificationtimestamps[$ns][$dbkey] ) ) {
}
}
+ /**
+ * Get the count of watchers and put it in $this->watchers
+ */
+ private function getWatcherInfo() {
+ global $wgUnwatchedPageThreshold;
+
+ if ( count( $this->everything ) == 0 ) {
+ return;
+ }
+
+ $user = $this->getUser();
+ $canUnwatchedpages = $user->isAllowed( 'unwatchedpages' );
+ if ( !$canUnwatchedpages && !is_int( $wgUnwatchedPageThreshold ) ) {
+ return;
+ }
+
+ $this->watchers = array();
+ $this->showZeroWatchers = $canUnwatchedpages;
+ $db = $this->getDB();
+
+ $lb = new LinkBatch( $this->everything );
+
+ $this->resetQueryParams();
+ $this->addTables( array( 'watchlist' ) );
+ $this->addFields( array( 'wl_title', 'wl_namespace', 'count' => 'COUNT(*)' ) );
+ $this->addWhere( array(
+ $lb->constructSet( 'wl', $db )
+ ) );
+ $this->addOption( 'GROUP BY', array( 'wl_namespace', 'wl_title' ) );
+ if ( !$canUnwatchedpages ) {
+ $this->addOption( 'HAVING', "COUNT(*) >= $wgUnwatchedPageThreshold" );
+ }
+
+ $res = $this->select( __METHOD__ );
+
+ foreach ( $res as $row ) {
+ $this->watchers[$row->wl_namespace][$row->wl_title] = (int)$row->count;
+ }
+ }
+
public function getCacheMode( $params ) {
$publicProps = array(
'protection',
'protection',
'talkid',
'watched', # private
+ 'watchers', # private
'notificationtimestamp', # private
'subjectid',
'url',
' protection - List the protection level of each page',
' talkid - The page ID of the talk page for each non-talk page',
' watched - List the watched status of each page',
+ ' watchers - The number of watchers, if allowed',
' notificationtimestamp - The watchlist notification timestamp of each page',
' subjectid - The page ID of the parent page for each talk page',
' url - Gives a full URL to the page, and also an edit URL',
'watched' => array(
'watched' => 'boolean'
),
+ 'watchers' => array(
+ 'watchers' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
'notificationtimestamp' => array(
'notificationtimestamp' => array(
ApiBase::PROP_TYPE => 'timestamp',
public function getDescription() {
return array( 'Update the notification timestamp for watched pages.',
'This affects the highlighting of changed pages in the watchlist and history,',
- 'and the sending of email when the "E-mail me when a page on my watchlist is',
+ 'and the sending of email when the "Email me when a page on my watchlist is',
'changed" preference is enabled.'
);
}
* @file
*/
-
/**
* @ingroup API
*/
class ApiTokens extends ApiBase {
public function execute() {
- wfProfileIn( __METHOD__ );
$params = $this->extractRequestParams();
$res = array();
$types = $this->getTokenTypes();
foreach ( $params['type'] as $type ) {
- $type = strtolower( $type );
-
$val = call_user_func( $types[$type], null, null );
if ( $val === false ) {
}
$this->getResult()->addValue( null, $this->getModuleName(), $res );
- wfProfileOut( __METHOD__ );
}
private function getTokenTypes() {
return $types;
}
wfProfileIn( __METHOD__ );
- $types = array( 'patrol' => 'ApiQueryRecentChanges::getPatrolToken' );
+ $types = array( 'patrol' => array( 'ApiQueryRecentChanges', 'getPatrolToken' ) );
$names = array( 'edit', 'delete', 'protect', 'move', 'block', 'unblock',
'email', 'import', 'watch', 'options' );
foreach ( $names as $name ) {
- $types[$name] = 'ApiQueryInfo::get' . ucfirst( $name ) . 'Token';
+ $types[$name] = array( 'ApiQueryInfo', 'get' . ucfirst( $name ) . 'Token' );
}
wfRunHooks( 'ApiTokensGetTokenTypes', array( &$types ) );
ksort( $types );
}
public function getResultProperties() {
- return array(
- '' => array(
- 'patroltoken' => array(
- ApiBase::PROP_TYPE => 'string',
- ApiBase::PROP_NULLABLE => true
- ),
- 'edittoken' => array(
- ApiBase::PROP_TYPE => 'string',
- ApiBase::PROP_NULLABLE => true
- ),
- 'deletetoken' => array(
- ApiBase::PROP_TYPE => 'string',
- ApiBase::PROP_NULLABLE => true
- ),
- 'protecttoken' => array(
- ApiBase::PROP_TYPE => 'string',
- ApiBase::PROP_NULLABLE => true
- ),
- 'movetoken' => array(
- ApiBase::PROP_TYPE => 'string',
- ApiBase::PROP_NULLABLE => true
- ),
- 'blocktoken' => array(
- ApiBase::PROP_TYPE => 'string',
- ApiBase::PROP_NULLABLE => true
- ),
- 'unblocktoken' => array(
- ApiBase::PROP_TYPE => 'string',
- ApiBase::PROP_NULLABLE => true
- ),
- 'emailtoken' => array(
- ApiBase::PROP_TYPE => 'string',
- ApiBase::PROP_NULLABLE => true
- ),
- 'importtoken' => array(
- ApiBase::PROP_TYPE => 'string',
- ApiBase::PROP_NULLABLE => true
- ),
- 'watchtoken' => array(
- ApiBase::PROP_TYPE => 'string',
- ApiBase::PROP_NULLABLE => true
- ),
- 'optionstoken' => array(
- ApiBase::PROP_TYPE => 'string',
- ApiBase::PROP_NULLABLE => true
- )
- )
+ $props = array(
+ '' => array(),
);
+
+ self::addTokenProperties( $props, $this->getTokenTypes() );
+
+ return $props;
}
public function getParamDescription() {
$res['id'] = $block->getId();
$target = $block->getType() == Block::TYPE_AUTO ? '' : $block->getTarget();
- $res['user'] = $target;
+ $res['user'] = $target instanceof User ? $target->getName() : $target;
$res['userid'] = $target instanceof User ? $target->getId() : 0;
$res['reason'] = $params['reason'];
$this->getResult()->addValue( null, $this->getModuleName(), $res );
* {{msg-mw|config-profile-no-anon}}
* {{msg-mw|config-profile-fishbowl}}
* {{msg-mw|config-profile-private}}',
+ 'config-email-settings' => '{{Identical|E-mail setting}}',
+ 'config-email-user' => '{{Identical|Enable user-to-user e-mail}}',
'config-upload-help' => 'The word "mode" here refers to the access rights given to various user groups when attempting to create and store files and/or subdiretories in the said directory on the server. It also refers to the <code>mode</code> command used to maipulate said right mask under Unix, Linux, and similar operating systems. A less operating-system-centric translation is fine.',
'config-logo-help' => '',
'config-cc-not-chosen' => '{{doc-important|Do not translate the "<code>proceed</code>" part.}}
'config-type-postgres' => 'PostgreSQL',
'config-type-sqlite' => 'SQLite',
'config-type-oracle' => 'Oracle',
- 'config-type-ibm_db2' => 'IBM DB2',
'config-support-info' => "Skoret eo ar reizhiadoù diaz titouroù da-heul gant MediaWiki :
$1
'config-support-postgres' => "* Ur reizhiad diaz titouroù brudet ha digor eo $1. Gallout a ra ober evit MySQL ([http://www.php.net/manual/en/pgsql.installation.php Penaos kempunañ PHP gant skor PostgreSQL]). Gallout a ra bezañ un nebeud drein bihan enni ha n'eo ket erbedet he implijout en un endro produiñ.",
'config-support-sqlite' => "* $1 zo ur reizhiad diaz titouroù skañv skoret eus ar c'hentañ. ([http://www.php.net/manual/en/pdo.installation.php Penaos kempunañ PHP gant skor SQLite], implijout a ra PDO)",
'config-support-oracle' => '* $1 zo un diaz titouroù kenwerzhel. ([http://www.php.net/manual/en/oci8.installation.php Penaos kempunañ PHP gant skor OCI8])',
- 'config-support-ibm_db2' => '* Un diaz titouroù evit embregerezhioù kenwerzhel eo $1.', # Fuzzy
'config-header-mysql' => 'Arventennoù MySQL',
'config-header-postgres' => 'Arventennoù PostgreSQL',
'config-header-sqlite' => 'Arventennoù SQLite',
'config-header-oracle' => 'Arventennoù Oracle',
- 'config-header-ibm_db2' => 'Arventennoù IBM DB2',
'config-invalid-db-type' => 'Direizh eo ar seurt diaz roadennoù',
'config-missing-db-name' => 'Ret eo deoc\'h merkañ un dalvoudenn evit "Anv an diaz titouroù"',
'config-missing-db-host' => 'Ret eo deoc\'h merkañ un dalvoudenn evit "Ostiz an diaz titouroù"',
'config-optional-continue' => "Sevel muioc'h a goulennoù ouzhin.",
'config-optional-skip' => 'Aet on skuizh, staliañ ar wiki hepken.',
'config-profile' => 'Profil ar gwirioù implijer :',
- 'config-profile-wiki' => 'Wiki hengounel', # Fuzzy
+ 'config-profile-wiki' => 'Wiki digor',
'config-profile-no-anon' => 'Krouidigezh ur gont ret',
'config-profile-fishbowl' => 'Embanner aotreet hepken',
'config-profile-private' => 'Wiki prevez',
'config-install-alreadydone' => "'''Diwallit''': Staliet hoc'h eus MediaWiki dija war a seblant hag emaoc'h o klask e staliañ c'hoazh.
Kit d'ar bajenn war-lerc'h, mar plij.",
'config-install-begin' => 'Pa vo bet pouezet ganeoc\'h war "{{int:config-continue}}" e krogo staliadur MediaWiki.
-Pouezit war Kent mar fell deoc\'h cheñch tra pe dra.', # Fuzzy
+Pouezit war "{{int:config-back}}" mar fell deoc\'h cheñch tra pe dra.',
'config-install-step-done' => 'graet',
'config-install-step-failed' => "c'hwitet",
'config-install-extensions' => 'En ur gontañ an astennoù',
== Kregiñ ganti ==
-* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]
-* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]
-* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]", # Fuzzy
+* [//www.mediawiki.org/wiki/Manual:Configuration_settings Roll an arventennoù kefluniañ]
+* [//www.mediawiki.org/wiki/Manual:FAQ FAG MediaWiki]
+* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce Roll ar c'haozeadennoù diwar-benn dasparzhoù MediaWiki]
+* [//www.mediawiki.org/wiki/Localisation#Translation_resources Lec'hiañ MediaWiki en ho yezh", # Fuzzy
);
/** Bosnian (bosanski)
'config-type-postgres' => 'PostgreSQL',
'config-type-sqlite' => 'SQLite',
'config-type-oracle' => 'Oracle',
- 'config-type-ibm_db2' => 'IBM DB2',
'config-support-info' => 'MediaWiki mendukung sistem basis data berikut:
$1
'config-support-postgres' => '* $1 adalah sistem basis data sumber terbuka populer sebagai alternatif untuk MySQL ([http://www.php.net/manual/en/pgsql.installation.php cara mengompilasi PHP dengan dukungan PostgreSQL]). Mungkin ada beberapa bug terbuka dan alternatif ini tidak direkomendasikan untuk dipakai dalam lingkungan produksi.',
'config-support-sqlite' => '* $1 adalah sistem basis data yang ringan yang sangat baik dukungannya. ([http://www.php.net/manual/en/pdo.installation.php cara mengompilasi PHP dengan dukungan SQLite], menggunakan PDO)',
'config-support-oracle' => '* $1 adalah basis data komersial untuka perusahaan. ([http://www.php.net/manual/en/oci8.installation.php cara mengompilasi PHP dengan dukungan OCI8])',
- 'config-support-ibm_db2' => '* $1 adalah basis data-perusahaan komersial.', # Fuzzy
'config-header-mysql' => 'Pengaturan MySQL',
'config-header-postgres' => 'Pengaturan PostgreSQL',
'config-header-sqlite' => 'Pengaturan SQLite',
'config-header-oracle' => 'Pengaturan Oracle',
- 'config-header-ibm_db2' => 'Pengaturan IBM DB2',
'config-invalid-db-type' => 'Jenis basis data tidak sah',
'config-missing-db-name' => 'Anda harus memasukkan nilai untuk "Nama basis data"',
'config-missing-db-host' => 'Anda harus memasukkan nilai untuk "Inang basis data"',
Ini lebih efisien daripada modus UTF-8 MySQL dan memungkinkan Anda untuk menggunakan ragam penuh karakter Unicode.
Dalam '''modus UTF-8''', MySQL akan tahu apa set karakter data dan dapat menampilkan dan mengubahnya sesuai keperluan, tetapi tidak akan mengizinkan Anda menyimpan karakter di atas [//en.wikipedia.org/wiki/Mapping_of_Unicode_character_planes Basic Multilingual Plane].",
- 'config-ibm_db2-low-db-pagesize' => "Basis data DB2 Anda tidak memiliki pagesize yang cukup untuk tablespace bawaan. Pagesize harus sama atau lebih dari '''32K'''.",
'config-site-name' => 'Nama wiki:',
'config-site-name-help' => 'Ini akan muncul di bilah judul peramban dan di berbagai tempat lainnya.',
'config-site-name-blank' => 'Masukkan nama situs.',
'config-project-namespace-help' => "ウィキペディアの例に従い、多くのウィキは、コンテンツのページとは分離したポリシーページを「'''プロジェクトの名前空間'''」に持っています。
この名前空間内のページのページ名はすべて特定の接頭辞で始まります。それをここで指定できます。
通常、この接頭辞はウィキ名に基づきますが、「#」や「:」のような区切り文字を含めることはできません。",
- 'config-ns-invalid' => '"<nowiki>$1</nowiki>"のように指定された名前空間は無効です。
-違うプロジェクト名前空間を指定してください。',
+ 'config-ns-invalid' => '指定した名前空間「<nowiki>$1</nowiki>」は無効です。
+別のプロジェクト名前空間を指定してください。',
'config-admin-box' => '管理アカウント',
'config-admin-name' => '名前:',
'config-admin-password' => 'パスワード:',
'config-admin-password-confirm' => 'パスワードの再入力:',
- 'config-admin-help' => '希望するユーザー名をここに入力してください (例: "Joe Bloggs")。
+ 'config-admin-help' => '希望するユーザー名をここに入力してください (例:「Joe Bloggs」)。
この名前でこのウィキにログインすることになります。',
'config-admin-name-blank' => '管理者のユーザー名を入力してください。',
'config-admin-name-invalid' => '指定したユーザー名「<nowiki>$1</nowiki>」は無効です。
'config-admin-password-mismatch' => '入力された2つのパスワードが一致しません。',
'config-admin-email' => 'メールアドレス:',
'config-admin-email-help' => 'メールアドレスを入力してください。他の利用者からのメールの受け取り、パスワードのリセット、ウォッチリストに登録したページの更新通知に使用します。空欄のままにすることもできます。',
- 'config-admin-error-user' => '"<nowiki>$1</nowiki>"という名前の管理者を作成する際に内部エラーが発生しました。',
- 'config-admin-error-password' => '管理者"<nowiki>$1</nowiki>"のパスワードを設定する際に内部エラーが発生しました: <pre>$2</pre>',
+ 'config-admin-error-user' => '「<nowiki>$1</nowiki>」という名前の管理者を作成する際に内部エラーが発生しました。',
+ 'config-admin-error-password' => '管理者「<nowiki>$1</nowiki>」のパスワードを設定する際に内部エラーが発生しました: <pre>$2</pre>',
+ 'config-admin-error-bademail' => '無効なメールアドレスを入力しました。',
'config-subscribe' => '[https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce リリース告知のメーリングリスト]を購読する。',
'config-subscribe-help' => 'これは、リリースの告知 (重要なセキュリティに関する案内を含む) に使用される、流量が少ないメーリングリストです。
このメーリングリストを購読して、新しいバージョンが出た場合にMediaWikiを更新してください。',
* @author පසිඳු කාවින්ද
*/
$messages['yi'] = array(
+ 'config-information' => 'אינפֿארמאציע',
'config-back' => '→ צוריק',
+ 'config-continue' => 'פֿארזעצן ←',
'config-page-language' => 'שפראַך',
'config-page-name' => 'נאָמען',
'config-page-options' => 'ברירות',
+ 'config-db-type' => 'דאטנבאזע טיפ:',
+ 'config-db-name' => 'דאטנבאזע נאָמען:',
+ 'config-project-namespace' => 'פראיעקט נאָמענטייל:',
'config-ns-generic' => 'פראיעקט',
'config-admin-name' => 'אײַער נאָמען:',
'config-admin-password' => 'פאַסווארט:',
+ 'config-admin-password-mismatch' => 'די צוויי פאסוועטרט איר האט איינגעגעבן שטימען נישט.',
'config-admin-email' => 'בליצפּאָסט אַדרעס:',
+ 'config-install-tables' => 'שאפן טאבעלעס',
+ 'config-install-tables-exist' => "'''ווארענונג''': זעט אויס אז די מעדיעוויקי טאבעלעס עקזיסטירן שוין.
+איבערהיפן שאפֿן.",
+ 'config-download-localsettings' => 'אראפלאדן <code>LocalSettings.php</code>',
'config-help' => 'הילף',
+ 'config-nofile' => 'מ\'האט נישט געקענט טרעפן די טעקע "$1". צי האט מען זי אויסגעמעקט?',
'mainpagetext' => "'''מעדיעוויקי אינסטאלירט מיט דערפאלג.'''",
'mainpagedocfooter' => "גיט זיך אן עצה מיט [//meta.wikimedia.org/wiki/Help:Contents באניצער'ס וועגווײַזער] פֿאר אינפֿארמאציע וויאזוי זיך באנוצן מיט וויקי ווייכוואַרג.
== נוצליכע וועבלינקען פֿאַר אנהייבערס ==
* [//www.mediawiki.org/wiki/Manual:Configuration_settings רשימה פון קאנפֿיגוראציעס]
* [//www.mediawiki.org/wiki/Manual:FAQ אפֿט געפֿרעגטע שאלות]
-* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce מעדיעוויקי באפֿרײַאונג פאסטליסטע]",
+* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce מעדיעוויקי באפֿרײַאונג פאסטליסטע]* [//www.mediawiki.org/wiki/Localisation#Translation_resources איבערזעצן מעדיעוויקי אין אײַער שפראך]",
);
/** Yoruba (Yorùbá)
$entry = $this->entry;
$params = $this->extractParameters();
$params[0] = Message::rawParam( $this->getPerformerElement() );
- $params[1] = $entry->getPerformer()->getName();
+ $params[1] = $this->canView( LogPage::DELETED_USER ) ? $entry->getPerformer()->getName() : '';
$params[2] = Message::rawParam( $this->makePageLink( $entry->getTarget() ) );
// Bad things happens if the numbers are not in correct order
$opts->add( 'hidepatrolled', $this->getUser()->getBoolOption( 'newpageshidepatrolled' ) );
$opts->add( 'hidebots', false );
$opts->add( 'hideredirs', true );
- $opts->add( 'limit', (int)$this->getUser()->getOption( 'rclimit' ) );
+ $opts->add( 'limit', $this->getUser()->getIntOption( 'rclimit' ) );
$opts->add( 'offset', '' );
$opts->add( 'namespace', '0' );
$opts->add( 'username', '' );
public function getDefaultOptions() {
$opts = new FormOptions();
- $opts->add( 'days', (int)$this->getUser()->getOption( 'rcdays' ) );
- $opts->add( 'limit', (int)$this->getUser()->getOption( 'rclimit' ) );
+ $opts->add( 'days', $this->getUser()->getIntOption( 'rcdays' ) );
+ $opts->add( 'limit', $this->getUser()->getIntOption( 'rclimit' ) );
$opts->add( 'from', '' );
$opts->add( 'hideminor', $this->getUser()->getBoolOption( 'hideminor' ) );
// source view for textual content
$sourceView = Xml::element( 'textarea', array(
'readonly' => 'readonly',
- 'cols' => intval( $user->getOption( 'cols' ) ),
- 'rows' => intval( $user->getOption( 'rows' ) ) ),
+ 'cols' => $user->getIntOption( 'cols' ),
+ 'rows' => $user->getIntOption( 'rows' ) ),
$content->getNativeData() . "\n" );
$previewButton = Xml::element( 'input', array(
? 'filereuploadsummary'
: 'fileuploadsummary',
'default' => $this->mComment,
- 'cols' => intval( $this->getUser()->getOption( 'cols' ) ),
+ 'cols' => $this->getUser()->getIntOption( 'cols' ),
'rows' => 8,
)
);
case self::SUCCESS:
# We've verified now, update the real record
$user = $this->getUser();
- if( (bool)$this->mRemember != (bool)$user->getOption( 'rememberpassword' ) ) {
+ if( (bool)$this->mRemember != $user->getBoolOption( 'rememberpassword' ) ) {
$user->setOption( 'rememberpassword', $this->mRemember ? 1 : 0 );
$user->saveSettings();
} else {
# Toggle watchlist content (all recent edits or just the latest)
if( $values['extended'] ) {
- $limitWatchlist = intval( $user->getOption( 'wllimit' ) );
+ $limitWatchlist = $user->getIntOption( 'wllimit' );
$usePage = false;
} else {
# Top log Ids for a page are not stored
+++ /dev/null
-<?php
-/**
- * Lithuanian (Lietuvių) specific code.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Language
- */
-
-/**
- * Lithuanian (Lietuvių)
- *
- * @ingroup Language
- */
-class LanguageLt extends Language {
- /* Word forms (with examples):
- 1 - vienas (1) lapas, dvidešimt vienas (21) lapas
- 2 - trys (3) lapai
- 3 - penkiolika (15) lapų
- */
-
- /**
- * Lithuanian plural forms as per http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#lt
- * @param $count int
- * @param $forms array
- *
- * @return string
- */
- function convertPlural( $count, $forms ) {
- if ( !count( $forms ) ) { return ''; }
-
- // if the number is not mentioned in message, then use $form[0] for singular and $form[1] for plural or zero
- if ( count( $forms ) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
-
- $forms = $this->preConvertPlural( $forms, 3 );
- // Form[0] if n mod 10 is 1 and n mod 100 not in 11..19;
- if ( $count % 10 == 1 && $count % 100 != 11 ) return $forms[0];
- // Forms[1] if n mod 10 in 2..9 and n mod 100 not in 11..19;
- if ( $count % 10 >= 2 && ( $count % 100 < 10 || $count % 100 >= 20 ) ) return $forms[1];
- return $forms[2];
- }
-}
+++ /dev/null
-<?php
-/**
- * Latvian (Latviešu) specific code.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @author Niklas Laxström
- * @copyright Copyright © 2006, Niklas Laxström
- * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
- * @ingroup Language
- */
-
-/**
- * Latvian (Latviešu)
- *
- * @ingroup Language
- */
-class LanguageLv extends Language {
- /**
- * Plural form transformations. Using the first form for words with the last digit 1, but not for words with the last digits 11, and the second form for all the others.
- *
- * Example: {{plural:{{NUMBEROFARTICLES}}|article|articles}}
- *
- * @param $count Integer
- * @param $forms Array
- * @return String
- */
- function convertPlural( $count, $forms ) {
- if ( !count( $forms ) ) { return ''; }
-
- // @todo FIXME: CLDR defines 3 plural forms instead of 2. Form for 0 is missing.
- // http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#lv
- $forms = $this->preConvertPlural( $forms, 2 );
-
- return ( ( $count % 10 == 1 ) && ( $count % 100 != 11 ) ) ? $forms[0] : $forms[1];
- }
-}
'exif-iimcategory-evn' => 'Environment',
'exif-iimcategory-hth' => 'Health',
'exif-iimcategory-hum' => 'Human interest',
-'exif-iimcategory-lab' => 'Labour',
+'exif-iimcategory-lab' => 'Labor',
'exif-iimcategory-lif' => 'Lifestyle and leisure',
'exif-iimcategory-pol' => 'Politics',
'exif-iimcategory-rel' => 'Religion and belief',
* @file
*/
+if ( PHP_SAPI != 'cli' ) {
+ die( "This filter can only be run from the command line.\n" );
+}
+
$source = file_get_contents( $argv[1] );
$regexp = '#\@var\s+([^\s]+)([^/]+)/\s+(var|public|protected|private)\s+(\$[^\s;=]+)#';
$replac = '${2} */ ${3} ${1} ${4}';
/** @dataProvider providerPlural */
function testPlural( $result, $value ) {
- $forms = array( 'one', 'other' );
+ $forms = array( 'zero', 'one', 'other' );
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
}
function providerPlural() {
return array(
- array( 'other', 0 ), #this must be zero form as per CLDR
+ array( 'zero', 0 ),
array( 'one', 1 ),
array( 'other', 11 ),
array( 'one', 21 ),