Apiary Publisher provides a simple CLI and PHP interface for publishing API Blueprints to Apiary.
Use composer:
$ composer require mangoweb/apiary-publisher
Register Mangoweb\ApiaryPublisher\Bridges\SymfonyConsole\ApiaryPublishCommand
to your Symfony Console application.
$app = new Symfony\Component\Console\Application();
$app->add(new Mangoweb\ApiaryPublisher\Bridges\SymfonyConsole\ApiaryPublishCommand);
# bin/console apiary:publish --name <apiName> --token <apiToken> <blueprintPath>
$ bin/console apiary:publish --name pollsapi --token 874887d6ecd0b106a47448c5beca1 blueprint.apib
# apiary-publish <apiName> <apiToken> <blueprintPath>
$ apiary-publish pollsapi 874887d6ecd0b106a47448c5beca1 blueprint.apib
$apiName = 'pollsapi';
$apiToken = '874887d6ecd0b106a47448c5beca1';
$code = file_get_contents(__DIR__ . '/blueprint.apib');
$publisher = new ApiaryPublisher($apiName, $apiToken);
$publisher->publish($code);
MIT. See full license.