Merge branch '2.7' into 2.8
* 2.7: Fixed the wrong source name and the ja translation [Debug] fix readme: DebugClassLoader moved to debug itself [SecurityBundle] disable the init:acl command if ACL is not used [DI] remove useless condition around unset [Form] Disabled view data validation if "data_class" is set to null [HttpFoundation] Workaround HHVM rewriting HTTP response line
This commit is contained in:
commit
5de9c354dd
@ -23,6 +23,18 @@ use Doctrine\DBAL\Schema\SchemaException;
|
|||||||
*/
|
*/
|
||||||
class InitAclCommand extends ContainerAwareCommand
|
class InitAclCommand extends ContainerAwareCommand
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function isEnabled()
|
||||||
|
{
|
||||||
|
if (!$this->getContainer()->has('security.acl.dbal.connection')) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent::isEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
@ -15,6 +15,7 @@ Debug::enable();
|
|||||||
You can also use the tools individually:
|
You can also use the tools individually:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
|
use Symfony\Component\Debug\DebugClassLoader;
|
||||||
use Symfony\Component\Debug\ErrorHandler;
|
use Symfony\Component\Debug\ErrorHandler;
|
||||||
use Symfony\Component\Debug\ExceptionHandler;
|
use Symfony\Component\Debug\ExceptionHandler;
|
||||||
|
|
||||||
@ -25,11 +26,9 @@ if ('cli' !== php_sapi_name()) {
|
|||||||
ini_set('display_errors', 1);
|
ini_set('display_errors', 1);
|
||||||
}
|
}
|
||||||
ErrorHandler::register();
|
ErrorHandler::register();
|
||||||
|
DebugClassLoader::enable();
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that the `Debug::enable()` call also registers the debug class loader
|
|
||||||
from the Symfony ClassLoader component when available.
|
|
||||||
|
|
||||||
This component can optionally take advantage of the features of the HttpKernel
|
This component can optionally take advantage of the features of the HttpKernel
|
||||||
and HttpFoundation components.
|
and HttpFoundation components.
|
||||||
|
|
||||||
|
@ -312,10 +312,7 @@ class Container implements IntrospectableContainerInterface, ResettableContainer
|
|||||||
$service = $this->$method();
|
$service = $this->$method();
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
unset($this->loading[$id]);
|
unset($this->loading[$id]);
|
||||||
|
unset($this->services[$id]);
|
||||||
if (array_key_exists($id, $this->services)) {
|
|
||||||
unset($this->services[$id]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($e instanceof InactiveScopeException && self::EXCEPTION_ON_INVALID_REFERENCE !== $invalidBehavior) {
|
if ($e instanceof InactiveScopeException && self::EXCEPTION_ON_INVALID_REFERENCE !== $invalidBehavior) {
|
||||||
return;
|
return;
|
||||||
|
@ -501,9 +501,7 @@ class Definition
|
|||||||
*/
|
*/
|
||||||
public function clearTag($name)
|
public function clearTag($name)
|
||||||
{
|
{
|
||||||
if (isset($this->tags[$name])) {
|
unset($this->tags[$name]);
|
||||||
unset($this->tags[$name]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -356,21 +356,11 @@ class Form implements \IteratorAggregate, FormInterface
|
|||||||
if (!FormUtil::isEmpty($viewData)) {
|
if (!FormUtil::isEmpty($viewData)) {
|
||||||
$dataClass = $this->config->getDataClass();
|
$dataClass = $this->config->getDataClass();
|
||||||
|
|
||||||
$actualType = is_object($viewData) ? 'an instance of class '.get_class($viewData) : 'a(n) '.gettype($viewData);
|
|
||||||
|
|
||||||
if (null === $dataClass && is_object($viewData) && !$viewData instanceof \ArrayAccess) {
|
|
||||||
$expectedType = 'scalar, array or an instance of \ArrayAccess';
|
|
||||||
|
|
||||||
throw new LogicException(
|
|
||||||
'The form\'s view data is expected to be of type '.$expectedType.', '.
|
|
||||||
'but is '.$actualType.'. You '.
|
|
||||||
'can avoid this error by setting the "data_class" option to '.
|
|
||||||
'"'.get_class($viewData).'" or by adding a view transformer '.
|
|
||||||
'that transforms '.$actualType.' to '.$expectedType.'.'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (null !== $dataClass && !$viewData instanceof $dataClass) {
|
if (null !== $dataClass && !$viewData instanceof $dataClass) {
|
||||||
|
$actualType = is_object($viewData)
|
||||||
|
? 'an instance of class '.get_class($viewData)
|
||||||
|
: 'a(n) '.gettype($viewData);
|
||||||
|
|
||||||
throw new LogicException(
|
throw new LogicException(
|
||||||
'The form\'s view data is expected to be an instance of class '.
|
'The form\'s view data is expected to be an instance of class '.
|
||||||
$dataClass.', but is '.$actualType.'. You can avoid this error '.
|
$dataClass.', but is '.$actualType.'. You can avoid this error '.
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
<target>アップロードされたファイルが大きすぎます。小さなファイルで再度アップロードしてください。</target>
|
<target>アップロードされたファイルが大きすぎます。小さなファイルで再度アップロードしてください。</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="30">
|
<trans-unit id="30">
|
||||||
<source>The CSRF token is invalid.</source>
|
<source>The CSRF token is invalid. Please try to resubmit the form.</source>
|
||||||
<target>CSRFトークンが無効です。</target>
|
<target>CSRFトークンが無効です、再送信してください。</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
|
@ -840,19 +840,19 @@ class SimpleFormTest extends AbstractFormTest
|
|||||||
$this->assertEquals(new PropertyPath('[name]'), $form->getPropertyPath());
|
$this->assertEquals(new PropertyPath('[name]'), $form->getPropertyPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function testViewDataMayBeObjectIfDataClassIsNull()
|
||||||
* @expectedException \Symfony\Component\Form\Exception\LogicException
|
|
||||||
*/
|
|
||||||
public function testViewDataMustNotBeObjectIfDataClassIsNull()
|
|
||||||
{
|
{
|
||||||
|
$object = new \stdClass();
|
||||||
$config = new FormConfigBuilder('name', null, $this->dispatcher);
|
$config = new FormConfigBuilder('name', null, $this->dispatcher);
|
||||||
$config->addViewTransformer(new FixedDataTransformer(array(
|
$config->addViewTransformer(new FixedDataTransformer(array(
|
||||||
'' => '',
|
'' => '',
|
||||||
'foo' => new \stdClass(),
|
'foo' => $object,
|
||||||
)));
|
)));
|
||||||
$form = new Form($config);
|
$form = new Form($config);
|
||||||
|
|
||||||
$form->setData('foo');
|
$form->setData('foo');
|
||||||
|
|
||||||
|
$this->assertSame($object, $form->getViewData());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testViewDataMayBeArrayAccessIfDataClassIsNull()
|
public function testViewDataMayBeArrayAccessIfDataClassIsNull()
|
||||||
|
@ -329,9 +329,6 @@ class Response
|
|||||||
$this->setDate(\DateTime::createFromFormat('U', time()));
|
$this->setDate(\DateTime::createFromFormat('U', time()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// status
|
|
||||||
header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode);
|
|
||||||
|
|
||||||
// headers
|
// headers
|
||||||
foreach ($this->headers->allPreserveCase() as $name => $values) {
|
foreach ($this->headers->allPreserveCase() as $name => $values) {
|
||||||
foreach ($values as $value) {
|
foreach ($values as $value) {
|
||||||
@ -339,6 +336,9 @@ class Response
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// status
|
||||||
|
header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode);
|
||||||
|
|
||||||
// cookies
|
// cookies
|
||||||
foreach ($this->headers->getCookies() as $cookie) {
|
foreach ($this->headers->getCookies() as $cookie) {
|
||||||
setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly());
|
setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly());
|
||||||
|
Reference in New Issue
Block a user