186 Commits

Author SHA1 Message Date
Nicolas Grekas
8a85abdbf1 Merge branch '6.4' into 7.4
* 6.4:
  [HttpKernel] Reset router locale to default when finishing main request
  Only decrement pendingRequests when it's more than zero
  [Dotenv] Fix self-referencing variables with defaults and env key resolution during deferred expansion
  Improve Bulgarian translations in validators.bg.xlf
  [Cache] Fix ChainAdapter ignoring item expiry when propagating to earlier adapters
  [Form] Fix typed property initialization in ValidatorExtension
  [Messenger] Fix duplicate pending messages in Redis transport with batch handlers
  Fix deprecation notices for "@method" annotations when implementing interfaces directly
2026-03-17 14:25:29 +01:00
Nicolas Grekas
a451c42d55 [Dotenv] Fix self-referencing variables with defaults and env key resolution during deferred expansion 2026-03-16 15:58:12 +01:00
Nicolas Grekas
02c51aeb01 Merge branch '6.4' into 7.4
* 6.4:
  [Dotenv] Fix double-unescaping of backslashes during deferred variable resolution
  [Dotenv] Fix escaped dollar signs lost during deferred variable resolution
  Bump Symfony version to 6.4.36
  Update VERSION for 6.4.35
  Update CONTRIBUTORS for 6.4.35
  Update CHANGELOG for 6.4.35
2026-03-09 18:19:59 +01:00
Nicolas Grekas
1c792074bc [Dotenv] Fix double-unescaping of backslashes during deferred variable resolution 2026-03-09 12:48:12 +01:00
Nicolas Grekas
c87272dd26 [Dotenv] Fix escaped dollar signs lost during deferred variable resolution 2026-03-08 18:51:23 +01:00
Nicolas Grekas
7e5529a0b0 Merge branch '6.4' into 7.4
* 6.4:
  [WebProfilerBundle] Cleanup whitespace
  [Validator] Regex bypass when match is false with too big input
  gracefully handle the kernel.runtime_mode.web parameter missing
  [Mailer] Rewrite "rebanded" to "re-branded"
  [DependencyInjection] Fix TypeError when using a custom container base class with typed $parameterBag
  [Dotenv] Defer variable and command expansion to account for overrides from subsequent .env files
  Bump Symfony version to 6.4.35
  Update VERSION for 6.4.34
  Update CONTRIBUTORS for 6.4.34
  Update CHANGELOG for 6.4.34
2026-03-03 08:48:48 +01:00
Nicolas Grekas
148138ead5 [Dotenv] Defer variable and command expansion to account for overrides from subsequent .env files 2026-02-26 11:15:49 +01:00
Nicolas Grekas
234b6c602f CS fixes 2025-07-10 10:14:14 +02:00
Christian Flothmann
07b2c58767 Merge branch '7.1' into 7.2
* 7.1:
  [TwigBridge] Remove `VersionAwareTest` from `AbstractLayoutTestCase`
  [DependencyInjection] Add coverage for error cases of `LazyClosure` and `AutowireLocator`
  [TwigBridge] Fixed a parameterized choice label translation
  Fix extracting of message from ->trans() method with named params
  [TwigBridge] Remove usage of Node() instantiations
  Update security.bg.xlf
  [Dotenv] Default value can be empty
  [Emoji] Update data to support emoji 16
  Add missing Albanian translations for Security and Validator components
  [HttpClient] Add `crypto_method` to scoped client options
  suppress proc_open errors
  [DependencyInjection] Fix `XmlFileLoader` not respecting when env for services
2024-09-28 14:51:41 +02:00
Christian Flothmann
56a10f3032 Merge branch '6.4' into 7.1
* 6.4:
  [TwigBridge] Remove usage of Node() instantiations
  Update security.bg.xlf
  [Dotenv] Default value can be empty
  [Emoji] Update data to support emoji 16
2024-09-28 13:14:12 +02:00
Christian Flothmann
436ae2dd89 Merge branch '5.4' into 6.4
* 5.4:
  [TwigBridge] Remove usage of Node() instantiations
  Update security.bg.xlf
  [Dotenv] Default value can be empty
2024-09-28 09:43:51 +02:00
HypeMC
4cb5f06e55 [Dotenv] Default value can be empty 2024-09-26 09:06:08 +02:00
Nicolas Grekas
b453abe5ea Merge branch '7.1' into 7.2
* 7.1:
  [Process] minor fix
  [Process] Fix finding executables independently of open_basedir
  [HttpKernel] Skip logging uncaught exceptions in ErrorHandler, assume $kernel->terminateWithException() will do it
  [Serializer] Fix for method named `get()`
  [Notifier][TurboSMS] Process partial accepted response from transport
  parse empty sequence elements as null
  [HttpClient] Fix setting CURLMOPT_MAXCONNECTS
  throw a meaningful exception when parsing dotenv files with BOM
  [FrameworkBundle] Fix schema & finish incomplete tests for lock & semaphore config
  [Cache] Fix RedisSentinel params types
  [FrameworkBundle] Fix service reset between tests
  [Uid][Serializer][Validator] Mention RFC 9562
  make sure temp files can be cleaned up on Windows
2024-09-17 14:51:32 +02:00
Christian Flothmann
6d966200b3 Merge branch '6.4' into 7.1
* 6.4:
  [Serializer] Fix for method named `get()`
  [Notifier][TurboSMS] Process partial accepted response from transport
  [HttpClient] Fix setting CURLMOPT_MAXCONNECTS
  throw a meaningful exception when parsing dotenv files with BOM
  [FrameworkBundle] Fix schema & finish incomplete tests for lock & semaphore config
  [Cache] Fix RedisSentinel params types
  [FrameworkBundle] Fix service reset between tests
  [Uid][Serializer][Validator] Mention RFC 9562
  make sure temp files can be cleaned up on Windows
2024-09-17 11:16:35 +02:00
Christian Flothmann
815284236c Merge branch '5.4' into 6.4
* 5.4:
  [HttpClient] Fix setting CURLMOPT_MAXCONNECTS
  throw a meaningful exception when parsing dotenv files with BOM
  [Cache] Fix RedisSentinel params types
  [FrameworkBundle] Fix service reset between tests
  [Uid][Serializer][Validator] Mention RFC 9562
  make sure temp files can be cleaned up on Windows
2024-09-16 18:01:33 +02:00
Christian Flothmann
bb4fef2bf0 throw a meaningful exception when parsing dotenv files with BOM 2024-09-16 11:39:25 +02:00
Alexandre Daubois
966f1900ef Remove unused code and unnecessary else branches 2024-08-02 08:50:04 +02:00
Alexander M. Turek
f38d8a3f81 Prefix all sprintf() calls 2024-06-20 17:52:34 +02:00
Nicolas Grekas
a2934c612c Merge branch '7.0' into 7.1
* 7.0:
  List CS fix in .git-blame-ignore-revs
  Fix implicitly-required parameters
  minor #53524 [Messenger] [AmazonSqs] Allow `async-aws/sqs` version 2 (smoench)
  Fix bad merge
  List CS fix in .git-blame-ignore-revs
  Fix implicitly-required parameters
  List CS fix in .git-blame-ignore-revs
  Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
  [Messenger][AmazonSqs] Allow async-aws/sqs version 2
2024-01-23 16:06:13 +01:00
Nicolas Grekas
d9eaf69997 Merge branch '5.4' into 6.3
* 5.4:
  Fix implicitly-required parameters
  List CS fix in .git-blame-ignore-revs
  Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
  [Messenger][AmazonSqs] Allow async-aws/sqs version 2
2024-01-23 15:35:58 +01:00
Nicolas Grekas
4de4884401 Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value 2024-01-23 14:51:25 +01:00
Oskar Stark
f3e6a5e66a [Dotenv][ErrorHandler][EventDispatcher] Use CPP 2024-01-08 13:57:37 +01:00
Nicolas Grekas
92db79428d feature #52638 [Dotenv] Add SYMFONY_DOTENV_PATH, consumed by debug:dotenv for custom .env path (GromNaN)
This PR was merged into the 7.1 branch.

Discussion
----------

[Dotenv] Add `SYMFONY_DOTENV_PATH`, consumed by `debug:dotenv` for custom `.env` path

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Issues        | Fix #47880
| License       | MIT

Continuation of #47901

Introduce `SYMFONY_DOTENV_PATH` set by DotEnv class and read by the `debug:dotenv` command to contextualize the debug info with the file that was actually parsed.

The custom path can be set in many ways:

- Doing a call to `(new Dotenv())->bootEnv(dirname(__DIR__).'my/custom/path/to/.env');`
- In `composer.json`: `"extra": { "runtime": { "dotenv_path": "my/custom/path/to/.env" }`
- With the env var: `$_SERVER['APP_RUNTIME_OPTIONS'] = ['dotenv_path' => 'my/custom/path/to/.env'];`

The dotenv file can be outside of the `project_dir`.

Commits
-------

52b6416ff9 DotEnv debug command aware of custom dotenv_path
2024-01-02 11:47:14 +01:00
Fabien Potencier
267a24da69 Merge branch '7.0' into 7.1
* 7.0:
  [VarDumper] Fix CSS alignment in HtmlDumper
  allow environment variables starting with an underscore
  Update a test
  [PsrHttpMessageBridge] Fix links in composer.json
  [Mailer][Postmark] Add missing changelog for webhook support
  [HttpKernel] fix "Cannot redeclare renderSymfonyLogoSvg()" inside phpunit tests
  Remove #StandWithUkraine
  [Notifier][Smsc] Require login and password
2023-12-28 20:18:34 +01:00
Fabien Potencier
96d1ee86e8 Merge branch '5.4' into 6.3
* 5.4:
  allow environment variables starting with an underscore
  Update a test
  Remove #StandWithUkraine
  [Notifier][Smsc] Require login and password
2023-12-28 20:16:47 +01:00
Christian Flothmann
07d75571cc allow environment variables starting with an underscore 2023-12-28 13:17:46 +01:00
Javier Eguiluz
0106cf412c Code updates 2023-12-18 18:35:59 +01:00
Jérôme Tamarelle
68cd3f91d2 DotEnv debug command aware of custom dotenv_path
Introduce SYMFONY_DOTENV_PATH set by DotEnv class and read by debug:dotenv command
to contextualize the debug info with the file that was actually parsed.
2023-11-20 14:49:26 +01:00
Fabien Potencier
7dfbe2976f Merge branch '5.4' into 6.3
* 5.4:
  [5.4] Remove unused test fixtures
  [Dotent] Add PHPDoc for `$overrideExistingVars`
  [SecurityBundle] Fix missing login-link element in xsd schema
  [Validator] Add missing Chinese translations #51934
  [Serializer] Fix using `DateIntervalNormalizer` with union types
  [Validator] fix: add missing translations for for Thai (th)
  fix #52273 [doctrine-messenger] DB table locks on messenger_messages with many failures
  [Serializer] Handle defaultContext for DateTimeNormalizer
  [CI] Add step to verify symfony/deprecation-contracts requirements
2023-10-26 11:15:14 -07:00
Alexandre Daubois
ceed2cd284 [Dotent] Add PHPDoc for $overrideExistingVars 2023-10-26 18:37:39 +02:00
Artyum Petrov
ceadb434fe Add "composer require..." in all exception messages when needed 2023-04-21 16:41:17 +02:00
Nicolas Grekas
070cdb03ac Merge branch '6.2' into 6.3
* 6.2:
  [Tests] Remove occurrences of `withConsecutive()`
  Fix support binary values in parameters.
  [Dotenv] Improve Dotenv::usePutenv phpdoc
2023-03-10 11:08:00 +01:00
Nicolas Grekas
4481aa45be Merge branch '5.4' into 6.2
* 5.4:
  [Tests] Remove occurrences of `withConsecutive()`
  Fix support binary values in parameters.
  [Dotenv] Improve Dotenv::usePutenv phpdoc
2023-03-10 11:06:03 +01:00
Antoine Lamirault
77b7660bfc [Dotenv] Improve Dotenv::usePutenv phpdoc 2023-03-09 21:36:58 +01:00
Wouter de Jong
94a91d5f92 Add void return types 2023-02-13 14:18:23 +01:00
Nicolas Grekas
10202edba8 Merge branch '5.4' into 6.2
* 5.4:
  [Serializer] Fix CsvEncoder decode on empty data
  [Tests] Migrate data providers to static ones
  stop using assertObjectHasAttribute()/assertObjectHasNotAttribute()
  [Dotenv] Fix phpdoc Dotenv
  [Config] Fix phpdoc nullable
  Fix some typos
2023-02-06 11:38:33 +01:00
Antoine Lamirault
434066786a [Dotenv] Fix phpdoc Dotenv 2023-02-05 18:27:03 +01:00
Benjamin Schultz
bdc3766f31 Remove code for legacy Process component versions 2022-09-30 15:41:10 +02:00
François-Xavier de Guillebon
7b89fb1317 Replace FILTER_VALIDATE_BOOLEAN by FILTER_VALIDATE_BOOL 2022-08-26 17:23:18 +02:00
Thomas Calvet
568c11bced Leverage non-capturing catches 2022-04-01 09:15:35 +02:00
Nicolas Grekas
3f9aaf78cd Merge branch '6.0' into 6.1
* 6.0: (27 commits)
  [DoctrineBridge] fix tests
  [HttpKernel] Fix session test cases for symfony
  [FrameworkBundle] Fix missing arguments when a serialization default context is bound
  [Runtime] Fix --env and --no-debug with dotenv_overload
  [Cache] fix merge
  cs fix
  [Finder] Fix finding VCS re-included files in excluded directory
  [Yaml] Improve the deprecation warnings for octal numbers to suggest migrating
  Fix Choice constraint with associative choices array
  [Form] UrlType should not add protocol to emails
  [Dotenv] Fix bootEnv() override with .env.local.php when the env key already exists
  Silence isatty warnings during tty detection
  [Serializer] Fix AbstractObjectNormalizer not considering pseudo type false
  [Notifier] Fix encoding of messages with FreeMobileTransport
  [Cache] workaround PHP crash
  [Console] Fix PHP 8.1 deprecation in ChoiceQuestion
  [HttpKernel] Fix compatibility with php bridge and already started php sessions
  [Notifier] smsapi-notifier - correct encoding
  Replaced full CoC text with link to documentation
  Making the parser stateless
  ...
2022-01-27 11:12:23 +01:00
Nicolas Grekas
45c47b67cc Merge branch '5.4' into 6.0
* 5.4: (21 commits)
  [Finder] Fix finding VCS re-included files in excluded directory
  [Yaml] Improve the deprecation warnings for octal numbers to suggest migrating
  Fix Choice constraint with associative choices array
  [Form] UrlType should not add protocol to emails
  [Dotenv] Fix bootEnv() override with .env.local.php when the env key already exists
  Silence isatty warnings during tty detection
  [Serializer] Fix AbstractObjectNormalizer not considering pseudo type false
  [Notifier] Fix encoding of messages with FreeMobileTransport
  [Cache] workaround PHP crash
  [Console] Fix PHP 8.1 deprecation in ChoiceQuestion
  [HttpKernel] Fix compatibility with php bridge and already started php sessions
  [Notifier] smsapi-notifier - correct encoding
  Replaced full CoC text with link to documentation
  Making the parser stateless
  [Console] fix restoring stty mode on CTRL+C
  fix merge (bis)
  fix merge
  [Process] Avoid calling fclose on an already closed resource
  [GHA] test tty group
  [DI] Fix tests on PHP 7.1
  ...
2022-01-26 18:23:29 +01:00
Thomas Calvet
84d1af2d39 [Dotenv] Fix bootEnv() override with .env.local.php when the env key already exists 2022-01-26 17:19:10 +01:00
Nicolas Grekas
0c868a8593 Add more nullsafe operators 2021-12-16 23:15:42 +01:00
Nicolas Grekas
f403e4d0f0 Merge branch '6.0' into 6.1
* 6.0:
  [6.0] cs fixes
  [5.4] cs fixes
  [5.3] cs fixes
  [Cache] Fix saving items with no expiration through ProxyAdapter
  CS fixes
  fix merge
  Remove pointless assignment
  [HttpClient] Fix tracing requests made after calling withOptions()
  [Cache] disable lock on CLI
  Revert "feature #41989 [Cache] make `LockRegistry` use semaphores when possible (nicolas-grekas)"
  [HttpKernel] fix how configuring log-level and status-code by exception works
  [VarDumper] add more "transient-on-macos" groups
2021-12-16 23:14:15 +01:00
Nicolas Grekas
5c43c5515e Merge branch '5.4' into 6.0
* 5.4:
  [5.4] cs fixes
  [5.3] cs fixes
  [Cache] Fix saving items with no expiration through ProxyAdapter
  CS fixes
  [HttpClient] Fix tracing requests made after calling withOptions()
  [Cache] disable lock on CLI
  Revert "feature #41989 [Cache] make `LockRegistry` use semaphores when possible (nicolas-grekas)"
  [HttpKernel] fix how configuring log-level and status-code by exception works
  [VarDumper] add more "transient-on-macos" groups
2021-12-16 23:05:41 +01:00
Nicolas Grekas
1f28b9b3ed Merge branch '5.3' into 5.4
* 5.3:
  [5.3] cs fixes
  [Cache] Fix saving items with no expiration through ProxyAdapter
  CS fixes
  [HttpClient] Fix tracing requests made after calling withOptions()
  [Cache] disable lock on CLI
  [VarDumper] add more "transient-on-macos" groups
2021-12-16 22:52:00 +01:00
Nicolas Grekas
6ff81d0179 Merge branch '4.4' into 5.3
* 4.4:
  [Cache] Fix saving items with no expiration through ProxyAdapter
  CS fixes
  [Cache] disable lock on CLI
  [VarDumper] add more "transient-on-macos" groups
2021-12-16 22:37:57 +01:00
Nicolas Grekas
15a389dd8d CS fixes 2021-12-16 22:17:20 +01:00
Thomas Calvet
2d9cbe409c Leverage str_starts_with(), str_ends_with() and str_contains() 2021-12-08 15:00:06 +01:00