Index: trunk/phase3/includes/User.php |
— | — | @@ -194,6 +194,7 @@ |
195 | 195 | * @var Block |
196 | 196 | */ |
197 | 197 | var $mBlock; |
| 198 | + private $mBlockedFromCreateAccount = false; |
198 | 199 | |
199 | 200 | static $idCacheByName = array(); |
200 | 201 | |
— | — | @@ -1246,7 +1247,7 @@ |
1247 | 1248 | $this->mBlock = Block::newFromTarget( $this->getName(), $ip, !$bFromSlave ); |
1248 | 1249 | if ( $this->mBlock instanceof Block ) { |
1249 | 1250 | wfDebug( __METHOD__ . ": Found block.\n" ); |
1250 | | - $this->mBlockedby = $this->mBlock->getBlocker()->getName(); |
| 1251 | + $this->mBlockedby = $this->mBlock->getByName(); |
1251 | 1252 | $this->mBlockreason = $this->mBlock->mReason; |
1252 | 1253 | $this->mHideName = $this->mBlock->mHideName; |
1253 | 1254 | $this->mAllowUsertalk = !$this->mBlock->prevents( 'editownusertalk' ); |
— | — | @@ -2921,12 +2922,11 @@ |
2922 | 2923 | # bug 13611: if the IP address the user is trying to create an account from is |
2923 | 2924 | # blocked with createaccount disabled, prevent new account creation there even |
2924 | 2925 | # when the user is logged in |
2925 | | - static $accBlock = false; |
2926 | | - if( $accBlock === false ){ |
2927 | | - $accBlock = Block::newFromTarget( null, wfGetIP() ); |
| 2926 | + if( $this->mBlockedFromCreateAccount === false ){ |
| 2927 | + $this->mBlockedFromCreateAccount = Block::newFromTarget( null, wfGetIP() ); |
2928 | 2928 | } |
2929 | | - return $accBlock instanceof Block && $accBlock->prevents( 'createaccount' ) |
2930 | | - ? $accBlock |
| 2929 | + return $this->mBlockedFromCreateAccount instanceof Block && $this->mBlockedFromCreateAccount->prevents( 'createaccount' ) |
| 2930 | + ? $this->mBlockedFromCreateAccount |
2931 | 2931 | : false; |
2932 | 2932 | } |
2933 | 2933 | |
Index: trunk/phase3/includes/db/Database.php |
— | — | @@ -1138,12 +1138,12 @@ |
1139 | 1139 | * Execute a SELECT query constructed using the various parameters provided. |
1140 | 1140 | * See below for full details of the parameters. |
1141 | 1141 | * |
1142 | | - * @param $table Table name |
1143 | | - * @param $vars Field names |
1144 | | - * @param $conds Conditions |
1145 | | - * @param $fname Caller function name |
1146 | | - * @param $options Query options |
1147 | | - * @param $join_conds Join conditions |
| 1142 | + * @param $table String|Array Table name |
| 1143 | + * @param $vars String|Array Field names |
| 1144 | + * @param $conds String|Array Conditions |
| 1145 | + * @param $fname String Caller function name |
| 1146 | + * @param $options Array Query options |
| 1147 | + * @param $join_conds Array Join conditions |
1148 | 1148 | * |
1149 | 1149 | * |
1150 | 1150 | * @b $table |
— | — | @@ -1549,10 +1549,10 @@ |
1550 | 1550 | * possible to determine how many rows were successfully inserted using |
1551 | 1551 | * DatabaseBase::affectedRows(). |
1552 | 1552 | * |
1553 | | - * @param $table Table name. This will be passed through |
| 1553 | + * @param $table String Table name. This will be passed through |
1554 | 1554 | * DatabaseBase::tableName(). |
1555 | 1555 | * @param $a Array of rows to insert |
1556 | | - * @param $fname Calling function name (use __METHOD__) for logs/profiling |
| 1556 | + * @param $fname String Calling function name (use __METHOD__) for logs/profiling |
1557 | 1557 | * @param $options Array of options |
1558 | 1558 | * |
1559 | 1559 | * @return bool |
— | — | @@ -1626,7 +1626,7 @@ |
1627 | 1627 | /** |
1628 | 1628 | * UPDATE wrapper. Takes a condition array and a SET array. |
1629 | 1629 | * |
1630 | | - * @param $table The name of the table to UPDATE. This will be passed through |
| 1630 | + * @param $table String name of the table to UPDATE. This will be passed through |
1631 | 1631 | * DatabaseBase::tableName(). |
1632 | 1632 | * |
1633 | 1633 | * @param $values Array: An array of values to SET. For each array element, |
— | — | @@ -2392,9 +2392,10 @@ |
2393 | 2393 | /** |
2394 | 2394 | * DELETE query wrapper. |
2395 | 2395 | * |
2396 | | - * @param $table Table name |
2397 | | - * @param $conds Condition array. See $conds in DatabaseBase::select() for |
| 2396 | + * @param $table Array Table name |
| 2397 | + * @param $conds String|Array of conditions. See $conds in DatabaseBase::select() for |
2398 | 2398 | * the format. Use $conds == "*" to delete all rows |
| 2399 | + * @param $fname String name of the calling function |
2399 | 2400 | * |
2400 | 2401 | * @return bool |
2401 | 2402 | */ |
Index: trunk/phase3/includes/Block.php |
— | — | @@ -160,7 +160,6 @@ |
161 | 161 | * |
162 | 162 | * @param $address string The IP address of the user, or blank to skip IP blocks |
163 | 163 | * @param $user int The user ID, or zero for anonymous users |
164 | | - * @param $killExpired bool Whether to delete expired rows while loading |
165 | 164 | * @return Boolean: the user is blocked from editing |
166 | 165 | * @deprecated since 1.18 |
167 | 166 | */ |
— | — | @@ -394,6 +393,7 @@ |
395 | 394 | * Insert a block into the block table. Will fail if there is a conflicting |
396 | 395 | * block (same name and options) already in the database. |
397 | 396 | * |
| 397 | + * @param $dbw DatabaseBase if you have one available |
398 | 398 | * @return mixed: false on failure, assoc array on success: |
399 | 399 | * ('id' => block ID, 'autoIds' => array of autoblock IDs) |
400 | 400 | */ |
— | — | @@ -428,6 +428,9 @@ |
429 | 429 | /** |
430 | 430 | * Update a block in the DB with new parameters. |
431 | 431 | * The ID field needs to be loaded first. |
| 432 | + * |
| 433 | + * @return Int number of affected rows, which should probably be 1 or something's |
| 434 | + * gone slightly awry |
432 | 435 | */ |
433 | 436 | public function update() { |
434 | 437 | wfDebug( "Block::update; timestamp {$this->mTimestamp}\n" ); |
— | — | @@ -770,6 +773,8 @@ |
771 | 774 | /** |
772 | 775 | * Get/set the SELECT ... FOR UPDATE flag |
773 | 776 | * @deprecated since 1.18 |
| 777 | + * |
| 778 | + * @param $x Bool |
774 | 779 | */ |
775 | 780 | public function forUpdate( $x = null ) { |
776 | 781 | # noop |
— | — | @@ -777,6 +782,9 @@ |
778 | 783 | |
779 | 784 | /** |
780 | 785 | * Get/set a flag determining whether the master is used for reads |
| 786 | + * |
| 787 | + * @param $x Bool |
| 788 | + * @return Bool |
781 | 789 | */ |
782 | 790 | public function fromMaster( $x = null ) { |
783 | 791 | return wfSetVar( $this->mFromMaster, $x ); |
— | — | @@ -864,7 +872,7 @@ |
865 | 873 | * Decode expiry which has come from the DB |
866 | 874 | * |
867 | 875 | * @param $expiry String: Database expiry format |
868 | | - * @param $timestampType Requested timestamp format |
| 876 | + * @param $timestampType Int Requested timestamp format |
869 | 877 | * @return String |
870 | 878 | * @deprecated since 1.18; use $wgLang->decodeExpiry() instead |
871 | 879 | */ |
— | — | @@ -876,6 +884,7 @@ |
877 | 885 | /** |
878 | 886 | * Get a timestamp of the expiry for autoblocks |
879 | 887 | * |
| 888 | + * @param $timestamp String|Int |
880 | 889 | * @return String |
881 | 890 | */ |
882 | 891 | public static function getAutoblockExpiry( $timestamp ) { |
— | — | @@ -1016,6 +1025,8 @@ |
1017 | 1026 | * From an existing Block, get the target and the type of target. Note that it is |
1018 | 1027 | * always safe to treat the target as a string; for User objects this will return |
1019 | 1028 | * User::__toString() which in turn gives User::getName(). |
| 1029 | + * |
| 1030 | + * @param $target String|Int|User |
1020 | 1031 | * @return array( User|String, Block::TYPE_ constant ) |
1021 | 1032 | */ |
1022 | 1033 | public static function parseTarget( $target ) { |
Index: trunk/extensions/CheckUser/CheckUser_body.php |
— | — | @@ -1093,7 +1093,7 @@ |
1094 | 1094 | $flags = array(); |
1095 | 1095 | if ( $block instanceof Block ) { |
1096 | 1096 | // Range blocked? |
1097 | | - if ( $block->getType == Block::TYPE_RANGE ) { |
| 1097 | + if ( $block->getType() == Block::TYPE_RANGE ) { |
1098 | 1098 | $userpage = Title::makeTitle( NS_USER, $block->getTarget() ); |
1099 | 1099 | $blocklog = $this->sk->makeKnownLinkObj( |
1100 | 1100 | $logs, |