jnonon / apigeenerator
Apigee skeleton class generator
dev-master
2013-02-24 02:24 UTC
Requires
- php: >=5.3.0
- ext-curl: *
- twig/twig: 1.*
This package is not auto-updated.
Last update: 2026-05-09 23:56:51 UTC
README
This tool generates Stub classes base on existing definitions in Apigee, for example tumblr console
Features
- Generates class files from Api definitions, minimizing the ammount of code to type
- Creates properties based on how often they are used across the API definition
- Adds phpDoc entries on each api method, if documentation exists
TODO
- Support other programming languages templates
Installing via Composer
-
Requires composer
-
In your
composer.jsonadd the following lines:
"require": { "jnonon/apigeenerator": "*" },
-
Install your dependencies:
php composer.phar install
-
Require Composer's autoloader. Composer also prepares an autoload file that's capable of autoloading all of the classes in any of the libraries that it downloads. To use it, just add the following line to your code's bootstrap process:
require 'vendor/autoload.php';
Usage Example
<?php /* redditApiGeenerator.php */ require __DIR__.'/vendor/autoload.php'; use Jnonon\Tools\ApiGeenerator\Client\ApiGeenerator; $apigee = new ApiGeenerator('reddit', 'RedditApi'); $apigee->setApigeeSourceUrl($url); $endpoints = $apigee->getEndpoints(); //Write to a path, overriding if exists //$apigee->generateClassForEndpoint($endpoints[0])->write('/desirable/filesystem/path', true); echo $apigee->generateClassForEndpoint($endpoints[0])->toString(); //See results //php redditApiGeenerator.php
Sample Output in Examples\RedditApi.php