Download the PHP package northwestern-sysdev/event-hub-php-sdk without Composer

On this page you can find all versions of the php package northwestern-sysdev/event-hub-php-sdk. 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 event-hub-php-sdk

EventHub PHP SDK Build Status Latest Stable Version Total Downloads Coverage Status

This is a set of PHP classes design to give you easy access to the new Northwestern EventHub & AMQ.

As of writing, this PHP SDK implements methods for all EventHub API calls.

Installation

This package is available via composer:

The latest version of this package supports PHP v7.4+. It may not work on older versions of PHP. Please use v1 if you require compatability with older versions!

Examples

Here are some quick examples for using this SDK. For more information about EventHub & its capabilities, please see the documentation on the Service Registry.

Note that all methods from this SDK can throw Northwestern\SysDev\SOA\EventHub\Exception\EventHubDown and Northwestern\SysDev\SOA\EventHub\Exception\EventHubError messages. The former indicates a network problem or outage; the latter is something wrong with your usage of EventHub.

Consumers

You can loop something like the below example code & schedule it in cron to poll the queue for messages.

Just be aware that EventHub supports webhook delivery; it can do HTTP POSTs to your application when it receives messages in real-time. You should evaluate that option before implementing queue polling.

Publishers

Managing Webhooks

EventHub can be configured to deliver messages destined for your application via HTTP POSTs to an API endpoint you've created via webhooks. This is a self-service feature you can configure yourself.

For full details on how this works & the config options, see the EventHub Webhook documentation.

FAQs

Why do I have to pass in a GuzzleHttp Client?

I've split this package off from a Laravel-specific one, and having Guzzle in the constructor makes it easy for me to let Laravel's service container inject the dependency.

Guzzle supports some cool middleware stuff, which you may want to set up before giving it to the EventHub SDK.

In fact, this package comes with a re-try middleware for temporary network errors. You can do this instead to get a Guzzle Client that will make three immediate re-try attempts if it's unable to establish a connection to EventHub:

This won't auto-retry anything that gets an HTTP error code, e.g. 401 Unauthorized won't trigger a re-try attempt. Feel free to extend the class & adjust createRetryHandler() to better suit your needs.

Do you have more documentation?

Not really. There are PHP docblocks in the code, but they just refer you back to the main EventHub API documentation. This SDK is just a little adapter layer to make using EventHub feel more PHP-y.

I need help!

The I&A team is the primary contact for EventHub -- I'm an end-user too!

But, if you have questions specifically abou the PHP SDK, you can ask in #et-sysdev on the NIT Slack or email [email protected].

Contributing

Submit a pull request!

If you need to include a local copy of the package for development purposes, adjust your consuming apps' composer.json thusly:

You can test the package by running phpunit && ./vendor/bin/phpstan analyse --level 5 src/.


All versions of event-hub-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
guzzlehttp/guzzle Version ^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 northwestern-sysdev/event-hub-php-sdk contains the following files

Loading the files please wait ....