Skip to content

apioo/fusio-sample-php-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Fusio PHP CLI sample

About

This is a simple PHP CLI application which shows how to use the PHP SDK to access a Fusio instance. In this example we simply output all registered routes. Fusio is an open source API management which helps to build and manage great APIs more information at: https://www.fusio-project.org/

<?php

require __DIR__ . '/vendor/autoload.php';

$tokenStore = new \Sdkgen\Client\TokenStore\MemoryTokenStore();
$scopes = ['backend'];

$credentials = new \Sdkgen\Client\Credentials\OAuth2('test', 'FRsNh1zKCXlB', 'https://demo.fusio-project.org/authorization/token', '', $tokenStore, $scopes);
$client = new \Fusio\Sdk\Client('https://demo.fusio-project.org', $credentials);

$collection = $client->backend()->operation()->getAll(0, 16, '');

echo 'Operations:' . "\n";
foreach ($collection->getEntry() as $operation) {
    echo '* ' . $operation->getHttpMethod() . ' ' . $operation->getHttpPath() . "\n";
}

Usage

To run this app simply execute following command:

composer install
php main.php

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages