-
Notifications
You must be signed in to change notification settings - Fork 0
/
ServiceProvider.php
39 lines (31 loc) · 1.06 KB
/
ServiceProvider.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
31
32
33
34
35
36
37
38
39
<?php
namespace Xanweb\C5\Foundation;
use Concrete\Core\Foundation\ClassAliasList;
use Concrete\Core\Http\Request as HttpRequest;
use Concrete\Core\Multilingual\Page\Section\Section;
use Concrete\Core\User\User;
use Xanweb\C5\Request\ServiceProvider as RequestServiceProvider;
use Xanweb\Common\Service\Provider as FoundationProvider;
class ServiceProvider extends FoundationProvider
{
protected function _register(): void
{
$aliases = [
'user' => User::class,
'http/request' => HttpRequest::class,
];
foreach ($aliases as $alias => $class) {
$this->app->alias($class, $alias);
}
$this->app->bind('site/active', fn ($app) => $app['site']->getSite());
ClassAliasList::getInstance()->registerMultiple([
'MultilingualSection' => Section::class,
]);
$requestProvider = new RequestServiceProvider($this->app);
$requestProvider->register();
}
public function provides(): array
{
return ['user', 'http/request', 'site/active'];
}
}