|
@@ 132-142 (lines=11) @@
|
| 129 |
|
$resultSet = $statement->fetchAll(PDO::FETCH_CLASS, get_called_class()); |
| 130 |
|
|
| 131 |
|
/** @var User $user */ |
| 132 |
|
foreach ($resultSet as $user) { |
| 133 |
|
// We have to set this before doing OAuth queries. :( |
| 134 |
|
$user->isNew = false; |
| 135 |
|
$user->setDatabase($database); |
| 136 |
|
|
| 137 |
|
// Using cached data here! |
| 138 |
|
if ($user->getOAuthOnWikiName(true) == $username) { |
| 139 |
|
// Success. |
| 140 |
|
return $user; |
| 141 |
|
} |
| 142 |
|
} |
| 143 |
|
|
| 144 |
|
// Cached data failed. Let's do it the *REALLY* hard way. |
| 145 |
|
foreach ($resultSet as $user) { |
|
@@ 145-155 (lines=11) @@
|
| 142 |
|
} |
| 143 |
|
|
| 144 |
|
// Cached data failed. Let's do it the *REALLY* hard way. |
| 145 |
|
foreach ($resultSet as $user) { |
| 146 |
|
// We have to set this before doing OAuth queries. :( |
| 147 |
|
$user->isNew = false; |
| 148 |
|
$user->setDatabase($database); |
| 149 |
|
|
| 150 |
|
// Don't use the cached data, but instead query the API. |
| 151 |
|
if ($user->getOAuthOnWikiName(false) == $username) { |
| 152 |
|
// Success. |
| 153 |
|
return $user; |
| 154 |
|
} |
| 155 |
|
} |
| 156 |
|
|
| 157 |
|
// Nope. Sorry. |
| 158 |
|
return false; |