forked from cognesy/instructor-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hub.php
30 lines (24 loc) · 801 Bytes
/
hub.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
use Cognesy\Instructor\Container\Container;
use Cognesy\Instructor\Events\EventDispatcher;
use Cognesy\InstructorHub\Configs\CommandConfig;
use Cognesy\InstructorHub\Configs\ServiceConfig;
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$loader = require 'vendor/autoload.php';
$loader->add('Cognesy\\InstructorHub\\', __DIR__ . '../src-hub/');
// wire up core components
$events = new EventDispatcher('hub');
$config = Container::fresh($events)
->external(
class: EventDispatcher::class,
reference: $events
)
->fromConfigProviders([
new CommandConfig(),
new ServiceConfig(),
]);
// run the app
$app = new Cognesy\InstructorHub\Hub($config);
$app->run($argc, $argv);