Download the PHP package symplely/hyper without Composer

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

hyper

Build StatusBuild statuscodecovCodacy BadgeMaintainability

An simple advance PSR-7 implementation and asynchronous PSR-18 HTTP client using coroutines.

Table of Contents

Introduction/Usage

This package is based on coroutines using yield an generator, it requires our other repo package Coroutine. It's construction is inspired by and an overhaul of shuttle, an PSR-18 client.

There is a lot to be said about coroutines, but for an quick overview, checkout this video, if you have no formulary with the concept or construction. Only one thing to keep in mind when viewing the video, is that it's an overview of callbacks vs promises vs generators, an object given an async/await construction in other languages. And the Promise reference there, is referred here has as an Task, that returns a plain Integer.

This library and the whole Coroutine concept here, is base around NEVER having the user/developer directly accessing the Task, the Promise like object. For conceptually usage example see Advanced Asyncio: Solving Real World Production Problems.

From example's folder:

Functions

The functions listed here and in Core.php file is the recommended way to use this package. An functional programming approach is being used, the actual OOP class library used is constantly changing, but these calling functions will not.

Installation

Usage/Historical

Making requests: The easy old fashion way, with one caveat, need to be prefix with yield

The quickest and easiest way to begin making requests is to use the HTTP method name:

This library has built-in methods to support the major HTTP verbs: GET, POST, PUT, PATCH, DELETE, HEAD, and OPTIONS. However, you can make any HTTP verb request using the request method directly, that returns an PSR-7 RequestInterface.

Handling responses

Responses in Hyper implement PSR-7 ResponseInterface and as such are streamable resources.

Handling failed requests

This library will throw a RequestException by default if the request failed. This includes things like host name not found, connection timeouts, etc.

Responses with HTTP 4xx or 5xx status codes will not throw an exception and must be handled properly within your business logic.

Making requests: The PSR-7 way, with one caveat, need to be prefix with yield

If code reusability and portability is your thing, future proof your code by making requests the PSR-7 way. Remember, PSR-7 stipulates that Request and Response messages be immutable.

Options

The following options can be pass on each request.

Request bodies

An easy way to submit data with your request is to use the Body class. This class will automatically transform the data, convert to a BufferStream, and set a default Content-Type header on the request.

Pass one of the following CONSTANTS, onto the class constructor will:

To submit a JSON payload with a request:

Contributing

Contributions are encouraged and welcome; I am always happy to get feedback or pull requests on Github :) Create Github Issues for bugs and new features and comment on the ones you are interested in.

License

The MIT License (MIT). Please see License File for more information.


All versions of hyper with dependencies

PHP Build Version
Package Version
Requires php Version >7.1
ext-json Version *
symplely/http Version ^1.1.0
symplely/logger Version ^1.0.9
symplely/coroutine Version ^1.7.0
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 symplely/hyper contains the following files

Loading the files please wait ....