Download the PHP package jasir/raml-server without Composer

On this page you can find all versions of the php package jasir/raml-server. 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 raml-server

PHP RAML Server

Build Status

Forked from https://github.com/dethbird/PHP_RAML_Server

New Features:

TBD:

Please look at clone & run example of server: ...

Integration with Nette framework + fully working API server: https://github.com/jasir/raml-server-nette-example

Here is gist with notebook examples: https://gist.github.com/jasir/1305abdeec6e259abe1fbf9a0a5c58c4


Original documentation here...

Overview

This is an implementation of a Apache/PHP server which takes a RAML API specification and stubs a working API server leveraging the Slim Microframework.

The developer does the actual implementation of the specified API methods. Required query parameters, headers, and body elements are validated before execution of these custom methods, and a 400 Bad Request is returned on error. It also has a way to request the response examples and schemas defined in the RAML for reflection discussed below in the usage section.

Requirements

A web server running PHP 5.5+. You can follow these instructions to spin up a free Amazon EC2 with everything you need including a mysql persistence layer for the actual method implementations.

Setup

Make

Make sure /public is the docroot for the host

Configs

Change the API

RAML Specs

The RAML API definitions reside in somedir/{version}/{api_name}.raml

Note: Make sure that the RAML doc you define has the same version number as the folder name that it lives in:

Method Definitions

Method Definitions live in user generated classes at /methods/{version}{api_name|UnderscoreToUcwords}.php.

Example: pizza_delivery_api would map to /methods/{version}/PizzaDeliveryApi.php.

These classes must extend MethodsBase(). They contain methods that directly map to requests.

Classes methods are mapped using the HTTP type and the request path:

Example: The route GET /v1.0/pizza/deliveries would map to a method called getPizzaDeliveries() and POST /v1.0/article/comments would map to postArticleComments()

As a general rule, while stubbing these out, you should set the response status to 501 to indicate that it is not implemented:

At this point the implementation is up to you. You could spawn a process in another language such as Python, or even call another service entirely! It's a real magical world.

Hit The API!

Basic Usage

Assuming your web server is running, we can now hit the endpoints of the API we have assumed. We can use a tool like Postman to make these requests. You could also just use command line curl.

Required query parameters, headers, and body schemas will be respected and HTTP 400 Bad Request will be returned for all malformed requests.

cURL

here are some example calls in curl for POST /correction:

Fetching Response Examples and Schemas

Two reserved HTTP headers exist for bypassing validation and just returning the examples and schemas defined in the RAML. Each response code 200, 201, 202 example and schema is requested one at a time.

X-Http-Example: HTTP Status Code (200,201,202,...)

X-Http-Schema: 1|null - if this flag is set it will return the schema for the requested X-Http-Example HTTP code.


All versions of raml-server with dependencies

PHP Build Version
Package Version
Requires slim/slim Version ~2.0
slim/extras Version ~2.0.0
guzzlehttp/guzzle Version ~6.0.0
alecsammon/php-raml-parser Version ~2.0
tracy/tracy Version ^2.3
nette/robot-loader Version ^2.3
symfony/yaml Version 3.1 as v2.6
nette/caching Version ^2.4
nette/finder Version ^2.3
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 jasir/raml-server contains the following files

Loading the files please wait ....