Download the PHP package mapudo/guzzle-bundle without Composer

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

Latest Version on Packagist Build Status Total Downloads

Requirements | Install | Usage | Contributing | Security | License | About

GuzzleBundle

The Mapudo GuzzleBundle allows integrating Guzzle into Symfony projects.

The main features of this bundle are:

Why yet another Guzzle Bundle? We simply weren't happy with the code quality and middleware integration of existing bundles and our issues were not addressed by their maintainers.

Requirements

Install

Via Composer

Usage

Activating the bundle

Register the bundle in your AppKernel.php.

Configuration

Configure the bundle via app/config.yml. You can define multiple clients and set basic options.

All request_options documented in the Guzzle documentation can be configured for clients, except for the following which can only be set on individual requests:

Clients defined in the configuration are then registered by the bundle's CompilerPass and you can afterwards access them from the container by name. For the above cases, we would have two clients which we can access with guzzle.client.test_client and guzzle.client.another_client.

Making requests

Making requests is easy and essentially the same as using Guzzle directly. As described above, you can also set request_options here that are not available to configure via the config.

Note: Clear your cache after adding a new log handler or a middleware so that the CompilerPass is run again.

Logging

The CompilerPass registers a logging middleware which defines a guzzle logging channel. By default all Monolog handlers defined in your config will log these requests. To disable logging for specific handlers add !guzzle to the channel list of the handler.

It is also possible to log request data into the Symfony profiler and debug toolbar. To do to this, activate the built-in profiler handler with the following configuration:

After adding this handler you need to rebuild the assets so your Profiler is styled, e.g. with assets:install. Here you can select which client's request to be shown.

Log into specific channels

Per default the LogMiddleware logs into the "guzzle" channel. If you want that a different handler is used (dependent on the channel) you can define a service tag for this.

YAML

As you can see, the tag now contain a "channel" node. If configured like this, the guzzle client mapudo_api will have the LogMiddleware as a middleware injected that uses a/multiple logger which log into the timings channel.

Important

Please note, that the service id of the LogMiddleware must contain the name log_middleware since the compiler pass checks if the service definition contains this name to retrieve the channel.

Add your own Logging

This bundle uses Symfony's normalizer to normalize the request and response objects before passing them to the logger. This allows you to handle the requests and responses as an array. If you want to work with objects instead, the bundle provides a request and response denormalizer which morphs the arrays into corresponding objects.

For example, to write your own handler, take the response and request array out of the given context and denormalize them.

or just do what you want.

Middleware

This bundle comes with two middleware services already implemented. One to dispatch events and one to log with given handlers.

Add your own Middleware

The bundle supports registering Middlewares by using __invoke() or creating a custom method.

The CompilerPass searches for services which are tagged with guzzle.middleware. A tag method is optional to define which method should be executed if you don't use __invoke() in your middleware. You need to add the tag client with the name of the client. However, if you want to create a middleware for all clients you can omit the tag.

YAML

XML

Events

Add your own Event Listeners

The CompilerPass searches for services tagged with kernel.event_listener. A tag event is also required to define on which event to listen to. You are allowed to use either guzzle_event.pre_transaction or guzzle_event.post_transaction. Unlike middleware, a client name is required here.

YAML

XML

Contributing

Please see CONTRIBUTING for details.

Security

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

License

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

About

This bundle was authored at Mapudo, the online materials marketplace. We're hiring!


All versions of guzzle-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
guzzlehttp/guzzle Version ~6.0
symfony/dependency-injection Version ~2.8|~3.0|~4.0
symfony/expression-language Version ~2.8|~3.0|~4.0
symfony/event-dispatcher Version ~2.8|~3.0|~4.0
symfony/http-kernel Version ~2.8|~3.0|~4.0
symfony/serializer Version ~2.8|~3.0|~4.0
symfony/property-access Version ~2.8|~3.0|~4.0
symfony/monolog-bundle Version ~2.8|~3.0|~4.0
psr/log Version ~1.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 mapudo/guzzle-bundle contains the following files

Loading the files please wait ....