2017 © Pedro Peláez
 

library php-linode-api

The v4 Linode API for PHP [BETA].

image

hnhdigital-os/php-linode-api

The v4 Linode API for PHP [BETA].

  • Sunday, May 20, 2018
  • by bluora
  • Repository
  • 2 Watchers
  • 3 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

 _     _                 _       ___  ______ _____
| |   (_)               | |     / _ \ | ___ \_   _|
| |    _ _ __   ___   __| | ___/ /_\ \| |_/ / | |
| |   | | '_ \ / _ \ / _` |/ _ \  _  ||  __/  | |
| |___| | | | | (_) | (_| |  __/ | | || |    _| |_
\_____/_|_| |_|\___/ \__,_|\___\_| |_/\_|    \___/

The v4.01 Linode API for PHP [BETA]., (*1)

#f03c15 Definately a work in progress. Do not use., (*2)

Latest Stable Version Total Downloads Latest Unstable Version License Donate to this project using Patreon, (*3)

Build Status StyleCI Test Coverage Issue Count Code Climate, (*4)

This package has been developed by H&H|Digital, an Australian botique developer. Visit us at hnh.digital., (*5)

This package is built automatically using the OpenAPI specification for the Linode v4 API., (*6)

Documentation

Requirements

  • PHP 7.1+

Install

Via composer:, (*7)

$ composer require hnhdigital-os/php-linode-api dev-master, (*8)

Examples

Regions

Results returned from any search based endpoint are provided as an instance of that type. This allows you to call any endpoints immediately., (*9)

Results from the get method are returned as an object that implements Iterator and Countable, allowing you to use this in a foreach and to use count. Linode limits search results to 25 records per page - this is overcome by automatically requesting the next page of records when the last record is reached in the current page., (*10)

foreach ((new Regions())->get() as $region) {
    // Do something with the region data (returned as an instance of Region)
}

Calling the all method automatically loads every page of results., (*11)

$regions = (new Regions())->get()->all();

Region

You can get a specific record, simply by creating the object with the required parameters. This will automatically call the endpoint and return the object ready to use. The record will auto-load by setting the last parameter to true., (*12)

$region = new Region('us-east-1a', true);

echo $region->id.' ('.$region->country.')';
us-east-1a (US)



Calling the `get` method directly on this same class will return an array of the values from the same endpoint. This will also auto-fill the object (the same as above, passing the true actually just calls the get method). ```php $result = (new Region('us-east-1a'))->get(); print_r($result);

Array ( [id] => us-east-1a [country] => US ) ```, (*13)

Contributing

Please see CONTRIBUTING for details., (*14)

Credits

License

The MIT License (MIT). Please see License File for more information., (*15)

The Versions

20/05 2018

dev-master

9999999-dev

The v4 Linode API for PHP [BETA].

  Sources   Download

MIT

The Requires

 

The Development Requires

20/05 2018

1.0.0-alpha

1.0.0.0-alpha

The v4 Linode API for PHP [BETA].

  Sources   Download

MIT

The Requires

 

The Development Requires