Merge "Cleaned up database reconnection logic"
[lhc/web/wiklou.git] / includes / api / ApiBase.php
index e451f2a..cfd4d01 100644 (file)
@@ -720,9 +720,13 @@ abstract class ApiBase extends ContextSource {
 
        /**
         * Die if none or more than one of a certain set of parameters is set and not false.
-        * @param array $params Array of parameter names
+        *
+        * Call getRequireOnlyOneParameterErrorMessages() to get a list of possible errors.
+        *
+        * @param array $params User provided set of parameters, as from $this->extractRequestParams()
+        * @param string $required,... Names of parameters of which exactly one must be set
         */
-       public function requireOnlyOneParameter( $params ) {
+       public function requireOnlyOneParameter( $params, $required /*...*/ ) {
                $required = func_get_args();
                array_shift( $required );
                $p = $this->getModulePrefix();
@@ -767,9 +771,12 @@ abstract class ApiBase extends ContextSource {
        /**
         * Die if more than one of a certain set of parameters is set and not false.
         *
-        * @param array $params
+        * Call getRequireMaxOneParameterErrorMessages() to get a list of possible errors.
+        *
+        * @param array $params User provided set of parameters, as from $this->extractRequestParams()
+        * @param string $required,... Names of parameters of which at most one must be set
         */
-       public function requireMaxOneParameter( $params ) {
+       public function requireMaxOneParameter( $params, $required /*...*/ ) {
                $required = func_get_args();
                array_shift( $required );
                $p = $this->getModulePrefix();
@@ -806,11 +813,13 @@ abstract class ApiBase extends ContextSource {
        /**
         * Die if none of a certain set of parameters is set and not false.
         *
+        * Call getRequireAtLeastOneParameterErrorMessages() to get a list of possible errors.
+        *
         * @since 1.23
-        * @param array $params User provided set of parameters
-        * @param string ... List of parameter names to check
+        * @param array $params User provided set of parameters, as from $this->extractRequestParams()
+        * @param string $required,... Names of parameters of which at least one must be set
         */
-       public function requireAtLeastOneParameter( $params ) {
+       public function requireAtLeastOneParameter( $params, $required /*...*/ ) {
                $required = func_get_args();
                array_shift( $required );
                $p = $this->getModulePrefix();
@@ -846,6 +855,11 @@ abstract class ApiBase extends ContextSource {
        }
 
        /**
+        * Get a WikiPage object from a title or pageid param, if possible.
+        * Can die, if no param is set or if the title or page id is not valid.
+        *
+        * Call getTitleOrPageIdErrorMessage() to get a list of possible errors.
+        *
         * @param array $params
         * @param bool|string $load Whether load the object's state from the database:
         *        - false: don't load (if the pageid is given, it will still be loaded)
@@ -883,6 +897,8 @@ abstract class ApiBase extends ContextSource {
        }
 
        /**
+        * Generates the possible error getTitleOrPageId() can die with
+        *
         * @return array
         */
        public function getTitleOrPageIdErrorMessage() {