array(), 'httpClient' => new Zend_Http_Client(), 'host' => 'http://services.nirvanix.com'); $this->_options = array_merge($defaultOptions, $options); // login and save sessionToken to default POST params $resp = $this->getService('Authentication')->login($authParams); $this->_options['defaults']['sessionToken'] = (string)$resp->SessionToken; } /** * Nirvanix divides its service into namespaces, with each namespace * providing different functionality. This is a factory method that * returns a preconfigured Zend_Service_Nirvanix_Namespace_Base proxy. * * @param string $namespace Name of the namespace * @return Zend_Service_Nirvanix_Namespace_Base */ public function getService($namespace, $options = array()) { switch ($namespace) { case 'IMFS': $class = 'Zend_Service_Nirvanix_Namespace_Imfs'; break; default: $class = 'Zend_Service_Nirvanix_Namespace_Base'; } $options['namespace'] = ucfirst($namespace); $options = array_merge($this->_options, $options); if (!class_exists($class)) { require_once 'Zend/Loader.php'; Zend_Loader::loadClass($class); } return new $class($options); } /** * Get the configured options. * * @return array */ public function getOptions() { return $this->_options; } }