remessage/client-bundle

A Re Message Client Bundle for Symfony

v0.3.4 2022-05-12 20:04 UTC

This package is auto-updated.

Last update: 2024-04-13 00:09:52 UTC


README

This package provides remessage/client package features for applications designed via Symfony framework.

Client uses the specific version when sends messages to Core. You cannot change the version of the API used, because this may violate the logic of this package.

Package version Client version Core version PHP Version

Requirements

  1. PHP 8.1+
  2. Requirements of remessage/client

Installation

  1. You will need Composer to install: composer require remessage/client-bundle
  2. Register the bundles in config/bundles.php:
    • RmClientBundle
    • RmMessageBundle
  3. Configure the application authorization (see Authorization)

Authorization

How to get authorization credentials for your application described here.

You have two options for setting authorization credentials: using environment variables and setting credentials directly in the package configuration.

To configure using environment variables, you need to use the symfony/dotenv package. Set the environment variables RM_APP_ID and RM_APP_SECRET in one of the .env files:

RM_APP_ID=paste-your-app-id
RM_APP_SECRET=paste-your-app-secret

Or in the package config you can set the app_id and app_secret properties:

remessage_client:
    auth:
        app_id: paste-your-app-id
        app_secret: paste-your-app-secret

This configuration provides automatic authorization on each request, if the service token is not found in the storage.

If you do not want to authorize your application for each request, you can disable automatic authorization:

remessage_client:
    auth:
        auto: false

This means that the parameters app_id and app_secret parameters will be injected in RM\Component\Client\Security\Authenticator\ServiceAuthenticator service, but the authenticate method will not be called. So you can call this method when you need.

Otherwise, if you do not need any of these behaviors, you can disable this behavior completely:

remessage_client:
    auth: false