Ejemplo n.º 1
0
 public static function getInstance()
 {
     if (null === self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Ejemplo n.º 2
0
 protected function __construct()
 {
     $this->config = Gengo_Config::getInstance();
     // default user agent string
     $user_agent = 'Gengo PHP Library; Version 2.1.3; http://gengo.com/';
     $user_agent = $this->config->get('useragent', $user_agent);
     $config = array('maxredirects' => 1, 'useragent' => $user_agent, 'timeout' => $this->config->get('timeout', 120), 'keepalive' => false);
     $this->client = new Zend_Http_Client(null, $config);
 }
Ejemplo n.º 3
0
 public function __construct($api_key = null, $private_key = null)
 {
     $this->config = Gengo_Config::getInstance();
     if (!is_null($api_key)) {
         $this->config->api_key = $api_key;
     }
     if (!is_null($private_key)) {
         $this->config->private_key = $private_key;
     }
     $this->client = Gengo_Client::getInstance();
     $this->response = null;
 }