http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97603
Revision: 97603
Author: nikerabbit
Date: 2011-09-20 08:39:29 +0000 (Tue, 20 Sep 2011)
Log Message:
-----------
Moved PatrolLog to logging folder, sorted the autoloaded entries alphabetically
Modified Paths:
--------------
trunk/phase3/includes/AutoLoader.php
Added Paths:
-----------
trunk/phase3/includes/logging/PatrolLog.php
Removed Paths:
-------------
trunk/phase3/includes/PatrolLog.php
Modified: trunk/phase3/includes/AutoLoader.php
===================================================================
--- trunk/phase3/includes/AutoLoader.php 2011-09-20 08:36:34 UTC (rev
97602)
+++ trunk/phase3/includes/AutoLoader.php 2011-09-20 08:39:29 UTC (rev
97603)
@@ -164,7 +164,6 @@
'PageQueryPage' => 'includes/PageQueryPage.php',
'Pager' => 'includes/Pager.php',
'PasswordError' => 'includes/User.php',
- 'PatrolLog' => 'includes/PatrolLog.php',
'PermissionsError' => 'includes/Exception.php',
'PhpHttpRequest' => 'includes/HttpFunctions.php',
'PoolCounter' => 'includes/PoolCounter.php',
@@ -538,16 +537,17 @@
'JSParser' => 'includes/libs/jsminplus.php',
# includes/logging
+ 'DatabaseLogEntry' => 'includes/logging/LogEntry.php',
+ 'DeleteLogFormatter' => 'includes/logging/LogFormatter.php',
+ 'LegacyLogFormatter' => 'includes/logging/LogFormatter.php',
'LogEntry' => 'includes/logging/LogEntry.php',
'LogEntryBase' => 'includes/logging/LogEntry.php',
- 'DatabaseLogEntry' => 'includes/logging/LogEntry.php',
- 'RCDatabaseLogEntry' => 'includes/logging/LogEntry.php',
+ 'LogFormatter' => 'includes/logging/LogFormatter.php',
'ManualLogEntry' => 'includes/logging/LogEntry.php',
- 'LogFormatter' => 'includes/logging/LogFormatter.php',
- 'LegacyLogFormatter' => 'includes/logging/LogFormatter.php',
- 'DeleteLogFormatter' => 'includes/logging/LogFormatter.php',
'MoveLogFormatter' => 'includes/logging/LogFormatter.php',
+ 'PatrolLog' => 'includes/logging/PatrolLog.php',
'PatrolLogFormatter' => 'includes/logging/LogFormatter.php',
+ 'RCDatabaseLogEntry' => 'includes/logging/LogEntry.php',
# includes/media
'BitmapHandler' => 'includes/media/Bitmap.php',
Deleted: trunk/phase3/includes/PatrolLog.php
===================================================================
--- trunk/phase3/includes/PatrolLog.php 2011-09-20 08:36:34 UTC (rev 97602)
+++ trunk/phase3/includes/PatrolLog.php 2011-09-20 08:39:29 UTC (rev 97603)
@@ -1,58 +0,0 @@
-<?php
-
-/**
- * Class containing static functions for working with
- * logs of patrol events
- *
- * @author Rob Church <[email protected]>
- * @author Niklas Laxström
- */
-class PatrolLog {
-
- /**
- * Record a log event for a change being patrolled
- *
- * @param $rc Mixed: change identifier or RecentChange object
- * @param $auto Boolean: was this patrol event automatic?
- *
- * @return bool
- */
- public static function record( $rc, $auto = false ) {
- if ( !$rc instanceof RecentChange ) {
- $rc = RecentChange::newFromId( $rc );
- if ( !is_object( $rc ) ) {
- return false;
- }
- }
-
- $title = Title::makeTitleSafe( $rc->getAttribute(
'rc_namespace' ), $rc->getAttribute( 'rc_title' ) );
- if( $title ) {
- $entry = new ManualLogEntry( 'patrol', 'patrol' );
- $entry->setTarget( $title );
- $entry->setParameters( self::buildParams( $rc, $auto )
);
- $entry->setPerformer( User::newFromName(
$rc->getAttribute( 'rc_user_text' ), false ) );
- $logid = $entry->insert();
- if ( !$auto ) {
- $entry->publish( $logid, 'udp' );
- }
- return true;
- }
- return false;
- }
-
- /**
- * Prepare log parameters for a patrolled change
- *
- * @param $change RecentChange to represent
- * @param $auto Boolean: whether the patrol event was automatic
- * @return Array
- */
- private static function buildParams( $change, $auto ) {
- return array(
- '4::curid' => $change->getAttribute( 'rc_this_oldid' ),
- '5::previd' => $change->getAttribute( 'rc_last_oldid' ),
- '6::auto' => (int)$auto
- );
- }
-
-}
Copied: trunk/phase3/includes/logging/PatrolLog.php (from rev 97601,
trunk/phase3/includes/PatrolLog.php)
===================================================================
--- trunk/phase3/includes/logging/PatrolLog.php (rev 0)
+++ trunk/phase3/includes/logging/PatrolLog.php 2011-09-20 08:39:29 UTC (rev
97603)
@@ -0,0 +1,58 @@
+<?php
+
+/**
+ * Class containing static functions for working with
+ * logs of patrol events
+ *
+ * @author Rob Church <[email protected]>
+ * @author Niklas Laxström
+ */
+class PatrolLog {
+
+ /**
+ * Record a log event for a change being patrolled
+ *
+ * @param $rc Mixed: change identifier or RecentChange object
+ * @param $auto Boolean: was this patrol event automatic?
+ *
+ * @return bool
+ */
+ public static function record( $rc, $auto = false ) {
+ if ( !$rc instanceof RecentChange ) {
+ $rc = RecentChange::newFromId( $rc );
+ if ( !is_object( $rc ) ) {
+ return false;
+ }
+ }
+
+ $title = Title::makeTitleSafe( $rc->getAttribute(
'rc_namespace' ), $rc->getAttribute( 'rc_title' ) );
+ if( $title ) {
+ $entry = new ManualLogEntry( 'patrol', 'patrol' );
+ $entry->setTarget( $title );
+ $entry->setParameters( self::buildParams( $rc, $auto )
);
+ $entry->setPerformer( User::newFromName(
$rc->getAttribute( 'rc_user_text' ), false ) );
+ $logid = $entry->insert();
+ if ( !$auto ) {
+ $entry->publish( $logid, 'udp' );
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Prepare log parameters for a patrolled change
+ *
+ * @param $change RecentChange to represent
+ * @param $auto Boolean: whether the patrol event was automatic
+ * @return Array
+ */
+ private static function buildParams( $change, $auto ) {
+ return array(
+ '4::curid' => $change->getAttribute( 'rc_this_oldid' ),
+ '5::previd' => $change->getAttribute( 'rc_last_oldid' ),
+ '6::auto' => (int)$auto
+ );
+ }
+
+}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs