Download the PHP package naroga/bernard-bundle without Composer

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

BernardBundle

Integrates Bernard neatly with a Symfony application.

Build Status

Getting Started

Everything starts by installing the bundle. This is done through composer by adding the following lines to your composer.json file and running composer update bernard/bernard-bundle.

Next up is adding the bundle to your kernel and configuring it in config.yml.

Great! You are now ready to use this diddy. Go and read the rest of the documentation on Bernard at bernardphp.com.

Running the Consumer

What good is a message queue if you don't know how to run the consumer? Luckily this bundle auto registers the commands with your application. So if you run php app/console you should see bernard:consume and bernard:produce. These work just as the documentation describes but if you are in doubt just add --help when running the command.

It is important to use --no-debug when running the consumer for longer periods of time. This is because Symfony by default in debug mode collects a lot of information and logging and if this is omitted you will run into memory problems sooner or later.

Adding Receivers

In order to know what messages needs to go where you have to register some receivers. This is done with a tag in your service definitions.

As the example shows it is possible to register the same receiver for many different message types.

Configuring Middlewares

By default the three core middlewares are registered for the consumer and only needs to be turned on. This example shows enabling all of them. But remember theese are only enabled for the consumer.

This is all good, but what if you can code your own? Luckily this is taken care of with a tag for the container through a compiler pass. When you define your service just tag your middleware factory service with bernard.middleware and give it a type attribute with either consumer or producer.

As the example shows a middleware factory can be registered for both the consumer and producer.

Configuration Options

There are different options that can be set that changes the behaviour for various drivers.

Doctrine

When using the doctrine driver it can be useful to use a seperate connection when using Bernard. In order to change it use the connection option. This also needs to be set if you default connection is called anything else than default.

FlatFile

The file driver needs to know what directory it should use for storing messages and its queue metadata.

The above example will dump your messages in the cache folder. In most cases you will want to change this to something because the cache folder is deleted every time the cache is cleared (obviously).

PhpRedis

PhpRedis depends on a service called snc_redis.bernard with a configured Redis instance. If you want to use a different name use the phpredis_service option:

If you're using the SncRedisBundle you have to set logging to false for the bernhard client to ensure that is is a Redis instance and not wrapped.

IronMQ

When using the IronMQ driver you have to configure an IronMQ connection instance. You can configure it like the following:

Amazon SQS

To use Amazon SQS, configure your driver like this:


All versions of bernard-bundle with dependencies

PHP Build Version
Package Version
Requires bernard/bernard Version >=0.11,<0.13
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 naroga/bernard-bundle contains the following files

Loading the files please wait ....