File: /home/aliazzsr/api.crm.vqode.com/config/web.php
<?php
use yii\helpers\ArrayHelper;
$db = require __DIR__ . '/db.php';
$params = ArrayHelper::merge(
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);
$config = [
'id' => 'yii-core-api',
'name' => 'Core API',
'version' => '1.0.3',
'sourceLanguage' => 'en',
'basePath' => dirname(__DIR__),
'bootstrap' => ['log'],
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],
'components' => [
'sentry' => [
'class' => 'mito\sentry\Component',
'dsn' => 'https://[email protected]/1374448',
'environment' => $params['environment']['name'],
'jsNotifier' => false,
],
'urlManager' => [
'enablePrettyUrl' => true,
'enableStrictParsing' => false,
'showScriptName' => false,
'rules' => [
[
'class' => 'yii\rest\UrlRule',
'extraPatterns' => [
'POST,OPTIONS {id}/validate' => 'validate',
'POST,OPTIONS validate' => 'validate',
],
'controller' => [
'company-type',
'company-role',
'company-contact',
'company-project',
'influencer',
'note',
'priority',
'project-contact',
'riba',
'sector',
'stage',
],
],
[
'class' => 'yii\rest\UrlRule',
'extraPatterns' => [
'PATCH {id}' => 'patch',
'GET,OPTIONS statistics' => 'statistics',
'POST,OPTIONS {id}/validate' => 'validate',
'POST,OPTIONS validate' => 'validate',
],
'controller' => [
'project',
'user',
]
],
[
'class' => 'yii\rest\UrlRule',
'tokens' => [
'{userId}' => '<userId:\d+>',
],
'extraPatterns' => [
'OPTIONS,GET,POST,DELETE {userId}/image' => 'image',
],
'controller' => [
'user',
],
],
[
'class' => 'yii\rest\UrlRule',
'extraPatterns' => [
'GET,OPTIONS first-letters' => 'first-letters',
'POST,OPTIONS {id}/validate' => 'validate',
'POST,OPTIONS validate' => 'validate',
],
'controller' => [
'company',
],
],
[
'class' => 'yii\rest\UrlRule',
'extraPatterns' => [
'GET,PUT,OPTIONS {id}/permissions' => 'permissions',
],
'controller' => [
'role',
],
],
[
'class' => 'yii\rest\UrlRule',
'tokens' => [
'{id}' => '<id:[A-Z]+>',
],
'controller' => [
'setting',
],
'except' => ['delete', 'create'],
],
'yii/rpc' => 'yii/default/rpc',
],
],
'request' => [
'enableCookieValidation' => false,
'parsers' => [
'application/json' => 'yii\web\JsonParser',
],
],
'response' => [
'format' => \yii\web\Response::FORMAT_JSON,
],
'cache' => [
'class' => 'yii\caching\FileCache',
'defaultDuration' => 600,
],
'sabre' => [
'class' => 'app\components\SabreConnector',
'host' => ArrayHelper::getValue($params, 'services.sabre-web.host'),
'token' => ArrayHelper::getValue($params, 'services.sabre-web.token'),
],
'logger' => [
'class' => 'app\components\Logger',
],
'user' => [
'class' => 'app\models\ApiUser',
'identityClass' => 'app\models\UserIdentity',
'enableSession' => false,
'enableAutoLogin' => false,
],
'formatter' => [
'class' => '\yii\i18n\Formatter',
'nullDisplay' => '',
'dateFormat' => 'php:d/m/Y',
'datetimeFormat' => 'php:d/m/Y H:i:s',
],
'db' => $db,
],
'modules' => [
'yii' => [
'class' => 'samdark\webshell\Module',
'allowedIPs' => ArrayHelper::getValue($params, 'admin.allowedIPs', []),
],
],
'params' => $params,
];
return $config;