A Zend Framework 2 module that allows the generation of Swagger compliant resource files and is based on swagger-php.
- PHP 5.3 or higher
- Zend Framework 2
Installation of SwaggerModule uses composer. For composer documentation, please refer to getcomposer.org.
-
cd my/project/directory
-
create a
composer.json
file with following contents:{ "require": { "outeredge/swagger-module": "dev-master" } }
-
install composer via
curl -s http://getcomposer.org/installer | php
(on windows, download http://getcomposer.org/installer and execute it with PHP) -
run
php composer.phar install
-
copy config/module.swagger.global.php.dist to your config/autoload folder and modify paths variable
-
open
my/project/directory/configs/application.config.php
and add the following key to yourmodules
:'SwaggerModule',
See swagger-php for library usage information.
$swagger = $this->getServiceLocator()->get('service.swagger');
echo $swagger->getResource('http://org.local/v1');