Download the PHP package ozean12/googlepubsub without Composer

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

Build Status Scrutinizer Code Quality Latest Stable Version Total Downloads

Ozean12GooglePubSubBundle

A Symfony 2 / Symfony 3 bundle which integrates Google Cloud Pub Sub with your application.

Installation

1. Require the bundle:
2. Set it up:

Usage

1. Publishing messages

In order to publish the message to PubSub, you need to define the topic first, as described in previous section. Once topic is defined, it can be accessed within the Publisher service:

MyTopicMessage is a simple class which implements the Ozean12\GooglePubSubBundle\DTO\MessageDataDTOInterface interface and holds the data which needs to be included in message.

publish method also accepts attributes array as a second argument.

If topic does not exist, it will be created automatically.

Result of the call will be an instance of Ozean12\GooglePubSubBundle\DTO\PublishMessageResultDTO which will contain the ids of created messages.

2. Subscribing to Push messages

When using the Push subscription, you need to create the endpoint which will receive the message from Google Pub/Sub and then pass it to PushSubscriberManager. This topic is outside the scope of the bundle. An example of this setup using the FOS REST Bundle:

By using the @ParamConverter annotation Symfony will automatically convert the request to PushMessageRequestDTO

PushMessageRequestDTO has two properties:

The PushSubscriberManager->processMessage() method will iterate over all registered subscribers and run the one with the name equal to the subscription property of the message. Example of subscriber:

3. Using Logger

If you want to log the interaction with Google services, setup the logger_channel option with the channel you want to use. Ex:

This will produce following log entries:

Credits

Ozean12


All versions of googlepubsub with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0|^5.0
google/cloud Version ^0.35
jms/serializer-bundle Version ^2.4
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 ozean12/googlepubsub contains the following files

Loading the files please wait ....