Index: trunk/extensions/SelectionSifter/schema/log.sql |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | l_new varchar(63), |
28 | 28 | -- new value (e.g. GA-Class) |
29 | 29 | |
30 | | - l_revision_timestamp binary(20) not null, |
| 30 | + l_revision_timestamp binary(14) not null, |
31 | 31 | -- timestamp when page was edited |
32 | 32 | -- a wiki-format timestamp |
33 | 33 | |
Index: trunk/extensions/SelectionSifter/schema/ratings.sql |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | r_quality varchar(63), |
19 | 19 | -- quality rating |
20 | 20 | |
21 | | - r_quality_timestamp binary(20), |
| 21 | + r_quality_timestamp binary(14), |
22 | 22 | -- time when quality rating was assigned |
23 | 23 | -- NOTE: a revid can be obtained from timestamp via API |
24 | 24 | -- a wiki-format timestamp |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | r_importance varchar(63), |
27 | 27 | -- importance rating |
28 | 28 | |
29 | | - r_importance_timestamp binary(20), |
| 29 | + r_importance_timestamp binary(14), |
30 | 30 | -- time when importance rating was assigned |
31 | 31 | -- a wiki-style timestamp |
32 | 32 | |
Index: trunk/extensions/SelectionSifter/models/Log.php |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | * Represents an convenience methods for logging |
6 | 6 | **/ |
7 | 7 | class AssessmentChangeLog { |
8 | | - public static function makeEntry( $project, $namespace, $article, $timestamp, $action, $old, $new ) { |
| 8 | + public static function makeEntry( $project, $namespace, $article, $timestamp, $action, $old, $new, $revision_timestamp ) { |
9 | 9 | $dbw = wfGetDB( DB_MASTER ); |
10 | 10 | $dbw->insert( |
11 | 11 | 'assessment_changelog', |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | 'l_timestamp' => $timestamp, |
18 | 18 | 'l_old' => $old, |
19 | 19 | 'l_new' => $new, |
20 | | - 'l_revision_timestamp' => 0 |
| 20 | + 'l_revision_timestamp' => $revision_timestamp |
21 | 21 | ), |
22 | 22 | __METHOD__ |
23 | 23 | ); |
Index: trunk/extensions/SelectionSifter/models/Rating.php |
— | — | @@ -50,7 +50,8 @@ |
51 | 51 | $timestamp, |
52 | 52 | "quality", |
53 | 53 | $this->old_quality, |
54 | | - $this->quality |
| 54 | + $this->quality, |
| 55 | + $timestamp |
55 | 56 | ); |
56 | 57 | } |
57 | 58 | if( strpos( $logAction, 'i' ) !== false ) { |
— | — | @@ -61,7 +62,8 @@ |
62 | 63 | $timestamp, |
63 | 64 | "importance", |
64 | 65 | $this->old_importance, |
65 | | - $this->importance |
| 66 | + $this->importance, |
| 67 | + $timestamp |
66 | 68 | ); |
67 | 69 | } |
68 | 70 | |
Index: trunk/extensions/SelectionSifter/AssessmentsExtractor.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
21 | | - * Once AssessmentsExtractor is build, call this method to generate |
| 21 | + * Once AssessmentsExtractor is built, call this method to generate |
22 | 22 | * an array of assessment. |
23 | 23 | * @todo Describe the returned array |
24 | 24 | * @todo What happens if the preparedText does not match the expected format? |
Index: trunk/extensions/SelectionSifter/SelectionSifter.hooks.php |
— | — | @@ -20,20 +20,19 @@ |
21 | 21 | foreach ( $assessments as $project => $assessment ) { |
22 | 22 | $curRating = $ratings[$project]; |
23 | 23 | if( $curRating ) { |
24 | | - $curRating->update( $assessment['importance'], $assessment['quality'], 0 ); |
| 24 | + $curRating->update( $assessment['importance'], $assessment['quality'], $timestamp ); |
25 | 25 | } else { |
26 | 26 | $rating = new Rating( |
27 | 27 | $project, |
28 | 28 | $main_title->getNamespace(), |
29 | 29 | $main_title->getText(), |
30 | 30 | $assessment['quality'], |
31 | | - 0, |
| 31 | + $timestamp, |
32 | 32 | $assessment['importance'], |
33 | | - 0 |
| 33 | + $timestamp |
34 | 34 | ); |
35 | 35 | $rating->saveAll(); |
36 | 36 | |
37 | | - $timestamp = wfTimestamp( TS_MW ); |
38 | 37 | if( isset( $assessment['quality'] ) ) { |
39 | 38 | AssessmentChangeLog::makeEntry( |
40 | 39 | $project, |
— | — | @@ -42,7 +41,8 @@ |
43 | 42 | $timestamp, |
44 | 43 | "quality", |
45 | 44 | "", |
46 | | - $assessment['quality'] |
| 45 | + $assessment['quality'], |
| 46 | + $timestamp |
47 | 47 | ); |
48 | 48 | } |
49 | 49 | if( isset( $assessment['importance'] ) ) { |
— | — | @@ -53,7 +53,8 @@ |
54 | 54 | $timestamp, |
55 | 55 | "importance", |
56 | 56 | "", |
57 | | - $assessment['importance'] |
| 57 | + $assessment['importance'], |
| 58 | + $timestamp |
58 | 59 | ); |
59 | 60 | } |
60 | 61 | } |
— | — | @@ -73,7 +74,7 @@ |
74 | 75 | $preparedText = $article->prepareTextForEdit( $text )->output->getText(); |
75 | 76 | $extractor = new AssessmentsExtractor( $preparedText ); |
76 | 77 | $assessments = $extractor->extractAssessments(); |
77 | | - SelectionSifterHooks::updateDatabase( $title, $assessments, $revision ); |
| 78 | + SelectionSifterHooks::updateDatabase( $title, $assessments, wfTimestamp( TS_MW, $revision->getTimestamp() ) ); |
78 | 79 | } |
79 | 80 | return true; |
80 | 81 | } |