Skip to content

Commit e99570a

Browse files
committed
Use the PHP config builder
1 parent f023271 commit e99570a

File tree

4 files changed

+22
-19
lines changed

4 files changed

+22
-19
lines changed

config/packages/gos_web_socket.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
use Symfony\Config\GosWebSocketConfig;
4+
5+
return static function (GosWebSocketConfig $gosWebSocket) {
6+
$gosWebSocket
7+
->server()
8+
->port('%env(int:GOS_WEB_SOCKET_SERVER_PORT)%')
9+
->host('%env(GOS_WEB_SOCKET_SERVER_IP)%')
10+
->router()
11+
->resources(['resource' => '%kernel.project_dir%/config/pubsub/websocket/*', 'type' => 'glob'])
12+
13+
;
14+
};

config/packages/gos_web_socket.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

config/services.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
# Put parameters here that don't need to change on each machine where the app is deployed
55
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
66
parameters:
7+
# Adds fallback params in case the corresponding env vars are not set.
8+
# This allows you to run cache:warmup even if your
9+
# environment variables are not available yet.
10+
# You should not need to change this value.
11+
env(GOS_WEB_SOCKET_SERVER_IP): '127.0.0.1'
12+
env(GOS_WEB_SOCKET_SERVER_PORT): 1337
713

814
services:
915
# default configuration for services in *this* file

src/Kernel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ class Kernel extends BaseKernel
1313

1414
protected function configureContainer(ContainerConfigurator $container): void
1515
{
16-
$container->import('../config/{packages}/*.yaml');
17-
$container->import('../config/{packages}/'.$this->environment.'/*.yaml');
16+
$container->import('../config/{packages}/*.{php,yaml}');
17+
$container->import('../config/{packages}/'.$this->environment.'/*.{php,yaml}');
1818

1919
if (is_file(\dirname(__DIR__).'/config/services.yaml')) {
2020
$container->import('../config/services.yaml');

0 commit comments

Comments
 (0)