Skip to content
master
Go to file
Code

Latest commit

Jess Carlos
Add ability to add additional headers during a request.
348eec2

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
Feb 6, 2016
Feb 15, 2017
Feb 15, 2017

readme.md

Kong-php

Build Status StyleCI Total Downloads Latest Stable Version License

About

A PHP Library for interacting with the Kong API Gateway Admin.

Official Documentation

Coming Soon...

Issues

If you have any issues please create a new Support ticket.

Requirements

  • PHP >= 5.5.9
  • PHP5-cURL Extension

Installation

Installation via Composer:

composer require ignittion/Kong-php

Configuration

PHP

Import the composer autoload file.

require 'vendor/autoload.php';

Define the Kong URL and Admin Port:

define('KONG_URL', 'https://kong-gateway.com');
define('KONG_PORT', 8001);

Laravel 5.1+

Add the Service Provider in config/app.php:

Ignittion\Kong\KongServiceProvider::class,

Add the Class Alias in config/app.php:

'Kong' => Ignittion\Kong\Facades\Kong::class,

Publish the kong.php config file:

php artisan vendor:publish

Lumen

Copy the src/config/kong.php to /path/to/root/config/kong.php

Register the ServiceProvider in bootstrap/app.php:

$app->register(Ignittion\Kong\KongServiceProvider::class);
$app->configure('kong');

Register Alias in bootstrap/app.php (optional):

  • Uncomment Facades: $app->withFacades();
  • Register Alias: class_alias(Ignittion\Kong\Facades\Kong::class, 'Kong');

Usage

PHP

$kong = new \Ignittion\Kong\Kong(KONG_URL, KONG_PORT);
$nodes = $kong->node()->get();

Laravel 5.1+

$nodes = Kong::node()->get();

Lumen

$nodes = app('kong')->nodes()->get();

License

Kong-php is open-source software and licensed under the MIT License.

Kong is Copyright Mashape, inc.

You can’t perform that action at this time.