/** * Connect to the CloudFiles Service * @return boolean success * @throws CloudFilesException * @throws AuthenticationException * @throws InvalidResponseException */ protected static function connect() { if ($server = self::$server_to_auth_map[self::getConfig('server')]) { self::$Authentication = new CF_Authentication(self::getConfig('username'), self::getConfig('api_key'), null, $server); self::$Authentication->ssl_use_cabundle(); self::$Authentication->authenticate(); $hostname = gethostname(); // Check to see if this is a rackspace node if (stripos($hostname, 'rackspace') === FALSE) { $serviceNet = FALSE; } else { $serviceNet = TRUE; } self::$Connection = new CF_Connection(self::$Authentication, $serviceNet); } $retval = !!self::$Connection; if (!$retval) { self::error("Unable to connect to rackspace, check your settings."); } return $retval; }