Skip to content

Commit

Permalink
Merge pull request #29 from softlayer/php8.1.12
Browse files Browse the repository at this point in the history
Php8.1.12 support
  • Loading branch information
allmightyspiff authored Nov 7, 2022
2 parents dfe76dd + 3d36916 commit 8afd99b
Show file tree
Hide file tree
Showing 11 changed files with 2,379 additions and 1,036 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: CI

on: [push]

jobs:
build-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: php-actions/composer@v6 # or alternative dependency management
with:
php_version: '8.1'
php_extensions: 'soap'
- uses: php-actions/phpunit@v3
with:
php_version: '8.1'
php_extensions: 'soap'
- uses: actions/upload-artifact@v2
with:
name: debug-output
path: output.log
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

31 changes: 17 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
# A SoftLayer API PHP client.

[![Build Status](https://travis-ci.org/softlayer/softlayer-api-php-client.svg?branch=master)](https://travis-ci.org/softlayer/softlayer-api-php-client)
![Build Status](https://github.com/softlayer/softlayer-api-php-client/actions/workflows/test.yml/badge.svg)

## Warning

```
The latest version 1.x is not backwards-compatible.
It is necessary to update scripts to function properly with the new version.
```
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.

[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)

## Overview

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.

Making API calls using the `\SoftLayer\SoapClient` or `\SoftLayer\XmlRpcClient` classes is done in the following steps:
Making API calls using the `\SoftLayer\SoapClient` is done in the following steps:

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.
2. Define and add optional headers to the client, such as object masks and result limits.
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.
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.
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.
3. Define and add optional headers to the client, such as object masks and result limits.
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.

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.

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.

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)


## System Requirements

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.
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).
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.

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.
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.

## Installation

Install the SoftLayer API client using [Composer](https://getcomposer.org/).
```bash
composer require softlayer/softlayer-api-php-client:~1.0@dev
composer require softlayer/softlayer-api-php-client:~2.0.0
```

## Usage
Expand Down Expand Up @@ -107,4 +110,4 @@ This software is written by the SoftLayer Development Team <[sldn@softlayer.com]

## Copyright

This software is Copyright &copy; 2009 – 2010 [SoftLayer Technologies, Inc](http://www.softlayer.com/). See the bundled LICENSE.textile file for more information.
This software is Copyright &copy; 2009 – 2022 [SoftLayer Technologies, Inc](http://www.softlayer.com/). See the bundled LICENSE.textile file for more information.
12 changes: 4 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "softlayer/softlayer-api-php-client",
"description": "SoftLayer API PHP client",
"keywords": ["softlayer"],
"homepage": "http://sldn.softlayer.com/article/PHP",
"homepage": "https://sldn.softlayer.com/php/",
"license": "MIT",
"authors": [
{
Expand All @@ -11,8 +11,7 @@
}
],
"require": {
"php": "^5.3|^7.0",
"ext-xmlrpc": "*",
"php": ">=8.0",
"ext-soap": "*"
},
"autoload": {
Expand All @@ -26,15 +25,12 @@
}
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
},
"config": {
"sort-packages": true
}
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^1.13|^2.0",
"phpunit/phpunit": "^5.4.3|^6.0|^7.0"
"friendsofphp/php-cs-fixer": ">=3.13.0",
"phpunit/phpunit": ">=9.0"
}
}
Loading

0 comments on commit 8afd99b

Please sign in to comment.