|
1 | 1 | # A SoftLayer API PHP client.
|
2 | 2 |
|
3 |
| -[](https://travis-ci.org/softlayer/softlayer-api-php-client) |
| 3 | + |
4 | 4 |
|
5 | 5 | ## Warning
|
6 | 6 |
|
7 |
| -``` |
8 |
| -The latest version 1.x is not backwards-compatible. |
9 |
| -It is necessary to update scripts to function properly with the new version. |
10 |
| -``` |
| 7 | +Use [v1.2.0](https://github.com/softlayer/softlayer-api-php-client/releases/tag/v1.2) for older PHP versions (php < 8.0) . [v2.0.0](https://github.com/softlayer/softlayer-api-php-client/releases/tag/v2.0.0) for php 8.0 or higher. |
| 8 | + |
| 9 | +[PHP 8.0 removed XMLRPC](https://php.watch/versions/8.0/xmlrpc) as a built in extension. As such, it is no longer required as part of the composer file in this project. The XmlRpcClient still exists here if you need it, but we assume most users are using the SoapClient. If there are any issues with this [Let us know on github](https://github.com/softlayer/softlayer-api-php-client/issues) |
11 | 10 |
|
12 | 11 | ## Overview
|
13 | 12 |
|
14 | 13 | The SoftLayer API PHP client classes provide a simple method for connecting to and making calls from the SoftLayer API and provides support for many of the SoftLayer API's features. Method calls and client management are handled by the PHP SOAP and XML-RPC extensions.
|
15 | 14 |
|
16 |
| -Making API calls using the `\SoftLayer\SoapClient` or `\SoftLayer\XmlRpcClient` classes is done in the following steps: |
| 15 | +Making API calls using the `\SoftLayer\SoapClient` is done in the following steps: |
17 | 16 |
|
18 |
| -1. Instantiate a new `\SoftLayer\SoapClient` or `\SoftLayer\XmlRpcClient` object using the `\SoftLayer\SoapClient::getClient()` or `\SoftLayer\XmlRpcClient::getClient()` methods. Provide the name of the service that you wish to query, an optional id number of the object that you wish to instantiate, your SoftLayer API username, your SoftLayer API key, and an optional API endpoint base URL. The client classes default to connect over the public Internet. Enter `\SoftLayer\SoapClient::API_PRIVATE_ENDPOINT` or `\SoftLayer\XmlRpcClient::API_PRIVATE_ENDPOINT` to connect to the API over SoftLayer's private network. The system making API calls must be connected to SoftLayer's private network (eg. purchased from SoftLayer or connected via VPN) in order to use the private network API endpoints. |
19 |
| -2. Define and add optional headers to the client, such as object masks and result limits. |
20 |
| -3. Call the API method you wish to call as if it were local to your client object. This class throws exceptions if it's unable to execute a query, so it's best to place API method calls in try / catch statements for proper error handling. |
| 17 | +1. Instantiate a new `\SoftLayer\SoapClient` object using the `\SoftLayer\SoapClient::getClient()` method. Provide the name of the service that you wish to query, an optional id number of the object that you wish to instantiate, your SoftLayer API username, your SoftLayer API key, and an optional API endpoint base URL. The client classes default to connect over the public Internet. |
| 18 | +2. Use `\SoftLayer\SoapClient::API_PRIVATE_ENDPOINT` to connect to the API over SoftLayer's private network. The system making API calls must be connected to SoftLayer's private network (eg. purchased from SoftLayer or connected via VPN) in order to use the private network API endpoints. |
| 19 | +3. Define and add optional headers to the client, such as object masks and result limits. |
| 20 | +4. Call the API method you wish to call as if it were local to your client object. This class throws exceptions if it's unable to execute a query, so it's best to place API method calls in try / catch statements for proper error handling. |
21 | 21 |
|
22 | 22 | Once your method is executed you may continue using the same client if you need to connect to the same service or define another client object if you wish to work with multiple services at once.
|
23 | 23 |
|
24 |
| -The most up to date version of this library can be found on the SoftLayer github public repositories: [http://github.com/softlayer/](http://github.com/softlayer/) . Please post to the SoftLayer forums [Stack Overflow](https://stackoverflow.com) or open a support ticket in the SoftLayer customer portal if you have any questions regarding use of this library. If you use Stack Overflow please tag your posts with “SoftLayer” so our team can easily find your post. |
| 24 | + |
| 25 | +The most up to date version of this library can be found on the SoftLayer github public repositories: [https://github.com/softlayer/softlayer-api-php-client](https://github.com/softlayer/softlayer-api-php-client) . Any issues using this library, please open a [Github Issue](https://github.com/softlayer/softlayer-api-php-client/issues) |
| 26 | + |
25 | 27 |
|
26 | 28 | ## System Requirements
|
27 | 29 |
|
28 |
| -The `\SoftLayer\SoapClient` class requires at least PHP 5.3.0 and the PHP SOAP enxtension installed. The `\SoftLayer\XmlRpcClient` class requires PHP at least PHP 5 and the PHP XML-RPC extension installed. |
| 30 | +The `\SoftLayer\SoapClient` class requires at least PHP 8.0.0 and the PHP SOAP enxtension installed and enabled (`extension=soap` in the php.ini file). |
| 31 | +Since [php 8.0 has removed xmlrpc extension](https://php.watch/versions/8.0/xmlrpc) you will need to manually install this library to use the `\SoftLayer\XmlRpcClient`. If you are using an earlier version of php that still includes ext-xml, please use v1.2.0 of this library. |
29 | 32 |
|
30 |
| -A valid API username and key are required to call the SoftLayer API. A connection to the SoftLayer private network is required to connect to SoftLayer's private network API endpopints. |
| 33 | +A valid API username and key are required to call the SoftLayer API. A connection to the SoftLayer private network is required to connect to SoftLayer's private network API endpopints. See [Authenticating to the SoftLayer API](https://sldn.softlayer.com/article/authenticating-softlayer-api/) for how to get these API keys. |
31 | 34 |
|
32 | 35 | ## Installation
|
33 | 36 |
|
34 | 37 | Install the SoftLayer API client using [Composer](https://getcomposer.org/).
|
35 | 38 | ```bash
|
36 |
| -composer require softlayer/softlayer-api-php-client:~1.0@dev |
| 39 | +composer require softlayer/softlayer-api-php-client:~2.0.0 |
37 | 40 | ```
|
38 | 41 |
|
39 | 42 | ## Usage
|
@@ -107,4 +110,4 @@ This software is written by the SoftLayer Development Team <[ [email protected]]
|
107 | 110 |
|
108 | 111 | ## Copyright
|
109 | 112 |
|
110 |
| -This software is Copyright © 2009 – 2010 [SoftLayer Technologies, Inc](http://www.softlayer.com/). See the bundled LICENSE.textile file for more information. |
| 113 | +This software is Copyright © 2009 – 2022 [SoftLayer Technologies, Inc](http://www.softlayer.com/). See the bundled LICENSE.textile file for more information. |
0 commit comments