The constructor for the CoMech\TRP\API class sets up the default variables used, such as the path to the certificate file and optionally a PSR-3 compliant logger. If the logger you choose is enabled, debug messages are output using the debug log facility. If you do not specify a logger, debug messages are silently dropped.
Parameters
$certificatefile | A path to a PEM format certificate file, with the private key included. Only the public key portion is sent over the wire to the server. |
---|
$logger | An instance of a PSR-3 compliant logger interface. |
---|
Return value
Constructors do not return values. Calling the constructor as part of object construction returns an instance of the CoMech\TRP\API class.
Possible Exceptions
The constructor may throw one of the following exceptions on error:
CoMech\TRP\Exception\FileNotFoundException | The certificate file you specified cannot be found (or accessed) |
---|
CoMech\TRP\Exception\CertificateFormatException | The certificate file you specified is an invalid format. The certificate file should be a correctly formatted OpenSSL-comaptible PEM file. |
---|