main.php catalog www/common/config/
return [
‘id’ => ‘my-bus-service’,
‘basePath’ => dirname(DIR),
‘vendorPath’ => dirname(dirname(DIR)) . ‘/vendor’,
‘container’ => [
‘definitions’ => [
‘common\services\content\ContentServiceInterface’ => ‘common\services\content\ContentService’,
‘common\repositories\content\ContentRepositoryInterface’ => ‘common\repositories\content\ContentRepository’,
‘common\repositories\trip\TripRepositoryInterface’ => ‘common\repositories\trip\TripRepository’,
‘common\services\trip\TripServiceInterface’ => ‘common\services\trip\TripService’,
‘common\services\auth\AuthServiceInterface’ => ‘common\services\auth\AuthService’,
‘common\repositories\user\UserRepositoryInterface’ => ‘common\repositories\user\UserRepository’,
‘common\repositories\token\TokenRepositoryInterface’ => ‘common\repositories\token\TokenRepository’,
‘common\services\token\TokenServiceInterface’ => ‘common\services\token\TokenService’,
‘common\services\profile\ProfileServiceInterface’ => ‘common\services\profile\ProfileService’,
‘common\repositories\profile\ProfileRepositoryInterface’ => ‘common\repositories\profile\ProfileRepository’,
‘common\services\order\OrderServiceInterface’ => ‘common\services\order\OrderService’,
],
‘singletons’ => [
‘common\services\external\ExternalServiceInterface’ => ‘common\services\external\ExternalService’
]
],
‘components’ => [
‘cache’ => [
‘class’ => ‘yii\caching\FileCache’,
‘cachePath’ => ‘@runtime/cache’,
]
],
];
old file <?php
return [
‘vendorPath’ => dirname(dirname(DIR)) . ‘/vendor’,
‘container’ => [
‘definitions’ => [
‘common\services\content\ContentServiceInterface’ => ‘common\services\content\ContentService’,
‘common\repositories\content\ContentRepositoryInterface’ => ‘common\repositories\content\ContentRepository’,
‘common\repositories\trip\TripRepositoryInterface’ => ‘common\repositories\trip\TripRepository’,
‘common\services\trip\TripServiceInterface’ => ‘common\services\trip\TripService’,
‘common\services\auth\AuthServiceInterface’ => ‘common\services\auth\AuthService’,
‘common\repositories\user\UserRepositoryInterface’ => ‘common\repositories\user\UserRepository’,
‘common\repositories\token\TokenRepositoryInterface’ => ‘common\repositories\token\TokenRepository’,
‘common\services\token\TokenServiceInterface’ => ‘common\services\token\TokenService’,
‘common\services\profile\ProfileServiceInterface’ => ‘common\services\profile\ProfileService’,
‘common\repositories\profile\ProfileRepositoryInterface’ => ‘common\repositories\profile\ProfileRepository’,
‘common\services\order\OrderServiceInterface’ => ‘common\services\order\OrderService’,
],
'singletons' => [
'common\services\external\ExternalServiceInterface' => 'common\services\external\ExternalService'
]
],
'components' => [
'cache' => [
'class' => 'yii\redis\Cache',
'redis' => [
'hostname' => 'localhost',
'port' => 6379,
'database' => 1
]
],
],
];
but i get a mistake return [ ‘id’ => ‘my-bus-service’, ‘basePath’ => dirname(DIR), ‘vendorPath’ => dirname(dirname(DIR)) . ‘/vendor’, ‘container’ => [ ‘definitions’ => [ ‘common\services\content\ContentServiceInterface’ => ‘common\services\content\ContentService’, ‘common\repositories\content\ContentRepositoryInterface’ => ‘common\repositories\content\ContentRepository’, ‘common\repositories\trip\TripRepositoryInterface’ => ‘common\repositories\trip\TripRepository’, ‘common\services\trip\TripServiceInterface’ => ‘common\services\trip\TripService’, ‘common\services\auth\AuthServiceInterface’ => ‘common\services\auth\AuthService’, ‘common\repositories\user\UserRepositoryInterface’ => ‘common\repositories\user\UserRepository’, ‘common\repositories\token\TokenRepositoryInterface’ => ‘common\repositories\token\TokenRepository’, ‘common\services\token\TokenServiceInterface’ => ‘common\services\token\TokenService’, ‘common\services\profile\ProfileServiceInterface’ => ‘common\services\profile\ProfileService’, ‘common\repositories\profile\ProfileRepositoryInterface’ => ‘common\repositories\profile\ProfileRepository’, ‘common\services\order\OrderServiceInterface’ => ‘common\services\order\OrderService’, ], ‘singletons’ => [ ‘common\services\external\ExternalServiceInterface’ => ‘common\services\external\ExternalService’ ] ], ‘components’ => [ ‘cache’ => [ ‘class’ => ‘yii\caching\FileCache’, // Укажите путь к каталогу, где будут храниться файлы кеша ‘cachePath’ => ‘@runtime/cache’, ] // Другие настройки компонентов ], ];
Fatal error : Uncaught yii\base\InvalidConfigException: The “id” configuration for the Application is required. in /home/ihorbor1/eeep.homes/www/vendor/yiisoft/yii2/base/Application.php:219 Stack trace: #0 /home/ihorbor1/eeep.homes/www/vendor/yiisoft/yii2/base/Application.php(201): yii\base\Application->preInit(1) #1 /home/ihorbor1/eeep.homes/www/frontend/web/index.php(17): yii\base\Application->__construct(1) #2 {main} thrown in /home/ihorbor1/eeep.homes/www/vendor/yiisoft/yii2/base/Application.php on line 219