dev-master
9999999-dev https://github.com/euro-ix/ixf-client-phpPHP client for RESTful access to the IX-F database
MIT
The Requires
- php >=5.3
- ext-curl *
- ext-json *
- ext-mbstring *
The Development Requires
ix-f ixp peeringdb
Wallogit.com
2017 © Pedro Peláez
PHP client for RESTful access to the IX-F database
PHP RESTful interface for the IXF database,, (*1)
This library is best used with Composer. Just add the following to
your composer.json:, (*2)
"require": {
"euro-ix/ixf-client-php": "dev-master"
}
If you are not using composer, see the demo file for an example list of includes., (*3)
First, prime the API with the endpoint (official end point to be provided when live) and your credentials:, (*4)
IXF\IXF::setApiBase( 'https://www.example.com/api' ); IXF\IXF::setApiUser( 'guest' ); IXF\IXF::setApiPass( 'guest' );
You can get an array of all IXPs and print their name, short name and latitude / longitude, as follows:, (*5)
$ixps = IXF\ApiResource::all( 'IXP' );
foreach( $ixps as $o )
echo $o->full_name . '[' . $o->short_name . '] => ' . $o->lat . ', ' . $o->lon . "\n";
You can use skip and limit options as follows:, (*6)
$ixps = IXF\ApiResource::all( 'IXP', [ 'skip' => 10, 'limit' => 5 ] );
The default ordering is by ID., (*7)
You can fetch a specific IXP by id and edit it as follows:, (*8)
$ixp = IXF\ApiResource::retrieve( 'IXP', $id ); $ixp->short_name = 'NEW_SHORTNAME'; $ixp->save();
You can also delete that IXP via:, (*9)
$ixp->delete();
Finally, create an IXP via:, (*10)
$newObjId = IXF\ApiResource::create( 'IXP',
[
"full_name" => "Test IXP",
"short_name" => "TIXP"
]
);
$newIXP = IXF\ApiResource::retrieve( 'IXP', $newObjId );
Complete documentation can be found in the wiki., (*11)
See the tests/ for sample test suites which will show how the code works., (*12)
We'll link API documentation when it's uploaded., (*13)
Written by Barry O'Donovan of INEX during the May 2014 euro-ix hackaton in Sheffield, UK., (*14)
Issues and pull requests are welcomed., (*15)
Stripe created a beautiful API for their payment gateway. They open sourced the PHP library under the MIT license. This library is based on that., (*16)
(a few hours later) Hmmmm... beautiful API interface, horrendously coded API library. It was a mistake to use it but that's a bed I've made for myself now. I've stripped 70% of the cruft and it's slightly more palatable., (*17)
PHP client for RESTful access to the IX-F database
MIT
ix-f ixp peeringdb