Merge branch '3.4' into 4.3

* 3.4:
  [ProxyManager] fix generating proxies for root-namespaced classes
  [DI] skip looking for config class when the extension class is anonymous
  Fix typo
  [Dotenv] FIX missing getenv
This commit is contained in:
Nicolas Grekas 2019-12-19 16:57:24 +01:00
commit dfa118f253
6 changed files with 20 additions and 5 deletions

View File

@ -85,6 +85,7 @@ EOF;
public function getProxyCode(Definition $definition)
{
$code = $this->classGenerator->generate($this->generateProxyClass($definition));
$code = preg_replace('/^(class [^ ]++ extends )([^\\\\])/', '$1\\\\$2', $code);
if (version_compare(self::getProxyManagerVersion(), '2.2', '<')) {
$code = preg_replace(

View File

@ -21,5 +21,5 @@ class LazyServiceProjectServiceContainer extends Container
}
}
class stdClass_%s extends %SstdClass implements \ProxyManager\%s
class stdClass_%s extends \stdClass implements \ProxyManager\%s
{%a}%A

View File

@ -80,6 +80,11 @@ abstract class Extension implements ExtensionInterface, ConfigurationExtensionIn
public function getConfiguration(array $config, ContainerBuilder $container)
{
$class = \get_class($this);
if (false !== strpos($class, "\0")) {
return null; // ignore anonymous classes
}
$class = substr_replace($class, '\Configuration', strrpos($class, '\\'));
$class = $container->getReflectionClass($class);

View File

@ -458,7 +458,7 @@ final class Dotenv
} elseif (isset($this->values[$name])) {
$value = $this->values[$name];
} else {
$value = '';
$value = (string) getenv($name);
}
if (!$matches['opening_brace'] && isset($matches['closing_brace'])) {

View File

@ -431,6 +431,17 @@ class DotenvTest extends TestCase
}
}
public function testGetVariablesValueFromGetenv()
{
putenv('Foo=Bar');
$dotenv = new Dotenv(true);
$values = $dotenv->parse('Foo=${Foo}');
$this->assertSame('Bar', $values['Foo']);
putenv('Foo');
}
/**
* @group legacy
* @expectedDeprecation The default value of "$usePutenv" argument of "%s" will be changed from "true" to "false" in Symfony 5.0. You should define its value explicitly.

View File

@ -403,13 +403,11 @@ class NativeSessionStorage implements SessionStorageInterface
* ini_set('session.save_path', '/tmp');
*
* or pass in a \SessionHandler instance which configures session.save_handler in the
* constructor, for a template see NativeFileSessionHandler or use handlers in
* composer package drak/native-session
* constructor, for a template see NativeFileSessionHandler.
*
* @see https://php.net/session-set-save-handler
* @see https://php.net/sessionhandlerinterface
* @see https://php.net/sessionhandler
* @see https://github.com/zikula/NativeSession
*
* @param \SessionHandlerInterface|null $saveHandler
*