Skip to content

Commit

Permalink
Merge branch '2.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobion committed Feb 21, 2015
2 parents 3410aa6 + bbd4a1e commit b05fce2
Show file tree
Hide file tree
Showing 35 changed files with 407 additions and 315 deletions.
Expand Up @@ -803,7 +803,7 @@ private function registerAnnotationsConfiguration(array $config, ContainerBuilde

if ('file' === $config['cache']) {
$cacheDir = $container->getParameterBag()->resolveValue($config['file_cache_dir']);
if (!is_dir($cacheDir) && false === @mkdir($cacheDir, 0777, true)) {
if (!is_dir($cacheDir) && false === @mkdir($cacheDir, 0777, true) && !is_dir($cacheDir)) {
throw new \RuntimeException(sprintf('Could not create cache directory "%s".', $cacheDir));
}

Expand Down
Expand Up @@ -23,6 +23,12 @@ interface SecurityFactoryInterface
{
public function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint);

/**
* Defines the position at which the provider is called.
* Possible values: pre_auth, form, http, and remember_me.
*
* @return string
*/
public function getPosition();

public function getKey();
Expand Down
Expand Up @@ -6,11 +6,11 @@
{% set link = collector.controller.file|file_link(collector.controller.line) %}
{% if collector.controller.method %}
<span class="sf-toolbar-info-class sf-toolbar-info-with-next-pointer">{{ collector.controller.class|abbr_class }}</span>
<span class="sf-toolbar-info-method" onclick="{% if link %}window.location='{{link|e('js')}}';window.event.stopPropagation();return false;{% endif %}">
<span class="sf-toolbar-info-method"{% if link %} onclick="window.location='{{link|e('js')}}';window.event.stopPropagation();return false;"{% endif %}>
{{ collector.controller.method }}
</span>
{% else %}
<span class="sf-toolbar-info-class" onclick="{% if link %}window.location='{{link|e('js')}}';window.event.stopPropagation();return false;{% endif %}">{{ collector.controller.class|abbr_class }}</span>
<span class="sf-toolbar-info-class"{% if link %} onclick="window.location='{{link|e('js')}}';window.event.stopPropagation();return false;"{% endif %}>{{ collector.controller.class|abbr_class }}</span>
{% endif %}
{% else %}
<span class="sf-toolbar-info-class">{{ collector.controller }}</span>
Expand Down
Expand Up @@ -173,7 +173,7 @@
var addEventListener;
if (document.addEventListener) {
if (document.attachEvent) {
addEventListener = function (element, eventName, callback) {
element.attachEvent('on' + eventName, callback);
};
Expand Down
Expand Up @@ -24,7 +24,7 @@
<div id="sfToolbarClearer-{{ token }}" style="clear: both; height: 38px;"></div>
{% endif %}

<div id="sfToolbarMainContent-{{ token }}" class="sf-toolbarreset" data-no-turbolink>
<div id="sfToolbarMainContent-{{ token }}" class="sf-toolbarreset clear-fix" data-no-turbolink>
{% for name, template in templates %}
{{ template.renderblock('toolbar', {
'collector': profile.getcollector(name),
Expand Down
Expand Up @@ -22,6 +22,11 @@ class EnumNodeDefinition extends ScalarNodeDefinition
{
private $values;

/**
* @param array $values
*
* @return EnumNodeDefinition|$this
*/
public function values(array $values)
{
$values = array_unique($values);
Expand Down
28 changes: 14 additions & 14 deletions src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php
Expand Up @@ -56,7 +56,7 @@ public function __construct($name, NodeParentInterface $parent = null)
*
* @param NodeParentInterface $parent The parent
*
* @return NodeDefinition
* @return NodeDefinition|$this
*/
public function setParent(NodeParentInterface $parent)
{
Expand All @@ -70,7 +70,7 @@ public function setParent(NodeParentInterface $parent)
*
* @param string $info The info text
*
* @return NodeDefinition
* @return NodeDefinition|$this
*/
public function info($info)
{
Expand All @@ -82,7 +82,7 @@ public function info($info)
*
* @param string|array $example
*
* @return NodeDefinition
* @return NodeDefinition|$this
*/
public function example($example)
{
Expand All @@ -95,7 +95,7 @@ public function example($example)
* @param string $key
* @param mixed $value
*
* @return NodeDefinition
* @return NodeDefinition|$this
*/
public function attribute($key, $value)
{
Expand Down Expand Up @@ -146,7 +146,7 @@ public function getNode($forceRootNode = false)
*
* @param mixed $value The default value
*
* @return NodeDefinition
* @return NodeDefinition|$this
*/
public function defaultValue($value)
{
Expand All @@ -159,7 +159,7 @@ public function defaultValue($value)
/**
* Sets the node as required.
*
* @return NodeDefinition
* @return NodeDefinition|$this
*/
public function isRequired()
{
Expand All @@ -173,7 +173,7 @@ public function isRequired()
*
* @param mixed $value
*
* @return NodeDefinition
* @return NodeDefinition|$this
*/
public function treatNullLike($value)
{
Expand All @@ -187,7 +187,7 @@ public function treatNullLike($value)
*
* @param mixed $value
*
* @return NodeDefinition
* @return NodeDefinition|$this
*/
public function treatTrueLike($value)
{
Expand All @@ -201,7 +201,7 @@ public function treatTrueLike($value)
*
* @param mixed $value
*
* @return NodeDefinition
* @return NodeDefinition|$this
*/
public function treatFalseLike($value)
{
Expand All @@ -213,7 +213,7 @@ public function treatFalseLike($value)
/**
* Sets null as the default value.
*
* @return NodeDefinition
* @return NodeDefinition|$this
*/
public function defaultNull()
{
Expand All @@ -223,7 +223,7 @@ public function defaultNull()
/**
* Sets true as the default value.
*
* @return NodeDefinition
* @return NodeDefinition|$this
*/
public function defaultTrue()
{
Expand All @@ -233,7 +233,7 @@ public function defaultTrue()
/**
* Sets false as the default value.
*
* @return NodeDefinition
* @return NodeDefinition|$this
*/
public function defaultFalse()
{
Expand All @@ -253,7 +253,7 @@ public function beforeNormalization()
/**
* Denies the node value being empty.
*
* @return NodeDefinition
* @return NodeDefinition|$this
*/
public function cannotBeEmpty()
{
Expand Down Expand Up @@ -281,7 +281,7 @@ public function validate()
*
* @param bool $deny Whether the overwriting is forbidden or not
*
* @return NodeDefinition
* @return NodeDefinition|$this
*/
public function cannotBeOverwritten($deny = true)
{
Expand Down
4 changes: 4 additions & 0 deletions src/Symfony/Component/Console/Command/Command.php
Expand Up @@ -170,6 +170,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
/**
* Interacts with the user.
*
* This method is executed before the InputDefinition is validated.
* This means that this is the only place where the command can
* interactively ask for values of missing required arguments.
*
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*/
Expand Down
6 changes: 4 additions & 2 deletions src/Symfony/Component/Console/Input/ArrayInput.php
Expand Up @@ -100,8 +100,10 @@ public function getParameterOption($values, $default = false)
$values = (array) $values;

foreach ($this->parameters as $k => $v) {
if (is_int($k) && in_array($v, $values)) {
return true;
if (is_int($k)) {
if (in_array($v, $values)) {
return true;
}
} elseif (in_array($k, $values)) {
return $v;
}
Expand Down
9 changes: 9 additions & 0 deletions src/Symfony/Component/Console/Tests/Input/ArrayInputTest.php
Expand Up @@ -38,6 +38,15 @@ public function testHasParameterOption()
$this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if an option is present in the passed parameters');
}

public function testGetParameterOption()
{
$input = new ArrayInput(array('name' => 'Fabien', '--foo' => 'bar'));
$this->assertEquals('bar', $input->getParameterOption('--foo'), '->getParameterOption() returns the option of specified name');

$input = new ArrayInput(array('Fabien', '--foo' => 'bar'));
$this->assertEquals('bar', $input->getParameterOption('--foo'), '->getParameterOption() returns the option of specified name');
}

public function testParseArguments()
{
$input = new ArrayInput(array('name' => 'foo'), new InputDefinition(array(new InputArgument('name'))));
Expand Down
Expand Up @@ -341,15 +341,15 @@ public function testGetOptionDefaults()
new InputOption('foo7', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, '', array(1, 2)),
));
$defaults = array(
'foo1' => null,
'foo1' => false,
'foo2' => null,
'foo3' => 'default',
'foo4' => null,
'foo5' => 'default',
'foo6' => array(),
'foo7' => array(1, 2),
);
$this->assertEquals($defaults, $definition->getOptionDefaults(), '->getOptionDefaults() returns the default values for all options');
$this->assertSame($defaults, $definition->getOptionDefaults(), '->getOptionDefaults() returns the default values for all options');
}

public function testGetSynopsis()
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Finder/Finder.php
Expand Up @@ -234,7 +234,7 @@ public function depth($level)
* $finder->date('> now - 2 hours');
* $finder->date('>= 2005-10-15');
*
* @param string $date A date rage string
* @param string $date A date range string
*
* @return Finder The current Finder instance
*
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Form/CHANGELOG.md
Expand Up @@ -10,8 +10,8 @@ CHANGELOG
2.6.2
-----

* Added back the `model_timezone` and `view_timezone` options for `TimeType`, `DateType`
and `BirthdayType`
* Added back the `model_timezone` and `view_timezone` options for `TimeType`, `DateType`
and `BirthdayType`

2.6.0
-----
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpFoundation/File/File.php
Expand Up @@ -130,7 +130,7 @@ public function move($directory, $name = null)
protected function getTargetFile($directory, $name = null)
{
if (!is_dir($directory)) {
if (false === @mkdir($directory, 0777, true)) {
if (false === @mkdir($directory, 0777, true) && !is_dir($directory)) {
throw new FileException(sprintf('Unable to create the "%s" directory', $directory));
}
} elseif (!is_writable($directory)) {
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/HttpFoundation/Request.php
Expand Up @@ -616,8 +616,8 @@ public static function getTrustedHosts()
* The following header keys are supported:
*
* * Request::HEADER_CLIENT_IP: defaults to X-Forwarded-For (see getClientIp())
* * Request::HEADER_CLIENT_HOST: defaults to X-Forwarded-Host (see getClientHost())
* * Request::HEADER_CLIENT_PORT: defaults to X-Forwarded-Port (see getClientPort())
* * Request::HEADER_CLIENT_HOST: defaults to X-Forwarded-Host (see getHost())
* * Request::HEADER_CLIENT_PORT: defaults to X-Forwarded-Port (see getPort())
* * Request::HEADER_CLIENT_PROTO: defaults to X-Forwarded-Proto (see getScheme() and isSecure())
*
* Setting an empty value allows to disable the trusted header for the given key.
Expand Down
Expand Up @@ -110,7 +110,7 @@ public function dump(Data $data)

if (false === $name) {
$name = strtr($file, '\\', '/');
$name = substr($file, strrpos($file, '/') + 1);
$name = substr($name, strrpos($name, '/') + 1);
}

$this->data[] = compact('data', 'name', 'file', 'line', 'fileExcerpt');
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpKernel/Kernel.php
Expand Up @@ -578,7 +578,7 @@ protected function buildContainer()
{
foreach (array('cache' => $this->getCacheDir(), 'logs' => $this->getLogDir()) as $name => $dir) {
if (!is_dir($dir)) {
if (false === @mkdir($dir, 0777, true)) {
if (false === @mkdir($dir, 0777, true) && !is_dir($dir)) {
throw new \RuntimeException(sprintf("Unable to create the %s directory (%s)\n", $name, $dir));
}
} elseif (!is_writable($dir)) {
Expand Down

0 comments on commit b05fce2

Please sign in to comment.