8000 Merge branch '2.1' · dirkaholic/symfony@0bfa86c · GitHub
[go: up one dir, main page]

Skip to content

Commit 0bfa86c

Browse files
committed
Merge branch '2.1'
* 2.1: [2.1] Fix SessionHandlerInterface autoloading Remove executable bit from HttpKernel/DependencyInjection/ConfigurableExtension.php [2.0][http-foundation] Fix Response::getDate method [DoctrineBridge] Require class option for DoctrineType [HttpFoundation] fixed the path to the SensioHandlerInterface class in composer.json Support the new Microsoft URL Rewrite Module for IIS 7.0. @see http://framework.zend.com/issues/browse/ZF-4491 @see http://framework.zend.com/code/revision.php?repname=Zend+Framework&rev=24842 fixed undefined variable hasColorSupport does not take an argument Improve FilterResponseEvent docblocks Response ref
2 parents 7a661d5 + 49ca648 commit 0bfa86c

File tree

10 files changed

+28
-10
lines changed

10 files changed

+28
-10
lines changed

src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
135135

136136
$resolver->setDefaults(array(
137137
'em' => null,
138-
'class' => null,
139138
'property' => null,
140139
'query_builder' => null,
141140
'loader' => $loader,
@@ -144,6 +143,8 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
144143
'group_by' => null,
145144
));
146145

146+
$resolver->setRequired(array('class'));
147+
147148
$resolver->setNormalizers(array(
148149
'em' => $emNormalizer,
149150
));

src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ protected function persist(array $entities)
110110
// be managed!
111111
}
112112

113+
/**
114+
* @expectedException Symfony\Component\OptionsResolver\Exception\MissingOptionsException
115+
*/
116+
public function testClassOptionIsRequired()
117+
{
118+
$this->factory->createNamed('name', 'entity');
119+
}
120+
113121
public function testSetDataToUninitializedEntityWithNonRequired()
114122
{
115123
$entity1 = new SingleIdentEntity(1, 'Foo');

src/Symfony/Component/Console/Output/StreamOutput.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function __construct($stream, $verbosity = self::VERBOSITY_NORMAL, $decor
5454
$this->stream = $stream;
5555

5656
if (null === $decorated) {
57-
$decorated = $this->hasColorSupport($decorated);
57+
$decorated = $this->hasColorSupport();
5858
}
5959

6060
parent::__construct($verbosity, $decorated, $formatter);

src/Symfony/Component/HttpFoundation/HeaderBag.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,9 @@ public function remove($key)
223223
* @param string $key The parameter key
224224
* @param \DateTime $default The default value
225225
*
226-
* @return \DateTime The filtered value
226+
* @return null|\DateTime The filtered value
227+
*
228+
* @throws \RuntimeException When the HTTP header is not parseable
227229
*
228230
* @api
229231
*/

src/Symfony/Component/HttpFoundation/Request.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,8 +1309,11 @@ protected function prepareRequestUri()
13091309
{
13101310
$requestUri = '';
13111311

1312-
if ($this->headers->has('X_REWRITE_URL') && false !== stripos(PHP_OS, 'WIN')) {
1313-
// check this first so IIS will catch
1312+
if ($this->headers->has('X_ORIGINAL_URL') && false !== stripos(PHP_OS, 'WIN')) {
1313+
// IIS with Microsoft Rewrite Module
1314+
$requestUri = $this->headers->get('X_ORIGINAL_URL');
1315+
} elseif ($this->headers->has('X_REWRITE_URL') && false !== stripos(PHP_OS, 'WIN')) {
1316+
// IIS with ISAPI_Rewrite
13141317
$requestUri = $this->headers->get('X_REWRITE_URL');
13151318
} elseif ($this->server->get('IIS_WasUrlRewritten') == '1' && $this->server->get('UNENCODED_URL') != '') {
13161319
// IIS7 with URL Rewrite: make sure we get the unencoded url (double slash problem)

src/Symfony/Component/HttpFoundation/Response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ public function mustRevalidate()
574574
*/
575575
public function getDate()
576576
{
577-
return $this->headers->getDate('Date');
577+
return $this->headers->getDate('Date', new \DateTime());
578578
}
579579

580580
/**

src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ public function testGetDate()
143143
$now = $this->createDateTimeNow();
144144
$response->headers->set('Date', $now->format(DATE_RFC2822));
145145
$this->assertEquals(0, $now->diff($response->getDate())->format('%s'), '->getDate() returns the date when the header has been modified');
146+
147+
$response = new Response('', 200);
148+
$response->headers->remove('Date');
149+
$this->assertInstanceOf('\DateTime', $response->getDate());
146150
}
147151

148152
public function testGetMaxAge()

src/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php

100755100644
File mode changed.

src/Symfony/Component/HttpKernel/Event/FilterResponseEvent.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class FilterResponseEvent extends KernelEvent
3030
{
3131
/**
3232
* The current response object
33-
* @var Symfony\Component\HttpFoundation\Response
33+
* @var Response
3434
*/
3535
private $response;
3636

@@ -44,7 +44,7 @@ public function __construct(HttpKernelInterface $kernel, Request $request, $requ
4444
/**
4545
* Returns the current response object
4646
*
47-
* @return Symfony\Component\HttpFoundation\Response
47+
* @return Response
4848
*
4949
* @api
5050
*/
@@ -56,7 +56,7 @@ public function getResponse()
5656
/**
5757
* Sets a new response object
5858
*
59-
* @param Symfony\Component\HttpFoundation\Response $response
59+
* @param Response $response
6060
*
6161
* @api
6262
*/

src/Symfony/Component/Security/Http/Firewall/ContextListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function handle(GetResponseEvent $event)
8888
$token = $this->refreshUser($token);
8989
} elseif (null !== $token) {
9090
if (null !== $this->logger) {
91-
$this->logger->warn(sprintf('Session includes a "%s" where a security token is expected', is_object($value) ? get_class($value) : gettype($value)));
91+
$this->logger->warn(sprintf('Session includes a "%s" where a security token is expected', is_object($token) ? get_class($token) : gettype($token)));
9292
}
9393

9494
$token = null;

0 commit comments

Comments
 (0)
0