=== PHP SDK Reference ==== Getting Started Inside the `clients/php` directory of the installation is an SDK for using Helix Web Services from PHP. Typically, you'll create an instance of `HelixWebServices\Api\DefaultApi`, configure it, and log in to your user. [source,php] .... use HelixWebServices\Api\DefaultApi; use HelixWebServices\Model\LoginRequest; $api = new DefaultApi(); $api->getApiClient()->getConfig()->setHost("https://helix.mycompany.com/api"); // If you are using the default installation, you'll likely need to disable SSL verification. // The default install creates a self-signed certificate, which is intended to be replaced // by your certificate. // $api->getApiClient()->getConfig()->setSslVerification(false); $login_request = new LoginRequest(); $login_request->setUser("myuser"); $login_request->setPassword("mypassword"); $login_response = $api->loginPost($login_request); $api->getApiClient()->getConfig()->setApiKey("Authorization", $login_response->getTicket()); // Now, list depots available on the p4d server with id 'myserver' $depots = $api->serverDepotsGet("myserver"); .... WARNING: The PHP client library includes the `/api` base path as part of the host URL configuration. In most other clients, this is a separate configuration value. [[php-api-client]] ==== ApiClient Reference The `ApiClient` implements basic interacting with the server, that is used by `DefaultApi` and `AlphaApi` classes. You access this usually by the `getApiClient()` method of these classes. [source,php] .... $api = new HelixWebServices\Api\DefaultApi(); $api->getApiClient(); .... [[php-api-client-get-config]] ===== ApiClient::getConfig .Method Signature [source,php] .... Configuration HelixWebServices\ApiClient::getConfig() .... .Returns [cols="1,2a", options="header"] |=== | Type | Notes | See <<php-configuration>> | |=== [[php-configuration]] ==== Configuration Reference The `Configuration` class is used by the `ApiClient` as the pool of settings that alter behavior for interacting with the underlying server. It is created with the `ApiClient`, which is typically owned by the `DefaultApi` or `AlphaApi` instance you create. [source,php] .... $api = new HelixWebServices\Api\DefaultApi(); $config = $api->getApiClient()->getConfig(); .... .Properties [cols="1,1,2a", options="header"] |=== | Name | Type | Description | apiKey | string | The authentication token for the user, as returned from login. | curlTimeout | string | The timeout (in seconds) of the HTTP request. Defaults to 0, which means no timeout. | debug | bool | Enable debug messaging. Defaults to false. | debugFile | string | Debug file location. Defaults to STDOUT by default. | host | string | The base URL we use to connect to the server, including the `/api/VERSION` string, e.g., `https://helix.mycompany.com/api`. | tempFolderPath | string | Debug file location. | sslVerification | boolean | Set to false to disable SSL verification. | userAgent | string | The User-Agent of the HTTP request, set to "PHP-Swagger" by default. |=== [[php-configuration-add-default-header]] ===== Configuration::addDefaultHeader Adds a default request header to all requests. .Method Signature [source,php] .... Configuration Configuration::addDefaultHeader($headerName, $headerValue) .... .Parameters [cols="1,1,2a,1", options="header"] |=== | Name | Type | Description | Required | $headerName | string | The header name (e.g., `Token`). | Yes | $headerValue | string | The header value (e.g., `1zu38fh`). |=== .Returns [cols="1,2a", options="header"] |=== | Type | Notes | <<php-configuration>> | This configuration object. |=== [[php-configuration-delete-default-header]] ===== Configuration::deleteDefaultHeader Removes a request header that may exist in the configuration. .Method Signature [source,php] .... Configuration Configuration::deleteDefaultHeader($headerName) .... .Parameters [cols="1,1,2a,1", options="header"] |=== | Name | Type | Description | Required | $headerName | string | The header name (e.g., `Token`). | Yes |=== .Returns [cols="1,2a", options="header"] |=== | Type | Notes | <<php-configuration>> | This configuration object. |=== [[php-configuration-get-default-headers]] ===== Configuration::getDefaultHeaders Retruns the array of request headers we set. .Method Signature [source,php] .... array Configuration::getDefaultHeaders() .... .Returns [cols="1,2a", options="header"] |=== | Type | Notes | array | The mapping of default request header names to values. |=== [[php-default-api]] ==== DefaultApi Reference include::../php-default.adoc[] [[php-alpha-api]] ==== AlphaApi Reference include::../php-alpha.adoc[] [[php-model]] ==== Model Reference include::../php-models.adoc[]