components.php 3.1 KB
<?php

/**
 * @author FilamentV <vortex.filament@gmail.com>
 * @copyright (c), Thread
 */
return [
    //CORE
    'param' => [
        'class' => \thread\modules\sys\modules\configs\components\ConfigsParams::class,
    ],
    'growl' => [
        'class' => \thread\modules\sys\modules\growl\components\Growl::class,
    ],
    'loogbook' => [
        'class' => \thread\modules\sys\modules\logbook\components\Logbook::class,
    ],
    'languages' => [
        'class' => \thread\app\model\Languages::class,
        'languageModel' => \thread\app\model\Language::class,
    ],
    'queue' => [
        'class' => \yii\queue\file\Queue::class,
        'path' => '@root/runtime/queue',
        'as log' => \yii\queue\LogBehavior::class
    ],
    //SEO
    'metatag' => [
        'class' => \thread\modules\seo\components\MetaTag::class
    ],
    'metabaseinfo' => [
        'class' => \thread\modules\seo\modules\info\components\MetaBaseInfo::class
    ],
    //DEFAULT CACHE
    'cache' => [
        'class' => \yii\caching\FileCache::class,
        'cachePath' => '@runtime',
        'keyPrefix' => 'thread'
    ],
    'mailer' => [
        'class' => \yii\swiftmailer\Mailer::class,
        'useFileTransport' => false,
        'enableSwiftMailerLogging' => false,
        'transport' => [
            'class' => 'Swift_SmtpTransport',
        ],
    ],
    'request' => [
        'class' => \thread\app\web\Request::class,
    ],
    'urlManager' => [
        'class' => \thread\app\web\UrlManager::class,
        'enablePrettyUrl' => true,
        'enableStrictParsing' => true,
        'showScriptName' => false,
    ],
    'authManager' => [
        'class' => \yii\rbac\DbManager::class,
    ],
    'assetManager' => [
        'class' => \yii\web\AssetManager::class,
        'appendTimestamp' => true,
        'linkAssets' => false,
        'bundles' => [
            'yii\web\JqueryAsset' => [
                'js' => [
//                    YII_ENV_DEV ? 'jquery.js' : 'jquery.min.js'
                    'jquery.min.js',
                ]
            ],
            'yii\bootstrap\BootstrapAsset' => [
                'css' => [
//                    YII_ENV_DEV ? 'css/bootstrap.css' : 'css/bootstrap.min.css',
                    'css/bootstrap.min.css'
                ]
            ],
            'yii\bootstrap\BootstrapPluginAsset' => [
                'js' => [
//                    YII_ENV_DEV ? 'js/bootstrap.js' : 'js/bootstrap.min.js',
                    'js/bootstrap.min.js'
                ]
            ],
            'yii\web\YiiAsset' => [
                'js' => [
//                    YII_ENV_DEV ? 'yii.js' : 'yii.min.js',
                    'yii.js'
                ]
            ]
        ],
    ],
    'i18n' => [
        'translations' => [
            'app' => [
                'class' => \yii\i18n\PhpMessageSource::class,
                'basePath' => '@thread/app/messages',
                'fileMap' => [
                    'app' => 'app.php',
                ],
//                'on missingTranslation' => [\thread\app\base\i18n\TranslationEventHandler::class, 'handleMissingTranslation']
            ],
        ]
    ],
];