8000 Merge branch '2.6' into 2.7 · saro0h/symfony@df0f2b2 · GitHub
[go: up one dir, main page]

Skip to content

Commit df0f2b2

Browse files
Merge branch '2.6' into 2.7
* 2.6: [FrameworkBundle] fix browserkit requirement [FrameworkBundle] fix expression-language requirement [TwigBridge] fix form requirement [Filesystem] restore ability to create broken symlinks [FrameworkBundle] fix http-foundation requirement [CssSelector] added the license of the Python library we ported to PHP [SecurityBundle] avoid unneeded work
2 parents c1c5cd5 + af0d5f9 commit df0f2b2

File tree

7 files changed

+52
-16
lines changed

7 files changed

+52
-16
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
106106

107107
try {
108108
$filesystem->symlink($relativeOriginDir, $targetDir);
109+
if (!file_exists($targetDir)) {
110+
throw new IOException('Symbolic link is broken');
111+
}
109112
$output->writeln('The assets were installed using symbolic links.');
110113
} catch (IOException $e) {
111114
if (!$input->getOption('relative')) {
@@ -116,6 +119,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
116119
// try again without the relative option
117120
try {
118121
$filesystem->symlink($originDir, $targetDir);
122+
if (!file_exists($targetDir)) {
123+
throw new IOException('Symbolic link is broken');
124+
}
119125
$output->writeln('It looks like your system doesn\'t support relative symbolic links, so the assets were installed by using absolute symbolic links.');
120126
} catch (IOException $e) {
121127
$this->hardCopy($originDir, $targetDir);

src/Symfony/Bundle/FrameworkBundle/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"symfony/dependency-injection" : "~2.6,>=2.6.2",
2121
"symfony/config" : "~2.4",
2222
"symfony/event-dispatcher": "~2.5",
23-
"symfony/http-foundation": "~2.4,>=2.4.9",
23+
"symfony/http-foundation": "~2.4.9|~2.5,>=2.5.4",
2424
"symfony/http-kernel": "~2.6",
2525
"symfony/filesystem": "~2.3",
2626
"symfony/routing": "~2.2",
@@ -41,7 +41,7 @@
4141
"symfony/security": "~2.6",
4242
"symfony/form": "~2.6",
4343
"symfony/class-loader": "~2.1",
44-
"symfony/expression-language": "~2.4",
44+
"symfony/expression-language": "~2.6",
4545
"symfony/process": "~2.0,>=2.0.5",
4646
"symfony/validator": "~2.5",
4747
"symfony/yaml": "~2.0,>=2.0.5"

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -601,17 +601,17 @@ private function createExpression($container, $expression)
601601

602602
private function createRequestMatcher($container, $path = null, $host = null, $methods = array(), $ip = null, array $attributes = array())
603603
{
604+
if ($methods) {
605+
$methods = array_map('strtoupper', (array) $methods);
606+
}
607+
604608
$serialized = serialize(array($path, $host, $methods, $ip, $attributes));
605609
$id = 'security.request_matcher.'.md5($serialized).sha1($serialized);
606610

607611
if (isset($this->requestMatchers[$id])) {
608612
return $this->requestMatchers[$id];
609613
}
610614

611-
if ($methods) {
612-
$methods = array_map('strtoupper', (array) $methods);
613-
}
614-
615615
// only add arguments that are necessary
616616
$arguments = array($path, $host, $methods, $ip, $attributes);
617617
while (count($arguments) > 0 && !end($arguments)) {

src/Symfony/Component/CssSelector/CssSelector.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,39 @@
2727
* This component is a port of the Python cssselector library,
2828
* which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
2929
*
30+
* Copyright (c) 2007-2012 Ian Bicking and contributors. See AUTHORS
31+
* for more details.
32+
*
33+
* All rights reserved.
34+
*
35+
* Redistribution and use in source and binary forms, with or without
36+
* modification, are permitted provided that the following conditions are
37+
* met:
38+
*
39+
* 1. Redistributions of source code must retain the above copyright
40+
* notice, this list of conditions and the following disclaimer.
41+
*
42+
* 2. Redistributions in binary form must reproduce the above copyright
43+
* notice, this list of conditions and the following disclaimer in
44+
* the documentation and/or other materials provided with the
45+
* distribution.
46+
*
47+
* 3. Neither the name of Ian Bicking nor the names of its contributors may
48+
* be used to endorse or promote products derived from this software
49+
* without specific prior written permission.
50+< 8000 div class="diff-text-inner"> *
51+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
52+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
53+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
54+
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IAN BICKING OR
55+
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
56+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
57+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
58+
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
59+
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
60+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
61+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
62+
*
3063
* @author Fabien Potencier <fabien@symfony.com>
3164
*
3265
* @api

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,7 @@ public function rename($origin, $target, $overwrite = false)
286286
*/
287287
public function symlink($originDir, $targetDir, $copyOnWindows = false)
288288
{
289-
$onWindows = strtoupper(substr(php_uname('s'), 0, 3)) === 'WIN';
290-
291-
if ($onWindows && $copyOnWindows) {
289+
if (defined('PHP_WINDOWS_VERSION_MAJOR') && $copyOnWindows) {
292290
$this->mirror($originDir, $targetDir);
293291

294292
return;
@@ -315,10 +313,6 @@ public function symlink($originDir, $targetDir, $copyOnWindows = false)
315313
}
316314
throw new IOException(sprintf('Failed to create symbolic link from "%s" to "%s".', $originDir, $targetDir), 0, null, $targetDir);
317315
}
318-
319-
if (!file_exists($targetDir)) {
320-
throw new IOException(sprintf('Symbolic link "%s" is created but appears to be broken.', $targetDir), 0, null, $targetDir);
321-
}
322316
}
323317
}
324318

src/Symfony/Component/Filesystem/Tests/FilesystemTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,11 +686,14 @@ public function testSymlink()
686686
$file = $this->workspace.DIRECTORY_SEPARATOR.'file';
687687
$link = $this->workspace.DIRECTORY_SEPARATOR.'link';
688688

689-
touch($file);
690-
689+
// $file does not exists right now: creating "broken" links is a wanted feature
691690
$this->filesystem->symlink($file, $link);
692691

693692
$this->assertTrue(is_link($link));
693+
694+
// Create the linked file AFTER creating the link
695+
touch($file);
696+
694697
$this->assertEquals($file, readlink($link));
695698
}
696699

src/Symfony/Component/HttpKernel/composer.json

-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"require": {
1919
"php": ">=5.3.3",
20-
"symfony/event-dispatcher": "2.5.*,>2.5.8|~2.6,>2.6.1",
20+
"symfony/event-dispatcher": "~2.5.9|~2.6,>=2.6.2",
2121
"symfony/http-foundation": "~2.5,>=2.5.4",
2222
"symfony/debug": "~2.6",
2323
"psr/log": "~1.0"

0 commit comments

Comments
 (0)
0