Skip to content

jguillaumesio/php-mercure-hub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ Warning

This project is still under development and is not usable yet, feel free to make pull requests or to contact me for any further questions !

TODO

  • Add config file checker
  • Only store useful headers in Subscription manager request attribute

Get started

PHP Extensions

Mandatory

  • openssl

Optional

Before starting it's greatly recommended to enabled these PHP extensions to improve
UUID generation performances as ramsey/uuid prescribe

  • ext-gmp
  • ext-bcmath

Configuration

Add the following key to you environment file, this must point out to the configuration
file for the library

MERCURE_CONFIG_PATH=/path/to/config.php  

Here is a default template for the configuration file, it must be a file that returns
an associative array

<?php  
return [  
 'utils' => '\Namespace\To\UtilClass',
 'auth_cookie_name' => 'mercureAuthorization',
 'jwt' => [
	 'algo' => 'HS256',
	 'secret' => 'secret'
	 ]
 ]  

You can either use the default utils class, or a custom one. If you implement your own
utils class it must extends \JGuillaumesio\PHPMercureHub\Utils\AbstractUtils implements \JGuillaumesio\PHPMercureHub\Utils\UtilsInterface

For those who aren't familiar with JWT algorithm, here is a simple website that can help you to generate secret file in the algorithm you want

8gwifi.org

Run tests

Windows

.\vendor\bin\phpunit --configuration phpunit.xml

Others

./vendor/bin/phpunit --configuration phpunit.xml

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages