Download the PHP package bradfeehan/guzzle-modular-service-descriptions without Composer

On this page you can find all versions of the php package bradfeehan/guzzle-modular-service-descriptions. 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 guzzle-modular-service-descriptions

guzzle-modular-service-descriptions

Build Status Code Coverage Scrutinizer Code Quality

A better ServiceDescriptionLoader for Guzzle 3.x

Features

Guzzle's service descriptions make it easy to describe APIs. A service description takes the form of a JSON object (or PHP associative array) that describes all the available operations and data models supported by the API. However, for large or poorly-designed APIs, the service description can quickly become hard to manage.

This project offers a replacement ServiceDescriptionLoader implementation, which allows for much more flexibility when writing service descriptions. It supports:

Installation

To get this library in to an existing project, the best way is to use Composer.

  1. Add bradfeehan/guzzle-modular-service-descriptions as a Composer dependency in your project's composer.json file:

  2. If you haven't already, download and install Composer:

  3. Install your Composer dependencies:

  4. Set up Composer's autoloader:

    "More on the composer.json format" "More detailed installation instructions on the Composer site" "More detailed instructions on the Composer site" "More information about the autoloader on the Composer site"

Usage

In contrast to typical Guzzle service descriptions, a modular service description is implemented as a directory. The format of the directory is very flexible. The directory structure is reflected in the heirarchy of the service description data.

Format

A file in the root of a modular service description directory defines the key with the name of the file. The content of the file defines the value of that key. As an example, consider the following directory structure:

The my_service_description directory can be loaded as a modular service description. The content inside name.txt will be put into the key name at the top level of the service description. The content of operations.json will be the value for the operations key in the service description. (So, to be a valid service description, operations.json should contain a JSON object, defining all the operations).

Nested directories

Another, more complex example:

Again, name.txt will contain the value for the name key. However, this time, the operations key is represented by a directory. The files inside are converted to nested keys in the resulting service description. So this example will result in the following representation:

__index files

Any files named __index.[ext] define the contents of the directory the file is in, rather than the name of the file. It's essentially an "empty" name. This concept is similar to Python's __init__.py, which makes the directory the package, rather than the file.

Groups

Files can also be grouped without causing the contents to be nested. This is useful for organising a large service description. For example, if there are thousands of operations, you'd have to have that many files in the operations directory. Using groups, the operations can be grouped logically inside the operations directory.

A group is implemented as a directory ending with .group. So you could have Users.group containing all the operations relating to users, etc.

Note that this could cause problems if you wanted to have a key ending with .group. Please let me know by filing a GitHub issue if this causes you any issues, and we can work out a way to compromise.

Loading the service description

To load a modular service description, load it using the included loader, and add it to the web service client instance:


All versions of guzzle-modular-service-descriptions with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
guzzle/guzzle Version ~3.0
symfony/yaml 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 bradfeehan/guzzle-modular-service-descriptions contains the following files

Loading the files please wait ....