Skip to content

Commit d4802aa

Browse files
Merge branch '2.6' into 2.7
* 2.6: Minor hot fix [PROCESS] make sure /dev/tty is readable [2.3] require-dev PHPUnit bridge [FrameworkBundle] Fixed Shell logo [2.3] Update CONTRIBUTING.md [2.3][Process] Fixed PhpProcess::getCommandLine() result [Console] explicit assertion for ArgvInput::getFirstArgument() with no arguments [PropertyAccess] unify and fix doc Enforce UTF-8 charset for core controllers Fix the toolbar JS for IE Conflicts: .travis.yml src/Symfony/Bridge/Doctrine/composer.json src/Symfony/Bridge/Monolog/composer.json src/Symfony/Bridge/Propel1/composer.json src/Symfony/Bridge/ProxyManager/composer.json src/Symfony/Bridge/Swiftmailer/composer.json src/Symfony/Bridge/Twig/composer.json src/Symfony/Bundle/DebugBundle/composer.json src/Symfony/Bundle/FrameworkBundle/composer.json src/Symfony/Bundle/SecurityBundle/composer.json src/Symfony/Bundle/TwigBundle/composer.json src/Symfony/Bundle/WebProfilerBundle/composer.json src/Symfony/Component/Asset/Exception/ExceptionInterface.php src/Symfony/Component/Asset/Exception/LogicException.php src/Symfony/Component/BrowserKit/composer.json src/Symfony/Component/ClassLoader/composer.json src/Symfony/Component/Console/composer.json src/Symfony/Component/Debug/composer.json src/Symfony/Component/DependencyInjection/composer.json src/Symfony/Component/DomCrawler/composer.json src/Symfony/Component/EventDispatcher/composer.json src/Symfony/Component/Form/composer.json src/Symfony/Component/HttpFoundation/composer.json src/Symfony/Component/HttpKernel/composer.json src/Symfony/Component/Intl/composer.json src/Symfony/Component/Routing/composer.json src/Symfony/Component/Security/Acl/composer.json src/Symfony/Component/Security/Core/composer.json src/Symfony/Component/Security/Csrf/composer.json src/Symfony/Component/Security/Http/composer.json src/Symfony/Component/Security/composer.json src/Symfony/Component/Templating/composer.json src/Symfony/Component/Translation/composer.json src/Symfony/Component/Validator/composer.json
2 parents 500a6b6 + 2f3692a commit d4802aa

File tree

17 files changed

+206
-131
lines changed

17 files changed

+206
-131
lines changed

.travis.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ matrix:
77
- php: 5.5
88
- php: 5.6
99
- php: 5.3
10-
env: components=low
10+
env: deps=low
1111
- php: 5.6
12-
env: components=high
12+
env: deps=high
1313
- php: hhvm-nightly
1414
allow_failures:
1515
- php: hhvm-nightly
@@ -19,8 +19,8 @@ services: mongodb
1919

2020
env:
2121
global:
22-
- components=no
23-
- SYMFONY_DEPRECATIONS_HELPER=strict
22+
- deps=no
23+
- SYMFONY_DEPRECATIONS_HELPER=weak
2424

2525
before_install:
2626
- travis_retry sudo apt-get install parallel
@@ -36,11 +36,11 @@ before_install:
3636
- if [ "$TRAVIS_BRANCH" = "master" ]; then export COMPOSER_ROOT_VERSION=dev-master; else export COMPOSER_ROOT_VERSION="$TRAVIS_BRANCH".x-dev; fi;
3737

3838
install:
39-
- if [ "$components" = "no" ]; then composer --prefer-source install; fi;
39+
- if [ "$deps" = "no" ]; then composer --prefer-source install; fi;
4040

4141
script:
42-
- if [ "$components" = "no" ]; then ls -d src/Symfony/*/* | parallel --gnu --keep-order 'echo -e "\\nRunning {} tests"; phpunit --exclude-group tty,benchmark,intl-data {} || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
43-
- if [ "$components" = "no" ]; then echo -e "\\nRunning tests requiring tty"; phpunit --group tty || (echo -e "\\e[41mKO\\e[0m tty group" && $(exit 1)); fi;
44-
- if [ "$components" != "no" ]; then export SYMFONY_DEPRECATIONS_HELPER=weak; fi;
45-
- if [ "$components" = "high" ]; then find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist | sed 's#\(.*\)/.*#\1#' | parallel --gnu --keep-order -j25% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source update; phpunit --exclude-group tty,benchmark,intl-data,legacy || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
46-
- if [ "$components" = "low" ]; then find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist | sed 's#\(.*\)/.*#\1#' | parallel --gnu --keep-order -j25% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source --prefer-lowest --prefer-stable update; phpunit --exclude-group tty,benchmark,intl-data || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
42+
- if [ "$deps" = "no" ]; then export SYMFONY_DEPRECATIONS_HELPER=strict; fi;
43+
- if [ "$deps" = "no" ]; then ls -d src/Symfony/*/* | parallel --gnu --keep-order 'echo -e "\\nRunning {} tests"; phpunit --exclude-group tty,benchmark,intl-data {} || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
44+
- if [ "$deps" = "no" ]; then echo -e "\\nRunning tests requiring tty"; phpunit --group tty || (echo -e "\\e[41mKO\\e[0m tty group" && $(exit 1)); fi;
45+
- if [ "$deps" = "high" ]; then find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist | sed 's#\(.*\)/.*#\1#' | parallel --gnu --keep-order -j25% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source update; phpunit --exclude-group tty,benchmark,intl-data,legacy || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;
46+
- if [ "$deps" = "low" ]; then find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist | sed 's#\(.*\)/.*#\1#' | parallel --gnu --keep-order -j25% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source --prefer-lowest --prefer-stable update; phpunit --exclude-group tty,benchmark,intl-data || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;

CONTRIBUTING.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Contributing
22
------------
33

4-
Symfony2 is an open source, community-driven project.
4+
Symfony is an open source, community-driven project.
55

66
If you'd like to contribute, please read the following documents:
77

@@ -12,6 +12,19 @@ If you'd like to contribute, please read the following documents:
1212
* [Pull Request Template][3]: Template header to use in your pull request
1313
description;
1414

15+
```markdown
16+
| Q | A
17+
| ------------- | ---
18+
| Bug fix? | yes/no
19+
| New feature? | yes/no
20+
| BC breaks? | no
21+
| Deprecations? | no
22+
| Tests pass? | yes
23+
| Fixed tickets | #1234
24+
| License | MIT
25+
| Doc PR | symfony/symfony-docs#1234
26+
```
27+
1528
* [Backwards Compatibility][4]: Backward compatibility rules.
1629

1730
[1]: http://symfony.com/doc/current/contributing/code/index.html

src/Symfony/Bundle/FrameworkBundle/Console/Shell.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ protected function getHeader()
2929
{
3030
return <<<EOF
3131
<info>
32-
_____ __ ___
33-
/ ____| / _| |__ \
34-
| (___ _ _ _ __ ___ | |_ ___ _ __ _ _ ) |
35-
\___ \| | | | '_ ` _ \| _/ _ \| '_ \| | | | / /
36-
____) | |_| | | | | | | || (_) | | | | |_| |/ /_
37-
|_____/ \__, |_| |_| |_|_| \___/|_| |_|\__, |____|
32+
_____ __
33+
/ ____| / _|
34+
| (___ _ _ _ __ ___ | |_ ___ _ __ _ _
35+
\___ \| | | | '_ ` _ \| _/ _ \| '_ \| | | |
36+
____) | |_| | | | | | | || (_) | | | | |_| |
37+
|_____/ \__, |_| |_| |_|_| \___/|_| |_|\__, |
3838
__/ | __/ |
3939
|___/ |___/
4040

src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function showAction(Request $request, FlattenException $exception, DebugL
6262

6363
$code = $exception->getStatusCode();
6464

65-
return new Response($this->twig->render(
65+
return Response::create($this->twig->render(
6666
$this->findTemplate($request, $request->getRequestFormat(), $code, $showException),
6767
array(
6868
'status_code' => $code,
@@ -71,7 +71,7 @@ public function showAction(Request $request, FlattenException $exception, DebugL
7171
'logger' => $logger,
7272
'currentContent' => $currentContent,
7373
)
74-
));
74+
))->setCharset('UTF-8');
7575
}
7676

7777
/**

src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ public function testOnlyClearOwnOutputBuffers()
4040
$request->headers->set('X-Php-Ob-Level', 1);
4141

4242
$controller = new ExceptionController($twig, false);
43-
$controller->showAction($request, $flatten);
43+
$response = $controller->showAction($request, $flatten);
44+
$this->assertEquals('UTF-8', $response->getCharset(), 'Request charset is explicitly set to UTF-8');
4445
}
4546

4647
public function testShowActionCanBeForcedToShowErrorPage()

src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,17 @@ public function showAction($token)
6262

6363
$code = $exception->getStatusCode();
6464

65-
return new Response($this->twig->render(
66-
$template,
67-
array(
65+
return Response::create(
66+
$this->twig->render($template, array(
6867
'status_code' => $code,
6968
'status_text' => Response::$statusTexts[$code],
7069
'exception' => $exception,
7170
'logger' => null,
7271
'currentContent' => '',
73-
)
74-
), 200, array('Content-Type' => 'text/html'));
72+
)),
73+
200,
74+
array('Content-Type' => 'text/html')
75+
)->setCharset('UTF-8');
7576
}
7677

7778
/**
@@ -97,10 +98,14 @@ public function cssAction($token)
9798
if (!$this->templateExists($template)) {
9899
$handler = new ExceptionHandler();
99100

100-
return new Response($handler->getStylesheet($exception), 200, array('Content-Type' => 'text/css'));
101+
$response = new Response($handler->getStylesheet($exception), 200, array('Content-Type' => 'text/css'));
102+
} else {
103+
$response = new Response($this->twig->render('@WebProfiler/Collector/exception.css.twig'), 200, array('Content-Type' => 'text/css'));
101104
}
102105

103-
return new Response($this->twig->render('@WebProfiler/Collector/exception.css.twig'), 200, array('Content-Type' => 'text/css'));
106+
$response->setCharset('UTF-8');
107+
108+
return $response;
104109
}
105110

106111
protected function getTemplate()

src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php

Lines changed: 63 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,20 @@ public function panelAction(Request $request, $token)
9999
throw new NotFoundHttpException(sprintf('Panel "%s" is not available for token "%s".', $panel, $token));
100100
}
101101

102-
return new Response($this->twig->render($this->getTemplateManager()->getName($profile, $panel), array(
103-
'token' => $token,
104-
'profile' => $profile,
105-
'collector' => $profile->getCollector($panel),
106-
'panel' => $panel,
107-
'page' => $page,
108-
'request' => $request,
109-
'templates' => $this->getTemplateManager()->getTemplates($profile),
110-
'is_ajax' => $request->isXmlHttpRequest(),
111-
)), 200, array('Content-Type' => 'text/html'));
102+
return Response::create(
103+
$this->twig->render($this->getTemplateManager()->getName($profile, $panel), array(
104+
'token' => $token,
105+
'profile' => $profile,
106+
'collector' => $profile->getCollector($panel),
107+
'panel' => $panel,
108+
'page' => $page,
109+
'request' => $request,
110+
'templates' => $this->getTemplateManager()->getTemplates($profile),
111+
'is_ajax' => $request->isXmlHttpRequest(),
112+
)),
113+
200,
114+
array('Content-Type' => 'text/html')
115+
)->setCharset('UTF-8');
112116
}
113117

114118
/**
@@ -147,9 +151,13 @@ public function infoAction($about)
147151

148152
$this->profiler->disable();
149153

150-
return new Response($this->twig->render('@WebProfiler/Profiler/info.html.twig', array(
151-
'about' => $about,
152-
)), 200, array('Content-Type' => 'text/html'));
154+
return Response::create(
155+
$this->twig->render('@WebProfiler/Profiler/info.html.twig', array(
156+
'about' => $about,
157+
)),
158+
200,
159+
array('Content-Type' => 'text/html')
160+
)->setCharset('UTF-8');
153161
}
154162

155163
/**
@@ -197,13 +205,17 @@ public function toolbarAction(Request $request, $token)
197205
// the profiler is not enabled
198206
}
199207

200-
return new Response($this->twig->render('@WebProfiler/Profiler/toolbar.html.twig', array(
201-
'position' => $position,
202-
'profile' => $profile,
203-
'templates' => $this->getTemplateManager()->getTemplates($profile),
204-
'profiler_url' => $url,
205-
'token' => $token,
206-
)), 200, array('Content-Type' => 'text/html'));
208+
return Response::create(
209+
$this->twig->render('@WebProfiler/Profiler/toolbar.html.twig', array(
210+
'position' => $position,
211+
'profile' => $profile,
212+
'templates' => $this->getTemplateManager()->getTemplates($profile),
213+
'profiler_url' => $url,
214+
'token' => $token,
215+
)),
216+
200,
217+
array('Content-Type' => 'text/html')
218+
)->setCharset('UTF-8');
207219
}
208220

209221
/**
@@ -241,16 +253,20 @@ public function searchBarAction(Request $request)
241253
$token = $session->get('_profiler_search_token');
242254
}
243255

244-
return new Response($this->twig->render('@WebProfiler/Profiler/search.html.twig', array(
245-
'token' => $token,
246-
'ip' => $ip,
247-
'method' => $method,
248-
'url' => $url,
249-
'start' => $start,
250-
'end' => $end,
251-
'limit' => $limit,
252-
'request' => $request,
253-
)), 200, array('Content-Type' => 'text/html'));
256+
return Response::create(
257+
$this->twig->render('@WebProfiler/Profiler/search.html.twig', array(
258+
'token' => $token,
259+
'ip' => $ip,
260+
'method' => $method,
261+
'url' => $url,
262+
'start' => $start,
263+
'end' => $end,
264+
'limit' => $limit,
265+
'request' => $request,
266+
)),
267+
200,
268+
array('Content-Type' => 'text/html')
269+
)->setCharset('UTF-8');
254270
}
255271

256272
/**
@@ -280,18 +296,22 @@ public function searchResultsAction(Request $request, $token)
280296
$end = $request->query->get('end', null);
281297
$limit = $request->query->get('limit');
282298

283-
return new Response($this->twig->render('@WebProfiler/Profiler/results.html.twig', array(
284-
'token' => $token,
285-
'profile' => $profile,
286-
'tokens' => $this->profiler->find($ip, $url, $limit, $method, $start, $end),
287-
'ip' => $ip,
288-
'method' => $method,
289-
'url' => $url,
290-
'start' => $start,
291-
'end' => $end,
292-
'limit' => $limit,
293-
'panel' => null,
294-
)), 200, array('Content-Type' => 'text/html'));
299+
return Response::create(
300+
$this->twig->render('@WebProfiler/Profiler/results.html.twig', array(
301+
'token' => $token,
302+
'profile' => $profile,
303+
'tokens' => $this->profiler->find($ip, $url, $limit, $method, $start, $end),
304+
'ip' => $ip,
305+
'method' => $method,
306+
'url' => $url,
307+
'start' => $start,
308+
'end' => $end,
309+
'limit' => $limit,
310+
'panel' => null,
311+
)),
312+
200,
313+
array('Content-Type' => 'text/html')
314+
)->setCharset('UTF-8');
295315
}
296316

297317
/**
@@ -365,7 +385,7 @@ public function phpinfoAction()
365385
phpinfo();
366386
$phpinfo = ob_get_clean();
367387

368-
return new Response($phpinfo, 200, array('Content-Type' => 'text/html'));
388+
return Response::create($phpinfo, 200, array('Content-Type' => 'text/html'))->setCharset('UTF-8');
369389
}
370390

371391
/**

src/Symfony/Bundle/WebProfilerBundle/Controller/RouterController.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,14 @@ public function panelAction($token)
6868

6969
$request = $profile->getCollector('request');
7070

71-
return new Response($this->twig->render('@WebProfiler/Router/panel.html.twig', array(
72-
'request' => $request,
73-
'router' => $profile->getCollector('router'),
74-
'traces' => $matcher->getTraces($request->getPathInfo()),
75-
)), 200, array('Content-Type' => 'text/html'));
71+
return Response::create(
72+
$this->twig->render('@WebProfiler/Router/panel.html.twig', array(
73+
'request' => $request,
74+
'router' => $profile->getCollector('router'),
75+
'traces' => $matcher->getTraces($request->getPathInfo()),
76+
)),
77+
200,
78+
array('Content-Type' => 'text/html')
79+
)->setCharset('UTF-8');
7680
}
7781
}

0 commit comments

Comments
 (0)