Added php-opencloud/openstack as SubModule
This commit is contained in:
parent
eac860ce50
commit
81d5c2a646
15 changed files with 282 additions and 178 deletions
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
[submodule "server/vendor/php-opencloud/openstack"]
|
||||||
|
path = server/vendor/php-opencloud/openstack
|
||||||
|
url = https://github.com/php-opencloud/openstack.git
|
24
server/composer.lock
generated
24
server/composer.lock
generated
|
@ -122,16 +122,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "guzzlehttp/psr7",
|
"name": "guzzlehttp/psr7",
|
||||||
"version": "1.2.1",
|
"version": "1.2.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/guzzle/psr7.git",
|
"url": "https://github.com/guzzle/psr7.git",
|
||||||
"reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982"
|
"reference": "f5d04bdd2881ac89abde1fb78cc234bce24327bb"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/4d0bdbe1206df7440219ce14c972aa57cc5e4982",
|
"url": "https://api.github.com/repos/guzzle/psr7/zipball/f5d04bdd2881ac89abde1fb78cc234bce24327bb",
|
||||||
"reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982",
|
"reference": "f5d04bdd2881ac89abde1fb78cc234bce24327bb",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -176,24 +176,24 @@
|
||||||
"stream",
|
"stream",
|
||||||
"uri"
|
"uri"
|
||||||
],
|
],
|
||||||
"time": "2015-11-03 01:34:55"
|
"time": "2016-01-23 01:23:02"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "justinrainbow/json-schema",
|
"name": "justinrainbow/json-schema",
|
||||||
"version": "v1.6.0",
|
"version": "1.6.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/justinrainbow/json-schema.git",
|
"url": "https://github.com/justinrainbow/json-schema.git",
|
||||||
"reference": "f9e27c3e202faf14fd581ef41355d83bb4b7eb7d"
|
"reference": "cc84765fb7317f6b07bd8ac78364747f95b86341"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/f9e27c3e202faf14fd581ef41355d83bb4b7eb7d",
|
"url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/cc84765fb7317f6b07bd8ac78364747f95b86341",
|
||||||
"reference": "f9e27c3e202faf14fd581ef41355d83bb4b7eb7d",
|
"reference": "cc84765fb7317f6b07bd8ac78364747f95b86341",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3.2"
|
"php": ">=5.3.29"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"json-schema/json-schema-test-suite": "1.1.0",
|
"json-schema/json-schema-test-suite": "1.1.0",
|
||||||
|
@ -206,7 +206,7 @@
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "1.4.x-dev"
|
"dev-master": "1.6.x-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
@ -242,7 +242,7 @@
|
||||||
"json",
|
"json",
|
||||||
"schema"
|
"schema"
|
||||||
],
|
],
|
||||||
"time": "2016-01-06 14:37:04"
|
"time": "2016-01-25 15:43:01"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "php-opencloud/openstack",
|
"name": "php-opencloud/openstack",
|
||||||
|
|
256
server/vendor/composer/installed.json
vendored
256
server/vendor/composer/installed.json
vendored
|
@ -167,134 +167,6 @@
|
||||||
"web service"
|
"web service"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "guzzlehttp/psr7",
|
|
||||||
"version": "1.2.1",
|
|
||||||
"version_normalized": "1.2.1.0",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/guzzle/psr7.git",
|
|
||||||
"reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/4d0bdbe1206df7440219ce14c972aa57cc5e4982",
|
|
||||||
"reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.4.0",
|
|
||||||
"psr/http-message": "~1.0"
|
|
||||||
},
|
|
||||||
"provide": {
|
|
||||||
"psr/http-message-implementation": "1.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "~4.0"
|
|
||||||
},
|
|
||||||
"time": "2015-11-03 01:34:55",
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "1.0-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"installation-source": "dist",
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"GuzzleHttp\\Psr7\\": "src/"
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"src/functions_include.php"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Michael Dowling",
|
|
||||||
"email": "mtdowling@gmail.com",
|
|
||||||
"homepage": "https://github.com/mtdowling"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "PSR-7 message implementation",
|
|
||||||
"keywords": [
|
|
||||||
"http",
|
|
||||||
"message",
|
|
||||||
"stream",
|
|
||||||
"uri"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "justinrainbow/json-schema",
|
|
||||||
"version": "v1.6.0",
|
|
||||||
"version_normalized": "1.6.0.0",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/justinrainbow/json-schema.git",
|
|
||||||
"reference": "f9e27c3e202faf14fd581ef41355d83bb4b7eb7d"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/f9e27c3e202faf14fd581ef41355d83bb4b7eb7d",
|
|
||||||
"reference": "f9e27c3e202faf14fd581ef41355d83bb4b7eb7d",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.3.2"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"json-schema/json-schema-test-suite": "1.1.0",
|
|
||||||
"phpdocumentor/phpdocumentor": "~2",
|
|
||||||
"phpunit/phpunit": "~3.7"
|
|
||||||
},
|
|
||||||
"time": "2016-01-06 14:37:04",
|
|
||||||
"bin": [
|
|
||||||
"bin/validate-json"
|
|
||||||
],
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "1.4.x-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"installation-source": "dist",
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"JsonSchema\\": "src/JsonSchema/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"BSD-3-Clause"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Bruno Prieto Reis",
|
|
||||||
"email": "bruno.p.reis@gmail.com"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Justin Rainbow",
|
|
||||||
"email": "justin.rainbow@gmail.com"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Igor Wiedler",
|
|
||||||
"email": "igor@wiedler.ch"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Robert Schönthal",
|
|
||||||
"email": "seroscho@googlemail.com"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "A library to validate a json schema.",
|
|
||||||
"homepage": "https://github.com/justinrainbow/json-schema",
|
|
||||||
"keywords": [
|
|
||||||
"json",
|
|
||||||
"schema"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "php-opencloud/openstack",
|
"name": "php-opencloud/openstack",
|
||||||
"version": "dev-master",
|
"version": "dev-master",
|
||||||
|
@ -342,5 +214,133 @@
|
||||||
"homepage": "https://github.com/jamiehannaford"
|
"homepage": "https://github.com/jamiehannaford"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "justinrainbow/json-schema",
|
||||||
|
"version": "1.6.1",
|
||||||
|
"version_normalized": "1.6.1.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/justinrainbow/json-schema.git",
|
||||||
|
"reference": "cc84765fb7317f6b07bd8ac78364747f95b86341"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/cc84765fb7317f6b07bd8ac78364747f95b86341",
|
||||||
|
"reference": "cc84765fb7317f6b07bd8ac78364747f95b86341",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.29"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"json-schema/json-schema-test-suite": "1.1.0",
|
||||||
|
"phpdocumentor/phpdocumentor": "~2",
|
||||||
|
"phpunit/phpunit": "~3.7"
|
||||||
|
},
|
||||||
|
"time": "2016-01-25 15:43:01",
|
||||||
|
"bin": [
|
||||||
|
"bin/validate-json"
|
||||||
|
],
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "1.6.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"installation-source": "dist",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"JsonSchema\\": "src/JsonSchema/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"BSD-3-Clause"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Bruno Prieto Reis",
|
||||||
|
"email": "bruno.p.reis@gmail.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Justin Rainbow",
|
||||||
|
"email": "justin.rainbow@gmail.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Igor Wiedler",
|
||||||
|
"email": "igor@wiedler.ch"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Robert Schönthal",
|
||||||
|
"email": "seroscho@googlemail.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "A library to validate a json schema.",
|
||||||
|
"homepage": "https://github.com/justinrainbow/json-schema",
|
||||||
|
"keywords": [
|
||||||
|
"json",
|
||||||
|
"schema"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "guzzlehttp/psr7",
|
||||||
|
"version": "1.2.2",
|
||||||
|
"version_normalized": "1.2.2.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/guzzle/psr7.git",
|
||||||
|
"reference": "f5d04bdd2881ac89abde1fb78cc234bce24327bb"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/guzzle/psr7/zipball/f5d04bdd2881ac89abde1fb78cc234bce24327bb",
|
||||||
|
"reference": "f5d04bdd2881ac89abde1fb78cc234bce24327bb",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.4.0",
|
||||||
|
"psr/http-message": "~1.0"
|
||||||
|
},
|
||||||
|
"provide": {
|
||||||
|
"psr/http-message-implementation": "1.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "~4.0"
|
||||||
|
},
|
||||||
|
"time": "2016-01-23 01:23:02",
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "1.0-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"installation-source": "dist",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"GuzzleHttp\\Psr7\\": "src/"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"src/functions_include.php"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Michael Dowling",
|
||||||
|
"email": "mtdowling@gmail.com",
|
||||||
|
"homepage": "https://github.com/mtdowling"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "PSR-7 message implementation",
|
||||||
|
"keywords": [
|
||||||
|
"http",
|
||||||
|
"message",
|
||||||
|
"stream",
|
||||||
|
"uri"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
7
server/vendor/guzzlehttp/psr7/CHANGELOG.md
vendored
7
server/vendor/guzzlehttp/psr7/CHANGELOG.md
vendored
|
@ -1,5 +1,12 @@
|
||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
|
## 1.2.2 - 2016-01-22
|
||||||
|
|
||||||
|
* Added support for URIs without any authority.
|
||||||
|
* Added support for HTTP 451 'Unavailable For Legal Reasons.'
|
||||||
|
* Added support for using '0' as a filename.
|
||||||
|
* Added support for including non-standard ports in Host headers.
|
||||||
|
|
||||||
## 1.2.1 - 2015-11-02
|
## 1.2.1 - 2015-11-02
|
||||||
|
|
||||||
* Now supporting negative offsets when seeking to SEEK_END.
|
* Now supporting negative offsets when seeking to SEEK_END.
|
||||||
|
|
16
server/vendor/guzzlehttp/psr7/Makefile
vendored
16
server/vendor/guzzlehttp/psr7/Makefile
vendored
|
@ -9,5 +9,21 @@ coverage:
|
||||||
view-coverage:
|
view-coverage:
|
||||||
open artifacts/coverage/index.html
|
open artifacts/coverage/index.html
|
||||||
|
|
||||||
|
check-tag:
|
||||||
|
$(if $(TAG),,$(error TAG is not defined. Pass via "make tag TAG=4.2.1"))
|
||||||
|
|
||||||
|
tag: check-tag
|
||||||
|
@echo Tagging $(TAG)
|
||||||
|
chag update $(TAG)
|
||||||
|
git commit -a -m '$(TAG) release'
|
||||||
|
chag tag
|
||||||
|
@echo "Release has been created. Push using 'make release'"
|
||||||
|
@echo "Changes made in the release commit"
|
||||||
|
git diff HEAD~1 HEAD
|
||||||
|
|
||||||
|
release: check-tag
|
||||||
|
git push origin master
|
||||||
|
git push origin $(TAG)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf artifacts/*
|
rm -rf artifacts/*
|
||||||
|
|
5
server/vendor/guzzlehttp/psr7/README.md
vendored
5
server/vendor/guzzlehttp/psr7/README.md
vendored
|
@ -6,6 +6,9 @@ functionality like query string parsing. Currently missing
|
||||||
ServerRequestInterface and UploadedFileInterface; a pull request for these features is welcome.
|
ServerRequestInterface and UploadedFileInterface; a pull request for these features is welcome.
|
||||||
|
|
||||||
|
|
||||||
|
[](https://travis-ci.org/guzzle/psr7)
|
||||||
|
|
||||||
|
|
||||||
# Stream implementation
|
# Stream implementation
|
||||||
|
|
||||||
This package comes with a number of stream implementations and stream
|
This package comes with a number of stream implementations and stream
|
||||||
|
@ -25,7 +28,7 @@ $a = Psr7\stream_for('abc, ');
|
||||||
$b = Psr7\stream_for('123.');
|
$b = Psr7\stream_for('123.');
|
||||||
$composed = new Psr7\AppendStream([$a, $b]);
|
$composed = new Psr7\AppendStream([$a, $b]);
|
||||||
|
|
||||||
$composed->addStream(Psr7\stream_for(' Above all listen to me').
|
$composed->addStream(Psr7\stream_for(' Above all listen to me'));
|
||||||
|
|
||||||
echo $composed(); // abc, 123. Above all listen to me.
|
echo $composed(); // abc, 123. Above all listen to me.
|
||||||
```
|
```
|
||||||
|
|
|
@ -113,7 +113,7 @@ class MultipartStream implements StreamInterface
|
||||||
// Set a default content-disposition header if one was no provided
|
// Set a default content-disposition header if one was no provided
|
||||||
$disposition = $this->getHeader($headers, 'content-disposition');
|
$disposition = $this->getHeader($headers, 'content-disposition');
|
||||||
if (!$disposition) {
|
if (!$disposition) {
|
||||||
$headers['Content-Disposition'] = $filename
|
$headers['Content-Disposition'] = ($filename === '0' || $filename)
|
||||||
? sprintf('form-data; name="%s"; filename="%s"',
|
? sprintf('form-data; name="%s"; filename="%s"',
|
||||||
$name,
|
$name,
|
||||||
basename($filename))
|
basename($filename))
|
||||||
|
@ -130,7 +130,7 @@ class MultipartStream implements StreamInterface
|
||||||
|
|
||||||
// Set a default Content-Type if one was not supplied
|
// Set a default Content-Type if one was not supplied
|
||||||
$type = $this->getHeader($headers, 'content-type');
|
$type = $this->getHeader($headers, 'content-type');
|
||||||
if (!$type && $filename) {
|
if (!$type && ($filename === '0' || $filename)) {
|
||||||
if ($type = mimetype_from_filename($filename)) {
|
if ($type = mimetype_from_filename($filename)) {
|
||||||
$headers['Content-Type'] = $type;
|
$headers['Content-Type'] = $type;
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,6 +59,7 @@ class Response implements ResponseInterface
|
||||||
428 => 'Precondition Required',
|
428 => 'Precondition Required',
|
||||||
429 => 'Too Many Requests',
|
429 => 'Too Many Requests',
|
||||||
431 => 'Request Header Fields Too Large',
|
431 => 'Request Header Fields Too Large',
|
||||||
|
451 => 'Unavailable For Legal Reasons',
|
||||||
500 => 'Internal Server Error',
|
500 => 'Internal Server Error',
|
||||||
501 => 'Not Implemented',
|
501 => 'Not Implemented',
|
||||||
502 => 'Bad Gateway',
|
502 => 'Bad Gateway',
|
||||||
|
|
17
server/vendor/guzzlehttp/psr7/src/Uri.php
vendored
17
server/vendor/guzzlehttp/psr7/src/Uri.php
vendored
|
@ -477,21 +477,28 @@ class Uri implements UriInterface
|
||||||
$uri = '';
|
$uri = '';
|
||||||
|
|
||||||
if (!empty($scheme)) {
|
if (!empty($scheme)) {
|
||||||
$uri .= $scheme . '://';
|
$uri .= $scheme . ':';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$hierPart = '';
|
||||||
|
|
||||||
if (!empty($authority)) {
|
if (!empty($authority)) {
|
||||||
$uri .= $authority;
|
if (!empty($scheme)) {
|
||||||
|
$hierPart .= '//';
|
||||||
|
}
|
||||||
|
$hierPart .= $authority;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($path != null) {
|
if ($path != null) {
|
||||||
// Add a leading slash if necessary.
|
// Add a leading slash if necessary.
|
||||||
if ($uri && substr($path, 0, 1) !== '/') {
|
if ($hierPart && substr($path, 0, 1) !== '/') {
|
||||||
$uri .= '/';
|
$hierPart .= '/';
|
||||||
}
|
}
|
||||||
$uri .= $path;
|
$hierPart .= $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$uri .= $hierPart;
|
||||||
|
|
||||||
if ($query != null) {
|
if ($query != null) {
|
||||||
$uri .= '?' . $query;
|
$uri .= '?' . $query;
|
||||||
}
|
}
|
||||||
|
|
|
@ -209,6 +209,14 @@ function modify_request(RequestInterface $request, array $changes)
|
||||||
// Remove the host header if one is on the URI
|
// Remove the host header if one is on the URI
|
||||||
if ($host = $changes['uri']->getHost()) {
|
if ($host = $changes['uri']->getHost()) {
|
||||||
$changes['set_headers']['Host'] = $host;
|
$changes['set_headers']['Host'] = $host;
|
||||||
|
|
||||||
|
if ($port = $changes['uri']->getPort()) {
|
||||||
|
$standardPorts = ['http' => 80, 'https' => 443];
|
||||||
|
$scheme = $changes['uri']->getScheme();
|
||||||
|
if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) {
|
||||||
|
$changes['set_headers']['Host'] .= ':'.$port;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$uri = $changes['uri'];
|
$uri = $changes['uri'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -546,6 +546,16 @@ class FunctionsTest extends \PHPUnit_Framework_TestCase
|
||||||
$this->assertEquals('www.foo.com', (string) $r2->getHeaderLine('host'));
|
$this->assertEquals('www.foo.com', (string) $r2->getHeaderLine('host'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testCanModifyRequestWithUriAndPort()
|
||||||
|
{
|
||||||
|
$r1 = new Psr7\Request('GET', 'http://foo.com:8000');
|
||||||
|
$r2 = Psr7\modify_request($r1, [
|
||||||
|
'uri' => new Psr7\Uri('http://www.foo.com:8000')
|
||||||
|
]);
|
||||||
|
$this->assertEquals('http://www.foo.com:8000', (string) $r2->getUri());
|
||||||
|
$this->assertEquals('www.foo.com:8000', (string) $r2->getHeaderLine('host'));
|
||||||
|
}
|
||||||
|
|
||||||
public function testCanModifyRequestWithCaseInsensitiveHeader()
|
public function testCanModifyRequestWithCaseInsensitiveHeader()
|
||||||
{
|
{
|
||||||
$r1 = new Psr7\Request('GET', 'http://foo.com', ['User-Agent' => 'foo']);
|
$r1 = new Psr7\Request('GET', 'http://foo.com', ['User-Agent' => 'foo']);
|
||||||
|
|
34
server/vendor/guzzlehttp/psr7/tests/UriTest.php
vendored
34
server/vendor/guzzlehttp/psr7/tests/UriTest.php
vendored
|
@ -244,4 +244,38 @@ class UriTest extends \PHPUnit_Framework_TestCase
|
||||||
$this->assertEquals('foo', $uri->getPath());
|
$this->assertEquals('foo', $uri->getPath());
|
||||||
$this->assertEquals('bar.com/foo', (string) $uri);
|
$this->assertEquals('bar.com/foo', (string) $uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dataProvider pathTestNoAuthority
|
||||||
|
*/
|
||||||
|
public function testNoAuthority($input)
|
||||||
|
{
|
||||||
|
$uri = new Uri($input);
|
||||||
|
|
||||||
|
$this->assertEquals($input, (string) $uri);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function pathTestNoAuthority()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
// path-rootless
|
||||||
|
['urn:example:animal:ferret:nose'],
|
||||||
|
// path-absolute
|
||||||
|
['urn:/example:animal:ferret:nose'],
|
||||||
|
['urn:/'],
|
||||||
|
// path-empty
|
||||||
|
['urn:'],
|
||||||
|
['urn'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @expectedException \InvalidArgumentException
|
||||||
|
* @expectedExceptionMessage Unable to parse URI
|
||||||
|
*/
|
||||||
|
public function testNoAuthorityWithInvalidPath()
|
||||||
|
{
|
||||||
|
$input = 'urn://example:animal:ferret:nose';
|
||||||
|
$uri = new Uri($input);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3.2"
|
"php": ">=5.3.29"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"json-schema/JSON-Schema-Test-Suite": "1.1.0",
|
"json-schema/JSON-Schema-Test-Suite": "1.1.0",
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
"bin": ["bin/validate-json"],
|
"bin": ["bin/validate-json"],
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "1.4.x-dev"
|
"dev-master": "1.6.x-dev"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,10 +19,27 @@ use JsonSchema\Validator;
|
||||||
class Factory
|
class Factory
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var UriRetriever
|
* @var UriRetriever $uriRetriever
|
||||||
*/
|
*/
|
||||||
protected $uriRetriever;
|
protected $uriRetriever;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array $constraintMap
|
||||||
|
*/
|
||||||
|
protected $constraintMap = array(
|
||||||
|
'array' => 'JsonSchema\Constraints\CollectionConstraint',
|
||||||
|
'collection' => 'JsonSchema\Constraints\CollectionConstraint',
|
||||||
|
'object' => 'JsonSchema\Constraints\ObjectConstraint',
|
||||||
|
'type' => 'JsonSchema\Constraints\TypeConstraint',
|
||||||
|
'undefined' => 'JsonSchema\Constraints\UndefinedConstraint',
|
||||||
|
'string' => 'JsonSchema\Constraints\StringConstraint',
|
||||||
|
'number' => 'JsonSchema\Constraints\NumberConstraint',
|
||||||
|
'enum' => 'JsonSchema\Constraints\EnumConstraint',
|
||||||
|
'format' => 'JsonSchema\Constraints\FormatConstraint',
|
||||||
|
'schema' => 'JsonSchema\Constraints\SchemaConstraint',
|
||||||
|
'validator' => 'JsonSchema\Validator',
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param UriRetriever $uriRetriever
|
* @param UriRetriever $uriRetriever
|
||||||
*/
|
*/
|
||||||
|
@ -43,6 +60,25 @@ class Factory
|
||||||
return $this->uriRetriever;
|
return $this->uriRetriever;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $name
|
||||||
|
* @param string $class
|
||||||
|
* @return Factory
|
||||||
|
*/
|
||||||
|
public function setConstraintClass($name, $class)
|
||||||
|
{
|
||||||
|
// Ensure class exists
|
||||||
|
if (!class_exists($class)) {
|
||||||
|
throw new InvalidArgumentException('Unknown constraint ' . $name);
|
||||||
|
}
|
||||||
|
// Ensure class is appropriate
|
||||||
|
if (!in_array('JsonSchema\Constraints\ConstraintInterface', class_implements($class))) {
|
||||||
|
throw new InvalidArgumentException('Invalid class ' . $name);
|
||||||
|
}
|
||||||
|
$this->constraintMap[$name] = $class;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a constraint instance for the given constraint name.
|
* Create a constraint instance for the given constraint name.
|
||||||
*
|
*
|
||||||
|
@ -52,30 +88,9 @@ class Factory
|
||||||
*/
|
*/
|
||||||
public function createInstanceFor($constraintName)
|
public function createInstanceFor($constraintName)
|
||||||
{
|
{
|
||||||
switch ($constraintName) {
|
if (array_key_exists($constraintName, $this->constraintMap)) {
|
||||||
case 'array':
|
return new $this->constraintMap[$constraintName](Constraint::CHECK_MODE_NORMAL, $this->uriRetriever, $this);
|
||||||
case 'collection':
|
|
||||||
return new CollectionConstraint(Constraint::CHECK_MODE_NORMAL, $this->uriRetriever, $this);
|
|
||||||
case 'object':
|
|
||||||
return new ObjectConstraint(Constraint::CHECK_MODE_NORMAL, $this->uriRetriever, $this);
|
|
||||||
case 'type':
|
|
||||||
return new TypeConstraint(Constraint::CHECK_MODE_NORMAL, $this->uriRetriever, $this);
|
|
||||||
case 'undefined':
|
|
||||||
return new UndefinedConstraint(Constraint::CHECK_MODE_NORMAL, $this->uriRetriever, $this);
|
|
||||||
case 'string':
|
|
||||||
return new StringConstraint(Constraint::CHECK_MODE_NORMAL, $this->uriRetriever, $this);
|
|
||||||
case 'number':
|
|
||||||
return new NumberConstraint(Constraint::CHECK_MODE_NORMAL, $this->uriRetriever, $this);
|
|
||||||
case 'enum':
|
|
||||||
return new EnumConstraint(Constraint::CHECK_MODE_NORMAL, $this->uriRetriever, $this);
|
|
||||||
case 'format':
|
|
||||||
return new FormatConstraint(Constraint::CHECK_MODE_NORMAL, $this->uriRetriever, $this);
|
|
||||||
case 'schema':
|
|
||||||
return new SchemaConstraint(Constraint::CHECK_MODE_NORMAL, $this->uriRetriever, $this);
|
|
||||||
case 'validator':
|
|
||||||
return new Validator(Constraint::CHECK_MODE_NORMAL, $this->uriRetriever, $this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new InvalidArgumentException('Unknown constraint ' . $constraintName);
|
throw new InvalidArgumentException('Unknown constraint ' . $constraintName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,8 +25,8 @@ class NumberConstraint extends Constraint
|
||||||
// Verify minimum
|
// Verify minimum
|
||||||
if (isset($schema->exclusiveMinimum)) {
|
if (isset($schema->exclusiveMinimum)) {
|
||||||
if (isset($schema->minimum)) {
|
if (isset($schema->minimum)) {
|
||||||
if ($schema->exclusiveMinimum && $element === $schema->minimum) {
|
if ($schema->exclusiveMinimum && $element <= $schema->minimum) {
|
||||||
$this->addError($path, "Must have a minimum value greater than boundary value of " . $schema->minimum, 'exclusiveMinimum', array('minimum' => $schema->minimum,));
|
$this->addError($path, "Must have a minimum value of " . $schema->minimum, 'exclusiveMinimum', array('minimum' => $schema->minimum,));
|
||||||
} else if ($element < $schema->minimum) {
|
} else if ($element < $schema->minimum) {
|
||||||
$this->addError($path, "Must have a minimum value of " . $schema->minimum, 'minimum', array('minimum' => $schema->minimum,));
|
$this->addError($path, "Must have a minimum value of " . $schema->minimum, 'minimum', array('minimum' => $schema->minimum,));
|
||||||
}
|
}
|
||||||
|
@ -40,8 +40,8 @@ class NumberConstraint extends Constraint
|
||||||
// Verify maximum
|
// Verify maximum
|
||||||
if (isset($schema->exclusiveMaximum)) {
|
if (isset($schema->exclusiveMaximum)) {
|
||||||
if (isset($schema->maximum)) {
|
if (isset($schema->maximum)) {
|
||||||
if ($schema->exclusiveMaximum && $element === $schema->maximum) {
|
if ($schema->exclusiveMaximum && $element >= $schema->maximum) {
|
||||||
$this->addError($path, "Must have a maximum value less than boundary value of " . $schema->maximum, 'exclusiveMaximum', array('maximum' => $schema->maximum,));
|
$this->addError($path, "Must have a maximum value of " . $schema->maximum, 'exclusiveMaximum', array('maximum' => $schema->maximum,));
|
||||||
} else if ($element > $schema->maximum) {
|
} else if ($element > $schema->maximum) {
|
||||||
$this->addError($path, "Must have a maximum value of " . $schema->maximum, 'maximum', array('maximum' => $schema->maximum,));
|
$this->addError($path, "Must have a maximum value of " . $schema->maximum, 'maximum', array('maximum' => $schema->maximum,));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue