forked from GNUsocial/gnu-social
		
	Merge remote branch 'gitorious/1.0.x' into 1.0.x
This commit is contained in:
		@@ -338,13 +338,27 @@ class Memcached_DataObject extends Safe_DataObject
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $start = microtime(true);
 | 
			
		||||
        $result = parent::_query($string);
 | 
			
		||||
        $fail = false;
 | 
			
		||||
        try {
 | 
			
		||||
            $result = parent::_query($string);
 | 
			
		||||
        } catch (Exception $e) {
 | 
			
		||||
            $fail = $e;
 | 
			
		||||
        }
 | 
			
		||||
        $delta = microtime(true) - $start;
 | 
			
		||||
 | 
			
		||||
        $limit = common_config('db', 'log_slow_queries');
 | 
			
		||||
        if (($limit > 0 && $delta >= $limit) || common_config('db', 'log_queries')) {
 | 
			
		||||
            $clean = $this->sanitizeQuery($string);
 | 
			
		||||
            common_log(LOG_DEBUG, sprintf("DB query (%0.3fs): %s", $delta, $clean));
 | 
			
		||||
            if ($fail) {
 | 
			
		||||
                $msg = sprintf("FAILED DB query (%0.3fs): %s - %s", $delta, $fail->getMessage(), $clean);
 | 
			
		||||
            } else {
 | 
			
		||||
                $msg = sprintf("DB query (%0.3fs): %s", $delta, $clean);
 | 
			
		||||
            }
 | 
			
		||||
            common_log(LOG_DEBUG, $msg);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ($fail) {
 | 
			
		||||
            throw $fail;
 | 
			
		||||
        }
 | 
			
		||||
        return $result;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -396,7 +396,7 @@ class StatusNet
 | 
			
		||||
    static function isHTTPS()
 | 
			
		||||
    {
 | 
			
		||||
        // There are some exceptions to this; add them here!
 | 
			
		||||
        return $_SERVER['HTTPS'];
 | 
			
		||||
        return !empty($_SERVER['HTTPS']);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user