__construct() public method

Construct
public __construct ( $base_url = null )
$base_url
示例#1
0
 /**
  *	Конструктор
  *
  *	@param	string	$base_url
  */
 public function __construct($base_url = null)
 {
     parent::__construct($base_url);
     $this->setOpt(CURLOPT_SSL_VERIFYPEER, false);
     $this->setJsonDecoder(function ($response) {
         if (($json_obj = json_decode($response, true)) !== null) {
             return $json_obj;
         }
         return $response;
     });
 }
示例#2
0
 public function __construct($account, $user, $key)
 {
     try {
         if (count(func_get_args()) !== 3) {
             throw new \Exception("HiboutikAPI: The contructor expects exactly 3 (three) arguments.");
         }
         $this->account_connection = "https://" . $account . ".hiboutik.com/apirest";
         $this->user_connection = $user;
         $this->key_connection = $key;
         $this->debug = false;
         parent::__construct();
         $user_agent = "HiboutikAPI v" . self::VERSION_API . " (+https://github.com/hiboutik/hiboutikapi)";
         $user_agent .= " PHP/" . PHP_VERSION;
         $curl_version = curl_version();
         $user_agent .= ' curl/' . $curl_version['version'];
         $this->setUserAgent($user_agent);
         $this->setBasicAuthentication($user, $key);
     } catch (\Exception $e) {
         trigger_error($e->getMessage(), E_USER_ERROR);
     }
 }
示例#3
0
 public function __construct()
 {
     parent::__construct();
 }
示例#4
0
 /**
  * Constructor
  *
  * @param array $conf key and login prameters
  */
 public function __construct(array $conf)
 {
     parent::__construct();
     $this->_data = $conf;
 }