Fix unnecessary GlobalFunctions.php bloat from r41148
authorTim Starling <tstarling@users.mediawiki.org>
Wed, 24 Sep 2008 08:36:44 +0000 (08:36 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Wed, 24 Sep 2008 08:36:44 +0000 (08:36 +0000)
includes/GlobalFunctions.php
includes/RecentChange.php

index 440791e..34260c7 100644 (file)
@@ -2907,20 +2907,3 @@ function wfStripIllegalFilenameChars( $name ) {
        $name = preg_replace ( "/[^".Title::legalChars()."]|:/", '-', $name );
        return $name;
 }
-
-/**
- * Send some text to
- * @param string $line
- */
-function wfRecentChange2UDP( $line ) {
-       global $wgRC2UDPAddress, $wgRC2UDPPort, $wgRC2UDPPrefix;
-       # Notify external application via UDP
-       if( $wgRC2UDPAddress ) {
-               $conn = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP );
-               if( $conn ) {
-                       $line = $wgRC2UDPPrefix . $line;
-                       socket_sendto( $conn, $line, strlen($line), 0, $wgRC2UDPAddress, $wgRC2UDPPort );
-                       socket_close( $conn );
-               }
-       }
-}
index b1c70d8..a2f965c 100644 (file)
@@ -210,7 +210,7 @@ class RecentChange
 
                # Notify external application via UDP
                if ( $wgRC2UDPAddress && ( !$this->mAttribs['rc_bot'] || !$wgRC2UDPOmitBots ) ) {
-                       wfRecentChange2UDP( $this->getIRCLine() );
+                       self::sendToUDP( $this->getIRCLine() );
                }
 
                # E-mail notifications
@@ -239,6 +239,23 @@ class RecentChange
                wfRunHooks( 'RecentChange_save', array( &$this ) );
        }
 
+       /**
+        * Send some text to UDP
+        * @param string $line
+        */
+       static function sendToUDP( $line ) {
+               global $wgRC2UDPAddress, $wgRC2UDPPort, $wgRC2UDPPrefix;
+               # Notify external application via UDP
+               if( $wgRC2UDPAddress ) {
+                       $conn = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP );
+                       if( $conn ) {
+                               $line = $wgRC2UDPPrefix . $line;
+                               socket_sendto( $conn, $line, strlen($line), 0, $wgRC2UDPAddress, $wgRC2UDPPort );
+                               socket_close( $conn );
+                       }
+               }
+       }
+
        /**
         * Mark a given change as patrolled
         *