canyin-project/ybcy/config/console.php

77 lines
2.0 KiB
PHP
Raw Normal View History

2024-11-01 16:07:54 +08:00
<?php
$info=file_get_contents('./web/cacheSet.log');
$passWord=json_decode($info,true)['redis']?:null;
$redisPort=json_decode($info,true)['redispx'];
$params = require __DIR__ . '/params.php';
$db = require __DIR__ . '/db.php';
$config = [
'id' => 'basic-console',
'basePath' => dirname(__DIR__),
'bootstrap' => ['queue'],
'controllerNamespace' => 'app\commands',
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
'@tests' => '@app/tests',
],
'components' => [
'timeZone'=>'PRC',
'cache' => [
'class' => 'yii\caching\FileCache',
],
'log' => [
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'db' => $db,
'redis' => [
'class' => 'yii\redis\Connection',
'hostname' => '127.0.0.1',
'port' =>$redisPort,
'database' => 0,
'password'=>$passWord
],
// 'queue'=> [
//
// 'class'=> \yii\queue\redis\Queue::class,
//
// 'redis'=>'redis',// Redis connection component or its config
//
// 'channel'=>'queue',// Queue channel key queue在redis中key的前缀
//
// 'as log'=> \yii\queue\LogBehavior::class,
//
// ],
'queue' => [
'class' => \yii\queue\file\Queue::class,
// 'as log' => \yii\queue\LogBehavior::class,//错误日志 默认为 console/runtime/logs/app.log
'path' => '@runtime/queue'
],
],
'params' => $params,
/*
'controllerMap' => [
'fixture' => [ // Fixture generation command line.
'class' => 'yii\faker\FixtureController',
],
],
*/
];
if (YII_ENV_DEV) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
];
}
return $config;