WordPress.org

Plugin Directory

Changeset 337290


Ignore:
Timestamp:
01/25/11 23:47:40 (3 years ago)
Author:
apokalyptik
Message:

fix variable name mismatch, remove code that never evaluates to true

Location:
hyperdb/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • hyperdb/trunk/db-config.php

    r261277 r337290  
    5959 
    6060/** 
    61  * tcp_responsiveness_check 
     61 * check_tcp_responsiveness 
    6262 * Enables checking TCP responsiveness by fsockopen prior to mysql_connect or 
    6363 * mysql_pconnect. This was added because PHP's mysql functions do not provide 
     
    6666 * Default: true 
    6767 */ 
    68 $wpdb->tcp_responsiveness_check = true; 
     68$wpdb->check_tcp_responsiveness = true; 
    6969 
    7070/** Configuration Functions **/ 
  • hyperdb/trunk/db.php

    r321090 r337290  
    794794     */ 
    795795    function check_tcp_responsiveness($host, $port, $float_timeout) { 
    796         if ( 1 == 2 && function_exists('apc_store') ) { 
    797             $use_apc = true; 
    798             $apc_key = "{$host}{$port}"; 
    799             $apc_ttl = 10; 
    800         } else { 
    801             $use_apc = false; 
    802         } 
    803         if ( $use_apc ) { 
    804             $cached_value=apc_fetch($apc_key); 
    805             switch ( $cached_value ) { 
    806                 case 'up': 
    807                     $this->tcp_responsive = 'true'; 
    808                     return true; 
    809                 case 'down': 
    810                     $this->tcp_responsive = 'false'; 
    811                     return false; 
    812             } 
    813         } 
    814             $socket = @ fsockopen($host, $port, $errno, $errstr, $float_timeout); 
    815             if ( $socket === false ) { 
    816             if ( $use_apc ) 
    817                 apc_store($apc_key, 'down', $apc_ttl); 
     796        $socket = @ fsockopen($host, $port, $errno, $errstr, $float_timeout); 
     797        if ( $socket === false ) 
    818798            return "[ > $float_timeout ] ($errno) '$errstr'"; 
    819         } 
    820799        fclose($socket); 
    821         if ( $use_apc ) 
    822             apc_store($apc_key, 'up', $apc_ttl); 
    823             return true; 
     800        return true; 
    824801    } 
    825802 
Note: See TracChangeset for help on using the changeset viewer.