-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use PHP config instead of YAML
- Loading branch information
Showing
30 changed files
with
455 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||
|
||
return static function (ContainerConfigurator $containerConfigurator): void { | ||
$containerConfigurator->extension('framework', [ | ||
'asset_mapper' => [ | ||
// The paths to make available to the asset mapper. | ||
'paths' => [ | ||
'assets/', | ||
], | ||
], | ||
]); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||
|
||
return static function (ContainerConfigurator $containerConfigurator): void { | ||
$containerConfigurator->extension('framework', [ | ||
// Unique name of your app: used to compute stable namespaces for cache keys. | ||
// 'prefix_seed' => 'your_vendor_name/app_name', | ||
|
||
// The "app" cache stores to the filesystem by default. | ||
// The data in this cache should persist between deploys. | ||
// Other options include: | ||
|
||
// Redis | ||
// 'app' => 'cache.adapter.redis', | ||
// 'default_redis_provider' => 'redis://localhost', | ||
|
||
// APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues) | ||
// 'app' => 'cache.adapter.apcu', | ||
|
||
// Namespaced pools use the above "app" backend by default | ||
// 'pools' => [ | ||
// 'my.dedicated.cache' => null | ||
// ], | ||
'cache' => null, | ||
]); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||
|
||
return static function (ContainerConfigurator $containerConfigurator): void { | ||
// Enable stateless CSRF protection for forms and logins/logouts | ||
$containerConfigurator->extension('framework', [ | ||
'form' => [ | ||
'csrf_protection' => [ | ||
'token_id' => 'submit', | ||
], | ||
], | ||
'csrf_protection' => [ | ||
'stateless_token_ids' => [ | ||
'submit', | ||
'authenticate', | ||
'logout', | ||
], | ||
], | ||
]); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||
|
||
return static function (ContainerConfigurator $containerConfigurator): void { | ||
// see https://symfony.com/doc/current/reference/configuration/framework.html | ||
$containerConfigurator->extension('framework', [ | ||
'secret' => '%env(APP_SECRET)%', | ||
// 'csrf_protection' => true, | ||
'http_method_override' => false, | ||
'handle_all_throwables' => true, | ||
|
||
// Enables session support. Note that the session will ONLY be started if you read or write from it. | ||
// Remove or comment this section to explicitly disable session support. | ||
'session' => [ | ||
'handler_id' => null, | ||
'cookie_secure' => 'auto', | ||
'cookie_samesite' => 'lax', | ||
'storage_factory_id' => 'session.storage.factory.native', | ||
], | ||
|
||
// 'esi' => true | ||
// 'fragments' => true | ||
'php_errors' => [ | ||
'log' => true, | ||
], | ||
]); | ||
|
||
if ($containerConfigurator->env() === 'test') { | ||
$containerConfigurator->extension('framework', [ | ||
'test' => true, | ||
'session' => [ | ||
'storage_factory_id' => 'session.storage.factory.mock_file', | ||
], | ||
]); | ||
} | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||
|
||
return static function (ContainerConfigurator $containerConfigurator): void { | ||
$containerConfigurator->extension('monolog', [ | ||
'channels' => [ | ||
'deprecation', | ||
], | ||
]); | ||
|
||
if ($containerConfigurator->env() === 'dev') { | ||
$containerConfigurator->extension('monolog', [ | ||
'handlers' => [ | ||
'main' => [ | ||
'type' => 'stream', | ||
'path' => '%kernel.logs_dir%/%kernel.environment%.log', | ||
'level' => 'debug', | ||
'channels' => [ | ||
'!event', | ||
], | ||
], | ||
// uncomment to get logging in your browser | ||
// you may have to allow bigger header sizes in your Web server configuration | ||
// 'firephp' => [ | ||
// 'type' => 'firephp', | ||
// 'level' => 'info', | ||
// ], | ||
// 'chromephp' => [ | ||
// 'type' => 'chromephp', | ||
// 'level' => 'info', | ||
// ], | ||
|
||
'console' => [ | ||
'type' => 'console', | ||
'process_psr_3_messages' => false, | ||
'channels' => [ | ||
'!event', | ||
'!doctrine', | ||
'!console', | ||
], | ||
], | ||
], | ||
]); | ||
} | ||
|
||
if ($containerConfigurator->env() === 'test') { | ||
$containerConfigurator->extension('monolog', [ | ||
'handlers' => [ | ||
'main' => [ | ||
'type' => 'fingers_crossed', | ||
'action_level' => 'error', | ||
'handler' => 'nested', | ||
'excluded_http_codes' => [ | ||
404, | ||
405, | ||
], | ||
'channels' => [ | ||
'!event', | ||
], | ||
], | ||
'nested' => [ | ||
'type' => 'stream', | ||
'path' => '%kernel.logs_dir%/%kernel.environment%.log', | ||
'level' => 'debug', | ||
], | ||
], | ||
]); | ||
} | ||
|
||
if ($containerConfigurator->env() === 'prod') { | ||
$containerConfigurator->extension('monolog', [ | ||
'handlers' => [ | ||
'main' => [ | ||
'type' => 'fingers_crossed', | ||
'action_level' => 'error', | ||
'handler' => 'nested', | ||
'excluded_http_codes' => [ | ||
404, | ||
405, | ||
], | ||
'buffer_size' => 50, | ||
], | ||
'nested' => [ | ||
'type' => 'stream', | ||
'path' => 'php://stderr', | ||
'level' => 'debug', | ||
'formatter' => 'monolog.formatter.json', | ||
], | ||
'console' => [ | ||
'type' => 'console', | ||
'process_psr_3_messages' => false, | ||
'channels' => [ | ||
'!event', | ||
'!doctrine', | ||
], | ||
], | ||
'deprecation' => [ | ||
'type' => 'stream', | ||
'channels' => [ | ||
'deprecation', | ||
], | ||
'path' => 'php://stderr', | ||
], | ||
], | ||
]); | ||
} | ||
}; |
Oops, something went wrong.