public function __construct()

in Aliyun/Log/Client.php [76:97]


    public function __construct(
        string $endpoint,
        string $accessKeyId = "",
        string $accessKey = "",
        string $token = "",
        Aliyun_Log_Models_CredentialsProvider $credentialsProvider = null
    ) {
        $this->setEndpoint($endpoint); // set $this->logHost
        if (!is_null($credentialsProvider)) {
            $this->credentialsProvider = $credentialsProvider;
        } else {
            if (empty($accessKeyId) || empty($accessKey)) {
                throw new Aliyun_Log_Exception("InvalidAccessKey", "accessKeyId or accessKeySecret is empty", "");
            }
            $this->credentialsProvider = new Aliyun_Log_Models_StaticCredentialsProvider(
                $accessKeyId,
                $accessKey,
                $token
            );
        }
        $this->source = Aliyun_Log_Util::getLocalIp();
    }