Merge "mw.widgets.TitleInputWidget: Allow limiting to main namespace, too"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 22 Jul 2015 15:15:53 +0000 (15:15 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 22 Jul 2015 15:15:53 +0000 (15:15 +0000)
42 files changed:
RELEASE-NOTES-1.26
autoload.php
includes/api/i18n/uk.json
includes/api/i18n/zh-hant.json
includes/changetags/ChangeTags.php
includes/db/Database.php
includes/filerepo/FileBackendDBRepoWrapper.php [new file with mode: 0644]
includes/filerepo/FileRepo.php
includes/filerepo/ForeignDBRepo.php
includes/filerepo/ForeignDBViaLBRepo.php
includes/filerepo/LocalRepo.php
includes/filerepo/file/LocalFile.php
includes/installer/i18n/it.json
includes/installer/i18n/pl.json
includes/libs/BufferingStatsdDataFactory.php
languages/i18n/ar.json
languages/i18n/ast.json
languages/i18n/be-tarask.json
languages/i18n/es.json
languages/i18n/et.json
languages/i18n/fa.json
languages/i18n/fi.json
languages/i18n/fr.json
languages/i18n/he.json
languages/i18n/lb.json
languages/i18n/lt.json
languages/i18n/mk.json
languages/i18n/ml.json
languages/i18n/nap.json
languages/i18n/pms.json
languages/i18n/sv.json
languages/i18n/tr.json
languages/i18n/uk.json
languages/i18n/zh-hans.json
languages/i18n/zh-hant.json
maintenance/migrateFileRepoLayout.php [new file with mode: 0644]
resources/lib/mustache/LICENSE [new file with mode: 0644]
resources/src/mediawiki.less/mediawiki.ui/mixins.less
tests/phpunit/MediaWikiTestCase.php
tests/phpunit/includes/db/ORMTableTest.php
tests/phpunit/includes/filerepo/FileBackendDBRepoWrapperTest.php [new file with mode: 0644]
tests/phpunit/includes/filerepo/MigrateFileRepoLayoutTest.php [new file with mode: 0644]

index 46ffe36..ec6bca5 100644 (file)
@@ -128,6 +128,7 @@ changes to languages because of Phabricator reports.
 * $wgSpecialPageGroups was removed (deprecated in 1.21).
 * SpecialPageFactory::setGroup was removed (deprecated in 1.21).
 * SpecialPageFactory::getGroup was removed (deprecated in 1.21).
+* DatabaseBase::ignoreErrors() is now protected.
 
 == Compatibility ==
 
index 734aa6a..a8940c4 100644 (file)
@@ -418,6 +418,7 @@ $wgAutoloadLocalClasses = array(
        'Field' => __DIR__ . '/includes/db/DatabaseUtility.php',
        'File' => __DIR__ . '/includes/filerepo/file/File.php',
        'FileBackend' => __DIR__ . '/includes/filebackend/FileBackend.php',
+       'FileBackendDBRepoWrapper' => __DIR__ . '/includes/filerepo/FileBackendDBRepoWrapper.php',
        'FileBackendError' => __DIR__ . '/includes/filebackend/FileBackend.php',
        'FileBackendException' => __DIR__ . '/includes/filebackend/FileBackend.php',
        'FileBackendGroup' => __DIR__ . '/includes/filebackend/FileBackendGroup.php',
@@ -772,6 +773,7 @@ $wgAutoloadLocalClasses = array(
        'MessageCache' => __DIR__ . '/includes/cache/MessageCache.php',
        'MessageContent' => __DIR__ . '/includes/content/MessageContent.php',
        'MessageSpecifier' => __DIR__ . '/includes/libs/MessageSpecifier.php',
+       'MigrateFileRepoLayout' => __DIR__ . '/maintenance/migrateFileRepoLayout.php',
        'MigrateUserGroup' => __DIR__ . '/maintenance/migrateUserGroup.php',
        'MimeMagic' => __DIR__ . '/includes/MimeMagic.php',
        'MinifyScript' => __DIR__ . '/maintenance/minify.php',
index 5fcca15..b439fb0 100644 (file)
        "apihelp-edit-param-prependtext": "Додати цей текст на початок сторінки. Замінює $1text.",
        "apihelp-edit-param-appendtext": "Додати цей текст у кінець сторінки. Замінює $1text.\n\nЩоб додати новий розділ, замість цього параметра використайте $1section=new.",
        "apihelp-edit-param-undo": "Скасувати цю версію. Замінює $1text, $1prependtext та $1appendtext.",
+       "apihelp-edit-param-undoafter": "Скасувати усі версії від $1undo до цієї. Якщо не вказано, просто скасувати одну версію.",
+       "apihelp-edit-param-redirect": "Автоматично виправляти перенаправлення.",
+       "apihelp-edit-param-contentformat": "Формат серіалізації вмісту, використовуваний для введеного тексту.",
+       "apihelp-edit-param-contentmodel": "Модель вмісту нового вмісту.",
+       "apihelp-edit-param-token": "Токен завжди має надсилатися як останній параметр або хоча б після параметра $1text.",
        "apihelp-edit-example-edit": "Редагувати сторінку",
        "apihelp-edit-example-prepend": "Додати зміст на початок сторінки",
        "apihelp-edit-example-undo": "Скасувати версії з 13579 по 13585 з автоматичним описом змін",
        "apihelp-emailuser-param-subject": "Заголовок теми.",
        "apihelp-emailuser-param-text": "Тіло листа.",
        "apihelp-emailuser-param-ccme": "Надіслати копію цього повідомлення мені.",
-       "apihelp-emailuser-example-email": "Відправити листа користувачу \"WikiSysop\" з текстом \"Вміст\"",
+       "apihelp-emailuser-example-email": "Відправити листа користувачу <kbd>WikiSysop</kbd> з текстом <kbd>Вміст</kbd>.",
        "apihelp-expandtemplates-description": "Розгортає усі шаблони у вікітекст.",
        "apihelp-expandtemplates-param-title": "Заголовок сторінки.",
        "apihelp-expandtemplates-param-text": "Вікітекст для перетворення.",
+       "apihelp-expandtemplates-param-revid": "ID версії, для <nowiki>{{REVISIONID}}</nowiki> і подібних змінних.",
+       "apihelp-expandtemplates-param-prop": "Яку інформацію отримувати.\n\nЗважте, що якщо не вибрано значень, результат міститиме вікітекст, але буде в застарілому форматі.",
+       "apihelp-expandtemplates-paramvalue-prop-wikitext": "Розгорнений вікітекст.",
+       "apihelp-expandtemplates-paramvalue-prop-categories": "Будь-які категорії, наявні у джерелі, але не виведені у вікітексті результату.",
+       "apihelp-expandtemplates-paramvalue-prop-properties": "Властивості сторінки, визначені розгорненими магічними словами у вікітексті.",
+       "apihelp-expandtemplates-paramvalue-prop-volatile": "Чи результат тривкий і не повинен повторно використовуватись десь іще на сторінці.",
+       "apihelp-expandtemplates-paramvalue-prop-ttl": "Максимальний час, після якого кеш результату стане недійсним.",
+       "apihelp-expandtemplates-paramvalue-prop-modules": "Будь-які модулі ResourceLoader, які парсерні функції запитують на додання у результат. Або <kbd>jsconfigvars</kbd>, або <kbd>encodedjsconfigvars</kbd> має бути запитано разом з <kbd>modules</kbd>.",
+       "apihelp-expandtemplates-paramvalue-prop-jsconfigvars": "Дає конфігурації JavaScript змінні, притаманні для сторінки.",
+       "apihelp-expandtemplates-paramvalue-prop-encodedjsconfigvars": "Дає конфігурації JavaScript змінні, притаманні для сторінки, як рядок JSON.",
+       "apihelp-expandtemplates-paramvalue-prop-parsetree": "Дерево парсу XML вхідних даних.",
+       "apihelp-expandtemplates-param-includecomments": "Чи включати HTML-коментарі у результат.",
+       "apihelp-expandtemplates-param-generatexml": "Дерево парсу XML вхідних даних (замінене на $1prop=parsetree).",
+       "apihelp-expandtemplates-example-simple": "Розгорнути вікітекст <kbd><nowiki>{{Project:Sandbox}}</nowiki></kbd>.",
+       "apihelp-feedcontributions-description": "Повертає стрічку внеску користувача.",
+       "apihelp-feedcontributions-param-feedformat": "Формат стрічки.",
+       "apihelp-feedcontributions-param-user": "Для яких користувачів отримати внесок.",
+       "apihelp-feedcontributions-param-namespace": "За яким простором назв фільтрувати внески.",
+       "apihelp-feedcontributions-param-year": "Від року (і раніше).",
+       "apihelp-feedcontributions-param-month": "До місяця (і раніше).",
+       "apihelp-feedcontributions-param-tagfilter": "Відфільтрувати внесок, у якого є ці теґи.",
+       "apihelp-feedcontributions-param-deletedonly": "Показати лише вилучений внесок.",
+       "apihelp-feedcontributions-param-toponly": "Показати лише редагування, які є останніми версіями.",
+       "apihelp-feedcontributions-param-newonly": "Показати лише редагування, які є створеннями сторінок.",
+       "apihelp-feedcontributions-param-showsizediff": "Показати різницю розміру між версіями.",
+       "apihelp-feedcontributions-example-simple": "Вивести внесок для користувача <kbd>Example</kbd>.",
+       "apihelp-feedrecentchanges-description": "Видає стрічку нових редагувань.",
+       "apihelp-feedrecentchanges-param-feedformat": "Формат стрічки.",
+       "apihelp-feedrecentchanges-param-namespace": "Простір назв, до якого обмежити результати.",
+       "apihelp-feedrecentchanges-param-invert": "Усі простори назв, крім вибраного.",
+       "apihelp-feedrecentchanges-param-associated": "Включно з пов'язаним (обговорення чи головним) простором назв.",
+       "apihelp-feedrecentchanges-param-days": "Дні, до яких обмежити результати.",
+       "apihelp-feedrecentchanges-param-limit": "Максимальна кількість результатів для виведення.",
+       "apihelp-feedrecentchanges-param-from": "Показати зміни відтоді.",
+       "apihelp-feedrecentchanges-param-hideminor": "Приховати незначні редагування.",
+       "apihelp-feedrecentchanges-param-hidebots": "Приховати редагування ботів.",
+       "apihelp-feedrecentchanges-param-hideanons": "Приховати редагування анонімних користувачів.",
+       "apihelp-feedrecentchanges-param-hideliu": "Приховати редагування зареєстрованих користувачів.",
+       "apihelp-feedrecentchanges-param-hidepatrolled": "Приховати відпатрульовані редагування.",
+       "apihelp-feedrecentchanges-param-hidemyself": "Приховати редагування поточного користувача.",
+       "apihelp-feedrecentchanges-param-tagfilter": "Фільтрувати за теґом.",
+       "apihelp-feedrecentchanges-param-target": "Показати лише зміни на сторінках, на які посилається ця сторінка.",
+       "apihelp-feedrecentchanges-param-showlinkedto": "Показати натомість лише зміни на сторінках, які посилаються на цю сторінку.",
+       "apihelp-feedrecentchanges-example-simple": "Показати нещодавні зміни.",
+       "apihelp-feedrecentchanges-example-30days": "Показати нещодавні зміни за 30 днів.",
+       "apihelp-feedwatchlist-description": "Видає стрічку списку спостереження.",
+       "apihelp-feedwatchlist-param-feedformat": "Формат стрічки.",
+       "apihelp-feedwatchlist-param-hours": "Список сторінок, змінених за цю кількість годин від зараз.",
+       "apihelp-feedwatchlist-param-linktosections": "За можливості, посилатися безпосередньо на змінені розділи.",
+       "apihelp-feedwatchlist-example-default": "Показати стрічку списку спостереження.",
+       "apihelp-filerevert-param-filename": "Цільова назва файлу, без префіксу File:.",
+       "apihelp-filerevert-param-comment": "Завантажити коментар.",
+       "apihelp-filerevert-param-archivename": "Архівна назва версії, до якої повернути.",
+       "apihelp-filerevert-example-revert": "Повернути <kbd>Wiki.png</kbd> до версії <kbd>2011-03-05T15:27:40Z</kbd>.",
+       "apihelp-help-description": "Відображати довідку для зазначених модулів.",
+       "apihelp-help-param-modules": "Модулі, для яких відображати довідку (значення параметрів <var>action</var> і <var>format</var> або <kbd>main</kbd>). Можна вказати під модулі через <kbd>+</kbd>.",
+       "apihelp-help-param-recursivesubmodules": "Включити довідку для підмодулів рекурсивно.",
+       "apihelp-help-param-helpformat": "Формат результату довідки.",
+       "apihelp-help-param-wrap": "Помістити результат у стандартну структуру API-відповіді.",
+       "apihelp-help-param-toc": "Включити зміст у HTML-результат.",
+       "apihelp-help-example-main": "Довідка для головного модуля.",
+       "apihelp-help-example-recursive": "Уся довідка на одній сторінці.",
+       "apihelp-help-example-help": "Довідка для самого модуля довідки.",
+       "apihelp-help-example-query": "Довідка для двох підмодулів запитів.",
+       "apihelp-imagerotate-description": "Поворот одного або декількох зображень.",
+       "apihelp-imagerotate-param-rotation": "Градуси для повороту зображення за годинниковою стрілкою.",
+       "apihelp-imagerotate-example-simple": "Повернути <kbd>File:Example.png</kbd> на <kbd>90</kbd> градусів.",
+       "apihelp-imagerotate-example-generator": "Повернути усі зображення у <kbd>Category:Flip</kbd> на <kbd>180</kbd> градусів.",
+       "apihelp-import-description": "Імпортувати сторінку з іншої вікі або з XML-файлу.\n\nЗважте, що HTTP POST має бути виконано як завантаження файлу (тобто з використанням даних різних частин/форм) під час надсилання файлу для параметра <var>xml</var>.",
+       "apihelp-import-param-summary": "Імпортувати підсумок.",
+       "apihelp-import-param-xml": "Завантажено XML-файл.",
+       "apihelp-import-param-interwikisource": "Для інтервікі-імпорту: вікі, з якої імпортувати.",
+       "apihelp-import-param-interwikipage": "Для інтервікі-імпорту: сторінки для імпорту.",
+       "apihelp-import-param-fullhistory": "Для інтервікі-імпорту: імпортувати повну історію, не лише поточну версію.",
+       "apihelp-import-param-templates": "Для інтервікі-імпорту: імпортувати також усі включені шаблони.",
+       "apihelp-import-param-namespace": "Імпортувати у цей простір назв. Не можна використати разом з <var>$1rootpage</var>.",
+       "apihelp-import-param-rootpage": "Імпортувати як підсторінку цієї сторінки. Не можна використати разом з <var>$1namespace</var>.",
+       "apihelp-import-example-import": "Імпортувати [[meta:Help:ParserFunctions]] у простір назв 100 з повною історією.",
+       "apihelp-login-description": "Увійти в систему й отримати куки автентифікації.\n\nУ випадку успішного входження в систему, потрібні куки буде включено в заголовки HTTP-відповіді. У разі невдалого входу, подальші спроби будуть обмежені до ліміту автоматичних спроб підбирання пароля.",
+       "apihelp-login-param-name": "Ім'я користувача.",
+       "apihelp-login-param-password": "Пароль.",
+       "apihelp-login-param-domain": "Домен (необов'язково).",
+       "apihelp-login-param-token": "Токен входу в систему, отриманий у першому запиті.",
+       "apihelp-login-example-gettoken": "Отримати токен входу в систему.",
+       "apihelp-login-example-login": "Увійти в систему.",
+       "apihelp-logout-description": "Вийти й очистити дані сесії.",
+       "apihelp-logout-example-logout": "Вийти з поточного облікового запису.",
+       "apihelp-managetags-description": "Виконати керівні завдання щодо зміни теґів.",
        "apihelp-move-param-ignorewarnings": "Ігнорувати всі попередження",
        "api-help-datatypes-header": "Типи даних"
 }
index 8531e23..b1e6d95 100644 (file)
@@ -43,7 +43,7 @@
        "apihelp-createaccount-param-name": "使用者名稱。",
        "apihelp-createaccount-param-password": "密碼 (若有設定 <var>$1mailpassword</var> 則可略過)。",
        "apihelp-createaccount-param-domain": "外部認証使用的網域 (選填)。",
-       "apihelp-createaccount-param-token": "å·²å\8f\96å¾\97帳è\99\9f建ç«\8bå¯\86é\91°æ\96¼ç¬¬ä¸\80次è«\8bæ±\82。",
+       "apihelp-createaccount-param-token": "å\9c¨ç¬¬ä¸\80次è«\8bæ±\82æ\99\82å·²å\8f\96å¾\97ç\9a\84帳è\99\9f建ç«\8bé\87\91é\91°。",
        "apihelp-createaccount-param-email": "使用者的電子郵件地址 (選填) 。",
        "apihelp-createaccount-param-realname": "使用者的真實姓名 (選填)。",
        "apihelp-createaccount-param-mailpassword": "若設為其他值,將會以電子郵件寄送隨機密碼給使用者。",
        "apihelp-query+stashimageinfo-example-simple": "回傳儲藏檔案的檔案資訊。",
        "apihelp-query+templates-description": "回傳指定頁面中所有引用的頁面。",
        "apihelp-query+templates-param-limit": "要回傳的模板數量。",
-       "apihelp-query+tokens-param-type": "è¦\81è«\8bæ±\82ç\9a\84å¯\86é\91°é¡\9eå\9e\8bã\80\82",
+       "apihelp-query+tokens-param-type": "請求的密鑰類型。",
        "apihelp-query+tokens-example-simple": "接收 csrf 密鑰 (預設)。",
        "apihelp-query+tokens-example-types": "接收監視密鑰以及巡邏密鑰。",
        "apihelp-query+transcludedin-param-limit": "回傳的數量。",
        "apihelp-format-example-generic": "格式化查詢結果為 $1 格式",
        "apihelp-dbg-description": "使用 PHP 的 <code>var_export()</code> 格式輸出資料。",
        "apihelp-dbgfm-description": "使用 PHP 的 <code>var_export()</code> 格式輸出資料 (使用 HTML 格式顯示)。",
-       "apihelp-dump-description": "使用 PHP 的 <code>var_dump()</code> 格式輸出資料。",
-       "apihelp-dumpfm-description": "使用 PHP 的 <code>var_dump()</code> 格式輸出資料 (使用 HTML 格式顯示)。",
        "apihelp-json-description": "使用 JSON 格式輸出資料。",
        "apihelp-jsonfm-description": "使用 JSON 格式輸出資料 (使用 HTML 格式顯示)。",
        "apihelp-none-description": "不輸出。",
        "apihelp-rawfm-description": "使用 JSON 格式的除錯元素輸出資料 (使用 HTML 格式顯示)。",
        "apihelp-txt-description": "使用 PHP 的 <code>print_r()</code> 格式輸出資料。",
        "apihelp-txtfm-description": "使用 PHP 的 <code>print_r()</code> 格式輸出資料 (使用 HTML 格式顯示)。",
-       "apihelp-wddx-description": "使用 WDDX 格式輸出資料。",
-       "apihelp-wddxfm-description": "使用 WDDX 格式輸出資料 (使用 HTML 格式顯示)。",
        "apihelp-xml-description": "使用 XML 格式輸出資料。",
        "apihelp-xmlfm-description": "使用 XML 格式輸出資料 (使用 HTML 格式顯示)。",
        "apihelp-yaml-description": "使用 YAML 格式輸出資料。",
index 95f4816..bf8386f 100644 (file)
@@ -611,17 +611,16 @@ class ChangeTags {
         * Build a text box to select a change tag
         *
         * @param string $selected Tag to select by default
-        * @param bool $fullForm
-        *        - if false, then it returns an array of (label, form).
-        *        - if true, it returns an entire form around the selector.
-        * @param Title $title Title object to send the form to.
-        *        Used when, and only when $fullForm is true.
+        * @param bool $fullForm Affects return value, see below
+        * @param Title $title Title object to send the form to. Used only if $fullForm is true.
+        * @param bool $ooui Use an OOUI TextInputWidget as selector instead of a non-OOUI input field
+        *        You need to call OutputPage::enableOOUI() yourself.
         * @return string|array
-        *        - if $fullForm is false: Array with
-        *        - if $fullForm is true: String, html fragment
+        *        - if $fullForm is false: an array of (label, selector).
+        *        - if $fullForm is true: HTML of entire form built around the selector.
         */
        public static function buildTagFilterSelector( $selected = '',
-               $fullForm = false, Title $title = null
+               $fullForm = false, Title $title = null, $ooui = false
        ) {
                global $wgUseTagFilter;
 
@@ -634,14 +633,24 @@ class ChangeTags {
                                'label',
                                array( 'for' => 'tagfilter' ),
                                wfMessage( 'tag-filter' )->parse()
-                       ),
-                       Xml::input(
+                       )
+               );
+
+               if ( $ooui ) {
+                       $data[] = new OOUI\TextInputWidget( array(
+                               'id' => 'tagfilter',
+                               'name' => 'tagfilter',
+                               'value' => $selected,
+                               'classes' => 'mw-tagfilter-input',
+                       ) );
+               } else {
+                       $data[] = Xml::input(
                                'tagfilter',
                                20,
                                $selected,
                                array( 'class' => 'mw-tagfilter-input mw-ui-input mw-ui-input-inline', 'id' => 'tagfilter' )
-                       )
-               );
+                       );
+               }
 
                if ( !$fullForm ) {
                        return $data;
index d7acb42..2ee4545 100644 (file)
@@ -230,7 +230,7 @@ abstract class DatabaseBase implements IDatabase {
         * @param null|bool $ignoreErrors
         * @return bool The previous value of the flag.
         */
-       public function ignoreErrors( $ignoreErrors = null ) {
+       protected function ignoreErrors( $ignoreErrors = null ) {
                return wfSetBit( $this->mFlags, DBO_IGNORE, $ignoreErrors );
        }
 
diff --git a/includes/filerepo/FileBackendDBRepoWrapper.php b/includes/filerepo/FileBackendDBRepoWrapper.php
new file mode 100644 (file)
index 0000000..0401d0c
--- /dev/null
@@ -0,0 +1,357 @@
+<?php
+/**
+ * Proxy backend that manages file layout rewriting for FileRepo.
+ *
+ * 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 FileRepo
+ * @ingroup FileBackend
+ * @author Aaron Schulz
+ */
+
+/**
+ * @brief Proxy backend that manages file layout rewriting for FileRepo.
+ *
+ * LocalRepo may be configured to store files under their title names or by SHA-1.
+ * This acts as a shim in the later case, providing backwards compatability for
+ * most callers. All "public"/"deleted" zone files actually go in an "original"
+ * container and are never changed.
+ *
+ * This requires something like thumb_handler.php and img_auth.php for client viewing of files.
+ *
+ * @ingroup FileRepo
+ * @ingroup FileBackend
+ * @since 1.25
+ */
+class FileBackendDBRepoWrapper extends FileBackend {
+       /** @var FileBackend */
+       protected $backend;
+       /** @var string */
+       protected $repoName;
+       /** @var Closure */
+       protected $dbHandleFunc;
+       /** @var ProcessCacheLRU */
+       protected $resolvedPathCache;
+       /** @var Array Map of (index => DBConnRef) */
+       protected $dbs;
+
+       public function __construct( array $config ) {
+               $config['name'] = $config['backend']->getName();
+               $config['wikiId'] = $config['backend']->getWikiId();
+               parent::__construct( $config );
+               $this->backend = $config['backend'];
+               $this->repoName = $config['repoName'];
+               $this->dbHandleFunc = $config['dbHandleFactory'];
+               $this->resolvedPathCache = new ProcessCacheLRU( 100 );
+       }
+
+       /**
+        * Get the underlying FileBackend that is being wrapped
+        *
+        * @return FileBackend
+        */
+       public function getInternalBackend() {
+               return $this->backend;
+       }
+
+       /**
+        * Translate a legacy "title" path to it's "sha1" counterpart
+        *
+        * E.g. mwstore://local-backend/local-public/a/ab/<name>.jpg
+        * => mwstore://local-backend/local-original/x/y/z/<sha1>.jpg
+        *
+        * @param string $path
+        * @param bool $latest
+        * @return string
+        */
+       public function getBackendPath( $path, $latest = true ) {
+               $paths = $this->getBackendPaths( array( $path ), $latest );
+               return current( $paths );
+       }
+
+       /**
+        * Translate legacy "title" paths to their "sha1" counterparts
+        *
+        * E.g. mwstore://local-backend/local-public/a/ab/<name>.jpg
+        * => mwstore://local-backend/local-original/x/y/z/<sha1>.jpg
+        *
+        * @param array $paths
+        * @param bool $latest
+        * @return array Translated paths in same order
+        */
+       public function getBackendPaths( array $paths, $latest = true ) {
+               $db = $this->getDB( $latest ? DB_MASTER : DB_SLAVE );
+               $origBasePath = $this->backend->getContainerStoragePath( "{$this->repoName}-original" );
+
+               // @TODO: batching
+               $resolved = array();
+               foreach ( $paths as $i => $path ) {
+                       if ( !$latest && $this->resolvedPathCache->has( $path, 'target', 10 ) ) {
+                               $resolved[$i] = $this->resolvedPathCache->get( $path, 'target' );
+                               continue;
+                       }
+
+                       list( , $container, $rel ) = FileBackend::splitStoragePath( $path );
+
+                       if ( $container === "{$this->repoName}-public" ) {
+                               $name = basename( $path );
+                               if ( strpos( $path, '!' ) !== false ) {
+                                       $sha1 = $db->selectField( 'oldimage', 'oi_sha1',
+                                               array( 'oi_archive_name' => $name ),
+                                               __METHOD__
+                                       );
+                               } else {
+                                       $sha1 = $db->selectField( 'image', 'img_sha1',
+                                               array( 'img_name' => $name ),
+                                               __METHOD__
+                                       );
+                               }
+                               if ( !strlen( $sha1 ) ) {
+                                       $resolved[$i] = $path; // give up
+                                       continue;
+                               }
+                               $resolved[$i] = $this->getPathForSHA1( $sha1 );
+                               $this->resolvedPathCache->set( $path, 'target', $resolved[$i] );
+                       } elseif ( $container === "{$this->repoName}-deleted" ) {
+                               $name = basename( $path ); // <hash>.<ext>
+                               $sha1 = substr( $name, 0, strpos( $name, '.' ) ); // ignore extension
+                               $resolved[$i] = $this->getPathForSHA1( $sha1 );
+                               $this->resolvedPathCache->set( $path, 'target', $resolved[$i] );
+                       } else {
+                               $resolved[$i] = $path;
+                       }
+               }
+
+               $res = array();
+               foreach ( $paths as $i => $path ) {
+                       $res[$i] = $resolved[$i];
+               }
+
+               return $res;
+       }
+
+       protected function doOperationsInternal( array $ops, array $opts ) {
+               return $this->backend->doOperationsInternal( $this->mungeOpPaths( $ops ), $opts );
+       }
+
+       protected function doQuickOperationsInternal( array $ops ) {
+               return $this->backend->doQuickOperationsInternal( $this->mungeOpPaths( $ops ) );
+       }
+
+       protected function doPrepare( array $params ) {
+               return $this->backend->doPrepare( $params );
+       }
+
+       protected function doSecure( array $params ) {
+               return $this->backend->doSecure( $params );
+       }
+
+       protected function doPublish( array $params ) {
+               return $this->backend->doPublish( $params );
+       }
+
+       protected function doClean( array $params ) {
+               return $this->backend->doClean( $params );
+       }
+
+       public function concatenate( array $params ) {
+               return $this->translateSrcParams( __FUNCTION__, $params );
+       }
+
+       public function fileExists( array $params ) {
+               return $this->translateSrcParams( __FUNCTION__, $params );
+       }
+
+       public function getFileTimestamp( array $params ) {
+               return $this->translateSrcParams( __FUNCTION__, $params );
+       }
+
+       public function getFileSize( array $params ) {
+               return $this->translateSrcParams( __FUNCTION__, $params );
+       }
+
+       public function getFileStat( array $params ) {
+               return $this->translateSrcParams( __FUNCTION__, $params );
+       }
+
+       public function getFileXAttributes( array $params ) {
+               return $this->translateSrcParams( __FUNCTION__, $params );
+       }
+
+       public function getFileSha1Base36( array $params ) {
+               return $this->translateSrcParams( __FUNCTION__, $params );
+       }
+
+       public function getFileProps( array $params ) {
+               return $this->translateSrcParams( __FUNCTION__, $params );
+       }
+
+       public function streamFile( array $params ) {
+               // The stream methods use the file extension to determine the
+               // Content-Type (as MediaWiki should already validate it on upload).
+               // The translated SHA1 path has no extension, so this needs to use
+               // the untranslated path extension.
+               $type = StreamFile::contentTypeFromPath( $params['src'] );
+               if ( $type && $type != 'unknown/unknown' ) {
+                       $params['headers'][] = "Content-type: $type";
+               }
+               return $this->translateSrcParams( __FUNCTION__, $params );
+       }
+
+       public function getFileContentsMulti( array $params ) {
+               return $this->translateArrayResults( __FUNCTION__, $params );
+       }
+
+       public function getLocalReferenceMulti( array $params ) {
+               return $this->translateArrayResults( __FUNCTION__, $params );
+       }
+
+       public function getLocalCopyMulti( array $params ) {
+               return $this->translateArrayResults( __FUNCTION__, $params );
+       }
+
+       public function getFileHttpUrl( array $params ) {
+               return $this->translateSrcParams( __FUNCTION__, $params );
+       }
+
+       public function directoryExists( array $params ) {
+               return $this->backend->directoryExists( $params );
+       }
+
+       public function getDirectoryList( array $params ) {
+               return $this->backend->getDirectoryList( $params );
+       }
+
+       public function getFileList( array $params ) {
+               return $this->backend->getFileList( $params );
+       }
+
+       public function getFeatures() {
+               return $this->backend->getFeatures();
+       }
+
+       public function clearCache( array $paths = null ) {
+               $this->backend->clearCache( null ); // clear all
+       }
+
+       public function preloadCache( array $paths ) {
+               $paths = $this->getBackendPaths( $paths );
+               $this->backend->preloadCache( $paths );
+       }
+
+       public function preloadFileStat( array $params ) {
+               return $this->translateSrcParams( __FUNCTION__, $params );
+       }
+
+       public function getScopedLocksForOps( array $ops, Status $status ) {
+               return $this->backend->getScopedFileLocks( $ops, $status );
+       }
+
+       /**
+        * Get the ultimate original storage path for a file
+        *
+        * Use this when putting a new file into the system
+        *
+        * @param string $sha1 File SHA-1 base36
+        * @return string
+        */
+       public function getPathForSHA1( $sha1 ) {
+               if ( strlen( $sha1 ) < 3 ) {
+                       throw new MWException( "Invalid file SHA-1." );
+               }
+               return $this->backend->getContainerStoragePath( "{$this->repoName}-original" ) .
+                       "/{$sha1[0]}/{$sha1[1]}/{$sha1[2]}/{$sha1}";
+       }
+
+       /**
+        * Get a connection to the repo file registry DB
+        *
+        * @param integer $index
+        * @return DBConnRef
+        */
+       protected function getDB( $index ) {
+               if ( !isset( $this->db[$index] ) ) {
+                       $func = $this->dbHandleFunc;
+                       $this->db[$index] = $func( $index );
+               }
+               return $this->db[$index];
+       }
+
+       /**
+        * Translates paths found in the "src" or "srcs" keys of a params array
+        *
+        * @param string $function
+        * @param array $params
+        */
+       protected function translateSrcParams( $function, array $params ) {
+               $latest = !empty( $params['latest'] );
+
+               if ( isset( $params['src'] ) ) {
+                       $params['src'] = $this->getBackendPath( $params['src'], $latest );
+               }
+
+               if ( isset( $params['srcs'] ) ) {
+                       $params['srcs'] = $this->getBackendPaths( $params['srcs'], $latest );
+               }
+
+               return $this->backend->$function( $params );
+       }
+
+       /**
+        * Translates paths when the backend function returns results keyed by paths
+        *
+        * @param string $function
+        * @param array $params
+        * @return array
+        */
+       protected function translateArrayResults( $function, array $params ) {
+               $origPaths = $params['srcs'];
+               $params['srcs'] = $this->getBackendPaths( $params['srcs'], !empty( $params['latest'] ) );
+               $pathMap = array_combine( $params['srcs'], $origPaths );
+
+               $results = $this->backend->$function( $params );
+
+               $contents = array();
+               foreach ( $results as $path => $result ) {
+                       $contents[$pathMap[$path]] = $result;
+               }
+
+               return $contents;
+       }
+
+       /**
+        * Translate legacy "title" source paths to their "sha1" counterparts
+        *
+        * This leaves destination paths alone since we don't want those to mutate
+        *
+        * @param array $ops
+        * @return array
+        */
+       protected function mungeOpPaths( array $ops ) {
+               // Ops that use 'src' and do not mutate core file data there
+               static $srcRefOps = array( 'store', 'copy', 'describe' );
+               foreach ( $ops as &$op ) {
+                       if ( isset( $op['src'] ) && in_array( $op['op'], $srcRefOps ) ) {
+                               $op['src'] = $this->getBackendPath( $op['src'], true );
+                       }
+                       if ( isset( $op['srcs'] ) ) {
+                               $op['srcs'] = $this->getBackendPaths( $op['srcs'], true );
+                       }
+               }
+               return $ops;
+       }
+}
index 82bbd76..7370c5c 100644 (file)
@@ -49,6 +49,9 @@ class FileRepo {
        /** @var int */
        public $descriptionCacheExpiry;
 
+       /** @var bool */
+       protected $hasSha1Storage = false;
+
        /** @var FileBackend */
        protected $backend;
 
@@ -1885,6 +1888,14 @@ class FileRepo {
 
                return $ret;
        }
+
+       /**
+        * Returns whether or not storage is SHA-1 based
+        * @return boolean
+        */
+       public function hasSha1Storage() {
+               return $this->hasSha1Storage;
+       }
 }
 
 /**
index 6e9e6ad..dfdb375 100644 (file)
@@ -76,17 +76,8 @@ class ForeignDBRepo extends LocalRepo {
         */
        function getMasterDB() {
                if ( !isset( $this->dbConn ) ) {
-                       $this->dbConn = DatabaseBase::factory( $this->dbType,
-                               array(
-                                       'host' => $this->dbServer,
-                                       'user' => $this->dbUser,
-                                       'password' => $this->dbPassword,
-                                       'dbname' => $this->dbName,
-                                       'flags' => $this->dbFlags,
-                                       'tablePrefix' => $this->tablePrefix,
-                                       'foreign' => true,
-                               )
-                       );
+                       $func = $this->getDBFactory();
+                       $this->dbConn = $func( DB_MASTER );
                }
 
                return $this->dbConn;
@@ -99,6 +90,25 @@ class ForeignDBRepo extends LocalRepo {
                return $this->getMasterDB();
        }
 
+       /**
+        * @return Closure
+        */
+       protected function getDBFactory() {
+               return function( $index ) {
+                       return DatabaseBase::factory( $this->dbType,
+                               array(
+                                       'host' => $this->dbServer,
+                                       'user' => $this->dbUser,
+                                       'password' => $this->dbPassword,
+                                       'dbname' => $this->dbName,
+                                       'flags' => $this->dbFlags,
+                                       'tablePrefix' => $this->tablePrefix,
+                                       'foreign' => true,
+                               )
+                       );
+               };
+       }
+
        /**
         * @return bool
         */
index 8153ffb..f49b716 100644 (file)
@@ -66,6 +66,16 @@ class ForeignDBViaLBRepo extends LocalRepo {
                return wfGetDB( DB_SLAVE, array(), $this->wiki );
        }
 
+       /**
+        * @return Closure
+        */
+       protected function getDBFactory() {
+               $wiki = $this->wiki;
+               return function( $index ) use ( $wiki ) {
+                       return wfGetDB( $index, array(), $wiki );
+               };
+       }
+
        function hasSharedCache() {
                return $this->hasSharedCache;
        }
index 800a230..1852912 100644 (file)
@@ -29,6 +29,9 @@
  * @ingroup FileRepo
  */
 class LocalRepo extends FileRepo {
+       /** @var bool */
+       protected $hasSha1Storage = false;
+
        /** @var array */
        protected $fileFactory = array( 'LocalFile', 'newFromTitle' );
 
@@ -47,6 +50,20 @@ class LocalRepo extends FileRepo {
        /** @var array */
        protected $oldFileFactoryKey = array( 'OldLocalFile', 'newFromKey' );
 
+       function __construct( array $info = null ) {
+               parent::__construct( $info );
+
+               $this->hasSha1Storage = isset( $info['storageLayout'] ) && $info['storageLayout'] === 'sha1';
+
+               if ( $this->hasSha1Storage() ) {
+                       $this->backend = new FileBackendDBRepoWrapper( array(
+                               'backend'         => $this->backend,
+                               'repoName'        => $this->name,
+                               'dbHandleFactory' => $this->getDBFactory()
+                       ) );
+               }
+       }
+
        /**
         * @throws MWException
         * @param stdClass $row
@@ -82,6 +99,11 @@ class LocalRepo extends FileRepo {
         * @return FileRepoStatus
         */
        function cleanupDeletedBatch( array $storageKeys ) {
+               if ( $this->hasSha1Storage() ) {
+                       wfDebug( __METHOD__ . ": skipped because storage uses sha1 paths\n" );
+                       return Status::newGood();
+               }
+
                $backend = $this->backend; // convenience
                $root = $this->getZonePath( 'deleted' );
                $dbw = $this->getMasterDB();
@@ -469,6 +491,16 @@ class LocalRepo extends FileRepo {
                return wfGetDB( DB_MASTER );
        }
 
+       /**
+        * Get a callback to get a DB handle given an index (DB_SLAVE/DB_MASTER)
+        * @return Closure
+        */
+       protected function getDBFactory() {
+               return function( $index ) {
+                       return wfGetDB( $index );
+               };
+       }
+
        /**
         * Get a key on the primary cache for this repository.
         * Returns false if the repository's cache is not accessible at this site.
@@ -514,4 +546,56 @@ class LocalRepo extends FileRepo {
                        'favicon' => wfExpandUrl( $wgFavicon ),
                ) );
        }
+
+       public function store( $srcPath, $dstZone, $dstRel, $flags = 0 ) {
+               return $this->skipWriteOperationIfSha1( __FUNCTION__, func_get_args() );
+       }
+
+       public function storeBatch( array $triplets, $flags = 0 ) {
+               return $this->skipWriteOperationIfSha1( __FUNCTION__, func_get_args() );
+       }
+
+       public function cleanupBatch( array $files, $flags = 0 ) {
+               return $this->skipWriteOperationIfSha1( __FUNCTION__, func_get_args() );
+       }
+
+       public function publish(
+               $srcPath,
+               $dstRel,
+               $archiveRel,
+               $flags = 0,
+               array $options = array()
+       ) {
+               return $this->skipWriteOperationIfSha1( __FUNCTION__, func_get_args() );
+       }
+
+       public function publishBatch( array $ntuples, $flags = 0 ) {
+               return $this->skipWriteOperationIfSha1( __FUNCTION__, func_get_args() );
+       }
+
+       public function delete( $srcRel, $archiveRel ) {
+               return $this->skipWriteOperationIfSha1( __FUNCTION__, func_get_args() );
+       }
+
+       public function deleteBatch( array $sourceDestPairs ) {
+               return $this->skipWriteOperationIfSha1( __FUNCTION__, func_get_args() );
+       }
+
+       /**
+        * Skips the write operation if storage is sha1-based, executes it normally otherwise
+        *
+        * @param string $function
+        * @param array $args
+        * @return FileRepoStatus
+        */
+       protected function skipWriteOperationIfSha1( $function, array $args ) {
+               $this->assertWritableRepo(); // fail out if read-only
+
+               if ( $this->hasSha1Storage() ) {
+                       wfDebug( __METHOD__ . ": skipped because storage uses sha1 paths\n" );
+                       return Status::newGood();
+               } else {
+                       return call_user_func_array('parent::' . $function, $args );
+               }
+       }
 }
index 6abe00c..4070553 100644 (file)
@@ -1459,7 +1459,7 @@ class LocalFile extends File {
         * The archive name should be passed through to recordUpload for database
         * registration.
         *
-        * @param string $srcPath Local filesystem path to the source image
+        * @param string $srcPath Local filesystem path or virtual URL to the source image
         * @param int $flags A bitwise combination of:
         *     File::DELETE_SOURCE    Delete the source file, i.e. move rather than copy
         * @param array $options Optional additional parameters
@@ -1477,7 +1477,7 @@ class LocalFile extends File {
         * The archive name should be passed through to recordUpload for database
         * registration.
         *
-        * @param string $srcPath Local filesystem path to the source image
+        * @param string $srcPath Local filesystem path or virtual URL to the source image
         * @param string $dstRel Target relative path
         * @param int $flags A bitwise combination of:
         *     File::DELETE_SOURCE    Delete the source file, i.e. move rather than copy
@@ -1486,7 +1486,8 @@ class LocalFile extends File {
         *     archive name, or an empty string if it was a new file.
         */
        function publishTo( $srcPath, $dstRel, $flags = 0, array $options = array() ) {
-               if ( $this->getRepo()->getReadOnlyReason() !== false ) {
+               $repo = $this->getRepo();
+               if ( $repo->getReadOnlyReason() !== false ) {
                        return $this->readOnlyFatalStatus();
                }
 
@@ -1494,13 +1495,29 @@ class LocalFile extends File {
 
                $archiveName = wfTimestamp( TS_MW ) . '!' . $this->getName();
                $archiveRel = 'archive/' . $this->getHashPath() . $archiveName;
-               $flags = $flags & File::DELETE_SOURCE ? LocalRepo::DELETE_SOURCE : 0;
-               $status = $this->repo->publish( $srcPath, $dstRel, $archiveRel, $flags, $options );
 
-               if ( $status->value == 'new' ) {
-                       $status->value = '';
+               if ( $repo->hasSha1Storage() ) {
+                       $sha1 = $repo->isVirtualUrl( $srcPath )
+                               ? $repo->getFileSha1( $srcPath )
+                               : File::sha1Base36( $srcPath );
+                       $dst = $repo->getBackend()->getPathForSHA1( $sha1 );
+                       $status = $repo->quickImport( $srcPath, $dst );
+                       if ( $flags & File::DELETE_SOURCE ) {
+                               unlink( $srcPath );
+                       }
+
+                       if ( $this->exists() ) {
+                               $status->value = $archiveName;
+                       }
                } else {
-                       $status->value = $archiveName;
+                       $flags = $flags & File::DELETE_SOURCE ? LocalRepo::DELETE_SOURCE : 0;
+                       $status = $repo->publish( $srcPath, $dstRel, $archiveRel, $flags, $options );
+
+                       if ( $status->value == 'new' ) {
+                               $status->value = '';
+                       } else {
+                               $status->value = $archiveName;
+                       }
                }
 
                $this->unlock(); // done
@@ -1941,14 +1958,14 @@ class LocalFileDeleteBatch {
                $this->status = $file->repo->newGood();
        }
 
-       function addCurrent() {
+       public function addCurrent() {
                $this->srcRels['.'] = $this->file->getRel();
        }
 
        /**
         * @param string $oldName
         */
-       function addOld( $oldName ) {
+       public function addOld( $oldName ) {
                $this->srcRels[$oldName] = $this->file->getArchiveRel( $oldName );
                $this->archiveUrls[] = $this->file->getArchiveUrl( $oldName );
        }
@@ -1957,7 +1974,7 @@ class LocalFileDeleteBatch {
         * Add the old versions of the image to the batch
         * @return array List of archive names from old versions
         */
-       function addOlds() {
+       public function addOlds() {
                $archiveNames = array();
 
                $dbw = $this->file->repo->getMasterDB();
@@ -1978,7 +1995,7 @@ class LocalFileDeleteBatch {
        /**
         * @return array
         */
-       function getOldRels() {
+       protected function getOldRels() {
                if ( !isset( $this->srcRels['.'] ) ) {
                        $oldRels =& $this->srcRels;
                        $deleteCurrent = false;
@@ -2050,7 +2067,7 @@ class LocalFileDeleteBatch {
                return $hashes;
        }
 
-       function doDBInserts() {
+       protected function doDBInserts() {
                $dbw = $this->file->repo->getMasterDB();
                $encTimestamp = $dbw->addQuotes( $dbw->timestamp() );
                $encUserId = $dbw->addQuotes( $this->user->getId() );
@@ -2165,8 +2182,8 @@ class LocalFileDeleteBatch {
         * Run the transaction
         * @return FileRepoStatus
         */
-       function execute() {
-
+       public function execute() {
+               $repo = $this->file->getRepo();
                $this->file->lock();
 
                // Prepare deletion batch
@@ -2180,7 +2197,7 @@ class LocalFileDeleteBatch {
                        if ( isset( $hashes[$name] ) ) {
                                $hash = $hashes[$name];
                                $key = $hash . $dotExt;
-                               $dstRel = $this->file->repo->getDeletedHashPath( $key ) . $key;
+                               $dstRel = $repo->getDeletedHashPath( $key ) . $key;
                                $this->deletionBatch[$name] = array( $srcRel, $dstRel );
                        }
                }
@@ -2193,20 +2210,22 @@ class LocalFileDeleteBatch {
                // them in a separate transaction, then run the file ops, then update the fa_name fields.
                $this->doDBInserts();
 
-               // Removes non-existent file from the batch, so we don't get errors.
-               // This also handles files in the 'deleted' zone deleted via revision deletion.
-               $checkStatus = $this->removeNonexistentFiles( $this->deletionBatch );
-               if ( !$checkStatus->isGood() ) {
-                       $this->status->merge( $checkStatus );
-                       return $this->status;
-               }
-               $this->deletionBatch = $checkStatus->value;
+               if ( !$repo->hasSha1Storage() ) {
+                       // Removes non-existent file from the batch, so we don't get errors.
+                       // This also handles files in the 'deleted' zone deleted via revision deletion.
+                       $checkStatus = $this->removeNonexistentFiles( $this->deletionBatch );
+                       if ( !$checkStatus->isGood() ) {
+                               $this->status->merge( $checkStatus );
+                               return $this->status;
+                       }
+                       $this->deletionBatch = $checkStatus->value;
 
-               // Execute the file deletion batch
-               $status = $this->file->repo->deleteBatch( $this->deletionBatch );
+                       // Execute the file deletion batch
+                       $status = $this->file->repo->deleteBatch( $this->deletionBatch );
 
-               if ( !$status->isGood() ) {
-                       $this->status->merge( $status );
+                       if ( !$status->isGood() ) {
+                               $this->status->merge( $status );
+                       }
                }
 
                if ( !$this->status->isOK() ) {
@@ -2232,7 +2251,7 @@ class LocalFileDeleteBatch {
         * @param array $batch
         * @return Status
         */
-       function removeNonexistentFiles( $batch ) {
+       protected function removeNonexistentFiles( $batch ) {
                $files = $newBatch = array();
 
                foreach ( $batch as $batchItem ) {
@@ -2293,7 +2312,7 @@ class LocalFileRestoreBatch {
         * Add a file by ID
         * @param int $fa_id
         */
-       function addId( $fa_id ) {
+       public function addId( $fa_id ) {
                $this->ids[] = $fa_id;
        }
 
@@ -2301,14 +2320,14 @@ class LocalFileRestoreBatch {
         * Add a whole lot of files by ID
         * @param int[] $ids
         */
-       function addIds( $ids ) {
+       public function addIds( $ids ) {
                $this->ids = array_merge( $this->ids, $ids );
        }
 
        /**
         * Add all revisions of the file
         */
-       function addAll() {
+       public function addAll() {
                $this->all = true;
        }
 
@@ -2320,12 +2339,13 @@ class LocalFileRestoreBatch {
         * So we save the batch and let the caller call cleanup()
         * @return FileRepoStatus
         */
-       function execute() {
+       public function execute() {
                global $wgLang;
 
+               $repo = $this->file->getRepo();
                if ( !$this->all && !$this->ids ) {
                        // Do nothing
-                       return $this->file->repo->newGood();
+                       return $repo->newGood();
                }
 
                $lockOwnsTrx = $this->file->lock();
@@ -2382,9 +2402,9 @@ class LocalFileRestoreBatch {
                                continue;
                        }
 
-                       $deletedRel = $this->file->repo->getDeletedHashPath( $row->fa_storage_key ) .
+                       $deletedRel = $repo->getDeletedHashPath( $row->fa_storage_key ) .
                                $row->fa_storage_key;
-                       $deletedUrl = $this->file->repo->getVirtualUrl() . '/deleted/' . $deletedRel;
+                       $deletedUrl = $repo->getVirtualUrl() . '/deleted/' . $deletedRel;
 
                        if ( isset( $row->fa_sha1 ) ) {
                                $sha1 = $row->fa_sha1;
@@ -2498,27 +2518,29 @@ class LocalFileRestoreBatch {
                        $status->error( 'undelete-missing-filearchive', $id );
                }
 
-               // Remove missing files from batch, so we don't get errors when undeleting them
-               $checkStatus = $this->removeNonexistentFiles( $storeBatch );
-               if ( !$checkStatus->isGood() ) {
-                       $status->merge( $checkStatus );
-                       return $status;
-               }
-               $storeBatch = $checkStatus->value;
+               if ( !$repo->hasSha1Storage() ) {
+                       // Remove missing files from batch, so we don't get errors when undeleting them
+                       $checkStatus = $this->removeNonexistentFiles( $storeBatch );
+                       if ( !$checkStatus->isGood() ) {
+                               $status->merge( $checkStatus );
+                               return $status;
+                       }
+                       $storeBatch = $checkStatus->value;
 
-               // Run the store batch
-               // Use the OVERWRITE_SAME flag to smooth over a common error
-               $storeStatus = $this->file->repo->storeBatch( $storeBatch, FileRepo::OVERWRITE_SAME );
-               $status->merge( $storeStatus );
+                       // Run the store batch
+                       // Use the OVERWRITE_SAME flag to smooth over a common error
+                       $storeStatus = $this->file->repo->storeBatch( $storeBatch, FileRepo::OVERWRITE_SAME );
+                       $status->merge( $storeStatus );
 
-               if ( !$status->isGood() ) {
-                       // Even if some files could be copied, fail entirely as that is the
-                       // easiest thing to do without data loss
-                       $this->cleanupFailedBatch( $storeStatus, $storeBatch );
-                       $status->ok = false;
-                       $this->file->unlock();
+                       if ( !$status->isGood() ) {
+                               // Even if some files could be copied, fail entirely as that is the
+                               // easiest thing to do without data loss
+                               $this->cleanupFailedBatch( $storeStatus, $storeBatch );
+                               $status->ok = false;
+                               $this->file->unlock();
 
-                       return $status;
+                               return $status;
+                       }
                }
 
                // Run the DB updates
@@ -2542,7 +2564,7 @@ class LocalFileRestoreBatch {
                }
 
                // If store batch is empty (all files are missing), deletion is to be considered successful
-               if ( $status->successCount > 0 || !$storeBatch ) {
+               if ( $status->successCount > 0 || !$storeBatch || $repo->hasSha1Storage() ) {
                        if ( !$exists ) {
                                wfDebug( __METHOD__ . " restored {$status->successCount} items, creating a new current\n" );
 
@@ -2565,7 +2587,7 @@ class LocalFileRestoreBatch {
         * @param array $triplets
         * @return Status
         */
-       function removeNonexistentFiles( $triplets ) {
+       protected function removeNonexistentFiles( $triplets ) {
                $files = $filteredTriplets = array();
                foreach ( $triplets as $file ) {
                        $files[$file[0]] = $file[0];
@@ -2591,7 +2613,7 @@ class LocalFileRestoreBatch {
         * @param array $batch
         * @return array
         */
-       function removeNonexistentFromCleanup( $batch ) {
+       protected function removeNonexistentFromCleanup( $batch ) {
                $files = $newBatch = array();
                $repo = $this->file->repo;
 
@@ -2616,7 +2638,7 @@ class LocalFileRestoreBatch {
         * This should be called from outside the transaction in which execute() was called.
         * @return FileRepoStatus
         */
-       function cleanup() {
+       public function cleanup() {
                if ( !$this->cleanupBatch ) {
                        return $this->file->repo->newGood();
                }
@@ -2635,7 +2657,7 @@ class LocalFileRestoreBatch {
         * @param Status $storeStatus
         * @param array $storeBatch
         */
-       function cleanupFailedBatch( $storeStatus, $storeBatch ) {
+       protected function cleanupFailedBatch( $storeStatus, $storeBatch ) {
                $cleanupBatch = array();
 
                foreach ( $storeStatus->success as $i => $success ) {
@@ -2693,7 +2715,7 @@ class LocalFileMoveBatch {
        /**
         * Add the current image to the batch
         */
-       function addCurrent() {
+       public function addCurrent() {
                $this->cur = array( $this->oldRel, $this->newRel );
        }
 
@@ -2701,7 +2723,7 @@ class LocalFileMoveBatch {
         * Add the old versions of the image to the batch
         * @return array List of archive names from old versions
         */
-       function addOlds() {
+       public function addOlds() {
                $archiveBase = 'archive';
                $this->olds = array();
                $this->oldCount = 0;
@@ -2751,7 +2773,7 @@ class LocalFileMoveBatch {
         * Perform the move.
         * @return FileRepoStatus
         */
-       function execute() {
+       public function execute() {
                $repo = $this->file->repo;
                $status = $repo->newGood();
 
@@ -2782,22 +2804,26 @@ class LocalFileMoveBatch {
                wfDebugLog( 'imagemove', "Renamed {$this->file->getName()} in database: " .
                        "{$statusDb->successCount} successes, {$statusDb->failCount} failures" );
 
-               // Copy the files into their new location.
-               // If a prior process fataled copying or cleaning up files we tolerate any
-               // of the existing files if they are identical to the ones being stored.
-               $statusMove = $repo->storeBatch( $triplets, FileRepo::OVERWRITE_SAME );
-               wfDebugLog( 'imagemove', "Moved files for {$this->file->getName()}: " .
-                       "{$statusMove->successCount} successes, {$statusMove->failCount} failures" );
-               if ( !$statusMove->isGood() ) {
-                       // Delete any files copied over (while the destination is still locked)
-                       $this->cleanupTarget( $triplets );
-                       $destFile->unlock();
-                       $this->file->unlockAndRollback(); // unlocks the destination
-                       wfDebugLog( 'imagemove', "Error in moving files: " . $statusMove->getWikiText() );
-                       $statusMove->ok = false;
-
-                       return $statusMove;
+               if ( !$repo->hasSha1Storage() ) {
+                       // Copy the files into their new location.
+                       // If a prior process fataled copying or cleaning up files we tolerate any
+                       // of the existing files if they are identical to the ones being stored.
+                       $statusMove = $repo->storeBatch( $triplets, FileRepo::OVERWRITE_SAME );
+                       wfDebugLog( 'imagemove', "Moved files for {$this->file->getName()}: " .
+                               "{$statusMove->successCount} successes, {$statusMove->failCount} failures" );
+                       if ( !$statusMove->isGood() ) {
+                               // Delete any files copied over (while the destination is still locked)
+                               $this->cleanupTarget( $triplets );
+                               $destFile->unlock();
+                               $this->file->unlockAndRollback(); // unlocks the destination
+                               wfDebugLog( 'imagemove', "Error in moving files: " . $statusMove->getWikiText() );
+                               $statusMove->ok = false;
+
+                               return $statusMove;
+                       }
+                       $status->merge( $statusMove );
                }
+
                $destFile->unlock();
                $this->file->unlock(); // done
 
@@ -2805,7 +2831,6 @@ class LocalFileMoveBatch {
                $this->cleanupSource( $triplets );
 
                $status->merge( $statusDb );
-               $status->merge( $statusMove );
 
                return $status;
        }
@@ -2816,7 +2841,7 @@ class LocalFileMoveBatch {
         *
         * @return FileRepoStatus
         */
-       function doDBUpdates() {
+       protected function doDBUpdates() {
                $repo = $this->file->repo;
                $status = $repo->newGood();
                $dbw = $this->db;
@@ -2868,7 +2893,7 @@ class LocalFileMoveBatch {
         * Generate triplets for FileRepo::storeBatch().
         * @return array
         */
-       function getMoveTriplets() {
+       protected function getMoveTriplets() {
                $moves = array_merge( array( $this->cur ), $this->olds );
                $triplets = array(); // The format is: (srcUrl, destZone, destUrl)
 
@@ -2890,7 +2915,7 @@ class LocalFileMoveBatch {
         * @param array $triplets
         * @return Status
         */
-       function removeNonexistentFiles( $triplets ) {
+       protected function removeNonexistentFiles( $triplets ) {
                $files = array();
 
                foreach ( $triplets as $file ) {
@@ -2920,7 +2945,7 @@ class LocalFileMoveBatch {
         * files. Called if something went wrong half way.
         * @param array $triplets
         */
-       function cleanupTarget( $triplets ) {
+       protected function cleanupTarget( $triplets ) {
                // Create dest pairs from the triplets
                $pairs = array();
                foreach ( $triplets as $triplet ) {
@@ -2936,7 +2961,7 @@ class LocalFileMoveBatch {
         * Called at the end of the move process if everything else went ok.
         * @param array $triplets
         */
-       function cleanupSource( $triplets ) {
+       protected function cleanupSource( $triplets ) {
                // Create source file names from the triplets
                $files = array();
                foreach ( $triplets as $triplet ) {
index 3547308..cbe64d6 100644 (file)
                        "Seb35",
                        "Nemo bis",
                        "Ricordisamoa",
-                       "Fpugliajno"
+                       "Fpugliajno",
+                       "The Polish"
                ]
        },
        "config-desc": "Il programma di installazione per MediaWiki",
-       "config-title": "Installazione MediaWiki $1",
+       "config-title": "Installazione di MediaWiki $1",
        "config-information": "Informazioni",
        "config-localsettings-upgrade": "È stato rilevato un file <code>LocalSettings.php</code>.\nPer aggiornare questa installazione, si prega di inserire il valore di <code>$wgUpgradeKey</code> nella casella qui sotto.\nLo potete trovare in <code>LocalSettings.php</code>.",
        "config-localsettings-cli-upgrade": "È stato rilevato un file <code>LocalSettings.php</code>.\nPer aggiornare questa installazione, eseguire <code>update.php</code>",
index e7d2388..6615026 100644 (file)
        "config-db-install-account": "Konto użytkownika dla instalatora",
        "config-db-username": "Nazwa użytkownika bazy danych:",
        "config-db-password": "Hasło bazy danych:",
-       "config-db-password-empty": "Wprowadź hasło dla nowego użytkownika bazy danych: $1.\nChoć istnieje możliwość tworzenia użytkowników bez hasła, nie jest to bezpieczne.",
-       "config-db-username-empty": "Należy podać wartość parametru \"{{int:config-db-username}}\".",
        "config-db-install-username": "Wprowadź nazwę użytkownika, który będzie używany do łączenia się z bazą danych podczas procesu instalacji.\nNie jest to nazwa konta MediaWiki, a użytkownika bazy danych.",
        "config-db-install-password": "Wprowadź hasło, które będzie wykorzystywane do łączenia się z bazą danych w procesie instalacji.\nTo nie jest hasło konta MediaWiki, lecz hasło do bazy danych.",
        "config-db-install-help": "Podaj nazwę użytkownika i jego hasło, które zostaną użyte do połączenia z bazą danych w czasie procesu instalacji.",
index 192b119..3d7fad5 100644 (file)
@@ -42,7 +42,7 @@ class BufferingStatsdDataFactory extends StatsdDataFactory {
        /**
         * Normalize a metric key for StatsD
         *
-        * Replace occurences of '::' with dots and any other non-alphabetic
+        * Replace occurences of '::' with dots and any other non-alphanumeric
         * characters with underscores. Combine runs of dots or underscores.
         * Then trim leading or trailing dots or underscores.
         *
@@ -51,7 +51,7 @@ class BufferingStatsdDataFactory extends StatsdDataFactory {
         */
        private static function normalizeMetricKey( $key ) {
                $key = preg_replace( '/[:.]+/', '.', $key );
-               $key = preg_replace( '/[^a-z.]+/i', '_', $key );
+               $key = preg_replace( '/[^a-z0-9.]+/i', '_', $key );
                $key = trim( $key, '_.' );
                return str_replace( array( '._', '_.' ), '.', $key );
        }
index ad2ae19..aa9f7ac 100644 (file)
@@ -51,7 +51,8 @@
                        "Khaled",
                        "Emara",
                        "Macofe",
-                       "Yahya Sakhnini"
+                       "Yahya Sakhnini",
+                       "Mervat Salman"
                ]
        },
        "tog-underline": "سطر تحت الوصلات:",
        "htmlform-cloner-create": "إضافة المزيد",
        "htmlform-cloner-delete": "إزالة",
        "htmlform-cloner-required": "مطلوب قيمة واحدة على الأقل.",
+       "htmlform-user-not-exists": "<strong>$1</strong> غير موجود",
+       "htmlform-user-not-valid": "اسم المستخدم <strong>$1</strong> غير صالح.",
        "sqlite-has-fts": "$1 بدعم البحث في كامل النص",
        "sqlite-no-fts": "$1 بدون دعم البحث في كامل النص",
        "logentry-delete-delete": "{{GENDER:$2|حذف|حذفت}} $1 صفحة $3",
index 2252d94..a6b5c69 100644 (file)
        "protectedinterface": "Esta páxina proporciona'l testu de la interfaz del software d'esta wiki, y ta candada pa torgar abusos.\nP'amestar o cambiar les traducciones de toles wikis, por favor usa [//translatewiki.net/translatewiki.net], el proyeutu de llocalización de MediaWiki.",
        "editinginterface": "<strong>Avisu:</strong> Tas editando una páxina que s'usa pa proporcionar el testu de la interfaz del programa.\nLos cambeos nesta páxina afeutarán al aspeutu de la interfaz pa otros usuarios d'esta wiki.",
        "translateinterface": "P'amestar o camudar les traducciones pa toles wikis, usa [//translatewiki.net/ translatewiki.net], el proyeutu de traducción de MediaWiki.",
-       "cascadeprotected": "Esta páxina ta protexida d'ediciones porque ta inxerta {{PLURAL:$1|na siguiente páxina, protexida|nes siguientes páxines, protexíes}} cola opción «en cascada» activada:\n$2",
+       "cascadeprotected": "Esta páxina ta protexida d'ediciones porque ta trescluída {{PLURAL:$1|na siguiente páxina, protexida|nes siguientes páxines, protexíes}} cola opción «en cascada» activada:\n$2",
        "namespaceprotected": "Nun tienes permisu pa editar páxines nel espaciu de nomes '''$1'''.",
        "customcssprotected": "Nun tienes permisu pa editar esta páxina CSS porque contien preferencies personales d'otru usuariu.",
        "customjsprotected": "Nun tienes permisu pa editar esta páxina de JavaScript porque contien preferencies personales d'otru usuariu.",
        "readonlywarning": "'''Avisu: La base de datos ta candada por mantenimientu, polo que nun vas poder guardar les tos ediciones nestos momentos.'''\nSeique habríes copiar y apegar el testu nun ficheru de testu y guardalu pa intentalo más sero.\n\nL'alministrador que la candó dio esta esplicación: $1",
        "protectedpagewarning": "'''Avisu: Esta páxina ta candada pa que sólo los alministradores puean editala.'''\nLa cabera entrada del rexistru s'ufre darréu pa referencia:",
        "semiprotectedpagewarning": "'''Nota:''' Esta páxina ta candada pa que nun puean editala namái que los usuarios rexistraos.\nLa cabera entrada del rexistru s'ufre darréu pa referencia:",
-       "cascadeprotectedwarning": "'''Avisu:''' Esta páxina ta candada pa que namái los alministradores puedan editala porque ta incluída {{PLURAL:$1|na siguiente páxina protexida|nes siguientes páxines protexíes}} en cascada:",
+       "cascadeprotectedwarning": "<strong>Avisu:</strong> Esta páxina ta candada pa que namái los alministradores puedan editala porque ta trescluída {{PLURAL:$1|na siguiente páxina protexida|nes siguientes páxines protexíes}} en cascada:",
        "titleprotectedwarning": "'''Avisu: Esta páxina ta candada pa que necesite [[Special:ListGroupRights|permisos especiales]] pa creala.'''\nLa cabera entrada del rexistru s'ufre darréu pa referencia:",
        "templatesused": "{{PLURAL:$1|Plantía usada|Plantíes usaes}} nesta páxina:",
        "templatesusedpreview": "{{PLURAL:$1|Plantía usada|Plantíes usaes}} nesta vista previa:",
        "protect-locked-blocked": "Nun pues camudar los niveles de proteición mentes teas bloquiáu. Esta\nye la configuración actual de la páxina '''$1''':",
        "protect-locked-dblock": "Los niveles de proteición nun puen ser camudaos pol mor d'un candáu activu de\nla base de datos. Esta ye la configuración actual de la páxina '''$1''':",
        "protect-locked-access": "La to cuenta nun tien permisu pa camudar los niveles de proteición de páxina.\nEsta ye la configuración actual pa la páxina '''$1''':",
-       "protect-cascadeon": "Esta páxina ta protexida nestos momentos porque ta incluída {{PLURAL:$1|na siguiente páxina, que tien|nes siguientes páxines, que tienen}} activada la proteición en cascada.\nLos cambios nel nivel de proteición d'esta páxina nun afeutarán a la proteición en cascada.",
+       "protect-cascadeon": "Esta páxina ta protexida nestos momentos porque ta trescluída {{PLURAL:$1|na siguiente páxina, que tien|nes siguientes páxines, que tienen}} activada la proteición en cascada.\nLos cambios nel nivel de proteición d'esta páxina nun afeutarán a la proteición en cascada.",
        "protect-default": "Permitir tolos usuarios",
        "protect-fallback": "Permitir namái usuarios con permisu \"$1\"",
        "protect-level-autoconfirmed": "Permitir namái usuarios autoconfirmaos",
        "htmlform-cloner-create": "Amestar más",
        "htmlform-cloner-delete": "Desaniciar",
        "htmlform-cloner-required": "Necesítase polo menos un valor.",
+       "htmlform-title-badnamespace": "[[:$1]] nun ta nel espaciu de nomes \"{{ns:$2}}\".",
+       "htmlform-title-not-creatable": "«$1» nun ye un títulu de páxina que pueda crease",
+       "htmlform-title-not-exists": "[[:$1]] nun esiste.",
+       "htmlform-user-not-exists": "<strong>$1</strong> nun esiste.",
+       "htmlform-user-not-valid": "<strong>$1</strong> nun ye un nome d'usuariu válidu.",
        "sqlite-has-fts": "$1 con sofitu pa busca de testu completu",
        "sqlite-no-fts": "$1 ensin sofitu pa busca de testu completu",
        "logentry-delete-delete": "$1 {{GENDER:$2|desanició}} la páxina $3",
index 585dcad..fd8a071 100644 (file)
        "log-description-contentmodel": "Падзеі, зьвязаныя з мадэлямі зьместу старонак",
        "logentry-contentmodel-change": "$1 {{GENDER:$2|зьмяніў|зьмяніла}} мадэль зьместу старонкі $3 з «$4» на «$5»",
        "logentry-contentmodel-change-revertlink": "адкаціць",
+       "logentry-contentmodel-change-revert": "адкат",
        "protectlogpage": "Журнал абаронаў",
        "protectlogtext": "Ніжэй пададзены сьпіс зьменаў абароны старонкі.\nГлядзіце [[Special:ProtectedPages|сьпіс абароненых старонак на цяперашні момант]].",
        "protectedarticle": "абароненая «[[$1]]»",
index b55d3e4..e39e8ce 100644 (file)
        "subject-preview": "Previsualización del asunto/encabezado:",
        "previewerrortext": "Se ha producido un error al intentar la vista previa de los cambios.",
        "blockedtitle": "El usuario está bloqueado",
-       "blockedtext": "<strong>Tu nombre de usuario o dirección IP ha sido bloqueada.</strong>\n\nEl bloqueo fue hecho por $1.\nLa razón dada es <em>$2</em>.\n\n* Inicio del bloqueo: $8\n* Caducidad del bloqueo: $6\n* Bloqueo destinado a: $7\n\nPuedes contactar a $1 o con otro de los [[{{MediaWiki:Grouppage-sysop}}|administradores]] para discutir el bloqueo.\nNo puedes utilizar la función «enviar correo electrónico a este usuario»  a menos que tengas una dirección de correo electrónico válida registrada en tus [[Special:Preferences|preferencias de usuario]] y que el bloqueo no haya inhabilitado esta función.\n\nTu dirección IP actual es $3, y el identificador del bloqueo es #$5.\nPor favor incluye todos los datos aquí mostrados en cualquier consulta que hagas.",
-       "autoblockedtext": "Tu dirección IP ha sido bloqueada automáticamente porque fue utilizada por otro usuario, que resultó bloqueado por $1.\n\nEl motivo dado es el siguiente:\n\n:<em>$2</em>\n\n* Inicio del bloqueo: $8\n* Caducidad del bloqueo: $6\n* Bloqueo destinado a: $7\n\nPuedes contactar con $1 o con otro de los [[{{MediaWiki:Grouppage-sysop}}|administradores]] para discutir el bloqueo.\n\nTen en cuenta que no podrás utilizar la herramienta de «enviar correo electrónico a este usuario» a menos que tengas una dirección de correo electrónico válida registrada en tus [[Special:Preferences|preferencias de usuario]] y la función no haya sido también bloqueada.\n\nTu dirección IP actual es $3, y el identificador del bloqueo es #$5.\nPor favor, incluye todos los datos aquí mostrados en cualquier consulta que hagas al respecto.",
+       "blockedtext": "<strong>Tu nombre de usuario o dirección IP ha sido bloqueada.</strong>\n\nEl bloqueo lo hizo $1.\nLa razón dada es <em>$2</em>.\n\n* Inicio del bloqueo: $8\n* Caducidad del bloqueo: $6\n* Bloqueo destinado a: $7\n\nPuedes contactar a $1 o con otro de los [[{{MediaWiki:Grouppage-sysop}}|administradores]] para discutir el bloqueo.\nNo puedes utilizar la función «enviar correo electrónico a este usuario» a menos que tengas una dirección de correo electrónico válida registrada en tus [[Special:Preferences|preferencias de usuario]] y la función no haya sido también bloqueada.\n\nTu dirección IP actual es $3, y el identificador del bloqueo es #$5.\nIncluye todos los datos aquí mostrados en cualquier consulta que hagas.",
+       "autoblockedtext": "Tu dirección IP ha sido bloqueada automáticamente porque fue utilizada por otro usuario, que resultó bloqueado por $1.\nEl motivo dado es el siguiente:\n\n:<em>$2</em>\n\n* Inicio del bloqueo: $8\n* Caducidad del bloqueo: $6\n* Bloqueo destinado a: $7\n\nPuedes contactar con $1 o con otro de los [[{{MediaWiki:Grouppage-sysop}}|administradores]] para discutir el bloqueo.\n\nTen en cuenta que no puedes utilizar la función «enviar correo electrónico a este usuario» a menos que tengas una dirección de correo electrónico válida registrada en tus [[Special:Preferences|preferencias de usuario]] y la función no haya sido también bloqueada.\n\nTu dirección IP actual es $3, y el identificador del bloqueo es #$5.\nIncluye todos los datos aquí mostrados en cualquier consulta que hagas.",
        "blockednoreason": "no se ha especificado el motivo",
        "whitelistedittext": "Tienes que $1 para editar páginas.",
        "confirmedittext": "Debes confirmar tu dirección de correo electrónico antes de poder editar páginas. Por favor, configura y confirma tu dirección de correo a través de tus [[Special:Preferences|preferencias de usuario]].",
        "largefileserver": "El tamaño de este archivo es mayor del que este servidor admite por configuración.",
        "emptyfile": "El archivo que has intentado subir parece estar vacío; por favor, verifica que realmente se trate del archivo que intentabas subir.",
        "windows-nonascii-filename": "Este wiki no admite nombres de archivo con caracteres especiales.",
-       "fileexists": "Ya existe un archivo con este nombre, por favor comprueba <strong>[[:$1]]</strong> si {{GENDER:|tú}} no estás seguro de querer cambiarlo.\n[[$1|thumb]]",
+       "fileexists": "Ya existe un archivo con este nombre. Comprueba <strong>[[:$1]]</strong> si {{GENDER:|tú}} no estás seguro de querer cambiarlo.\n[[$1|thumb]]",
        "filepageexists": "La página de descripción de este archivo ya ha sido creada en <strong>[[:$1]]</strong>, pero no existe actualmente ningún fichero con este nombre.\nEl resumen que ha ingresado no aparecerá en la página de descripción. Para que el sumario aparezca, deberá editarlo manualmente.\n[[$1|thumb]]",
        "fileexists-extension": "Existe un archivo con un nombre similar: [[$2|thumb]]\n* Nombre del archivo que se está subiendo: <strong>[[:$1]]</strong>\n* Nombre del archivo ya existente: <strong>[[:$2]]</strong>\n¿Quieres cambiar el nombre para que sea más distintivo?",
        "fileexists-thumbnail-yes": "El archivo parece ser una imagen de tamaño reducido ''(thumbnail)''. [[$1|thumb]]\nPor favor comprueba el archivo <strong>[[:$1]]</strong>.\nSi el archivo comprobado es la misma imagen a tamaño original no es necesario subir un thumbnail más.",
        "protect-expiring-local": "caduca el $1",
        "protect-expiry-indefinite": "indefinido",
        "protect-cascade": "Protección en cascada - proteger todas las páginas incluidas en ésta.",
-       "protect-cantedit": "No puedes cambiar el nivel de protección porque no tienes permiso para hacer ediciones.",
+       "protect-cantedit": "No puedes cambiar el nivel de protección de esta página porque no tienes permiso para editarla.",
        "protect-othertime": "Especificar caducidad:",
        "protect-othertime-op": "otra (especificar)",
        "protect-existing-expiry": "Fecha de caducidad actual: $2 a las $3",
        "file-no-thumb-animation": "'''Nota: debido a limitaciones técnicas, las miniaturas de este archivo no están animadas.'''",
        "file-no-thumb-animation-gif": "'''Nota: Debido a limitaciones técnicas, las miniaturas de imágenes GIF de alta resolución como esta no están animadas.'''",
        "newimages": "Galería de imágenes nuevas",
-       "imagelisttext": "Debajo hay una lista de '''$1''' {{PLURAL:$1|imagen|imágenes}} ordenadas $2.",
+       "imagelisttext": "Debajo hay una lista de <strong>$1</strong> {{PLURAL:$1|archivo ordenado|archivos ordenados}} $2.",
        "newimages-summary": "Esta página especial muestra una galería de los últimos archivos subidos.",
        "newimages-legend": "Nombre del fichero",
        "newimages-label": "Nombre del fichero (o una parte):",
        "noimages": "No hay nada que ver.",
        "ilsubmit": "Buscar",
        "bydate": "por fecha",
-       "sp-newimages-showfrom": "Mostrar nuevas imágenes empezando por $2, $1",
+       "sp-newimages-showfrom": "Mostrar archivos nuevos empezando desde $2, $1",
        "seconds-abbrev": "$1s",
        "minutes-abbrev": "$1m",
        "hours-abbrev": "$1h",
        "htmlform-title-badnamespace": "[[:$1]] no está en el espacio de nombres \"{{ns:$2}}\".",
        "htmlform-title-not-creatable": "\"$1\" no es un título de página que se pueda crear",
        "htmlform-title-not-exists": "[[:$1]] no existe.",
+       "htmlform-user-not-exists": "<strong>$1</strong> no existe.",
+       "htmlform-user-not-valid": "<strong>$1</strong> no es un nombre de usuario válido.",
        "sqlite-has-fts": "$1 con soporte para búsqueda de texto completo",
        "sqlite-no-fts": "$1 sin soporte para búsqueda de texto completo",
        "logentry-delete-delete": "$1 {{GENDER:$2|borró}} la página «$3»",
index 6aabe74..ff936ad 100644 (file)
        "readonlywarning": "'''Hoiatus: Andmebaas on lukustatud hooldustöödeks, nii et praegu ei saa parandusi salvestada.'''\nVõid teksti hilisemaks kasutamiseks alles hoida tekstifailina.\n\nAdministraator, kes andmebaasi lukustas, andis järgmise selgituse: $1",
        "protectedpagewarning": "'''Hoiatus: See lehekülg on lukustatud, nii et ainult administraatori õigustega kasutajad saavad seda redigeerida.'''\nAllpool on toodud uusim logisissekanne:",
        "semiprotectedpagewarning": "'''Märkus:''' See lehekülg on lukustatud, nii et üksnes registreeritud kasutajad saavad seda muuta.\nAllpool on toodud uusim logisissekanne:",
-       "cascadeprotectedwarning": "'''Hoiatus:''' See lehekülg on nii lukustatud, et ainult administraatori õigustega kasutajad saavad seda redigeerida, sest lehekülg on osa {{PLURAL:$1|järgmisest|järgmisest}} kaskaadkaitsega {{PLURAL:$1|leheküljest|lehekülgedest}}:",
+       "cascadeprotectedwarning": "<strong>Hoiatus:</strong> See lehekülg on nii lukustatud, et ainult administraatori õigustega kasutajad saavad seda redigeerida, sest lehekülg on osa {{PLURAL:$1|järgmisest|järgmistest}} kaskaadkaitsega {{PLURAL:$1|leheküljest|lehekülgedest}}:",
        "titleprotectedwarning": "'''Hoiatus: See lehekülg on nii lukustatud, et selle loomiseks on tarvis [[Special:ListGroupRights|eriõigusi]].'''\nAllpool on toodud uusim logisissekanne:",
        "templatesused": "Sellel leheküljel on kasutusel {{PLURAL:$1|järgmine mall|järgmised mallid}}:",
        "templatesusedpreview": "Eelvaates {{PLURAL:$1|kasutatav mall|kasutatavad mallid}}:",
        "rollback-success": "Tühistati muudatused, mille tegi $1;\npöörduti tagasi viimasele muudatusele, mille tegi $2.",
        "sessionfailure-title": "Seansiviga",
        "sessionfailure": "Sinu sisselogimisseansiga näib probleem olevat.\nSee toiming on seansiärandamise vastase ettevaatusabinõuna tühistatud.\nMine tagasi eelmisele leheküljele ja taaslaadi see, seejärel proovi uuesti.",
+       "changecontentmodel": "Lehekülje sisumudeli muutmine",
+       "changecontentmodel-legend": "Sisumudeli muutmine",
+       "changecontentmodel-title-label": "Lehekülje pealkiri",
+       "changecontentmodel-model-label": "Uus sisumudel",
+       "changecontentmodel-reason-label": "Põhjus:",
+       "changecontentmodel-success-title": "Sisumudel on muudetud",
+       "changecontentmodel-success-text": "Lehekülje [[:$1]] sisumudel on muudetud.",
+       "changecontentmodel-cannot-convert": "Lehekülje [[:$1]] sisumudelit ei saa teisendada tüübiks $2.",
+       "changecontentmodel-title-cantexist": "Lehekülg ei saa olla pealkirja \"$1\" all.",
+       "changecontentmodel-nodirectediting": "Sisumudel $1 ei võimalda otseredigeerimist.",
+       "log-name-contentmodel": "Sisumudeli muutmislogi",
+       "log-description-contentmodel": "Lehekülje sisumudelite muutmisega seotud sündmused",
+       "logentry-contentmodel-change": "$1 {{GENDER:$2|muutis}} lehekülje \"$3\" sisumudeli: \"$4\" → \"$5\"",
+       "logentry-contentmodel-change-revertlink": "võta tagasi",
+       "logentry-contentmodel-change-revert": "tagasi võetud",
        "protectlogpage": "Kaitsmislogi",
        "protectlogtext": "Allpool on loetletud lehekülgede kaitsetasemete muutmised. Praegu kaitstud lehekülgi vaata [[Special:ProtectedPages|kaitstud lehtede loetelust]].",
        "protectedarticle": "kaitses lehekülje \"[[$1]]\"",
        "tooltip-pt-logout": "Logi välja",
        "tooltip-pt-createaccount": "See pole küll kohustuslik, aga sul tasub konto luua ja sisse logida.",
        "tooltip-ca-talk": "Arutelu selle lehekülje sisu kohta",
-       "tooltip-ca-edit": "Sa saad seda lehekülge muuta. Palun kasuta enne salvestamist eelvaadet.",
+       "tooltip-ca-edit": "Muuda seda lehekülge",
        "tooltip-ca-addsection": "Lisa uus alaosa",
        "tooltip-ca-viewsource": "See lehekülg on kaitstud.\nSaad vaadata selle lähteteksti.",
        "tooltip-ca-history": "Selle lehekülje varasemad redaktsioonid",
        "pageinfo-robot-index": "Lubatud",
        "pageinfo-robot-noindex": "Keelatud",
        "pageinfo-watchers": "Lehekülje jälgijate arv",
+       "pageinfo-visiting-watchers": "Viimaseid muudatusi külastanud jälgijate arv",
        "pageinfo-few-watchers": "Alla {{PLURAL:$1|ühe jälgija|$1 jälgija}}",
+       "pageinfo-few-visiting-watchers": "Pole kindel, kas jälgijatest keegi külastab viimaseid muudatusi.",
        "pageinfo-redirects-name": "Sellele leheküljele suunatud lehekülgi",
        "pageinfo-subpages-name": "Selle lehekülje alamlehekülgi",
        "pageinfo-subpages-value": "$1 ($2 {{PLURAL:$2|ümbersuunamine|ümbersuunamist}}; $3 {{PLURAL:$3|mitteümbersuunamine|mitteümbersuunamist}})",
        "htmlform-cloner-create": "Lisa veel",
        "htmlform-cloner-delete": "Eemalda",
        "htmlform-cloner-required": "Vähemalt üks väärtus on nõutav.",
+       "htmlform-title-badnamespace": "[[:$1]] pole nimeruumis \"{{ns:$2}}\".",
+       "htmlform-title-not-creatable": "Pealkirja \"$1\" all ei saa lehekülge alustada.",
+       "htmlform-title-not-exists": "Lehekülge [[:$1]] pole olemas.",
+       "htmlform-user-not-exists": "Kasutajat <strong>$1</strong> pole olemas.",
+       "htmlform-user-not-valid": "<strong>$1</strong> pole sobiv kasutajanimi.",
        "sqlite-has-fts": "$1 koos täistekstiotsingu toega",
        "sqlite-no-fts": "$1 ilma täistekstiotsingu toeta",
        "logentry-delete-delete": "$1 {{GENDER:$2|kustutas}} lehekülje $3",
index 9967cff..5afd8b3 100644 (file)
        "htmlform-title-badnamespace": "[[:$1]] در فضای نام \"{{ns:$2}}\"  موجود نیست.",
        "htmlform-title-not-creatable": "\"$1\" عنوان قابل ایجاد نیست",
        "htmlform-title-not-exists": "[[:$1]] وجود ندارد.",
+       "htmlform-user-not-exists": "<strong>$1</strong> وجود ندارد.",
+       "htmlform-user-not-valid": "حساب کاربری <strong>$1</strong> معتبر نیست.",
        "sqlite-has-fts": "$1 با پشتیبانی از جستجو در متن کامل",
        "sqlite-no-fts": "$1 بدون پشتیبانی از جستجو در متن کامل",
        "logentry-delete-delete": "$1 صفحهٔ $3 را {{GENDER:$2|حذف کرد}}",
index 86eac92..cc8537a 100644 (file)
        "searchrelated": "samankaltainen",
        "searchall": "kaikki",
        "showingresults": "Alla on vain {{PLURAL:$1|<strong>1</strong> hakutulos|<strong>$1</strong> hakutulosta}} alkaen tuloksesta nro <strong>$2</strong>.",
-       "showingresultsinrange": "Alla näytetään {{PLURAL:$1|<strong>1</strong> tulos|<strong>$1</strong> tulosta}} väliltä <strong>$2</strong> – <strong>$3</strong>.",
+       "showingresultsinrange": "Alla näytetään {{PLURAL:$1|<strong>1</strong> tulos|<strong>$1</strong> tulosta}} väliltä <strong>$2</strong><strong>$3</strong>.",
        "search-showingresults": "{{PLURAL:$4|Tulos <strong>$1</strong> enimmäismäärästä <strong>$3</strong>|Tulokset <strong>$1 – $2</strong> enimmäismäärästä <strong>$3</strong>}}",
        "search-nonefound": "Hakusi ei tuottanut tulosta.",
        "powersearch-legend": "Laajennettu haku",
index 239aa3a..d6ab4d8 100644 (file)
        "htmlform-title-badnamespace": "[[:$1]] n'est pas dans l'espace de noms \"{{ns:$2}}\" .",
        "htmlform-title-not-creatable": "\"$1\" n'est pas un titre de page réalisable",
        "htmlform-title-not-exists": "[[:$1]] n’existe pas",
+       "htmlform-user-not-exists": "<strong>$1</strong> n’existe pas.",
+       "htmlform-user-not-valid": "<strong>$1</strong> n’est pas un nom d’utilisateur valide.",
        "sqlite-has-fts": "$1 avec recherche en texte intégral supportée",
        "sqlite-no-fts": "$1 sans recherche en texte intégral supportée",
        "logentry-delete-delete": "$1 {{GENDER:$2|a supprimé}} la page $3",
index 656f423..1093f27 100644 (file)
        "htmlform-title-badnamespace": "[[:$1]] אינו במרחב השם \"{{ns:$2}}\".",
        "htmlform-title-not-creatable": "\"$1\" אינו שם של דף שאפשר ליצור",
        "htmlform-title-not-exists": "[[:$1]] אינו קיים.",
+       "htmlform-user-not-exists": "<strong>$1</strong> אינו קיים.",
+       "htmlform-user-not-valid": "<strong>$1</strong> אינו שם משתמש תקין.",
        "sqlite-has-fts": "$1 עם תמיכה בחיפוש בטקסט מלא",
        "sqlite-no-fts": "$1 ללא תמיכה בחיפוש בטקסט מלא",
        "logentry-delete-delete": "$1 {{GENDER:$2|מחק|מחקה}} את הדף $3&rlm;",
index d2fb581..ebb128f 100644 (file)
        "htmlform-cloner-required": "Mindestens ee Wäert ass obligatoresch.",
        "htmlform-title-badnamespace": "[[:$1]] ass net am Nummraum \"{{ns:$2}}\".",
        "htmlform-title-not-exists": "[[:$1]] gëtt et net.",
+       "htmlform-user-not-exists": "<strong>$1</strong> gëtt et net.",
+       "htmlform-user-not-valid": "<strong>$1</strong> ass kee valabele Benotzernumm.",
        "sqlite-has-fts": "$1 ënnerstëtzt d'Volltextsich",
        "sqlite-no-fts": "$1 ënnerstëtzt d'Volltextsich net",
        "logentry-delete-delete": "$1 {{GENDER:$2|huet}} d'Säit $3 geläscht",
index a11fbb5..5a10de5 100644 (file)
        "protectedinterface": "Šiame puslapyje yra apsaugotas nuo piktnaudžiavimo programinės įrangos sąsajos tekstas. Norėdami pridėti ar pakeisti vertimus visose wiki, naudokite [//translatewiki.net/ translatewiki.net] MediaWiki vertimų projektą.",
        "editinginterface": "'''Dėmesio:''' Jūs redaguojate puslapį, kuris yra naudojamas programinės įrangos sąsajos tekste. Pakeitimai šiame puslapyje taip pat pakeis naudotojo sąsajos išvaizdą ir kitiems naudotojams šiame wiki.",
        "translateinterface": "Kad pridėtumėte vertimus visoms wiki, naudokitės  [//translatewiki.net/ translatewiki.net] – projektu, skirtu MediaWiki vertimams į vietines kalbas.",
-       "cascadeprotected": "Šis puslapis buvo apsaugotas nuo redagavimo, kadangi jis yra įtrauktas į {{PLURAL:$1|šį puslapį, apsaugotą|šiuos puslapius, apsaugotus}} „pakopinės apsaugos“ pasirinktimi:\n$2",
+       "cascadeprotected": "Šis puslapis buvo apsaugotas nuo redagavimo, kadangi jis yra įtrauktas į {{PLURAL:$1|šį puslapį, kuris yra apsaugotas|šiuos puslapius, kurie yra apsaugoti}} su „pakopinės apsaugos“ parinktimi:\n$2",
        "namespaceprotected": "Jūs neturite teisės redaguoti puslapių '''$1''' srityje.",
        "customcssprotected": "Jūs neturite teisės keisti šį CSS puslapį, nes jame yra kito naudotojo asmeniniai nustatymai.",
        "customjsprotected": "Jūs neturite teisės keisti šį JavaScript puslapį, nes jame yra kito naudotojo asmeniniai nustatymai.",
        "creating": "Kuriama $1",
        "editingsection": "Taisomas $1 (skyrelis)",
        "editingcomment": "Taisomas $1 (naujas skyrius)",
-       "editconflict": "Jūsų pakeitimai negali būti įrašyti dėl redagavimo konflikto. Ar norite išspręsti konfliktą rankiniu būdu?",
+       "editconflict": "Redaguoti konfliktą: $1",
        "explainconflict": "Kažkas kitas jau pakeitė puslapį nuo tada, kai jūs pradėjote jį redaguoti.\nViršutiniame tekstiniame lauke pateikta šiuo metu esanti puslapio versija.\nJūsų keitimai pateikti žemiau esančiame lauke.\nJums reikia sujungti jūsų pakeitimus su esančia versija.\nKai paspausite „{{int:savearticle}}“, bus įrašytas '''tik''' tekstas viršutiniame tekstiniame lauke.",
        "yourtext": "Jūsų tekstas",
        "storedversion": "Išsaugota versija",
        "readonlywarning": "'''Įspėjimas: Duomenų bazė buvo užrakinta techninei profilaktikai, todėl šiuo metu negalėsite išsaugoti savo pakeitimų. Siūlome nusikopijuoti tekstą į tekstinį failą ir vėliau jį čia išsaugoti.'''\n\nJą užrakinusio administratoriaus paaiškinimas: $1",
        "protectedpagewarning": "'''Dėmesio: Šis puslapis yra užrakintas taip, kad jį redaguoti gali tik administratoriaus teises turintys naudotojai.'''\nNaujausias įrašas žurnale yra pateiktas žemiau:",
        "semiprotectedpagewarning": "'''Pastaba:''' Šis puslapis buvo užrakintas, jį gali redaguoti tik registruoti naudotojai.\nNaujausias įrašas žurnale yra pateiktas žemiau:",
-       "cascadeprotectedwarning": "'''Dėmesio''': Šis puslapis buvo užrakintas taip, kad tik naudotojai su administratoriaus teisėmis galėtų jį redaguoti, nes jis yra įtrauktas į {{PLURAL:$1|šį puslapį, apsaugotą|šiuos puslapius, apsaugotus}} „pakopinės apsaugos“ pasirinktimi:",
+       "cascadeprotectedwarning": "<strong>Dėmesio:</strong> Šis puslapis buvo užrakintas taip, kad tik naudotojai su administratoriaus teisėmis galėtų jį redaguoti, nes jis yra įtrauktas į {{PLURAL:$1|šį puslapį, apsaugotą|šiuos puslapius, apsaugotus}} „pakopinės apsaugos“ pasirinktimi:",
        "titleprotectedwarning": "'''Dėmesio: Šis puslapis buvo užrakintas taip, kad tik [[Special:ListGroupRights|kai kurie naudotojai]] galėtų jį sukurti.'''\nNaujausias įrašas žurnale yra pateiktas žemiau:",
        "templatesused": "{{PLURAL:$1|Šablonas|Šablonai}}, naudojami puslapyje:",
        "templatesusedpreview": "{{PLURAL:$1|Šablonas|Šablonai}}, naudoti šioje peržiūroje:",
        "changecontentmodel-nodirectediting": "$1 turinio modelis nepalaiko tiesioginio redagavimo",
        "log-name-contentmodel": "Turinio modelio kaitos istorija",
        "log-description-contentmodel": "Įvykiai susiję su puslapio turinio modeliu",
-       "logentry-contentmodel-change": "$1 atnaujino puslapio $3 turinio modelį iš $4 į $5",
+       "logentry-contentmodel-change": "$1 {{GENDER:$2|atnaujino}} puslapio $3 turinio modelį iš $4 į $5",
        "logentry-contentmodel-change-revertlink": "atšaukti",
        "logentry-contentmodel-change-revert": "atšaukti",
        "protectlogpage": "Rakinimų sąrašas",
        "protect-locked-blocked": "Jūs negalite keisti apsaugos lygių, kol esate užbluokuotas.\nČia yra dabartiniai nustatymai puslapiui '''$1''':",
        "protect-locked-dblock": "Apsaugos lygiai negali būti pakeisti dėl duomenų bazės užrakinimo.\nČia yra dabartiniai nustatymai puslapiui '''$1''':",
        "protect-locked-access": "Jūsų paskyra neturi teisių keisti puslapių apsaugos lygių.\nČia yra dabartiniai nustatymai puslapiui '''$1''':",
-       "protect-cascadeon": "Šis puslapis dabar yra apsaugotas, nes jis yra įtrauktas į {{PLURAL:$1|šį puslapį, apsaugotą|šiuos puslapius, apsaugotus}} „pakopinės apsaugos“ pasirinktimi. Jūs galite pakeisti šio puslapio apsaugos lygį, bet tai nepaveiks pakopinės apsaugos.",
+       "protect-cascadeon": "Šis puslapis dabar yra apsaugotas, nes jis yra įtrauktas į {{PLURAL:$1|šį puslapį, apsaugotą|šiuos puslapius, apsaugotus}} „pakopinės apsaugos“ parinktimi.\nPuslapio apsaugos lygių pakeitimai neturės poveikio pakopinei apsaugai.",
        "protect-default": "Leisti visiems naudotojams",
        "protect-fallback": "Reikalauti „$1“ teisės",
        "protect-level-autoconfirmed": "Blokuoti naujai prisiregistravusius ir neregistruotus naudotojus",
        "pageinfo-robot-index": "Leidžiama",
        "pageinfo-robot-noindex": "Neleidžiama",
        "pageinfo-watchers": "Puslapio stebėtojų skaičius",
-       "pageinfo-visiting-watchers": "Skaičius puslapio stebėtojų, lankančių pastaruosius pakeitimus",
+       "pageinfo-visiting-watchers": "Skaičius puslapio stebėtojų, kurie aplankė pastaruosius pakeitimus",
        "pageinfo-few-watchers": "Mažiau nei $1 {{PLURAL:$1|stebėtojas|stebėtojų}}",
        "pageinfo-few-visiting-watchers": "Gali būti arba nebūti stebėtojų, lankančių pastaruosius pakeitimus",
        "pageinfo-redirects-name": "Nukreipimai į šį puslapį",
        "htmlform-cloner-create": "Pridėti dar",
        "htmlform-cloner-delete": "Pašalinti",
        "htmlform-cloner-required": "Bent viena reikšmė būtina.",
+       "htmlform-title-badnamespace": "[[:$1]] nėra \"{{ns:$2}}\" vardų srityje.",
+       "htmlform-title-not-creatable": "\"$1\" nėra tinkamas sukūrimui puslapio pavadinimas",
+       "htmlform-title-not-exists": "[[:$1]] neegzistuoja.",
+       "htmlform-user-not-exists": "<strong>$1</strong> neegzistuoja.",
+       "htmlform-user-not-valid": "<strong>$1</strong> nėra tinkamas naudotojo vardas.",
        "sqlite-has-fts": "$1 su visatekstės paieškos palaikymu",
        "sqlite-no-fts": "$1 be visatekstės paieškos palaikymo",
        "logentry-delete-delete": "$1 {{GENDER:$2|ištrynė}} puslapį $3",
index 07b93dc..c8dec2a 100644 (file)
        "htmlform-title-badnamespace": "[[:$1]] не се наоѓа во именскиот простор „{{ns:$2}}“.",
        "htmlform-title-not-creatable": "Насловот „$1“ не може да се создава",
        "htmlform-title-not-exists": "[[:$1]] не постои.",
+       "htmlform-user-not-exists": "<strong>$1</strong> не постои.",
+       "htmlform-user-not-valid": "<strong>$1</strong> не претставува важечко корисничко име.",
        "sqlite-has-fts": "$1 со поддршка за пребарување по цели текстови",
        "sqlite-no-fts": "$1 без поддршка за пребарување по цели текстови",
        "logentry-delete-delete": "$1 {{GENDER:$2|ја избриша}} страницата $3",
index 05ef25d..ef2c4a0 100644 (file)
        "htmlform-cloner-create": "കൂടുതൽ ചേർക്കുക",
        "htmlform-cloner-delete": "നീക്കം ചെയ്യുക",
        "htmlform-cloner-required": "കുറഞ്ഞത് ഒരു വിലയെങ്കിലും നൽകിയിരിക്കണം.",
+       "htmlform-title-badnamespace": "[[:$1]] ഉള്ളത് \"{{ns:$2}}\" നാമമേഖലയിലല്ല.",
+       "htmlform-title-not-creatable": "\"$1\" സൃഷ്ടിക്കാനാവുന്ന തലക്കെട്ടല്ല.",
+       "htmlform-title-not-exists": "[[:$1]] നിലവിലില്ല.",
+       "htmlform-user-not-exists": "<strong>$1</strong> നിലവിലില്ല.",
+       "htmlform-user-not-valid": "<strong>$1</strong> സാധുതയുള്ള ഉപയോക്തൃനാമമല്ല.",
        "sqlite-has-fts": "പൂർണ്ണ-എഴുത്ത് തിരച്ചിൽ പിന്തുണയുള്ള $1",
        "sqlite-no-fts": "പൂർണ്ണ-എഴുത്ത് തിരച്ചിൽ പിന്തുണയില്ലാത്ത $1",
        "logentry-delete-delete": "$3 എന്ന താൾ $1 {{GENDER:$2|മായ്ച്ചിരിക്കുന്നു}}",
index 81bca69..90d1f90 100644 (file)
        "htmlform-title-badnamespace": "[[:$1]] nun è dint'a lu namespace \"{{ns:$2}}\".",
        "htmlform-title-not-creatable": "\"$1\" nun è nu titolo criabbele 'e paggena",
        "htmlform-title-not-exists": "[[:$1]] nun esiste.",
+       "htmlform-user-not-exists": "<strong>$1</strong> nun esiste.",
+       "htmlform-user-not-valid": "<strong>$1</strong> nun è nu nomme buono.",
        "sqlite-has-fts": "$1 cu supporto 'e ricerche full-text",
        "sqlite-no-fts": "$1 senza supporto 'e ricerche full-text",
        "logentry-delete-delete": "$1 {{GENDER:$2|scancellaje}} 'a paggena $3",
index e6952c3..b207f10 100644 (file)
        "yourdiff": "Diferense",
        "copyrightwarning": "Che a ten-a për piasì da ment che tute le contribussion a {{SITENAME}} as consìdero dàite sota a na licensa ëd la sòrt $2 (che a varda $1 për avèj pì 'd detaj).\nSe a veul nen che sò test a peula esse modificà e distribuì da qualsëssìa përson-a sensa gnun-a limitassion ëd gnun-a sòrt, che a lo buta pa ambelessì.<br />\nËn mandand ës test-sì chiel as fa garant sota soa responsabilità che ël test a l'ha scrivusslo despërchiel, ò pura che a l'ha tracopialo da na sorgiss ëd pùblich domini, ò da n'àutra sorgiss dla midema sòrt.\n'''Anserì mai dël material coatà da drit d'autor sensa avèj n'autorisassion për felo!'''",
        "copyrightwarning2": "Për piasì, che a ten-a da ment che tute le contribussion a {{SITENAME}} a peulo esse modificà ò scancelà da d'àutri contributor. Se a veul nen che lòn che a scriv a ven-a modificà sensa limitassion ëd gnun-a sòrt, che a lo manda nen ambelessì.<br />\nAnt l'istess temp, ën mandand dël material un as pija la responsabilità dë dì che a l'ha scrivusslo daspërchiel, ò pura che a l'ha copialo da na sorgiss ëd domini pùblich, ò pura da 'nt n'àutra sorgiss dla midema sòrt (che a varda $1 për avèj pì d'anformassion).\n'''Che a manda pa dël material coata da drit d'autor sensa avèj avù ël përmess ëd felo!'''",
+       "editpage-cannot-use-custom-model": "Ël model ëd contnù ëd sa pàgina a peul nen esse modificà.",
        "longpageerror": "'''EROR: Ël test che a l'ha mandà a l'é longh {{PLURAL:$1|un kilobyte|$1 kilobytes}}, che a resta pì che ël lìmit màssim {{PLURAL:$2|d'un kilobyte|ëd $2 kilobyte}}.''' Parèj as peul pa salvesse.",
        "readonlywarning": "'''Avis: La base ëd dat a l'é stàita blocà për manutension, e donca a podrà pa salvesse soe modìfiche tut sùbit.'''\nA peul esse che a-j ven-a còmod copiesse via sò test e ancoless-lo an n'archivi ëd test e goernelo për pi tard.\n\nL'aministrator che a l'ha fàit ël blocagi a l'ha dàit costa spiegassion: $1",
        "protectedpagewarning": "'''Avis: costa pàgina-sì a l'é stàita protegiùa an manera che mach j'utent con la qualìfica da aministrator a peulo feje dle modìfiche.'''\nL'ùltima vos dël registr a l'é smonùa sì-sota për arferiment:",
        "semiprotectedpagewarning": "'''Nòta:''' Costa pàgina-sì a l'é stàita blocà an manera che mach j'utent registrà a peulo modifichela.\nL'ùltima vos dël registr a l'é smonùa sì-sota për arferiment:",
-       "cascadeprotectedwarning": "'''Tension:''' Sta pàgina a l'é stàita blocà an manera che mach j'utent con la qualìfica da aministrator a peulo modifichela, për via che a l'é comprèisa an {{PLURAL:$1|costa pàgina-sì|an coste pàgine-sì}} ch'a l'han ël sistema ëd protession a cascada:",
+       "cascadeprotectedwarning": "<strong>Tension:</strong> Sta pàgina a l'é stàita blocà an manera che mach j'utent con la qualìfica da aministrator a peulo modifichela, për via che a l'é comprèisa an {{PLURAL:$1|costa pàgina-sì|an coste pàgine-sì}} ch'a l'han ël sistema ëd protession a cascada:",
        "titleprotectedwarning": "'''Avis: sta pàgina-sì a l'é stàita blocà an manera che a-i é dabzògn ëd [[Special:ListGroupRights|drit specìfich]] për creela.'''\nL'ùltima vos dël registr a l'é smonùa sì-sota për arferiment:",
        "templatesused": "{{PLURAL:$1|Stamp}} dovrà da costa pàgina-sì:",
        "templatesusedpreview": "{{PLURAL:$1|Stamp}} dovrà an costa preuva:",
        "content-model-css": "CSS",
        "content-json-empty-object": "Oget veuid",
        "content-json-empty-array": "Tàula veuida",
+       "duplicate-args-warning": "<strong>Atension:</strong> [[:$1]] a arciama [[:$2]] con pe che un valor për ël paràmeter \"$3\". Mach l'ùltim valor fornì a sarà dovrà.",
        "duplicate-args-category": "Pàgine ch'a deuvro d'argoment dobi ant j'arceste dë stamp",
        "duplicate-args-category-desc": "La pàgina a conten cj'arceste dë stamp che deuvro ëd duplicà d'argoment, tanme <code><nowiki>{{foo|bar=1|bar=2}}</nowiki></code> o <code><nowiki>{{foo|bar|1=baz}}</nowiki></code>.",
        "expensive-parserfunction-warning": "'''Atension:''' Costa pàgina a l'ha tròpe ciamà costose a le fonsions d'anàlisi sintàtica.\n\nA dovrìa essnie men che {{PLURAL:$2|$2}}, adess a-i na j'é {{PLURAL:$1|$1}}.",
        "badsig": "Soa firma a l'é nen giusta, che a controla j'istrussion HTML.",
        "badsiglength": "Sò stranòm a l'é tròp longh.\nA deuv nen esse pì longh che $1 {{PLURAL:$1|caràter|caràter}}.",
        "yourgender": "'Me ch'a preferiss esse descrivù?",
-       "gender-unknown": "I preferisso nen dilo",
+       "gender-unknown": "Cand a parlërà ëd chiel, ël programa a dovrërà dle paròle ëd géner neutral, s'a l'é possìbil",
        "gender-male": "Chiel a modìfica dle pàgine dla wiki",
        "gender-female": "Chila a modìfica dle pàgine dla wiki",
        "prefs-help-gender": "Definì coste preferense a l'é opsional.\nËl programa a deuvra sò valor për adressesse a chiel e massionelo a j'àutri an dovrand ël géner gramatical giust.\nCosta anformassion a sarà pùblica.",
        "uploaddisabledtext": "La possibilità ëd carié dj'archivi a l'é staita disabilità.",
        "php-uploaddisabledtext": "Ij cariament d'archivi a son disabilità an PHP.\nPër piasì, ch'a controla l'ampostassion file_uploads.",
        "uploadscripted": "St'archivi-sì a l'ha andrinta chèich-còs (dël còdes HTML ò pura un senari) che a podrìa esse travajà mal da chèich programa ëd navigassion.",
+       "upload-scripted-pi-callback": "Impossìbil carié n'archivi ch'a conten d'anstrussion ëd tratament ëd feuj dë stil XML.",
+       "uploaded-script-svg": "Element ëscrivìbil «$1» trovà ant l'archivi SVG carià.",
+       "uploaded-hostile-svg": "CSS nen sigur trovà ant l'element dë stil ëd n'archivi SVG carià.",
+       "uploaded-event-handler-on-svg": "Fissé dj'atribù ëd gestion d'eveniment <code>$1=\"$2\"</code> a l'é nen përmëttù ant j'archivi SVG.",
+       "uploaded-href-attribute-svg": "J'atribù <code>&lt;$1 $2=\"$3\"&gt;</code> con un bërsaj nen local (për esempi http://, javascript:, e via fòrt) a son nen përmëttù ant j'archivi SVG.",
+       "uploaded-href-unsafe-target-svg": "href ver un bërsaj nen sigur <code>&lt;$1 $2=\"$3\"&gt;</code> trovà ant l'archivi SVG carià.",
+       "uploaded-animate-svg": "Trovà na tichëtta «animate», ch'a podrìa modifiché ël href an dovrand l'atribù «from» <code>&lt;$1 $2=\"$3\"&gt;</code> ant l'archivi SVG carià.",
        "uploadscriptednamespace": "S'archivi SVG a conten në spassi nominal «$1» nen autorisà",
        "uploadinvalidxml": "L'XML ant l'archivi carià a l'ha nen podù esse analisà.",
        "uploadvirus": "St'archivi-sì a l'han andrinta un '''vìrus!''' Detaj: $1",
index 9ac28bb..c4fb1be 100644 (file)
        "htmlform-title-badnamespace": "[[:$1]] är inte i \"{{ns:$2}}\"-namnrymden.",
        "htmlform-title-not-creatable": "\"$1\" är inte en sidtitel som kan skapas",
        "htmlform-title-not-exists": "[[:$1]] finns inte.",
+       "htmlform-user-not-exists": "<strong>$1</strong> finns inte.",
+       "htmlform-user-not-valid": "<strong>$1</strong> är inte ett giltigt användarnamn.",
        "sqlite-has-fts": "$1 med stöd för fulltextsökning",
        "sqlite-no-fts": "$1 utan stöd för fulltextsökning",
        "logentry-delete-delete": "$1 {{GENDER:$2|raderade}} sidan $3",
index 81e8cb1..e34fc5c 100644 (file)
@@ -75,7 +75,8 @@
                        "Watermelon juice",
                        "Ömer Berkay",
                        "Demircimehmed",
-                       "Uğurkent"
+                       "Uğurkent",
+                       "Kincki"
                ]
        },
        "tog-underline": "Bağlantıların altını çiz:",
        "htmlform-cloner-required": "En az bir değer gereklidir.",
        "htmlform-title-not-creatable": "\"$1\"oluşturulabilir bir sayfa ismi değil.",
        "htmlform-title-not-exists": "[[:$1]] mevcut değil",
+       "htmlform-user-not-exists": "<strong>$1</strong> mevcut değil.",
+       "htmlform-user-not-valid": "<strong>$1</strong> geçerli bir kullanıcı ismi değildir.",
        "sqlite-has-fts": "$1 tam-metin arama desteği ile",
        "sqlite-no-fts": "$1 tam-metin arama desteği olmaksızın",
        "logentry-delete-delete": "$1 $3 sayfasını {{GENDER:$2|sildi}}",
index c6b0efe..9ae575c 100644 (file)
        "filedelete-submit": "Вилучити",
        "filedelete-success": "'''$1''' було вилучено.",
        "filedelete-success-old": "Версія '''[[Media:$1|$1]]''' від $3, $2 була вилучена.",
-       "filedelete-nofile": "Файл '''$1''' не існує.",
+       "filedelete-nofile": "<strong>$1</strong> не існує.",
        "filedelete-nofile-old": "Не існує архівної версії '''$1''' із зазначеними атрибутами.",
        "filedelete-otherreason": "Інша/додаткова причина:",
        "filedelete-reason-otherlist": "Інша причина",
        "htmlform-title-badnamespace": "[[:$1]] не в просторі назв «{{ns:$2}}».",
        "htmlform-title-not-creatable": "«$1» — назва сторінки, яку не можна створити",
        "htmlform-title-not-exists": "[[:$1]] не існує.",
+       "htmlform-user-not-exists": "<strong>$1</strong> не існує.",
+       "htmlform-user-not-valid": "<strong>$1</strong> не є дійсним іменем користувача.",
        "sqlite-has-fts": "$1 з підтримкою повнотекстового пошуку",
        "sqlite-no-fts": "$1 без підтримки повнотекстового пошуку",
        "logentry-delete-delete": "$1 {{GENDER:$2|вилучив|вилучила}} сторінку $3",
index 75dda9b..fa1931a 100644 (file)
        "htmlform-title-badnamespace": "[[:$1]]不在“{{ns:$2}}”名字空间中。",
        "htmlform-title-not-creatable": "“$1”不是一个可创建的页面标题",
        "htmlform-title-not-exists": "[[:$1]]不存在",
+       "htmlform-user-not-exists": "<strong>$1</strong>不存在。",
+       "htmlform-user-not-valid": "<strong>$1</strong>不是一个有效的用户名。",
        "sqlite-has-fts": "带全文搜索的版本$1",
        "sqlite-no-fts": "不带全文搜索的版本$1",
        "logentry-delete-delete": "$1{{GENDER:$2|删除}}页面$3",
index 760595d..bc9b314 100644 (file)
        "nopagetext": "您所指定的目標頁面並不存在。",
        "pager-newer-n": "較新 $1 筆",
        "pager-older-n": "較舊 $1 筆",
-       "suppress": "失職",
+       "suppress": "監督",
        "querypage-disabled": "此特殊頁面因考量效能問題已被停用。",
        "apihelp": "API 說明",
        "apihelp-no-such-module": "查無模組 \"$1\"。",
        "api-error-illegal-filename": "不允許使用的檔案名稱。",
        "api-error-internal-error": "內部錯誤:此 Wiki 在處理你的上傳時發生錯誤。",
        "api-error-invalid-file-key": "內部錯誤:於暫存儲存庫中查無檔案。",
-       "api-error-missingparam": "內部錯誤:請求缺少參數。",
+       "api-error-missingparam": "內部錯誤:請求缺少參數。",
        "api-error-missingresult": "內部錯誤:無法辨識複製是否成功。",
        "api-error-mustbeloggedin": "您必須登入方可上傳檔案。",
        "api-error-mustbeposted": "內部錯誤:請求需使用 HTTP POST。",
diff --git a/maintenance/migrateFileRepoLayout.php b/maintenance/migrateFileRepoLayout.php
new file mode 100644 (file)
index 0000000..78587ce
--- /dev/null
@@ -0,0 +1,232 @@
+<?php
+/**
+ * Copy all files in FileRepo to an originals container using SHA1 paths.
+ *
+ * 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 Maintenance
+ */
+
+require_once __DIR__ . '/Maintenance.php';
+
+/**
+ * Copy all files in FileRepo to an originals container using SHA1 paths.
+ *
+ * This script should be run while the repo is still set to the old layout.
+ *
+ * @ingroup Maintenance
+ */
+class MigrateFileRepoLayout extends Maintenance {
+       public function __construct() {
+               parent::__construct();
+               $this->mDescription = "Copy files in repo to a different layout.";
+               $this->addOption( 'oldlayout', "Old layout; one of 'name' or 'sha1'", true, true );
+               $this->addOption( 'newlayout', "New layout; one of 'name' or 'sha1'", true, true );
+               $this->addOption( 'since', "Copy only files from after this timestamp", false, true );
+               $this->setBatchSize( 50 );
+       }
+
+       public function execute() {
+               $oldLayout = $this->getOption( 'oldlayout' );
+               if ( !in_array( $oldLayout, array( 'name', 'sha1' ) ) ) {
+                       $this->error( "Invalid old layout.", 1 );
+               }
+               $newLayout = $this->getOption( 'newlayout' );
+               if ( !in_array( $newLayout, array( 'name', 'sha1' ) ) ) {
+                       $this->error( "Invalid new layout.", 1 );
+               }
+               $since = $this->getOption( 'since' );
+
+               $repo = $this->getRepo();
+
+               $be = $repo->getBackend();
+               if ( $be instanceof FileBackendDBRepoWrapper ) {
+                       $be = $be->getInternalBackend(); // avoid path translations for this script
+               }
+
+               $dbw = $repo->getMasterDB();
+
+               $origBase = $be->getContainerStoragePath( "{$repo->getName()}-original" );
+               $startTime = wfTimestampNow();
+
+               // Do current and archived versions...
+               $conds = array();
+               if ( $since ) {
+                       $conds[] = 'img_timestamp >= ' . $dbw->addQuotes( $dbw->timestamp( $since ) );
+               }
+
+               $batch = array();
+               $lastName = '';
+               do {
+                       $res = $dbw->select( 'image', array( 'img_name', 'img_sha1' ),
+                               array_merge( array( 'img_name > ' . $dbw->addQuotes( $lastName ) ), $conds ),
+                               __METHOD__,
+                               array( 'LIMIT' => $this->mBatchSize, 'ORDER BY' => 'img_name' )
+                       );
+
+                       foreach ( $res as $row ) {
+                               $lastName = $row->img_name;
+                               $sha1 = $row->img_sha1;
+                               if ( !strlen( $sha1 ) ) {
+                                       $this->error( "Image SHA-1 not set for {$row->img_name}." );
+                               } else {
+                                       $file = $repo->newFile( $row->img_name );
+
+                                       if ( $oldLayout === 'sha1' ) {
+                                               $spath = "{$origBase}/{$sha1[0]}/{$sha1[1]}/{$sha1[2]}/{$sha1}";
+                                       } else {
+                                               $spath = $file->getPath();
+                                       }
+
+                                       if ( $newLayout === 'sha1' ) {
+                                               $dpath = "{$origBase}/{$sha1[0]}/{$sha1[1]}/{$sha1[2]}/{$sha1}";
+                                       } else {
+                                               $dpath = $file->getPath();
+                                       }
+
+                                       $status = $be->prepare( array( 'dir' => dirname( $dpath ) ) );
+                                       if ( !$status->isOK() ) {
+                                               $this->error( print_r( $status->getErrorsArray(), true ) );
+                                       }
+
+                                       $batch[] = array( 'op' => 'copy', 'overwrite' => true,
+                                               'src' => $spath, 'dst' => $dpath, 'img' => $row->img_name );
+                               }
+
+                               foreach ( $file->getHistory() as $ofile ) {
+                                       $sha1 = $ofile->getSha1();
+                                       if ( !strlen( $sha1 ) ) {
+                                               $this->error( "Image SHA-1 not set for {$ofile->getArchiveName()}." );
+                                               continue;
+                                       }
+
+                                       if ( $oldLayout === 'sha1' ) {
+                                               $spath = "{$origBase}/{$sha1[0]}/{$sha1[1]}/{$sha1[2]}/{$sha1}";
+                                       } elseif ( $ofile->isDeleted( File::DELETED_FILE ) ) {
+                                               $spath = $be->getContainerStoragePath( "{$repo->getName()}-deleted" ) .
+                                                       '/' . $repo->getDeletedHashPath( $sha1 ) .
+                                                       $sha1 . '.' . $ofile->getExtension();
+                                       } else {
+                                               $spath = $ofile->getPath();
+                                       }
+
+                                       if ( $newLayout === 'sha1' ) {
+                                               $dpath = "{$origBase}/{$sha1[0]}/{$sha1[1]}/{$sha1[2]}/{$sha1}";
+                                       } else {
+                                               $dpath = $ofile->getPath();
+                                       }
+
+                                       $status = $be->prepare( array( 'dir' => dirname( $dpath ) ) );
+                                       if ( !$status->isOK() ) {
+                                               $this->error( print_r( $status->getErrorsArray(), true ) );
+                                       }
+                                       $batch[] = array( 'op' => 'copy', 'overwrite' => true,
+                                               'src' => $spath, 'dst' => $dpath, 'img' => $ofile->getArchiveName() );
+                               }
+
+                               if ( count( $batch ) >= $this->mBatchSize ) {
+                                       $this->runBatch( $batch, $be );
+                                       $batch = array();
+                               }
+                       }
+               } while ( $res->numRows() );
+
+               if ( count( $batch ) ) {
+                       $this->runBatch( $batch, $be );
+               }
+
+               // Do deleted versions...
+               $conds = array();
+               if ( $since ) {
+                       $conds[] = 'fa_deleted_timestamp >= ' . $dbw->addQuotes( $dbw->timestamp( $since ) );
+               }
+
+               $batch = array();
+               $lastId = 0;
+               do {
+                       $res = $dbw->select( 'filearchive', array( 'fa_storage_key', 'fa_id', 'fa_name' ),
+                               array_merge( array( 'fa_id > ' . $dbw->addQuotes( $lastId ) ), $conds ),
+                               __METHOD__,
+                               array( 'LIMIT' => $this->mBatchSize, 'ORDER BY' => 'fa_id' )
+                       );
+
+                       foreach ( $res as $row ) {
+                               $lastId = $row->fa_id;
+                               $sha1Key = $row->fa_storage_key;
+                               if ( !strlen( $sha1Key ) ) {
+                                       $this->error( "Image SHA-1 not set for file #{$row->fa_id} (deleted)." );
+                                       continue;
+                               }
+                               $sha1 = substr( $sha1Key, 0, strpos( $sha1Key, '.' ) );
+
+                               if ( $oldLayout === 'sha1' ) {
+                                       $spath = "{$origBase}/{$sha1[0]}/{$sha1[1]}/{$sha1[2]}/{$sha1}";
+                               } else {
+                                       $spath = $be->getContainerStoragePath( "{$repo->getName()}-deleted" ) .
+                                               '/' . $repo->getDeletedHashPath( $sha1Key ) . $sha1Key;
+                               }
+
+                               if ( $newLayout === 'sha1' ) {
+                                       $dpath = "{$origBase}/{$sha1[0]}/{$sha1[1]}/{$sha1[2]}/{$sha1}";
+                               } else {
+                                       $dpath = $be->getContainerStoragePath( "{$repo->getName()}-deleted" ) .
+                                               '/' . $repo->getDeletedHashPath( $sha1Key ) . $sha1Key;
+                               }
+
+                               $status = $be->prepare( array( 'dir' => dirname( $dpath ) ) );
+                               if ( !$status->isOK() ) {
+                                       $this->error( print_r( $status->getErrorsArray(), true ) );
+                               }
+
+                               $batch[] = array( 'op' => 'copy', 'src' => $spath, 'dst' => $dpath,
+                                       'overwriteSame' => true, 'img' => "(ID {$row->fa_id}) {$row->fa_name}" );
+
+                               if ( count( $batch ) >= $this->mBatchSize ) {
+                                       $this->runBatch( $batch, $be );
+                                       $batch = array();
+                               }
+                       }
+               } while ( $res->numRows() );
+
+               if ( count( $batch ) ) {
+                       $this->runBatch( $batch, $be );
+               }
+
+               $this->output( "Done (started $startTime)\n" );
+       }
+
+       protected function getRepo() {
+               return RepoGroup::singleton()->getLocalRepo();
+       }
+
+       protected function runBatch( array $ops, FileBackend $be ) {
+               $this->output( "Migrating file batch:\n" );
+               foreach ( $ops as $op ) {
+                       $this->output( "\"{$op['img']}\" (dest: {$op['dst']})\n" );
+               }
+
+               $status = $be->doOperations( $ops );
+               if ( !$status->isOK() ) {
+                       $this->output( print_r( $status->getErrorsArray(), true ) );
+               }
+
+               $this->output( "Batch done\n\n" );
+       }
+}
+
+$maintClass = 'MigrateFileRepoLayout';
+require_once RUN_MAINTENANCE_IF_MAIN;
diff --git a/resources/lib/mustache/LICENSE b/resources/lib/mustache/LICENSE
new file mode 100644 (file)
index 0000000..aa1b831
--- /dev/null
@@ -0,0 +1,10 @@
+The MIT License
+
+Copyright (c) 2009 Chris Wanstrath (Ruby)
+Copyright (c) 2010-2014 Jan Lehnardt (JavaScript)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
index 56b6811..16fd7ec 100644 (file)
 
        &:hover {
                // The inner bottom bevel should match the active background color.
-               box-shadow: 0 1px rgba(0, 0, 0, 10%), inset 0 -3px rgba(0, 0, 0, 20%);
-               border-bottom-color: @highlightColor;
+               background-color: @highlightColor;
        }
 
        &:focus {
-               border-color: rgba(0,0,0,0.2);
-               box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2);
+               border-color: @colorWhite;
+               box-shadow: 0 0 0 1px @highlightColor;
 
                outline: none;
                // remove outline in Firefox
                color: @colorButtonText;
        }
 
+       &:focus {
+               background-color: @highlightColor;
+       }
+
        &:disabled {
                color: @colorDisabledText;
 
index 0ce056f..43d8ce8 100644 (file)
@@ -204,9 +204,6 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                        while ( $this->db->trxLevel() > 0 ) {
                                $this->db->rollback();
                        }
-
-                       // don't ignore DB errors
-                       $this->db->ignoreErrors( false );
                }
 
                DeferredUpdates::clearPendingUpdates();
@@ -233,9 +230,6 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                        while ( $this->db->trxLevel() > 0 ) {
                                $this->db->rollback();
                        }
-
-                       // don't ignore DB errors
-                       $this->db->ignoreErrors( false );
                }
 
                // Restore mw globals
index 338d931..764560d 100644 (file)
@@ -68,25 +68,6 @@ class ORMTableTest extends MediaWikiTestCase {
                $this->assertInstanceOf( $class, $class::singleton() );
                $this->assertTrue( $class::singleton() === $class::singleton() );
        }
-
-       /**
-        * @since 1.21
-        */
-       public function testIgnoreErrorsOverride() {
-               $table = $this->getTable();
-
-               $db = $table->getReadDbConnection();
-               $db->ignoreErrors( true );
-
-               try {
-                       $table->rawSelect( "this is invalid" );
-                       $this->fail( "An invalid query should trigger a DBQueryError even if ignoreErrors is enabled." );
-               } catch ( DBQueryError $ex ) {
-                       $this->assertTrue( true, "just making phpunit happy" );
-               }
-
-               $db->ignoreErrors( false );
-       }
 }
 
 /**
diff --git a/tests/phpunit/includes/filerepo/FileBackendDBRepoWrapperTest.php b/tests/phpunit/includes/filerepo/FileBackendDBRepoWrapperTest.php
new file mode 100644 (file)
index 0000000..681e368
--- /dev/null
@@ -0,0 +1,138 @@
+<?php
+
+class FileBackendDBRepoWrapperTest extends MediaWikiTestCase {
+       protected $backendName = 'foo-backend';
+       protected $repoName = 'pureTestRepo';
+
+       /**
+        * @dataProvider getBackendPathsProvider
+        * @covers FileBackendDBRepoWrapper::getBackendPaths
+        */
+       public function testGetBackendPaths(
+               $mocks,
+               $latest,
+               $dbReadsExpected,
+               $dbReturnValue,
+               $originalPath,
+               $expectedBackendPath,
+               $message ) {
+               list( $dbMock, $backendMock, $wrapperMock ) = $mocks;
+
+               $dbMock->expects( $dbReadsExpected )
+                       ->method( 'selectField' )
+                       ->will( $this->returnValue( $dbReturnValue ) );
+
+               $newPaths = $wrapperMock->getBackendPaths( array( $originalPath ), $latest );
+
+               $this->assertEquals(
+                       $expectedBackendPath,
+                       $newPaths[0],
+                       $message );
+       }
+
+       public function getBackendPathsProvider() {
+               $prefix = 'mwstore://' . $this->backendName . '/' . $this->repoName;
+               $mocksForCaching = $this->getMocks();
+
+               return array(
+                       array(
+                               $mocksForCaching,
+                               false,
+                               $this->once(),
+                               '96246614d75ba1703bdfd5d7660bb57407aaf5d9',
+                               $prefix . '-public/f/o/foobar.jpg',
+                               $prefix . '-original/9/6/2/96246614d75ba1703bdfd5d7660bb57407aaf5d9',
+                               'Public path translated correctly',
+                       ),
+                       array(
+                               $mocksForCaching,
+                               false,
+                               $this->never(),
+                               '96246614d75ba1703bdfd5d7660bb57407aaf5d9',
+                               $prefix . '-public/f/o/foobar.jpg',
+                               $prefix . '-original/9/6/2/96246614d75ba1703bdfd5d7660bb57407aaf5d9',
+                               'LRU cache leveraged',
+                       ),
+                       array(
+                               $this->getMocks(),
+                               true,
+                               $this->once(),
+                               '96246614d75ba1703bdfd5d7660bb57407aaf5d9',
+                               $prefix . '-public/f/o/foobar.jpg',
+                               $prefix . '-original/9/6/2/96246614d75ba1703bdfd5d7660bb57407aaf5d9',
+                               'Latest obtained',
+                       ),
+                       array(
+                               $this->getMocks(),
+                               true,
+                               $this->never(),
+                               '96246614d75ba1703bdfd5d7660bb57407aaf5d9',
+                               $prefix . '-deleted/f/o/foobar.jpg',
+                               $prefix . '-original/f/o/o/foobar',
+                               'Deleted path translated correctly',
+                       ),
+                       array(
+                               $this->getMocks(),
+                               true,
+                               $this->once(),
+                               null,
+                               $prefix . '-public/b/a/baz.jpg',
+                               $prefix . '-public/b/a/baz.jpg',
+                               'Path left untouched if no sha1 can be found',
+                       ),
+               );
+       }
+
+       /**
+        * @covers FileBackendDBRepoWrapper::getFileContentsMulti
+        */
+       public function testGetFileContentsMulti() {
+               list( $dbMock, $backendMock, $wrapperMock ) = $this->getMocks();
+
+               $sha1Path = 'mwstore://' . $this->backendName . '/' . $this->repoName
+                       . '-original/9/6/2/96246614d75ba1703bdfd5d7660bb57407aaf5d9';
+               $filenamePath = 'mwstore://' . $this->backendName . '/' . $this->repoName
+                       . '-public/f/o/foobar.jpg';
+
+               $dbMock->expects( $this->once() )
+                       ->method( 'selectField' )
+                       ->will( $this->returnValue( '96246614d75ba1703bdfd5d7660bb57407aaf5d9' ) );
+
+               $backendMock->expects( $this->once() )
+                       ->method( 'getFileContentsMulti')
+                       ->will( $this->returnValue( array( $sha1Path => 'foo' ) ) );
+
+               $result = $wrapperMock->getFileContentsMulti( array( 'srcs' => array( $filenamePath ) ) );
+
+               $this->assertEquals(
+                       array( $filenamePath => 'foo' ),
+                       $result,
+                       'File contents paths translated properly'
+               );
+       }
+
+       protected function getMocks() {
+               $dbMock = $this->getMockBuilder( 'DatabaseMysql' )
+                       ->disableOriginalConstructor()
+                       ->getMock();
+
+               $backendMock = $this->getMock( 'FSFileBackend',
+                       array(),
+                       array( array(
+                               'name' => $this->backendName,
+                               'wikiId' => wfWikiId()
+                       ) ) );
+
+               $wrapperMock = $this->getMock( 'FileBackendDBRepoWrapper',
+                       array( 'getDB' ),
+                       array( array(
+                               'backend' => $backendMock,
+                               'repoName' => $this->repoName,
+                               'dbHandleFactory' => null
+                       ) ) );
+
+               $wrapperMock->expects( $this->any() )->method( 'getDB' )->will( $this->returnValue( $dbMock ) );
+
+               return array( $dbMock, $backendMock, $wrapperMock );
+       }
+}
diff --git a/tests/phpunit/includes/filerepo/MigrateFileRepoLayoutTest.php b/tests/phpunit/includes/filerepo/MigrateFileRepoLayoutTest.php
new file mode 100644 (file)
index 0000000..65db7e4
--- /dev/null
@@ -0,0 +1,114 @@
+<?php
+
+class MigrateFileRepoLayoutTest extends MediaWikiTestCase {
+       protected $tmpPrefix;
+       protected $migratorMock;
+       protected $tmpFilepath;
+       protected $text = 'testing';
+
+       protected function setUp() {
+               parent::setUp();
+
+               $filename = 'Foo.png';
+
+               $this->tmpPrefix = wfTempDir() . '/migratefilelayout-test-' . time() . '-' . mt_rand();
+
+               $backend = new FSFileBackend( array(
+                       'name' => 'local-migratefilerepolayouttest',
+                       'wikiId' => wfWikiID(),
+                       'containerPaths' => array(
+                               'migratefilerepolayouttest-original' => "{$this->tmpPrefix}-original",
+                               'migratefilerepolayouttest-public' => "{$this->tmpPrefix}-public",
+                               'migratefilerepolayouttest-thumb' => "{$this->tmpPrefix}-thumb",
+                               'migratefilerepolayouttest-temp' => "{$this->tmpPrefix}-temp",
+                               'migratefilerepolayouttest-deleted' => "{$this->tmpPrefix}-deleted",
+                       )
+               ) );
+
+               $dbMock = $this->getMockBuilder( 'DatabaseMysql' )
+                       ->disableOriginalConstructor()
+                       ->getMock();
+
+               $imageRow = new stdClass;
+               $imageRow->img_name = $filename;
+               $imageRow->img_sha1 = sha1( $this->text );
+
+               $dbMock->expects( $this->any() )
+                       ->method( 'select' )
+                       ->will( $this->onConsecutiveCalls(
+                               new FakeResultWrapper( array( $imageRow ) ), // image
+                               new FakeResultWrapper( array() ), // image
+                               new FakeResultWrapper( array() ) // filearchive
+                       ) );
+
+               $repoMock = $this->getMock( 'LocalRepo',
+                       array( 'getMasterDB' ),
+                       array( array(
+                               'name' => 'migratefilerepolayouttest',
+                               'backend' => $backend
+                       ) ) );
+
+               $repoMock->expects( $this->any() )->method( 'getMasterDB' )->will( $this->returnValue( $dbMock ) );
+
+               $this->migratorMock = $this->getMock( 'MigrateFileRepoLayout', array( 'getRepo' ) );
+               $this->migratorMock->expects( $this->any() )->method( 'getRepo' )->will( $this->returnValue( $repoMock ) );
+
+               $this->tmpFilepath = TempFSFile::factory( 'migratefilelayout-test-', 'png' )->getPath();
+
+               file_put_contents( $this->tmpFilepath, $this->text );
+
+               $hashPath = $repoMock->getHashPath( $filename );
+
+               $status = $repoMock->store( $this->tmpFilepath, 'public', $hashPath . $filename, FileRepo::OVERWRITE );
+       }
+
+       protected function deleteFilesRecursively( $directory ) {
+               foreach ( glob( $directory . '/*' ) as $file ) {
+               if ( is_dir( $file ) ) {
+                       $this->deleteFilesRecursively( $file );
+               } else {
+                       unlink( $file );
+               }
+               }
+
+               rmdir( $directory );
+       }
+
+       protected function tearDown() {
+       foreach ( glob( $this->tmpPrefix . '*' ) as $directory ) {
+               $this->deleteFilesRecursively( $directory );
+       }
+
+       unlink( $this->tmpFilepath );
+
+               parent::tearDown();
+       }
+
+       public function testMigration() {
+               $this->migratorMock->loadParamsAndArgs( null, array( 'oldlayout' => 'name', 'newlayout' => 'sha1' ) );
+
+               ob_start();
+
+               $this->migratorMock->execute();
+
+               ob_end_clean();
+
+               $sha1 = sha1( $this->text );
+
+               $expectedOriginalFilepath = $this->tmpPrefix
+                       . '-original/'
+                       . substr( $sha1, 0, 1 )
+                       . '/'
+                       . substr( $sha1, 1, 1 )
+                       . '/'
+                       . substr( $sha1, 2, 1 )
+                       . '/'
+                       . $sha1 ;
+
+               $this->assertEquals( file_get_contents( $expectedOriginalFilepath ), $this->text, 'New sha1 file should be exist and have the right contents' );
+
+               $expectedPublicFilepath = $this->tmpPrefix . '-public/f/f8/Foo.png';
+
+               $this->assertEquals( file_get_contents( $expectedPublicFilepath ), $this->text, 'Existing name file should still and have the right contents' );
+       }
+}