Uploadcare\Api::__construct PHP Method

__construct() public method

Constructor
public __construct ( string $public_key, string $secret_key, string $userAgentName = null, string $cdn_host = null, string $cdn_protocol = null, integer $retry_throttled = null )
$public_key string A public key given by Uploadcare.com
$secret_key string A private (secret) key given by Uploadcare.com
$userAgentName string Custom User agent name to report
$cdn_host string CDN Host
$cdn_protocol string CDN Protocol
$retry_throttled integer Retry throttled requests this number of times
    public function __construct($public_key, $secret_key, $userAgentName = null, $cdn_host = null, $cdn_protocol = null, $retry_throttled = null)
    {
        $this->public_key = $public_key;
        $this->secret_key = $secret_key;
        $this->widget = new Widget($this);
        $this->uploader = new Uploader($this);
        if ($cdn_host !== null) {
            $this->cdn_host = $cdn_host;
        }
        if ($cdn_protocol !== null) {
            $this->cdn_protocol = $cdn_protocol;
        }
        if ($retry_throttled !== null) {
            $this->retry_throttled = $retry_throttled;
        }
        if ($userAgentName !== null) {
            $this->userAgentName = $userAgentName;
        }
    }

Usage Example

 public function __construct($public, $private)
 {
     parent::__construct($public, $private);
 }