accounts/common/config/config.php

117 lines
4.3 KiB
PHP
Raw Permalink Normal View History

<?php
Upgrade project to PHP 8.3, add PHPStan, upgrade almost every dependency (#36) * start updating to PHP 8.3 * taking off! Co-authored-by: ErickSkrauch <erickskrauch@yandex.ru> Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * dropped this Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * migrate to symfonymailer Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * this is so stupid 😭 Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * ah, free, at last. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * oh, Gabriel. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * now dawns thy reckoning. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * and thy gore shall GLISTEN before the temples of man. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * creature of steel. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * my gratitude upon thee for my freedom. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * but the crimes thy kind has committed against humanity Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * Upgrade PHP-CS-Fixer and do fix the codebase * First review round (maybe I have broken something) * are NOT forgotten. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * Enable parallel PHP-CS-Fixer runner * PHPStan level 1 * PHPStan level 2 * PHPStan level 3 * PHPStan level 4 * PHPStan level 5 * Levels 6 and 7 takes too much effort. Generate a baseline and fix them eventually * Resolve TODO's related to the php-mock * Drastically reduce baseline size with the Rector * More code modernization with help of the Rector * Update GitLab CI --------- Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> Co-authored-by: ErickSkrauch <erickskrauch@yandex.ru>
2024-12-02 15:40:55 +05:30
return [
'version' => '{{PLACE_VERSION_HERE}}', // This will be replaced by build tool
'vendorPath' => dirname(__DIR__, 2) . '/vendor',
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
'@root' => dirname(__DIR__, 2),
'@api' => '@root/api',
'@common' => '@root/common',
'@console' => '@root/console',
],
'params' => [
'fromEmail' => 'account@ely.by',
'supportEmail' => 'support@ely.by',
],
'container' => [
'singletons' => [
GuzzleHttp\ClientInterface::class => GuzzleHttp\Client::class,
2019-05-09 06:53:49 +05:30
Ely\Mojang\Api::class => Ely\Mojang\Api::class,
2021-03-04 10:28:07 +05:30
common\components\SkinsSystemApi::class => [
'class' => common\components\SkinsSystemApi::class,
2021-03-04 12:28:44 +05:30
'__construct()' => [
'http://' . (getenv('CHRLY_HOST') ?: 'skinsystem.ely.by'),
],
2021-03-04 10:28:07 +05:30
],
League\OAuth2\Server\AuthorizationServer::class => common\components\OAuth2\AuthorizationServerFactory::build(...),
],
],
'components' => [
'cache' => [
'class' => yii\redis\Cache::class,
],
'db' => [
'class' => yii\db\Connection::class,
'dsn' => 'mysql:host=' . (getenv('DB_HOST') ?: 'db') . ';dbname=' . getenv('DB_DATABASE'),
'username' => getenv('DB_USER'),
'password' => getenv('DB_PASSWORD'),
'charset' => 'utf8mb4',
'schemaMap' => [
'mysql' => common\db\mysql\Schema::class,
],
],
'unbufferedDb' => [
'class' => yii\db\Connection::class,
'dsn' => 'mysql:host=' . (getenv('DB_HOST') ?: 'db') . ';dbname=' . getenv('DB_DATABASE'),
'username' => getenv('DB_USER'),
'password' => getenv('DB_PASSWORD'),
'charset' => 'utf8mb4',
'attributes' => [
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => false,
],
'schemaMap' => [
'mysql' => common\db\mysql\Schema::class,
],
],
'mailer' => [
Upgrade project to PHP 8.3, add PHPStan, upgrade almost every dependency (#36) * start updating to PHP 8.3 * taking off! Co-authored-by: ErickSkrauch <erickskrauch@yandex.ru> Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * dropped this Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * migrate to symfonymailer Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * this is so stupid 😭 Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * ah, free, at last. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * oh, Gabriel. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * now dawns thy reckoning. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * and thy gore shall GLISTEN before the temples of man. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * creature of steel. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * my gratitude upon thee for my freedom. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * but the crimes thy kind has committed against humanity Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * Upgrade PHP-CS-Fixer and do fix the codebase * First review round (maybe I have broken something) * are NOT forgotten. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * Enable parallel PHP-CS-Fixer runner * PHPStan level 1 * PHPStan level 2 * PHPStan level 3 * PHPStan level 4 * PHPStan level 5 * Levels 6 and 7 takes too much effort. Generate a baseline and fix them eventually * Resolve TODO's related to the php-mock * Drastically reduce baseline size with the Rector * More code modernization with help of the Rector * Update GitLab CI --------- Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> Co-authored-by: ErickSkrauch <erickskrauch@yandex.ru>
2024-12-02 15:40:55 +05:30
'class' => yii\symfonymailer\Mailer::class,
'viewPath' => '@common/mail',
'transport' => [
'scheme' => 'smtp',
'host' => getenv('SMTP_HOST'),
'username' => getenv('SMTP_USER'),
'password' => getenv('SMTP_PASS'),
2024-12-02 18:53:43 +05:30
'port' => (int)(getenv('SMTP_PORT') ?: 587),
'encryption' => getenv('SMTP_ENCRYPTION') ?: 'tls',
],
],
'sentry' => [
'class' => common\components\Sentry::class,
'enabled' => !empty(getenv('SENTRY_DSN')),
'dsn' => getenv('SENTRY_DSN'),
'environment' => (function(): string {
if (!empty(getenv('SENTRY_ENV'))) {
return getenv('SENTRY_ENV');
}
return YII_ENV_DEV ? 'Development' : 'Production';
})(),
],
'security' => [
'passwordHashStrategy' => 'password_hash',
],
'redis' => [
'class' => yii\redis\Connection::class,
'hostname' => getenv('REDIS_HOST') ?: 'redis',
'password' => getenv('REDIS_PASS') ?: null,
'port' => getenv('REDIS_PORT') ?: 6379,
'database' => getenv('REDIS_DATABASE') ?: 0,
],
'guzzle' => [
'class' => GuzzleHttp\Client::class,
],
'emailsRenderer' => [
'class' => common\components\EmailsRenderer\Component::class,
'serviceUrl' => getenv('EMAILS_RENDERER_HOST') ?: 'http://emails-renderer:3000',
'basePath' => '/images/emails',
],
'authManager' => [
'class' => \api\rbac\Manager::class,
2019-08-02 06:06:24 +05:30
'itemFile' => '@api/rbac/.generated/items.php',
'ruleFile' => '@api/rbac/.generated/rules.php',
],
'statsd' => [
'class' => common\components\StatsD::class,
'host' => getenv('STATSD_HOST'),
Upgrade project to PHP 8.3, add PHPStan, upgrade almost every dependency (#36) * start updating to PHP 8.3 * taking off! Co-authored-by: ErickSkrauch <erickskrauch@yandex.ru> Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * dropped this Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * migrate to symfonymailer Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * this is so stupid 😭 Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * ah, free, at last. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * oh, Gabriel. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * now dawns thy reckoning. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * and thy gore shall GLISTEN before the temples of man. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * creature of steel. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * my gratitude upon thee for my freedom. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * but the crimes thy kind has committed against humanity Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * Upgrade PHP-CS-Fixer and do fix the codebase * First review round (maybe I have broken something) * are NOT forgotten. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> * Enable parallel PHP-CS-Fixer runner * PHPStan level 1 * PHPStan level 2 * PHPStan level 3 * PHPStan level 4 * PHPStan level 5 * Levels 6 and 7 takes too much effort. Generate a baseline and fix them eventually * Resolve TODO's related to the php-mock * Drastically reduce baseline size with the Rector * More code modernization with help of the Rector * Update GitLab CI --------- Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> Co-authored-by: ErickSkrauch <erickskrauch@yandex.ru>
2024-12-02 15:40:55 +05:30
'port' => (int)getenv('STATSD_PORT') ?: 8125,
'namespace' => getenv('STATSD_NAMESPACE') ?: 'ely.accounts.' . gethostname() . '.app',
],
'queue' => [
'class' => yii\queue\redis\Queue::class,
],
],
];