HEX
Server: LiteSpeed
System: Linux premium260.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
User: aliazzsr (627)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/aliazzsr/api.crm.vqode.com/config/test.php
<?php

$db = require __DIR__ . '/test_db.php';

$params = yii\helpers\ArrayHelper::merge(
    require(__DIR__ . '/params.php'),
    require(__DIR__ . '/params-local.php')
);

$config = [
    'id' => 'yii-core-api',
    'name' => 'Core API',
    'version' => '0.4.3',
    'sourceLanguage' => 'en',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'aliases' => [
        '@bower' => '@vendor/bower-asset',
        '@npm'   => '@vendor/npm-asset',
    ],
    'components' => [
        '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',
            ],
        ],
        /** @todo set up MailCatcher */
        'mailer' => [
            'class' => 'yii\swiftmailer\Mailer',
            'useFileTransport' => true,
            'fileTransportPath' => '@runtime/mail',
            'viewPath' => '@app/views/mail',
        ],
        /* @todo dont use Sabre in tests
        'sabre' => [
            'class' => 'app\components\SabreConnector',
            'host' => \yii\helpers\ArrayHelper::getValue($params, 'services.sabre-web.host'),
        ],
        */
        'logger' => [
            'class' => 'app\components\Logger',
        ],
        'log' => [
            'traceLevel' => 3,
            'targets' => [
                'fileTarget' => [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                    'logVars' => [],
                ],
            ],
        ],
        'request' => [
            'enableCookieValidation' => false,
            'parsers' => [
                'application/json' => 'yii\web\JsonParser',
            ],
        ],
        'response' => [
            'format' => \yii\web\Response::FORMAT_JSON,
        ],
        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
        '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,
    ],
    'params' => $params,
];

return $config;