Download the PHP package p/iris without Composer

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

THIS PACKAGE IS ABANDONNED PLEASE USE A MORE MODERN APPROACH LIKE guzzle

Iris

Iris is a simple library that wrap cURL functions to ease their use. Iris can dot that using a simple OOP approach to cURL.

This package is compliant with PSR-1, PSR-2, and PSR-4.

Iris was built to understand cURL advance features. It is loosely based on phpmulticurl.

Features & Roadmap

Requirements

You need PHP >= 5.3.0 and the cURL extension to use Iris but the latest stable version of PHP is recommended.

Installation

You may install the Iris package with Composer.

Or you can download the library and point to its autoloading script.

Usage

Documentation

Iris\Message

Instantiation

to perform simple requests you need to instantiate the P\Iris\Message object.

Before anything else you may want to specify your own user agent. By defaut the library set its own user agent. You can override this behaviour by setting you own user agent using the P\Iris\Message::setUserAgent method. Once set, the user agent won't change even if you reset the Iris\Message object.

At any given time you can reset the current cURL handler allowing you to perform multiple call using the same P\Iris\Message object. Once resetted, the object will loose any reference to the old request, except for the user agent and the event listerners attached to it.

Adding Options

cURL calls are all about options, P\Iris\Message help you set them using the setOption method.

the setOption method can accept an array as a single value or a cURL options and its value.

The options can be changed and altered at any given times before performing the request as their are applied only when the request is performed.

Performing a request

Using Procedural code

To perform a request you need to call the Iris\Message::execute method.

You'll get access to:

Using Events

Another way to deal with the result is by using event listener. The \Iris\Message comes with a simple event listener mechanism. You can register as many callback functions as you want and they will be executed on request success or on request error like explain below:

Depending on the result of the cURL request one of the event will be called. Of course you can remove the callback by using the P\Iris\Message::removeListener with the same parameters used to add the callback.

Simple Requests (GET, POST, PUT, DELETE, HEAD)

The class comes with specialized method to perform usual calls used in REST API:

These methods takes up to 3 parameters:

Here's a simple example:

You do not need to use the P\Iris\Message::execute method as it is called directly by the P\Iris\Message::get method. If you do not want the request to be directly issue then you have to specify it using the third argument.

The request is registered but not execute, you will need to call explicitly P\Iris\Message::execute or P\Iris\Batch::execute to perform the request.

Iris\Envelope

This class is responsible for wrapping curl_multi_* function. As it is you could use it to perform parallel calls using cURL but really don't, there's a simpler way using P\Iris\Batch.

The sole purpose of this function is to configure how cURL may behave when using parallel request. You can specify:

Iris\Batch

Instantiation

This class was build to simplify parallel calls. To instantiate this class you must give it a object of type Iris\Enveloppe

Adding Request

Once the \P\Iris\Batch is instantiate you just need to provide the cURL requests to perform in parallel.

To do so you can use the \P\Iris\Batch::addOne function that will had a single \P\Iris\Message object or the \P\Iris\Batch::addMany that will accept an array or any Traversable object that contained only \P\Iris\Message objects.

At any given time you can count the number of \P\Iris\Message objects present in the \P\Iris\Batch object. This number will decrease as the object performs the requests.

Performing the requests

Once you have added all the \P\Iris\Message objects you can safely perform you parallel requests using the \P\Iris\Batch::execute method.

When using the \P\Iris\Batch you must use \P\Iris\Message event listeners to process each cURL request individually.

Contribution

Please see CONTRIBUTING for details.

Credits


All versions of iris with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
ext-curl Version *
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 p/iris contains the following files

Loading the files please wait ....