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