http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73782

Revision: 73782
Author:   kwisatz
Date:     2010-09-26 16:27:36 +0000 (Sun, 26 Sep 2010)

Log Message:
-----------
QrCode: improved debugging statements, replaced deprecated call to User::isBot()

Modified Paths:
--------------
    trunk/extensions/QrCode/QrCode.php

Modified: trunk/extensions/QrCode/QrCode.php
===================================================================
--- trunk/extensions/QrCode/QrCode.php  2010-09-26 15:59:33 UTC (rev 73781)
+++ trunk/extensions/QrCode/QrCode.php  2010-09-26 16:27:36 UTC (rev 73782)
@@ -22,7 +22,7 @@
 $wgExtensionCredits['parserhook'][] = array(
        'path' => __FILE__,
        'name' => 'QrCode',
-       'version' => '0.06',
+       'version' => '0.07',
        'author' => array( 'David Raison' ), 
        'url' => 'http://www.mediawiki.org/wiki/Extension:QrCode',
        'descriptionmsg' => 'qrcode-desc'
@@ -149,7 +149,8 @@
                $tmpName = tempnam( $wgTmpDirectory, 'qrcode' );
 
                QRcode::png( $this->_label, $tmpName, $this->_ecc, 
$this->_size, $this->_margin );
-               wfDebug( "Generated qrcode file $tmpName with ecc 
".$this->_ecc.", ".$this->_size." and boundary ".$this->_margin.".\n" );
+               wfDebug( "QrCode::_generate: Generated qrcode file $tmpName 
with ecc ".$this->_ecc
+                       .", ".$this->_size." and boundary 
".$this->_margin.".\n" );
 
                return $this->_publish( $tmpName );
        }
@@ -162,14 +163,15 @@
        private function _getBot(){
                $bot = User::createNew( $this->_qrCodeBot );
                if( $bot != null ){
+                       wfDebug( 'QrCode::_getBot: Created new user 
'.$this->_qrCodeBot."\n" );
                        //$bot->setPassword( '' );   // doc says empty password 
disables, but this triggers an exception
                } else {
                        $bot = User::newFromName( $this->_qrCodeBot );
-                       wfDebug( 'Created new user '.$this->_qrCodeBot );
                }   
-               if( !$bot->isBot() ) {
+
+               if( !$bot->isAllowed( 'bot' ) ) {       // User::isBot() has 
been deprecated
                        $bot->addGroup( 'bot' );
-                       wfDebug( 'Added user '.$this->_qrCodeBot.' to Bot 
group' );
+                       wfDebug( 'QrCode::_getBot: Added user 
'.$this->_qrCodeBot.' to Bot group'."\n" );
                }
 
                return $bot;
@@ -178,7 +180,7 @@
        /**
         * Handle mediawiki file repositories
         * @param $tmpName, the file's temporary name
-        * @return boolean value for success or failure of file "upload"
+        * @return boolean false on failure or wikitext on success
         */
        private function _publish( $tmpName ){
                global $wgOut;



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to