Index: trunk/extensions/UserDailyContribs/api/ApiUserDailyContribs.php |
— | — | @@ -2,32 +2,30 @@ |
3 | 3 | |
4 | 4 | class ApiUserDailyContribs extends ApiBase { |
5 | 5 | |
6 | | - |
7 | 6 | public function execute() { |
8 | | - $params = $this->extractRequestParams(); |
9 | | - $result = $this->getResult(); |
| 7 | + $params = $this->extractRequestParams(); |
| 8 | + $result = $this->getResult(); |
10 | 9 | |
11 | | - $userName = $params['user']; |
12 | | - $days = $params['daysago']; |
13 | | - $user = User::newFromName($userName); |
14 | | - $now = time(); |
15 | | - $result->addValue( array( 'query', $this->getModuleName() ), |
16 | | - 'totalEdits', |
17 | | - ($user->getEditCount() == NULL)?0:$user->getEditCount() ); |
18 | | - $result->addValue( array( 'query', $this->getModuleName() ), |
19 | | - 'registration', $user->getRegistration() ); |
20 | | - $result->addValue( array( 'query', $this->getModuleName() ), |
21 | | - 'timeFrameEdits', getUserEditCountSince( $now - ($days * 60 *60 *24) )); |
22 | | - |
| 10 | + $userName = $params['user']; |
| 11 | + $days = $params['daysago']; |
| 12 | + $user = User::newFromName($userName); |
| 13 | + $now = time(); |
| 14 | + $result->addValue( array( 'query', $this->getModuleName() ), |
| 15 | + 'totalEdits', |
| 16 | + ($user->getEditCount() == NULL)?0:$user->getEditCount() ); |
| 17 | + $result->addValue( array( 'query', $this->getModuleName() ), |
| 18 | + 'registration', $user->getRegistration() ); |
| 19 | + $result->addValue( array( 'query', $this->getModuleName() ), |
| 20 | + 'timeFrameEdits', getUserEditCountSince( $now - ($days * 60 *60 *24) )); |
23 | 21 | } |
24 | | - |
25 | | - public function getAllowedParams() { |
| 22 | + |
| 23 | + public function getAllowedParams() { |
26 | 24 | return array( |
27 | 25 | 'user' => null, |
28 | 26 | 'daysago' => null, |
29 | 27 | ); |
30 | | - } |
31 | | - |
| 28 | + } |
| 29 | + |
32 | 30 | public function getParamDescription() { |
33 | 31 | return array( |
34 | 32 | 'user' => 'Username to query', |
— | — | @@ -48,5 +46,4 @@ |
49 | 47 | } |
50 | 48 | //2009-05-01-18-35-35 |
51 | 49 | //YYYY-MM-DD-HH-MM-SS |
52 | | - |
53 | | - } |
\ No newline at end of file |
| 50 | +} |
\ No newline at end of file |