Download the PHP package frangeris/skeleton-provider without Composer

On this page you can find all versions of the php package frangeris/skeleton-provider. 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 skeleton-provider

Skeleton provider

This vendor is the complement of a wrapper for creating fast providers using standard REST SDK, which is the common place where the logic of each given resource is determined through of RESTful API.

Features to be taken into consideration to define the logic of work:

Let's rock and roll...

1) Installation

The best way to start a clean project is to delegate this task to composer, just run the following:

After this, a clean folder has been created (now a folder without repo), initialize your repository and haste charge... all dependencies have been installed, if you are at this point, you can already start creating your respective providers to consume your RESTful api.

2) Setting up

The first thing to consider is what related to namespaces by default is using psr-4 under the namespace Providers, if you want change, you can do...

Default configuration(autoload inside composer.json):

3) Configuration

For the skeleton-sdk Client to work's properly, it needs variables to manage the requests, these variables are domain (base_url, public & private key (signatures) when using hmac authentication, an example of the structure of the configuration is as follows:

Where method is the signature to use for authenticate if is "hmac" then public & private key are required, the base url for creating the path to request. This is the configuration that the skeleton-sdk customer uses to make consequential request.

4) Lets start coding

Each provider must extend the abstract class Skeleton\SDK\Providers\AbstractProvider belonging to the skeleton-sdk package(we are extending an sdk) and implement Skeleton\SDK\Common\Supplier\ISupplier interface to overwrite inherited methods (CRUD) leaving your provider like this:

In this class of example, show the basic operations of a resource through an api, if carefully note some methods require a parameter to run, we will start sending values and customize our provider..

Inside the package, there is a tool for create providers with all the default structure(enum, exceptions) and folders, from / run:

And it'll show a list of available commads, for create new provider use:

create($provider)

Normally used for the creation of a resource, in this case a post request to the address specified with the data you want to be sent, let's show an example where you want to create a test user using hmac authentificar signature for the request:

The TestProvider class contains a property inherited from AbstractProvider called skeleton, this property allows the request through guzzle, is a broker for each call using the signatures provided in settings travez of skeleton-sdk, methods available (signature) are:

  1. Hmac(public & private) key
  2. Oauth2 (todo)
  3. ...

The configuration is composed of two main parts: the method to be used for authentication and base_url parameter containing the url base to form the request.

5) Providers:

For a provider may have the ability to request, this needs an instance of a client, above noticed as he passed as parameter when creating the same, this is required for all providers, then simply you pass parameters (data) to send the request either under or object and create the method would be responsible for making the request and the response retornarte.

The first step in the above method is to verify the provider received is not an array, the post method of skeleton obligation instance receives an associative array where index is the field name with its respective value.

If the value is not an array, skeleton provides the ability to map the values of the properties of an object to an associative array with all their assigned values, this is done by the fragment method that receives an object and returns an array associative.

Then simply called the post content within the instance method of skeleton, using as first parameter the resource to consume and as second parameter the asosiative of data to send, from the side of test / run.php print output and have something like:

Onsite returned by the post skeleton instance method object is of type GuzzleHttp\Message\Response providing all native methods for manejor guzzle response: D


All versions of skeleton-provider with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
frangeris/skeleton-sdk Version v1.0.0
symfony/console Version 2.6.*
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 frangeris/skeleton-provider contains the following files

Loading the files please wait ....