Remove @static from all over the place. That's what the static keyword is for, this...
[lhc/web/wiklou.git] / includes / api / ApiQueryRecentChanges.php
1 <?php
2 /**
3 *
4 *
5 * Created on Oct 19, 2006
6 *
7 * Copyright © 2006 Yuri Astrakhan <Firstname><Lastname>@gmail.com
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 * http://www.gnu.org/copyleft/gpl.html
23 *
24 * @file
25 */
26
27 if ( !defined( 'MEDIAWIKI' ) ) {
28 // Eclipse helper - will be ignored in production
29 require_once( 'ApiQueryBase.php' );
30 }
31
32 /**
33 * A query action to enumerate the recent changes that were done to the wiki.
34 * Various filters are supported.
35 *
36 * @ingroup API
37 */
38 class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
39
40 public function __construct( $query, $moduleName ) {
41 parent::__construct( $query, $moduleName, 'rc' );
42 }
43
44 private $fld_comment = false, $fld_parsedcomment = false, $fld_user = false, $fld_userid = false,
45 $fld_flags = false, $fld_timestamp = false, $fld_title = false, $fld_ids = false,
46 $fld_sizes = false, $fld_redirect = false, $fld_patrolled = false, $fld_loginfo = false,
47 $fld_tags = false, $token = array();
48
49 private $tokenFunctions;
50
51 /**
52 * Get an array mapping token names to their handler functions.
53 * The prototype for a token function is func($pageid, $title, $rc)
54 * it should return a token or false (permission denied)
55 * @return array(tokenname => function)
56 */
57 protected function getTokenFunctions() {
58 // Don't call the hooks twice
59 if ( isset( $this->tokenFunctions ) ) {
60 return $this->tokenFunctions;
61 }
62
63 // If we're in JSON callback mode, no tokens can be obtained
64 if ( !is_null( $this->getMain()->getRequest()->getVal( 'callback' ) ) ) {
65 return array();
66 }
67
68 $this->tokenFunctions = array(
69 'patrol' => array( 'ApiQueryRecentChanges', 'getPatrolToken' )
70 );
71 wfRunHooks( 'APIQueryRecentChangesTokens', array( &$this->tokenFunctions ) );
72 return $this->tokenFunctions;
73 }
74
75 /**
76 * @param $pageid
77 * @param $title
78 * @param $rc RecentChange
79 * @return bool|String
80 */
81 public static function getPatrolToken( $pageid, $title, $rc ) {
82 global $wgUser;
83 if ( !$wgUser->useRCPatrol() && ( !$wgUser->useNPPatrol() ||
84 $rc->getAttribute( 'rc_type' ) != RC_NEW ) )
85 {
86 return false;
87 }
88
89 // The patrol token is always the same, let's exploit that
90 static $cachedPatrolToken = null;
91 if ( is_null( $cachedPatrolToken ) ) {
92 $cachedPatrolToken = $wgUser->editToken( 'patrol' );
93 }
94
95 return $cachedPatrolToken;
96 }
97
98 /**
99 * Sets internal state to include the desired properties in the output.
100 * @param $prop Array associative array of properties, only keys are used here
101 */
102 public function initProperties( $prop ) {
103 $this->fld_comment = isset( $prop['comment'] );
104 $this->fld_parsedcomment = isset( $prop['parsedcomment'] );
105 $this->fld_user = isset( $prop['user'] );
106 $this->fld_userid = isset( $prop['userid'] );
107 $this->fld_flags = isset( $prop['flags'] );
108 $this->fld_timestamp = isset( $prop['timestamp'] );
109 $this->fld_title = isset( $prop['title'] );
110 $this->fld_ids = isset( $prop['ids'] );
111 $this->fld_sizes = isset( $prop['sizes'] );
112 $this->fld_redirect = isset( $prop['redirect'] );
113 $this->fld_patrolled = isset( $prop['patrolled'] );
114 $this->fld_loginfo = isset( $prop['loginfo'] );
115 $this->fld_tags = isset( $prop['tags'] );
116 }
117
118 public function execute() {
119 $this->run();
120 }
121
122 public function executeGenerator( $resultPageSet ) {
123 $this->run( $resultPageSet );
124 }
125
126 /**
127 * Generates and outputs the result of this query based upon the provided parameters.
128 *
129 * @param $resultPageSet ApiPageSet
130 */
131 public function run( $resultPageSet = null ) {
132 global $wgUser;
133 /* Get the parameters of the request. */
134 $params = $this->extractRequestParams();
135
136 /* Build our basic query. Namely, something along the lines of:
137 * SELECT * FROM recentchanges WHERE rc_timestamp > $start
138 * AND rc_timestamp < $end AND rc_namespace = $namespace
139 * AND rc_deleted = '0'
140 */
141 $this->addTables( 'recentchanges' );
142 $index = array( 'recentchanges' => 'rc_timestamp' ); // May change
143 $this->addWhereRange( 'rc_timestamp', $params['dir'], $params['start'], $params['end'] );
144 $this->addWhereFld( 'rc_namespace', $params['namespace'] );
145 $this->addWhereFld( 'rc_deleted', 0 );
146
147 if ( !is_null( $params['type'] ) ) {
148 $this->addWhereFld( 'rc_type', $this->parseRCType( $params['type'] ) );
149 }
150
151 if ( !is_null( $params['show'] ) ) {
152 $show = array_flip( $params['show'] );
153
154 /* Check for conflicting parameters. */
155 if ( ( isset( $show['minor'] ) && isset( $show['!minor'] ) )
156 || ( isset( $show['bot'] ) && isset( $show['!bot'] ) )
157 || ( isset( $show['anon'] ) && isset( $show['!anon'] ) )
158 || ( isset( $show['redirect'] ) && isset( $show['!redirect'] ) )
159 || ( isset( $show['patrolled'] ) && isset( $show['!patrolled'] ) )
160 ) {
161 $this->dieUsageMsg( array( 'show' ) );
162 }
163
164 // Check permissions
165 if ( isset( $show['patrolled'] ) || isset( $show['!patrolled'] ) ) {
166 if ( !$wgUser->useRCPatrol() && !$wgUser->useNPPatrol() ) {
167 $this->dieUsage( 'You need the patrol right to request the patrolled flag', 'permissiondenied' );
168 }
169 }
170
171 /* Add additional conditions to query depending upon parameters. */
172 $this->addWhereIf( 'rc_minor = 0', isset( $show['!minor'] ) );
173 $this->addWhereIf( 'rc_minor != 0', isset( $show['minor'] ) );
174 $this->addWhereIf( 'rc_bot = 0', isset( $show['!bot'] ) );
175 $this->addWhereIf( 'rc_bot != 0', isset( $show['bot'] ) );
176 $this->addWhereIf( 'rc_user = 0', isset( $show['anon'] ) );
177 $this->addWhereIf( 'rc_user != 0', isset( $show['!anon'] ) );
178 $this->addWhereIf( 'rc_patrolled = 0', isset( $show['!patrolled'] ) );
179 $this->addWhereIf( 'rc_patrolled != 0', isset( $show['patrolled'] ) );
180 $this->addWhereIf( 'page_is_redirect = 1', isset( $show['redirect'] ) );
181
182 // Don't throw log entries out the window here
183 $this->addWhereIf( 'page_is_redirect = 0 OR page_is_redirect IS NULL', isset( $show['!redirect'] ) );
184 }
185
186 if ( !is_null( $params['user'] ) && !is_null( $params['excludeuser'] ) ) {
187 $this->dieUsage( 'user and excludeuser cannot be used together', 'user-excludeuser' );
188 }
189
190 if ( !is_null( $params['user'] ) ) {
191 $this->addWhereFld( 'rc_user_text', $params['user'] );
192 $index['recentchanges'] = 'rc_user_text';
193 }
194
195 if ( !is_null( $params['excludeuser'] ) ) {
196 // We don't use the rc_user_text index here because
197 // * it would require us to sort by rc_user_text before rc_timestamp
198 // * the != condition doesn't throw out too many rows anyway
199 $this->addWhere( 'rc_user_text != ' . $this->getDB()->addQuotes( $params['excludeuser'] ) );
200 }
201
202 /* Add the fields we're concerned with to our query. */
203 $this->addFields( array(
204 'rc_timestamp',
205 'rc_namespace',
206 'rc_title',
207 'rc_cur_id',
208 'rc_type',
209 'rc_moved_to_ns',
210 'rc_moved_to_title',
211 'rc_deleted'
212 ) );
213
214 $showRedirects = false;
215 /* Determine what properties we need to display. */
216 if ( !is_null( $params['prop'] ) ) {
217 $prop = array_flip( $params['prop'] );
218
219 /* Set up internal members based upon params. */
220 $this->initProperties( $prop );
221
222 if ( $this->fld_patrolled && !$wgUser->useRCPatrol() && !$wgUser->useNPPatrol() ) {
223 $this->dieUsage( 'You need the patrol right to request the patrolled flag', 'permissiondenied' );
224 }
225
226 /* Add fields to our query if they are specified as a needed parameter. */
227 $this->addFieldsIf( 'rc_id', $this->fld_ids );
228 $this->addFieldsIf( 'rc_this_oldid', $this->fld_ids );
229 $this->addFieldsIf( 'rc_last_oldid', $this->fld_ids );
230 $this->addFieldsIf( 'rc_comment', $this->fld_comment || $this->fld_parsedcomment );
231 $this->addFieldsIf( 'rc_user', $this->fld_user );
232 $this->addFieldsIf( 'rc_user_text', $this->fld_user || $this->fld_userid );
233 $this->addFieldsIf( 'rc_minor', $this->fld_flags );
234 $this->addFieldsIf( 'rc_bot', $this->fld_flags );
235 $this->addFieldsIf( 'rc_new', $this->fld_flags );
236 $this->addFieldsIf( 'rc_old_len', $this->fld_sizes );
237 $this->addFieldsIf( 'rc_new_len', $this->fld_sizes );
238 $this->addFieldsIf( 'rc_patrolled', $this->fld_patrolled );
239 $this->addFieldsIf( 'rc_logid', $this->fld_loginfo );
240 $this->addFieldsIf( 'rc_log_type', $this->fld_loginfo );
241 $this->addFieldsIf( 'rc_log_action', $this->fld_loginfo );
242 $this->addFieldsIf( 'rc_params', $this->fld_loginfo );
243 $showRedirects = $this->fld_redirect || isset( $show['redirect'] ) || isset( $show['!redirect'] );
244 }
245
246 if ( $this->fld_tags ) {
247 $this->addTables( 'tag_summary' );
248 $this->addJoinConds( array( 'tag_summary' => array( 'LEFT JOIN', array( 'rc_id=ts_rc_id' ) ) ) );
249 $this->addFields( 'ts_tags' );
250 }
251
252 if ( $params['toponly'] || $showRedirects ) {
253 $this->addTables( 'page' );
254 $this->addJoinConds( array( 'page' => array( 'LEFT JOIN', array( 'rc_namespace=page_namespace', 'rc_title=page_title' ) ) ) );
255
256 if ( $params['toponly'] ) {
257 $this->addWhere( 'rc_this_oldid = page_latest' );
258 }
259 }
260
261 if ( !is_null( $params['tag'] ) ) {
262 $this->addTables( 'change_tag' );
263 $this->addJoinConds( array( 'change_tag' => array( 'INNER JOIN', array( 'rc_id=ct_rc_id' ) ) ) );
264 $this->addWhereFld( 'ct_tag' , $params['tag'] );
265 global $wgOldChangeTagsIndex;
266 $index['change_tag'] = $wgOldChangeTagsIndex ? 'ct_tag' : 'change_tag_tag_id';
267 }
268
269 $this->token = $params['token'];
270 $this->addOption( 'LIMIT', $params['limit'] + 1 );
271 $this->addOption( 'USE INDEX', $index );
272
273 $count = 0;
274 /* Perform the actual query. */
275 $res = $this->select( __METHOD__ );
276
277 $titles = array();
278
279 /* Iterate through the rows, adding data extracted from them to our query result. */
280 foreach ( $res as $row ) {
281 if ( ++ $count > $params['limit'] ) {
282 // We've reached the one extra which shows that there are additional pages to be had. Stop here...
283 $this->setContinueEnumParameter( 'start', wfTimestamp( TS_ISO_8601, $row->rc_timestamp ) );
284 break;
285 }
286
287 if ( is_null( $resultPageSet ) ) {
288 /* Extract the data from a single row. */
289 $vals = $this->extractRowInfo( $row );
290
291 /* Add that row's data to our final output. */
292 if ( !$vals ) {
293 continue;
294 }
295 $fit = $this->getResult()->addValue( array( 'query', $this->getModuleName() ), null, $vals );
296 if ( !$fit ) {
297 $this->setContinueEnumParameter( 'start', wfTimestamp( TS_ISO_8601, $row->rc_timestamp ) );
298 break;
299 }
300 } else {
301 $titles[] = Title::makeTitle( $row->rc_namespace, $row->rc_title );
302 }
303 }
304
305 if ( is_null( $resultPageSet ) ) {
306 /* Format the result */
307 $this->getResult()->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'rc' );
308 } else {
309 $resultPageSet->populateFromTitles( $titles );
310 }
311 }
312
313 /**
314 * Extracts from a single sql row the data needed to describe one recent change.
315 *
316 * @param $row The row from which to extract the data.
317 * @return An array mapping strings (descriptors) to their respective string values.
318 * @access public
319 */
320 public function extractRowInfo( $row ) {
321 /* If page was moved somewhere, get the title of the move target. */
322 $movedToTitle = false;
323 if ( isset( $row->rc_moved_to_title ) && $row->rc_moved_to_title !== '' ) {
324 $movedToTitle = Title::makeTitle( $row->rc_moved_to_ns, $row->rc_moved_to_title );
325 }
326
327 /* Determine the title of the page that has been changed. */
328 $title = Title::makeTitle( $row->rc_namespace, $row->rc_title );
329
330 /* Our output data. */
331 $vals = array();
332
333 $type = intval( $row->rc_type );
334
335 /* Determine what kind of change this was. */
336 switch ( $type ) {
337 case RC_EDIT:
338 $vals['type'] = 'edit';
339 break;
340 case RC_NEW:
341 $vals['type'] = 'new';
342 break;
343 case RC_MOVE:
344 $vals['type'] = 'move';
345 break;
346 case RC_LOG:
347 $vals['type'] = 'log';
348 break;
349 case RC_MOVE_OVER_REDIRECT:
350 $vals['type'] = 'move over redirect';
351 break;
352 default:
353 $vals['type'] = $type;
354 }
355
356 /* Create a new entry in the result for the title. */
357 if ( $this->fld_title ) {
358 ApiQueryBase::addTitleInfo( $vals, $title );
359 if ( $movedToTitle ) {
360 ApiQueryBase::addTitleInfo( $vals, $movedToTitle, 'new_' );
361 }
362 }
363
364 /* Add ids, such as rcid, pageid, revid, and oldid to the change's info. */
365 if ( $this->fld_ids ) {
366 $vals['rcid'] = intval( $row->rc_id );
367 $vals['pageid'] = intval( $row->rc_cur_id );
368 $vals['revid'] = intval( $row->rc_this_oldid );
369 $vals['old_revid'] = intval( $row->rc_last_oldid );
370 }
371
372 /* Add user data and 'anon' flag, if use is anonymous. */
373 if ( $this->fld_user || $this->fld_userid ) {
374
375 if ( $this->fld_user ) {
376 $vals['user'] = $row->rc_user_text;
377 }
378
379 if ( $this->fld_userid ) {
380 $vals['userid'] = $row->rc_user;
381 }
382
383 if ( !$row->rc_user ) {
384 $vals['anon'] = '';
385 }
386 }
387
388 /* Add flags, such as new, minor, bot. */
389 if ( $this->fld_flags ) {
390 if ( $row->rc_bot ) {
391 $vals['bot'] = '';
392 }
393 if ( $row->rc_new ) {
394 $vals['new'] = '';
395 }
396 if ( $row->rc_minor ) {
397 $vals['minor'] = '';
398 }
399 }
400
401 /* Add sizes of each revision. (Only available on 1.10+) */
402 if ( $this->fld_sizes ) {
403 $vals['oldlen'] = intval( $row->rc_old_len );
404 $vals['newlen'] = intval( $row->rc_new_len );
405 }
406
407 /* Add the timestamp. */
408 if ( $this->fld_timestamp ) {
409 $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $row->rc_timestamp );
410 }
411
412 /* Add edit summary / log summary. */
413 if ( $this->fld_comment && isset( $row->rc_comment ) ) {
414 $vals['comment'] = $row->rc_comment;
415 }
416
417 if ( $this->fld_parsedcomment && isset( $row->rc_comment ) ) {
418 global $wgUser;
419 $vals['parsedcomment'] = $wgUser->getSkin()->formatComment( $row->rc_comment, $title );
420 }
421
422 if ( $this->fld_redirect ) {
423 if ( $row->page_is_redirect ) {
424 $vals['redirect'] = '';
425 }
426 }
427
428 /* Add the patrolled flag */
429 if ( $this->fld_patrolled && $row->rc_patrolled == 1 ) {
430 $vals['patrolled'] = '';
431 }
432
433 if ( $this->fld_loginfo && $row->rc_type == RC_LOG ) {
434 $vals['logid'] = intval( $row->rc_logid );
435 $vals['logtype'] = $row->rc_log_type;
436 $vals['logaction'] = $row->rc_log_action;
437 ApiQueryLogEvents::addLogParams(
438 $this->getResult(),
439 $vals, $row->rc_params,
440 $row->rc_log_type, $row->rc_timestamp
441 );
442 }
443
444 if ( $this->fld_tags ) {
445 if ( $row->ts_tags ) {
446 $tags = explode( ',', $row->ts_tags );
447 $this->getResult()->setIndexedTagName( $tags, 'tag' );
448 $vals['tags'] = $tags;
449 } else {
450 $vals['tags'] = array();
451 }
452 }
453
454 if ( !is_null( $this->token ) ) {
455 $tokenFunctions = $this->getTokenFunctions();
456 foreach ( $this->token as $t ) {
457 $val = call_user_func( $tokenFunctions[$t], $row->rc_cur_id,
458 $title, RecentChange::newFromRow( $row ) );
459 if ( $val === false ) {
460 $this->setWarning( "Action '$t' is not allowed for the current user" );
461 } else {
462 $vals[$t . 'token'] = $val;
463 }
464 }
465 }
466
467 return $vals;
468 }
469
470 private function parseRCType( $type ) {
471 if ( is_array( $type ) ) {
472 $retval = array();
473 foreach ( $type as $t ) {
474 $retval[] = $this->parseRCType( $t );
475 }
476 return $retval;
477 }
478 switch( $type ) {
479 case 'edit':
480 return RC_EDIT;
481 case 'new':
482 return RC_NEW;
483 case 'log':
484 return RC_LOG;
485 }
486 }
487
488 public function getCacheMode( $params ) {
489 if ( isset( $params['show'] ) ) {
490 foreach ( $params['show'] as $show ) {
491 if ( $show === 'patrolled' || $show === '!patrolled' ) {
492 return 'private';
493 }
494 }
495 }
496 if ( isset( $params['token'] ) ) {
497 return 'private';
498 }
499 if ( !is_null( $params['prop'] ) && in_array( 'parsedcomment', $params['prop'] ) ) {
500 // formatComment() calls wfMsg() among other things
501 return 'anon-public-user-private';
502 }
503 return 'public';
504 }
505
506 public function getAllowedParams() {
507 return array(
508 'start' => array(
509 ApiBase::PARAM_TYPE => 'timestamp'
510 ),
511 'end' => array(
512 ApiBase::PARAM_TYPE => 'timestamp'
513 ),
514 'dir' => array(
515 ApiBase::PARAM_DFLT => 'older',
516 ApiBase::PARAM_TYPE => array(
517 'newer',
518 'older'
519 )
520 ),
521 'namespace' => array(
522 ApiBase::PARAM_ISMULTI => true,
523 ApiBase::PARAM_TYPE => 'namespace'
524 ),
525 'user' => array(
526 ApiBase::PARAM_TYPE => 'user'
527 ),
528 'excludeuser' => array(
529 ApiBase::PARAM_TYPE => 'user'
530 ),
531 'tag' => null,
532 'prop' => array(
533 ApiBase::PARAM_ISMULTI => true,
534 ApiBase::PARAM_DFLT => 'title|timestamp|ids',
535 ApiBase::PARAM_TYPE => array(
536 'user',
537 'userid',
538 'comment',
539 'parsedcomment',
540 'flags',
541 'timestamp',
542 'title',
543 'ids',
544 'sizes',
545 'redirect',
546 'patrolled',
547 'loginfo',
548 'tags'
549 )
550 ),
551 'token' => array(
552 ApiBase::PARAM_TYPE => array_keys( $this->getTokenFunctions() ),
553 ApiBase::PARAM_ISMULTI => true
554 ),
555 'show' => array(
556 ApiBase::PARAM_ISMULTI => true,
557 ApiBase::PARAM_TYPE => array(
558 'minor',
559 '!minor',
560 'bot',
561 '!bot',
562 'anon',
563 '!anon',
564 'redirect',
565 '!redirect',
566 'patrolled',
567 '!patrolled'
568 )
569 ),
570 'limit' => array(
571 ApiBase::PARAM_DFLT => 10,
572 ApiBase::PARAM_TYPE => 'limit',
573 ApiBase::PARAM_MIN => 1,
574 ApiBase::PARAM_MAX => ApiBase::LIMIT_BIG1,
575 ApiBase::PARAM_MAX2 => ApiBase::LIMIT_BIG2
576 ),
577 'type' => array(
578 ApiBase::PARAM_ISMULTI => true,
579 ApiBase::PARAM_TYPE => array(
580 'edit',
581 'new',
582 'log'
583 )
584 ),
585 'toponly' => false,
586 );
587 }
588
589 public function getParamDescription() {
590 $p = $this->getModulePrefix();
591 return array(
592 'start' => 'The timestamp to start enumerating from',
593 'end' => 'The timestamp to end enumerating',
594 'dir' => $this->getDirectionDescription( $p ),
595 'namespace' => 'Filter log entries to only this namespace(s)',
596 'user' => 'Only list changes by this user',
597 'excludeuser' => 'Don\'t list changes by this user',
598 'prop' => array(
599 'Include additional pieces of information',
600 ' user - Adds the user responsible for the edit and tags if they are an IP',
601 ' userid - Adds the user id responsible for the edit',
602 ' comment - Adds the comment for the edit',
603 ' parsedcomment - Adds the parsed comment for the edit',
604 ' flags - Adds flags for the edit',
605 ' timestamp - Adds timestamp of the edit',
606 ' title - Adds the page title of the edit',
607 ' ids - Adds the page ID, recent changes ID and the new and old revision ID',
608 ' sizes - Adds the new and old page length in bytes',
609 ' redirect - Tags edit if page is a redirect',
610 ' patrolled - Tags edits that have been patrolled',
611 ' loginfo - Adds log information (logid, logtype, etc) to log entries',
612 ' tags - Lists tags for the entry',
613 ),
614 'token' => 'Which tokens to obtain for each change',
615 'show' => array(
616 'Show only items that meet this criteria.',
617 "For example, to see only minor edits done by logged-in users, set {$p}show=minor|!anon"
618 ),
619 'type' => 'Which types of changes to show',
620 'limit' => 'How many total changes to return',
621 'tag' => 'Only list changes tagged with this tag',
622 'toponly' => 'Only list changes which are the latest revision',
623 );
624 }
625
626 public function getDescription() {
627 return 'Enumerate recent changes';
628 }
629
630 public function getPossibleErrors() {
631 return array_merge( parent::getPossibleErrors(), array(
632 array( 'show' ),
633 array( 'code' => 'permissiondenied', 'info' => 'You need the patrol right to request the patrolled flag' ),
634 array( 'code' => 'user-excludeuser', 'info' => 'user and excludeuser cannot be used together' ),
635 ) );
636 }
637
638 protected function getExamples() {
639 return array(
640 'api.php?action=query&list=recentchanges'
641 );
642 }
643
644 public function getVersion() {
645 return __CLASS__ . ': $Id$';
646 }
647 }