Skip to content

Limited Config  #13

@yagami271

Description

@yagami271

Hello,
when i see https://github.com/SlimPay/hapiclient-php/blob/master/src/Http/HapiClient.php
the constructor of HapiClient call the client's custructor, so you cant add spécific configuration for Client

public function __construct(
            $apiUrl = null,
            $entryPointUrl = '/',
            $profile = null,
            AuthenticationMethod $authenticationMethod = null)
    {
        $this->apiUrl = trim($apiUrl);
        $this->entryPointUrl = trim($entryPointUrl);
        $this->profile = trim($profile);
        $this->authenticationMethod = $authenticationMethod;
        
        if ($this->apiUrl) {
            $baseUrl = rtrim($this->apiUrl, '/') . '/';
            
            if (Misc::isGuzzle6()) {

                $this->client = new Client(['base_uri' => $baseUrl,'proxy'=>'XX.XX.XXX.XX:XXXXX']);
            } else {
                $this->client = new Client(['base_url' => $baseUrl]);
            }
        } else {
            $this->client = new Client();
        }
    }


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions