Update core 8.3.0

This commit is contained in:
Rob Davies 2017-04-13 15:53:35 +01:00
parent da7a7918f8
commit cd7a898e66
6144 changed files with 132297 additions and 87747 deletions

View file

@ -2,6 +2,10 @@ language: php
sudo: false
cache:
directories:
- $HOME/.composer/cache/files
matrix:
include:
- php: 5.3
@ -12,10 +16,9 @@ matrix:
env: deps=low
- php: 5.6
env: deps=high
- php: nightly
- php: 7.0
- php: hhvm
allow_failures:
- php: nightly
- php: hhvm
fast_finish: true
@ -25,15 +28,15 @@ env:
- SYMFONY_DEPRECATIONS_HELPER=weak
before_install:
- composer self-update
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then phpenv config-rm xdebug.ini; fi;
- composer self-update
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] && [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then php -i; fi;
# Set the COMPOSER_ROOT_VERSION to the right version according to the branch being built
- if [ "$TRAVIS_BRANCH" = "master" ]; then export COMPOSER_ROOT_VERSION=dev-master; else export COMPOSER_ROOT_VERSION="$TRAVIS_BRANCH".x-dev; fi;
install:
- if [[ "$TRAVIS_PHP_VERSION" != "5.3" ]] && [[ "$TRAVIS_PHP_VERSION" != "5.4" ]]; then composer require --no-update zendframework/zend-diactoros; fi;
- if [ "$TRAVIS_PHP_VERSION" != "5.3" ]; then composer require --no-update zendframework/zend-diactoros; fi;
- if [ "$deps" = "no" ]; then export SYMFONY_DEPRECATIONS_HELPER=strict; fi;
- if [ "$deps" = "no" ]; then composer --prefer-source install; fi;
- if [ "$deps" = "high" ]; then composer --prefer-source update; fi;

View file

@ -0,0 +1,3 @@
* 1.0.0 (2016-09-14)
* Initial release

View file

@ -1,7 +0,0 @@
CHANGELOG
=========
2.8.0
-----
* added the component

View file

@ -45,11 +45,11 @@ class DiactorosFactory implements HttpMessageFactoryInterface
$server = DiactorosRequestFactory::normalizeServer($symfonyRequest->server->all());
$headers = $symfonyRequest->headers->all();
try {
$body = new DiactorosStream($symfonyRequest->getContent(true));
} catch (\LogicException $e) {
if (PHP_VERSION_ID < 50600) {
$body = new DiactorosStream('php://temp', 'wb+');
$body->write($symfonyRequest->getContent());
} else {
$body = new DiactorosStream($symfonyRequest->getContent(true));
}
$request = new ServerRequest(
@ -86,6 +86,10 @@ class DiactorosFactory implements HttpMessageFactoryInterface
$files = array();
foreach ($uploadedFiles as $key => $value) {
if (null === $value) {
$files[$key] = new DiactorosUploadedFile(null, 0, UPLOAD_ERR_NO_FILE, null, null);
continue;
}
if ($value instanceof UploadedFile) {
$files[$key] = $this->createUploadedFile($value);
} else {
@ -107,7 +111,7 @@ class DiactorosFactory implements HttpMessageFactoryInterface
{
return new DiactorosUploadedFile(
$symfonyUploadedFile->getRealPath(),
$symfonyUploadedFile->getSize(),
$symfonyUploadedFile->getClientSize(),
$symfonyUploadedFile->getError(),
$symfonyUploadedFile->getClientOriginalName(),
$symfonyUploadedFile->getClientMimeType()

View file

@ -14,6 +14,7 @@ namespace Symfony\Bridge\PsrHttpMessage\Factory;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\UploadedFileInterface;
use Psr\Http\Message\UriInterface;
use Symfony\Bridge\PsrHttpMessage\HttpFoundationFactoryInterface;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\HttpFoundation\File\UploadedFile;
@ -32,6 +33,20 @@ class HttpFoundationFactory implements HttpFoundationFactoryInterface
*/
public function createRequest(ServerRequestInterface $psrRequest)
{
$server = array();
$uri = $psrRequest->getUri();
if ($uri instanceof UriInterface) {
$server['SERVER_NAME'] = $uri->getHost();
$server['SERVER_PORT'] = $uri->getPort();
$server['REQUEST_URI'] = $uri->getPath();
$server['QUERY_STRING'] = $uri->getQuery();
}
$server['REQUEST_METHOD'] = $psrRequest->getMethod();
$server = array_replace($server, $psrRequest->getServerParams());
$parsedBody = $psrRequest->getParsedBody();
$parsedBody = is_array($parsedBody) ? $parsedBody : array();
@ -41,7 +56,7 @@ class HttpFoundationFactory implements HttpFoundationFactoryInterface
$psrRequest->getAttributes(),
$psrRequest->getCookieParams(),
$this->getFiles($psrRequest->getUploadedFiles()),
$psrRequest->getServerParams(),
$server,
$psrRequest->getBody()->__toString()
);
$request->headers->replace($psrRequest->getHeaders());
@ -80,10 +95,14 @@ class HttpFoundationFactory implements HttpFoundationFactoryInterface
*/
private function createUploadedFile(UploadedFileInterface $psrUploadedFile)
{
$temporaryPath = $this->getTemporaryPath();
$psrUploadedFile->moveTo($temporaryPath);
$temporaryPath = '';
$clientFileName = '';
if (UPLOAD_ERR_NO_FILE !== $psrUploadedFile->getError()) {
$temporaryPath = $this->getTemporaryPath();
$psrUploadedFile->moveTo($temporaryPath);
$clientFileName = $psrUploadedFile->getClientFilename();
$clientFileName = $psrUploadedFile->getClientFilename();
}
return new UploadedFile(
$temporaryPath,

View file

@ -1,4 +1,4 @@
Copyright (c) 2004-2015 Fabien Potencier
Copyright (c) 2004-2016 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View file

@ -24,10 +24,16 @@
"symfony/phpunit-bridge": "~2.7|~3.0"
},
"suggest": {
"psr/http-message-implementation": "To use the HttpFoundation factory",
"zendframework/zend-diactoros": "To use the Zend Diactoros factory"
},
"autoload": {
"psr-4": { "Symfony\\Bridge\\PsrHttpMessage\\": "" }
},
"minimum-stability": "dev"
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
}
}