Download the PHP package jenky/hermes without Composer

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

Hermes

Latest Version on Packagist Test Status Quality Score Codecov Total Downloads

The package provides a nice and easy wrapper around Guzzle for use in your Laravel applications. If you don't know what Guzzle does, take a peek at their intro. Shortly said, Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and trivial to integrate with web service.

Install

You may use Composer to install Hermes into your Laravel project:

After installing Hermes, publish its assets using the vendor:publish Artisan command.

or

Configuration

After publishing Hermes's assets, its primary configuration file will be located at config/hermes.php. This configuration file allows you to configure your guzzle client options and each configuration option includes a description of its purpose, so be sure to thoroughly explore this file.

Channel configuration

A channel is simply a guzzle http client instance with its own configuration. This allows you to create a http client on the fly and reuse anytime, anywhere you want.

Configure the guzzle option

Set guzzle request options within the channel. Please visit Request Options for more information.

Configure the guzzle handler

Configure guzzle Handler within the channel.

By default, guzzle will choose the most appropriate handler based on the extensions available on your system. However you can override this behavior with handler option. Optionally, any constructor parameters the handler needs may be specified using the with configuration option:

An alternative way is set the handler in the options configuration:

Configure the guzzle middleware

Configure guzzle Middleware within the channel.

You can read about the middleware in the middleware section.

Do no attempt to resolve container binding implementations such as config, session driver, logger inside the hermes config file. This is because those implementations are not yet bound to the container when the hermes config is loaded.

Instead of using middleware in config, consider customizing the guzzle handler stack if you needs container binding implementations.

Customizing the guzzle handler stack

Sometimes you may need complete control over how guzzle's HandleStack is configured for an existing channel. For example, you may want to add, remove or unshift a middleware for a given channel's handler stack.

To get started, define a tap array on the channel's configuration. The tap array should contain a list of classes that should have an opportunity to customize (or "tap" into) the handle stack instance after it is created:

Once you have configured the tap option on your channel, you're ready to define the class that will customize your HandlerStack instance. This class only needs a single method: __invoke, which receives an GuzzleHttp\HandlerStack instance.

All of your "tap" classes are resolved by the service container, so any constructor dependencies they require will automatically be injected.

"Tap" class parameters

"Tap" class can also receive additional parameters. For example, if your handler needs to log the Guzzle request and response by using a specific Laravel logger channel, you could create a LogMiddleware class that receives a channel name as an additional argument.

Additional parameters will be passed to the class after the $stack argument:

"Tap" class parameters may be specified in hermes config by separating the class name and parameters with a :. Multiple parameters should be delimited by commas:

Middleware

RequestEvent

This middleware will fire Jenky\Hermes\Events\RequestHandled event when a request had been fulfilled. It has these properties:

ResponseHandler

When sending the request, GuzzleHttp\Psr7\Response will be used as the default response handler. However you can configure the request options to use your own response handler. Please note that response handler must be an instance of Psr\Http\Message\ResponseInterface

json driver will automatically use Jenky\Hermes\Middleware\ResponseHandler middleware and set the default response_handler to Jenky\Hermes\JsonResponse

Now your HTTP request will returns an instance of Jenky\Hermes\JsonResponse instead of GuzzleHttp\Psr7\Response which provides a variety of methods that may be used to inspect the response:

The Jenky\Hermes\JsonResponse object also implements the PHP ArrayAccess interface and support magic __get method, allowing you to access JSON response data directly on the response:

Usage

Sometimes you may wish to send a request to a channel other than your application's default channel. You may use the channel method on the Guzzle facade to retrieve and send to any channel defined in your configuration file:

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

Contributing

Please see CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

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


All versions of hermes with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.3|^8.0
guzzlehttp/guzzle Version ^6.3|^7.0
illuminate/config Version ^5.7|^6.0|^7.0|^8.0
illuminate/container Version ^5.7|^6.0|^7.0|^8.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 jenky/hermes contains the following files

Loading the files please wait ....