Initial config file parsing logic
This commit is contained in:
@ -6,9 +6,15 @@ use NoccyLabs\Mercureact\Daemon;
|
||||
|
||||
require_once __DIR__."/../vendor/autoload.php";
|
||||
|
||||
$config = Configuration::createDefault()
|
||||
->setAllowAnonymousSubscribe(true)
|
||||
->setJwtSecret("!ChangeThisMercureHubJWTSecretKey!");
|
||||
$opts = getopt("c:");
|
||||
|
||||
if (isset($opts['c'])) {
|
||||
$config = Configuration::fromFile($opts['c']);
|
||||
} else {
|
||||
$config = Configuration::createDefault()
|
||||
->setAllowAnonymousSubscribe(true)
|
||||
->setJwtSecret("!ChangeThisMercureHubJWTSecretKey!");
|
||||
}
|
||||
|
||||
$daemon = new Daemon($config);
|
||||
$daemon->start();
|
Reference in New Issue
Block a user