Laravel version update

Laravel version update
This commit is contained in:
Manish Verma
2018-08-06 18:48:58 +05:30
parent d143048413
commit 126fbb0255
13678 changed files with 1031482 additions and 778530 deletions

View File

@@ -1,10 +1,8 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @see https://github.com/zendframework/zend-http for the canonical source repository
* @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)
* @license https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License
*/
namespace Zend\Http\PhpEnvironment;
@@ -40,7 +38,6 @@ class RemoteAddress
*/
protected $proxyHeader = 'HTTP_X_FORWARDED_FOR';
/**
* Changes proxy handling setting.
*
@@ -118,14 +115,14 @@ class RemoteAddress
*/
protected function getIpAddressFromProxy()
{
if (!$this->useProxy
|| (isset($_SERVER['REMOTE_ADDR']) && !in_array($_SERVER['REMOTE_ADDR'], $this->trustedProxies))
if (! $this->useProxy
|| (isset($_SERVER['REMOTE_ADDR']) && ! in_array($_SERVER['REMOTE_ADDR'], $this->trustedProxies))
) {
return false;
}
$header = $this->proxyHeader;
if (!isset($_SERVER[$header]) || empty($_SERVER[$header])) {
if (! isset($_SERVER[$header]) || empty($_SERVER[$header])) {
return false;
}

View File

@@ -1,10 +1,8 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @see https://github.com/zendframework/zend-http for the canonical source repository
* @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)
* @license https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License
*/
namespace Zend\Http\PhpEnvironment;
@@ -47,14 +45,14 @@ class Request extends HttpRequest
*
* @var ParametersInterface
*/
protected $serverParams = null;
protected $serverParams;
/**
* PHP environment params ($_ENV)
*
* @var ParametersInterface
*/
protected $envParams = null;
protected $envParams;
/**
* Construct
@@ -207,7 +205,7 @@ class Request extends HttpRequest
// This seems to be the only way to get the Authorization header on Apache
if (function_exists('apache_request_headers')) {
$apacheRequestHeaders = apache_request_headers();
if (!isset($this->serverParams['HTTP_AUTHORIZATION'])) {
if (! isset($this->serverParams['HTTP_AUTHORIZATION'])) {
if (isset($apacheRequestHeaders['Authorization'])) {
$this->serverParams->set('HTTP_AUTHORIZATION', $apacheRequestHeaders['Authorization']);
} elseif (isset($apacheRequestHeaders['authorization'])) {
@@ -220,7 +218,7 @@ class Request extends HttpRequest
$headers = [];
foreach ($server as $key => $value) {
if ($value || (!is_array($value) && strlen($value))) {
if ($value || (! is_array($value) && strlen($value))) {
if (strpos($key, 'HTTP_') === 0) {
if (strpos($key, 'HTTP_COOKIE') === 0) {
// Cookies are handled using the $_COOKIE superglobal
@@ -253,8 +251,8 @@ class Request extends HttpRequest
$uri = new HttpUri();
// URI scheme
if ((!empty($this->serverParams['HTTPS']) && strtolower($this->serverParams['HTTPS']) !== 'off')
|| (!empty($this->serverParams['HTTP_X_FORWARDED_PROTO'])
if ((! empty($this->serverParams['HTTPS']) && strtolower($this->serverParams['HTTPS']) !== 'off')
|| (! empty($this->serverParams['HTTP_X_FORWARDED_PROTO'])
&& $this->serverParams['HTTP_X_FORWARDED_PROTO'] == 'https')
) {
$scheme = 'https';
@@ -284,13 +282,13 @@ class Request extends HttpRequest
'useTldCheck' => false,
]);
// If invalid. Reset the host & port
if (!$hostnameValidator->isValid($host)) {
if (! $hostnameValidator->isValid($host)) {
$host = null;
$port = null;
}
}
if (!$host && isset($this->serverParams['SERVER_NAME'])) {
if (! $host && isset($this->serverParams['SERVER_NAME'])) {
$host = $this->serverParams['SERVER_NAME'];
if (isset($this->serverParams['SERVER_PORT'])) {
$port = (int) $this->serverParams['SERVER_PORT'];
@@ -299,7 +297,7 @@ class Request extends HttpRequest
// Reported at least for Safari on Windows
if (isset($this->serverParams['SERVER_ADDR']) && preg_match('/^\[[0-9a-fA-F\:]+\]$/', $host)) {
$host = '[' . $this->serverParams['SERVER_ADDR'] . ']';
if ($port . ']' == substr($host, strrpos($host, ':')+1)) {
if ($port . ']' == substr($host, strrpos($host, ':') + 1)) {
// The last digit of the IPv6-Address has been taken as port
// Unset the port so the default port can be used
$port = null;
@@ -393,7 +391,7 @@ class Request extends HttpRequest
foreach ($_FILES as $fileName => $fileParams) {
$files[$fileName] = [];
foreach ($fileParams as $param => $data) {
if (!is_array($data)) {
if (! is_array($data)) {
$files[$fileName][$param] = $data;
} else {
foreach ($data as $i => $v) {
@@ -414,7 +412,7 @@ class Request extends HttpRequest
*/
protected function mapPhpFileParam(&$array, $paramName, $index, $value)
{
if (!is_array($value)) {
if (! is_array($value)) {
$array[$index][$paramName] = $value;
} else {
foreach ($value as $i => $v) {
@@ -436,18 +434,6 @@ class Request extends HttpRequest
$requestUri = null;
$server = $this->getServer();
// Check this first so IIS will catch.
$httpXRewriteUrl = $server->get('HTTP_X_REWRITE_URL');
if ($httpXRewriteUrl !== null) {
$requestUri = $httpXRewriteUrl;
}
// Check for IIS 7.0 or later with ISAPI_Rewrite
$httpXOriginalUrl = $server->get('HTTP_X_ORIGINAL_URL');
if ($httpXOriginalUrl !== null) {
$requestUri = $httpXOriginalUrl;
}
// IIS7 with URL Rewrite: make sure we get the unencoded url
// (double slash problem).
$iisUrlRewritten = $server->get('IIS_WasUrlRewritten');
@@ -456,12 +442,10 @@ class Request extends HttpRequest
return $unencodedUrl;
}
$requestUri = $server->get('REQUEST_URI');
// HTTP proxy requests setup request URI with scheme and host [and port]
// + the URL path, only use URL path.
if (!$httpXRewriteUrl) {
$requestUri = $server->get('REQUEST_URI');
}
if ($requestUri !== null) {
return preg_replace('#^[^/:]+://[^/]+#', '', $requestUri);
}
@@ -485,7 +469,6 @@ class Request extends HttpRequest
* Uses a variety of criteria in order to detect the base URL of the request
* (i.e., anything additional to the document root).
*
*
* @return string
*/
protected function detectBaseUrl()

View File

@@ -1,10 +1,8 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @see https://github.com/zendframework/zend-http for the canonical source repository
* @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)
* @license https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License
*/
namespace Zend\Http\PhpEnvironment;
@@ -38,7 +36,7 @@ class Response extends HttpResponse
*/
public function getVersion()
{
if (!$this->version) {
if (! $this->version) {
$this->version = $this->detectVersion();
}
return $this->version;