/** * Creates a singleton connection handle * * @return CF_Connection */ private function auth() { if (is_null($this->conn)) { $username = Mage::getStoreConfig('imagecdn/rackspace/username'); $api_key = Mage::getStoreConfig('imagecdn/rackspace/api_key'); $auth = new CF_Authentication($username, $api_key); $auth->ssl_use_cabundle(); $auth->authenticate(); if ($auth->authenticated()) { $this->conn = new CF_Connection($auth); $this->conn->ssl_use_cabundle(); return $this->conn; } else { return false; } } else { return $this->conn; } }