Download the PHP package arbor-education/arbor-sdk-php without Composer
On this page you can find all versions of the php package arbor-education/arbor-sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download arbor-education/arbor-sdk-php
More information about arbor-education/arbor-sdk-php
Files in arbor-education/arbor-sdk-php
Package arbor-sdk-php
Short Description Arbor Education PHP SDK
License Apache-2.0
Homepage https://github.com/arbor-education/sis-sdk-php
Informations about the package arbor-sdk-php
Arbor SDK
Arbor Education SDK library.
Introduction
PHP SDK is a library which simplifies the process of integrating the Arbor REST API with your own software.
Rather than handling XML and making HTTP requests in your code, you can simply include the SDK and use getters and setters on models in order to access data from Arbor. PHP SDK includes hundreds of models as well as a gateway pattern for querying the API via a query model.
SDK supports and requires any PSR 18 based HTTP client. Make sure to install one prior to using the SDK.
Requirements
- PHP 8.1 or higher
- Composer
Installation
Simply download the project and run composer install
from the root of the project to use as standalone for testing purposes.
Find the latest version on Packagist Arbor Education - PHP SDK and install it with composer directly in your project composer require arbor-education/arbor-sdk-php
Once setup use the examples/config-dist.php
to create your own config. For this you will need your apps credentials added on Arbor Education - Developers Portal in order to be able to make requests to a sandbox environment.
Usage
The PsrRestGateway
class is a gateway implementation for interacting with REST APIs using PSR-compliant HTTP clients. It provides methods for CRUD operations, bulk creation, querying, and handling API responses.
In the examples/example-bootstrap
you will find the configuration needed to make requests, either using it directly from examples/config.php
or using your own configuration. The entire examples
directory is focused on helping you develop your app faster. Scripts written represent some of the most frequently used queries.
Example
When initializing the PsrRestGateway
you will need to pass the Arbor\Api\Gateway\HttpClient\HttpClientInterface
.
This will create a new instance of the PsrRestGateway
which you can use to interact with the Arbor API. It will try to find any existing installed PSR-18 HTTP client, or you can pass your own implementation of Psr\Http\Client\ClientInterface
to the HttpClient
class.
This will set the default gateway for all models, allowing you to use the SDK without needing to pass the gateway instance every time you want to retrieve or manipulate a model.
Use Arbor\Api\Gateway\PsrRestGateway
to make GET, POST, PUT and DELETE requests and use Arbor\Query\Query
to add filters to your requests.
php $student = \Arbor\Model\Student::retrieve(16);
or use [examples/student-retrieve.php](https://github.com/arbor-education/sis-sdk-php/blob/master/examples/student-retrieve.php) to see how to retrieve a record.
#### POST request:
use [examples/staff-create.php](https://github.com/arbor-education/sis-sdk-php/blob/master/examples/staff-create.php) to see how to create a new record.
#### PUT request:
use [examples/staff-create.php](https://github.com/arbor-education/sis-sdk-php/blob/master/examples/staff-update.php) to see how to update an existing record.
#### DELETE request:
#### Query filters:
List of filters can be found in `Arbor\Query\Query`
Check `examples` directory to see usages of filters.
All versions of arbor-sdk-php with dependencies
ext-json Version *
php-http/discovery Version ^1.0
psr/http-client-implementation Version *
psr/http-client Version ^1.0
psr/http-message Version ^2.0
psr/http-factory Version ^1.0
nyholm/psr7 Version ^1.8