[Labs-l] PHP update?

Maximilian Doerr cybernet678 at yahoo.com
Tue Oct 22 17:35:10 UTC 2013


It seems to happen on the grid at random.  
Below is a PHP fragment:

echo "Retrieving blacklists...\n\n";
    $d = 0;
    $a = 0;
    $e = 0;
    $status = array( 'status' => 'start', 'bladd'=>$a, 'bldeleted'=>$d, 'blexception'=>$e, 'scanprogress'=>'x', 'scantype'=>'x' );
    $rundata = array();
    updateStatus();
    $globalblacklistregex = $site2->initPage( 'Spam blacklist' )->get_text();
    $globalblacklistregexarray = explode( "\n", $globalblacklistregex );
    $rundata['globalblacklistregex'] = $globalblacklistregexarray;                                                                     

    $blacklistregex = $site->initPage( 'MediaWiki:Spam-blacklist' )->get_text();
    $blacklistregexarray = explode( "\n", $blacklistregex );
    $rundata['blacklistregex'] = $blacklistregexarray; 
    $blacklistregex = buildSafeRegexes(array_merge($blacklistregexarray, $globalblacklistregexarray));
    $rundata['blacklist'] = $blacklistregex;

    $whitelistregex = $site->initPage( 'MediaWiki:Spam-whitelist' )->get_text();
    $whitelistregexarray = explode( "\n", $whitelistregex );
    $whitelistregex = buildSafeRegexes($whitelistregexarray);
    $rundata['whitelist'] = $whitelistregex;
    $rundata['whitelistregex'] = $whitelistregexarray;
    
    $dblocal = new Database( 'tools-db', $toolserver_username2, $toolserver_password2, 'cyberbot' );
    $dbwiki = new Database( 'enwiki.labsdb', $toolserver_username, $toolserver_password, 'enwiki_p' );
	$pagebuffer = array();
		
    $exceptions = $site->initPage( 'User:Cyberpower678/spam-exception.js' )->get_text();
    if( !is_null($exceptions) ) {
        $exceptions = explode( "\n", $exceptions );
        $exceptions = stripLines( $exceptions );
        $exceptions = str_replace( "<nowiki>", "", $exceptions );
        $exceptions = str_replace( "</nowiki>", "", $exceptions );
        foreach( $exceptions as $id=>$exception ) {
            if( str_replace( 'ns=', '', $exception ) != $exception ) $temp[] = array( 'ns'=>trim( substr( $exception, strlen("ns=") ) ) );
            else {
                $exception = explode( '|', $exception );
                $temp[] = array( 'page'=>trim( substr( $exception[0], strlen("page=") ) ), 'url'=>trim( substr( $exception[1], strlen("url=") ) ) );
            }
        }
        $exceptions = $temp;
        unset($temp);
    }

    if( !isset( $exceptions[0]['page'] ) && !isset( $exceptions[0]['url'] ) && !isset( $exceptions[0]['ns'] ) ) $exceptions = null;

So when I run this on my computer, it runs fine, but it tends to randomly fail on labs.
$globalblacklistregex = $site2->initPage( 'Spam blacklist' )->get_text();  always returns page text 
$blacklistregex = $site->initPage( 'MediaWiki:Spam-blacklist' )->get_text();  always returns page text
$whitelistregex = $site->initPage( 'MediaWiki:Spam-whitelist' )->get_text();  always returns page text
$exceptions = $site->initPage( 'User:Cyberpower678/spam-exception.js' )->get_text(); mostly returns PHP Notice:  unserialize(): Error at offset 0 of 3xxx bytes in /data/project/cyberbot/Peachy/Includes/Wiki.php on line 596
	Where xxx is some random number.  Occasionally it returns page text.

-----Original Message-----
From: labs-l-bounces at lists.wikimedia.org [mailto:labs-l-bounces at lists.wikimedia.org] On Behalf Of Marc A. Pelletier
Sent: Tuesday, October 22, 2013 9:17 AM
To: labs-l at lists.wikimedia.org
Subject: Re: [Labs-l] PHP update?

On 10/22/2013 08:48 AM, Maximilian Doerr wrote:
> Was PHP recently updated on labs?  I’ve got this major unserialization 
> error that seems to be happening at random.  The bot bug that I have 
> been struggling to debug has no logical explanation to what could be 
> causing it.

No updates.

Do you get that error on the grid or does it also occur when testing "by hand"?

-- Marc



_______________________________________________
Labs-l mailing list
Labs-l at lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/labs-l




More information about the Labs-l mailing list