Download the PHP package igsem/phalcon-swagger without Composer

On this page you can find all versions of the php package igsem/phalcon-swagger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phalcon-swagger

SWAGGER support for Phalcon

What it does?

This bundle/plugin parses your source code and generates swagger documentation for your API.

How does it work?

The bundle has one controller with 2 actions.

Swagger-UI uses CDN's for its assets, therefor no js or css files are included!

Hot to install?

You can install the bundle via composer or just download the git repos and paste it into your project dir.

There are 2 important things which needs to be configured:

Routing

You must configure 2 routes in order to get it working:

The first route is the route of the json response, which swagger needs in order to render the documentation. This URL maps to a controller which scans your project for annotations.

The second route is the route where you want to be able to access the documentation.

I am using an env file for my configurations, therefore the first route is a parameter in my env file. The reason for this is that the URL for the json response needs to be registered in the DI as well.

DI

The bundle is expecting an entry with the name swagger in your di container.

Here I am loading the configuration from an .env file:

And here I am registering the di:

Now, it is up to you how you get the swagger entry into your di container. You can just go and register all the values statically.

These values are expected and mandatory:

These values are optional:

Usage

The usage is the same as with the standard Swagger library, see https://github.com/zircote/swagger-php for more info.

I am using just a basic configuration for Swagger but if you would like to extend it, use ignored folders etc. I recommend to have an annotation on your base controller like this:

!Please note that the configuration is overwriting the annotation, therefore use this as an extend only!

alt text

Examples

Here is how to annotate models:

And an example controller for login:

alt text

What is missing

I came up with the library quiet fast and had no time to write tests or test it on more examples. The library should work and I am using it in my projects. Everyone is free to use or modify it as he sees fit. I will be more than happy to have some pull requests :) if someone is interested.


All versions of phalcon-swagger with dependencies

PHP Build Version
Package Version
Requires zircote/swagger-php Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package igsem/phalcon-swagger contains the following files

Loading the files please wait ....