Download the PHP package hibira-io/symfony-bundle without Composer

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

hibira-io/symfony-bundle

ci

Realtime Symfony apps on Hibira, without running a Mercure hub. Symfony UX Turbo Streams, Doctrine #[Broadcast] entities and Symfony Messenger send their updates to Hibira, and the browser receives them over WebSockets.

Desktop Phone

What the bundle gives you:

Supports Symfony 6.4, 7.x and 8.x (PHP 8.1+), UX Turbo 2 and 3.

Install

Symfony Flex enables the bundle, adds the Stimulus controller to assets/controllers.json and pusher-js to your import map (or package.json with Webpack Encore).

Copy the app ID, key and secret from your app page on hibira.io/portal into .env.local (the Free plan needs no card). The secret is shown once, when you create the app or rotate it.

Import the routes:

Then check the setup:

On your app page, add your site's origin (for example https://shop.example.com) to Allowed origins, or browsers can't connect.

Configuration

Everything is optional. These are the defaults:

host, port and scheme take env placeholders too, such as '%env(int:HIBIRA_PORT)%'.

Turbo Streams

Mark an entity with #[Broadcast] and give it a stream template, exactly as in the UX Turbo docs:

Listen in a page. A class name follows every entity of that class, an entity follows that one entity, and any other string is a topic of your own:

Without Mercure installed, hibira becomes UX Turbo's default transport. With both, pass it by name: turbo_stream_listen(topic, 'hibira'), or set turbo.default_transport: hibira. #[Broadcast(transports: ['hibira'])] limits an entity to Hibira.

Send a stream from anywhere, for example a Messenger handler reporting progress:

Each topic becomes the private channel private-turbo-<sha256(topic)>, and the page carries an HMAC of that name, so a browser can't subscribe to a topic its page didn't render. Free plans take events up to 4 KB, Hobby and Starter 10 KB. A stream over the limit is replaced by <turbo-stream action="refresh">, which reloads the page in place (set turbo.oversize: throw to get a PayloadTooLargeException instead).

Messenger

Hibira::publish() and every Turbo broadcast dispatch Hibira\SymfonyBundle\Message\PublishEvent. With no routing it is handled during the request. Route it to a transport to send events from a worker:

Hibira::trigger() always sends right away.

Your own channels

Private and presence channels are authorized by POST /hibira/auth, which asks your listeners. Nobody gets in until a listener calls allow():

In the browser, add {{ hibira_meta_tags() }} to your layout's <head> and use the shared client:

With AssetMapper, add the module to importmap.php once: '@hibira-io/symfony-bundle/hibira.js' => ['path' => '@hibira-io/symfony-bundle/hibira.js'].

Webhooks

Point your app's webhook at https://your-site/hibira/webhook. The bundle checks X-Pusher-Signature (and, during a secret rotation, X-Hibira-Previous-Signature) and dispatches one WebhookReceivedEvent per event:

Push notifications

GET /hibira/push/token?user_id=... returns a user token for the signed-in user, for setUserId() in the web, Android and iOS SDKs.

Coming from Mercure

Mercure Hibira
symfony/mercure-bundle and a hub to run hibira-io/symfony-bundle, hosted
MERCURE_URL, MERCURE_PUBLIC_URL, MERCURE_JWT_SECRET HIBIRA_APP_ID, HIBIRA_APP_KEY, HIBIRA_APP_SECRET
turbo_stream_listen(topic) unchanged (transport hibira)
#[Broadcast] unchanged
HubInterface::publish(new Update(...)) Hibira::turboStream() or Hibira::publish()
Update routed through Messenger PublishEvent routed through Messenger
Private updates with JWT cookies Signed private channels, ChannelAuthorizationEvent

Example

example/ is a live board on FrankenPHP: Doctrine #[Broadcast] → Messenger worker → Hibira → Turbo Streams. Put your credentials in example/.env.local, then:

and open http://localhost:8000 in two windows.

Development

中文摘要

hibira-io/symfony-bundle 讓 Symfony 專案不用自己架 Mercure hub,就能用 Hibira 推送即時更新:


All versions of symfony-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
pusher/pusher-php-server Version ^7.2
symfony/config Version ^6.4|^7.0|^8.0
symfony/console Version ^6.4|^7.0|^8.0
symfony/dependency-injection Version ^6.4|^7.0|^8.0
symfony/event-dispatcher Version ^6.4|^7.0|^8.0
symfony/framework-bundle Version ^6.4|^7.0|^8.0
symfony/http-foundation Version ^6.4|^7.0|^8.0
symfony/http-kernel Version ^6.4|^7.0|^8.0
symfony/routing Version ^6.4|^7.0|^8.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 hibira-io/symfony-bundle contains the following files

Loading the files please wait ...