Download the PHP package codecasts/restinga without Composer

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

Restinga

Easily Create REST API Clients for your PHP Applications

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads

What it is?

Restinga is tool to help you building REST Clients for your chosen API's.

Why?

Well, sometimes the PHP Clients that companies provides sucks, you know it. Sometimes they are even more hard to use than CURLing the API itself. We've built this package to help you when that happens.

Quick Start

Before starting, you need to install Restinga as a project dependency. you can do that by running:

composer require codecasts/restinga ~1.0

So now we can move defining your services.

1 - Creating a Descritor for the Desired Service

Let's take for example Digital Ocean API, Restinga is not designed to handle Authorization it self so you should already have a person token or user token.

Start by Creating a file that will describe where to find and how to authorize the requests, you can easily do that by extending the Codecasts\Restinga\Service\Descriptor class.

After creating this file, you need to Register it on the Restinga Container, so it can be used by your resource classes later.

You can do that by using:

2 - Defining your resources

Ok, now that we have everything in place, let's create our first resource. Let's say we want to handle the digital ocean droplets, right? so, we'll define a Resource (by extending Codecasts\Restinga\Data\Resource) to handle it.

3 - Using the Defined Resource

Ok, now that we defined your resource, we can start using it.

Creating a Droplet

Error when creating a Droplet

Finding a resource by it's identifier

Updating an Resource

The General idea is the same:

Deleting an Resource

Works the same way:

Nested Resources All good for an example so far, but real world api has nested objects. That's ok, let's see how to handle it.

Digital Ocean has Domain and Domain Records, let's create those two resources and link them.

Domains:

DomainRecord:

Those two are created but not linked yet, let's do that by creating a record() method inside the Domain resource class:

Now, we can use it this way:

Other method also works the same way, for example, to find and update a record

NOTICE: Full documentation is about to be writen. Thanks for understanding


All versions of restinga with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
ext-curl Version *
ext-json Version *
mashape/unirest-php 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 codecasts/restinga contains the following files

Loading the files please wait ....