Merge "make list of 'Languages that support variant conversion' dynamic"
[lhc/web/wiklou.git] / includes / api / ApiBase.php
index 6a9be24..bc94ee4 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Created on Sep 5, 2006
  *
- * Copyright © 2006, 2010 Yuri Astrakhan <Firstname><Lastname>@gmail.com
+ * Copyright © 2006, 2010 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
  *
  * 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
@@ -134,7 +134,7 @@ abstract class ApiBase extends ContextSource {
        /**
         * Get the name of the module as shown in the profiler log
         *
-        * @param $db DatabaseBase
+        * @param $db DatabaseBase|bool
         *
         * @return string
         */
@@ -825,7 +825,7 @@ abstract class ApiBase extends ContextSource {
         */
        protected function getWatchlistValue ( $watchlist, $titleObj, $userOption = null ) {
 
-               $userWatching = $titleObj->userIsWatching();
+               $userWatching = $this->getUser()->isWatched( $titleObj );
 
                switch ( $watchlist ) {
                        case 'watch':
@@ -1184,7 +1184,8 @@ abstract class ApiBase extends ContextSource {
         * @param $errorCode string Brief, arbitrary, stable string to allow easy
         *   automated identification of the error, e.g., 'unknown_action'
         * @param $httpRespCode int HTTP response code
-        * @param $extradata array Data to add to the <error> element; array in ApiResult format
+        * @param $extradata array Data to add to the "<error>" element; array in ApiResult format
+        * @throws UsageException
         */
        public function dieUsage( $description, $errorCode, $httpRespCode = 0, $extradata = null ) {
                Profiler::instance()->close();
@@ -1307,6 +1308,8 @@ abstract class ApiBase extends ContextSource {
                'specialpage-cantexecute' => array( 'code' => 'specialpage-cantexecute', 'info' => "You don't have permission to view the results of this special page" ),
                'invalidoldimage' => array( 'code' => 'invalidoldimage', 'info' => 'The oldimage parameter has invalid format' ),
                'nodeleteablefile' => array( 'code' => 'nodeleteablefile', 'info' => 'No such old version of the file' ),
+               'fileexists-forbidden' => array( 'code' => 'fileexists-forbidden', 'info' => 'A file with name "$1" already exists, and cannot be overwritten.' ),
+               'fileexists-shared-forbidden' => array( 'code' => 'fileexists-shared-forbidden', 'info' => 'A file with name "$1" already exists in the shared file repository, and cannot be overwritten.' ),
 
                // ApiEditPage messages
                'noimageredirect-anon' => array( 'code' => 'noimageredirect-anon', 'info' => "Anonymous users can't create image redirects" ),