-
Notifications
You must be signed in to change notification settings - Fork 23
/
Bootstrap.php
45 lines (40 loc) · 1.18 KB
/
Bootstrap.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
40
41
42
43
44
45
<?php
namespace yii2mod\cms;
use yii\base\BootstrapInterface;
use yii\console\Application as ConsoleApplication;
/**
* Class Bootstrap
*
* @package yii2mod\cms
*/
class Bootstrap implements BootstrapInterface
{
/**
* @inheritdoc
*/
public function bootstrap($app)
{
if (!isset($app->get('i18n')->translations['yii2mod.cms'])) {
$app->get('i18n')->translations['yii2mod.cms'] = [
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => '@yii2mod/cms/messages',
];
}
if (!$app->hasModule('comment') && !($app instanceof ConsoleApplication)) {
$app->setModule('comment', ['class' => 'yii2mod\comments\Module']);
}
if (!$app->has('fileStorage')) {
$app->set('fileStorage', [
'class' => 'yii2tech\filestorage\local\Storage',
'basePath' => '@webroot/files',
'baseUrl' => '@web/files',
'filePermission' => 0777,
'buckets' => [
'item' => [
'baseSubPath' => 'attachment',
],
],
]);
}
}
}