Index: trunk/extensions/DSMW/jobs/DSMWUpdateJob.php |
— | — | @@ -12,18 +12,22 @@ |
13 | 13 | */ |
14 | 14 | class DSMWUpdateJob extends Job { |
15 | 15 | |
16 | | - function __construct( $title ) { |
17 | | - parent::__construct( 'DSMWUpdateJob', $title ); |
| 16 | + public function __construct( $title ) { |
| 17 | + parent::__construct( __CLASS__, $title ); |
18 | 18 | } |
19 | 19 | |
20 | | - function run() { |
| 20 | + public function run() { |
21 | 21 | global $wgServerName, $wgScriptPath, $wgServer, $wgScriptExtension; |
| 22 | + |
| 23 | + wfProfileIn( 'DSMWUpdateJob::run()' ); |
| 24 | + |
22 | 25 | $urlServer = 'http://' . $wgServerName; |
23 | | - wfProfileIn( 'DSMWUpdateJob::run()' ); |
| 26 | + |
24 | 27 | $revids = array(); |
25 | 28 | $revids1 = array(); |
26 | 29 | $page_ids = array(); |
27 | | -// Getting all the revision ids of pages having been logootized |
| 30 | + |
| 31 | + // Getting all the revision ids of pages having been logootized |
28 | 32 | $db = wfGetDB( DB_SLAVE ); |
29 | 33 | |
30 | 34 | $model_table = $db->tableName( 'model' ); |
— | — | @@ -86,6 +90,7 @@ |
87 | 91 | $modelAfterIntegrate = $logoot->getModel(); |
88 | 92 | $tmp = serialize( $listOp ); |
89 | 93 | $patchid = sha1( $tmp ); |
| 94 | + |
90 | 95 | if ( $ns == NS_FILE || $ns == NS_IMAGE || $ns == NS_MEDIA ) { |
91 | 96 | $apiUrl = $wgServer . $wgScriptPath . "/api" . $wgScriptExtension; |
92 | 97 | $onPage = str_replace( array( ' ' ), array( '%20' ), $lastRev->getTitle()->getText() ); |
— | — | @@ -105,12 +110,14 @@ |
106 | 111 | $patch = new Patch( false, false, $listOp, $urlServer, 0 ); |
107 | 112 | $patch->storePage( $lastRev->getTitle()->getText(), $lastRev->getId() ); |
108 | 113 | } |
| 114 | + |
109 | 115 | manager::storeModel( $lastRev->getId(), $sessionId = session_id(), $modelAfterIntegrate, $blobCB = 0 ); |
110 | 116 | } |
111 | 117 | } |
112 | 118 | |
113 | | - |
114 | 119 | wfProfileOut( 'DSMWUpdateJob::run()' ); |
| 120 | + |
115 | 121 | return true; |
116 | 122 | } |
| 123 | + |
117 | 124 | } |