Merge branch '2.8' into 3.4
* 2.8: [travis] cache compiled php extensions fix merge
This commit is contained in:
commit
f5060c122b
26
.travis.yml
26
.travis.yml
@ -36,6 +36,7 @@ cache:
|
|||||||
directories:
|
directories:
|
||||||
- .phpunit
|
- .phpunit
|
||||||
- php-$MIN_PHP
|
- php-$MIN_PHP
|
||||||
|
- php-ext
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- memcached
|
- memcached
|
||||||
@ -110,6 +111,23 @@ before_install:
|
|||||||
echo extension = mongo.so >> $INI
|
echo extension = mongo.so >> $INI
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# tpecl is a helper to compile and cache php extensions
|
||||||
|
tpecl () {
|
||||||
|
local ext_name=$1
|
||||||
|
local ext_so=$2
|
||||||
|
local ext_dir=$(php -r "echo ini_get('extension_dir');")
|
||||||
|
local ext_cache=~/php-ext/$(basename $ext_dir)/$ext_name
|
||||||
|
|
||||||
|
if [[ -e $ext_cache/$ext_so ]]; then
|
||||||
|
echo extension = $ext_cache/$ext_so >> $INI
|
||||||
|
else
|
||||||
|
mkdir -p $ext_cache
|
||||||
|
echo yes | pecl install -f $ext_name &&
|
||||||
|
cp $ext_dir/$ext_so $ext_cache
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
export -f tpecl
|
||||||
|
|
||||||
# Matrix lines for intermediate PHP versions are skipped for pull requests
|
# Matrix lines for intermediate PHP versions are skipped for pull requests
|
||||||
if [[ ! $deps && ! $PHP = ${MIN_PHP%.*} && ! $PHP = hhvm* && $TRAVIS_PULL_REQUEST != false ]]; then
|
if [[ ! $deps && ! $PHP = ${MIN_PHP%.*} && ! $PHP = hhvm* && $TRAVIS_PULL_REQUEST != false ]]; then
|
||||||
deps=skip
|
deps=skip
|
||||||
@ -128,11 +146,11 @@ before_install:
|
|||||||
- |
|
- |
|
||||||
# Install extra PHP extensions
|
# Install extra PHP extensions
|
||||||
if [[ ! $skip && $PHP = 5.* ]]; then
|
if [[ ! $skip && $PHP = 5.* ]]; then
|
||||||
([[ $deps ]] || tfold ext.symfony_debug 'cd src/Symfony/Component/Debug/Resources/ext && phpize && ./configure && make && echo extension = $(pwd)/modules/symfony_debug.so >> '"$INI") &&
|
([[ $deps ]] || tfold ext.symfony_debug 'cd src/Symfony/Component/Debug/Resources/ext && phpize && ./configure && make && echo extension = $(pwd)/modules/symfony_debug.so >> '"$INI")
|
||||||
tfold ext.apcu4 'echo yes | pecl install -f apcu-4.0.11'
|
tfold ext.apcu tpecl apcu-4.0.11 apcu.so
|
||||||
elif [[ ! $skip && $PHP = 7.* ]]; then
|
elif [[ ! $skip && $PHP = 7.* ]]; then
|
||||||
tfold ext.apcu5 'echo yes | pecl install -f apcu-5.1.6'
|
tfold ext.apcu tpecl apcu-5.1.6 apcu.so
|
||||||
tfold ext.mongodb pecl install -f mongodb-1.4.0RC1
|
tfold ext.mongodb tpecl mongodb-1.4.0RC1 mongodb.so
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- |
|
- |
|
||||||
|
@ -104,7 +104,6 @@ EOF;
|
|||||||
\$context = \$this->context;
|
\$context = \$this->context;
|
||||||
\$request = \$this->request ?: \$this->createRequest(\$pathinfo);
|
\$request = \$this->request ?: \$this->createRequest(\$pathinfo);
|
||||||
\$requestMethod = \$canonicalMethod = \$context->getMethod();
|
\$requestMethod = \$canonicalMethod = \$context->getMethod();
|
||||||
\$scheme = \$context->getScheme();
|
|
||||||
|
|
||||||
if ('HEAD' === \$requestMethod) {
|
if ('HEAD' === \$requestMethod) {
|
||||||
\$canonicalMethod = 'GET';
|
\$canonicalMethod = 'GET';
|
||||||
@ -362,7 +361,7 @@ EOF;
|
|||||||
$code .= <<<EOF
|
$code .= <<<EOF
|
||||||
if ('/' === substr(\$pathinfo, -1)) {
|
if ('/' === substr(\$pathinfo, -1)) {
|
||||||
// no-op
|
// no-op
|
||||||
} elseif (!in_array(\$this->context->getMethod(), array('HEAD', 'GET'))) {
|
} elseif ('GET' !== \$canonicalMethod) {
|
||||||
goto $gotoname;
|
goto $gotoname;
|
||||||
} else {
|
} else {
|
||||||
return array_replace(\$ret, \$this->redirect(\$rawPathinfo.'/', '$name'));
|
return array_replace(\$ret, \$this->redirect(\$rawPathinfo.'/', '$name'));
|
||||||
@ -379,7 +378,7 @@ EOF;
|
|||||||
$schemes = str_replace("\n", '', var_export(array_flip($schemes), true));
|
$schemes = str_replace("\n", '', var_export(array_flip($schemes), true));
|
||||||
$code .= <<<EOF
|
$code .= <<<EOF
|
||||||
\$requiredSchemes = $schemes;
|
\$requiredSchemes = $schemes;
|
||||||
if (!isset(\$requiredSchemes[\$scheme])) {
|
if (!isset(\$requiredSchemes[\$context->getScheme()])) {
|
||||||
return array_replace(\$ret, \$this->redirect(\$rawPathinfo, '$name', key(\$requiredSchemes)));
|
return array_replace(\$ret, \$this->redirect(\$rawPathinfo, '$name', key(\$requiredSchemes)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|||||||
$context = $this->context;
|
$context = $this->context;
|
||||||
$request = $this->request ?: $this->createRequest($pathinfo);
|
$request = $this->request ?: $this->createRequest($pathinfo);
|
||||||
$requestMethod = $canonicalMethod = $context->getMethod();
|
$requestMethod = $canonicalMethod = $context->getMethod();
|
||||||
$scheme = $context->getScheme();
|
|
||||||
|
|
||||||
if ('HEAD' === $requestMethod) {
|
if ('HEAD' === $requestMethod) {
|
||||||
$canonicalMethod = 'GET';
|
$canonicalMethod = 'GET';
|
||||||
|
@ -23,7 +23,6 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|||||||
$context = $this->context;
|
$context = $this->context;
|
||||||
$request = $this->request ?: $this->createRequest($pathinfo);
|
$request = $this->request ?: $this->createRequest($pathinfo);
|
||||||
$requestMethod = $canonicalMethod = $context->getMethod();
|
$requestMethod = $canonicalMethod = $context->getMethod();
|
||||||
$scheme = $context->getScheme();
|
|
||||||
|
|
||||||
if ('HEAD' === $requestMethod) {
|
if ('HEAD' === $requestMethod) {
|
||||||
$canonicalMethod = 'GET';
|
$canonicalMethod = 'GET';
|
||||||
|
@ -23,7 +23,6 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$context = $this->context;
|
$context = $this->context;
|
||||||
$request = $this->request ?: $this->createRequest($pathinfo);
|
$request = $this->request ?: $this->createRequest($pathinfo);
|
||||||
$requestMethod = $canonicalMethod = $context->getMethod();
|
$requestMethod = $canonicalMethod = $context->getMethod();
|
||||||
$scheme = $context->getScheme();
|
|
||||||
|
|
||||||
if ('HEAD' === $requestMethod) {
|
if ('HEAD' === $requestMethod) {
|
||||||
$canonicalMethod = 'GET';
|
$canonicalMethod = 'GET';
|
||||||
@ -84,7 +83,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$ret = array('_route' => 'baz3');
|
$ret = array('_route' => 'baz3');
|
||||||
if ('/' === substr($pathinfo, -1)) {
|
if ('/' === substr($pathinfo, -1)) {
|
||||||
// no-op
|
// no-op
|
||||||
} elseif (!in_array($this->context->getMethod(), array('HEAD', 'GET'))) {
|
} elseif ('GET' !== $canonicalMethod) {
|
||||||
goto not_baz3;
|
goto not_baz3;
|
||||||
} else {
|
} else {
|
||||||
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'baz3'));
|
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'baz3'));
|
||||||
@ -101,7 +100,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'baz4')), array ());
|
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'baz4')), array ());
|
||||||
if ('/' === substr($pathinfo, -1)) {
|
if ('/' === substr($pathinfo, -1)) {
|
||||||
// no-op
|
// no-op
|
||||||
} elseif (!in_array($this->context->getMethod(), array('HEAD', 'GET'))) {
|
} elseif ('GET' !== $canonicalMethod) {
|
||||||
goto not_baz4;
|
goto not_baz4;
|
||||||
} else {
|
} else {
|
||||||
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'baz4'));
|
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'baz4'));
|
||||||
@ -190,7 +189,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$ret = array('_route' => 'hey');
|
$ret = array('_route' => 'hey');
|
||||||
if ('/' === substr($pathinfo, -1)) {
|
if ('/' === substr($pathinfo, -1)) {
|
||||||
// no-op
|
// no-op
|
||||||
} elseif (!in_array($this->context->getMethod(), array('HEAD', 'GET'))) {
|
} elseif ('GET' !== $canonicalMethod) {
|
||||||
goto not_hey;
|
goto not_hey;
|
||||||
} else {
|
} else {
|
||||||
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'hey'));
|
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'hey'));
|
||||||
@ -340,7 +339,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
if ('/secure' === $pathinfo) {
|
if ('/secure' === $pathinfo) {
|
||||||
$ret = array('_route' => 'secure');
|
$ret = array('_route' => 'secure');
|
||||||
$requiredSchemes = array ( 'https' => 0,);
|
$requiredSchemes = array ( 'https' => 0,);
|
||||||
if (!isset($requiredSchemes[$scheme])) {
|
if (!isset($requiredSchemes[$context->getScheme()])) {
|
||||||
return array_replace($ret, $this->redirect($rawPathinfo, 'secure', key($requiredSchemes)));
|
return array_replace($ret, $this->redirect($rawPathinfo, 'secure', key($requiredSchemes)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -351,7 +350,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
if ('/nonsecure' === $pathinfo) {
|
if ('/nonsecure' === $pathinfo) {
|
||||||
$ret = array('_route' => 'nonsecure');
|
$ret = array('_route' => 'nonsecure');
|
||||||
$requiredSchemes = array ( 'http' => 0,);
|
$requiredSchemes = array ( 'http' => 0,);
|
||||||
if (!isset($requiredSchemes[$scheme])) {
|
if (!isset($requiredSchemes[$context->getScheme()])) {
|
||||||
return array_replace($ret, $this->redirect($rawPathinfo, 'nonsecure', key($requiredSchemes)));
|
return array_replace($ret, $this->redirect($rawPathinfo, 'nonsecure', key($requiredSchemes)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|||||||
$context = $this->context;
|
$context = $this->context;
|
||||||
$request = $this->request ?: $this->createRequest($pathinfo);
|
$request = $this->request ?: $this->createRequest($pathinfo);
|
||||||
$requestMethod = $canonicalMethod = $context->getMethod();
|
$requestMethod = $canonicalMethod = $context->getMethod();
|
||||||
$scheme = $context->getScheme();
|
|
||||||
|
|
||||||
if ('HEAD' === $requestMethod) {
|
if ('HEAD' === $requestMethod) {
|
||||||
$canonicalMethod = 'GET';
|
$canonicalMethod = 'GET';
|
||||||
|
@ -23,7 +23,6 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|||||||
$context = $this->context;
|
$context = $this->context;
|
||||||
$request = $this->request ?: $this->createRequest($pathinfo);
|
$request = $this->request ?: $this->createRequest($pathinfo);
|
||||||
$requestMethod = $canonicalMethod = $context->getMethod();
|
$requestMethod = $canonicalMethod = $context->getMethod();
|
||||||
$scheme = $context->getScheme();
|
|
||||||
|
|
||||||
if ('HEAD' === $requestMethod) {
|
if ('HEAD' === $requestMethod) {
|
||||||
$canonicalMethod = 'GET';
|
$canonicalMethod = 'GET';
|
||||||
|
@ -23,7 +23,6 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$context = $this->context;
|
$context = $this->context;
|
||||||
$request = $this->request ?: $this->createRequest($pathinfo);
|
$request = $this->request ?: $this->createRequest($pathinfo);
|
||||||
$requestMethod = $canonicalMethod = $context->getMethod();
|
$requestMethod = $canonicalMethod = $context->getMethod();
|
||||||
$scheme = $context->getScheme();
|
|
||||||
|
|
||||||
if ('HEAD' === $requestMethod) {
|
if ('HEAD' === $requestMethod) {
|
||||||
$canonicalMethod = 'GET';
|
$canonicalMethod = 'GET';
|
||||||
@ -58,7 +57,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$ret = array('_route' => 'a_fourth');
|
$ret = array('_route' => 'a_fourth');
|
||||||
if ('/' === substr($pathinfo, -1)) {
|
if ('/' === substr($pathinfo, -1)) {
|
||||||
// no-op
|
// no-op
|
||||||
} elseif (!in_array($this->context->getMethod(), array('HEAD', 'GET'))) {
|
} elseif ('GET' !== $canonicalMethod) {
|
||||||
goto not_a_fourth;
|
goto not_a_fourth;
|
||||||
} else {
|
} else {
|
||||||
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'a_fourth'));
|
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'a_fourth'));
|
||||||
@ -73,7 +72,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$ret = array('_route' => 'a_fifth');
|
$ret = array('_route' => 'a_fifth');
|
||||||
if ('/' === substr($pathinfo, -1)) {
|
if ('/' === substr($pathinfo, -1)) {
|
||||||
// no-op
|
// no-op
|
||||||
} elseif (!in_array($this->context->getMethod(), array('HEAD', 'GET'))) {
|
} elseif ('GET' !== $canonicalMethod) {
|
||||||
goto not_a_fifth;
|
goto not_a_fifth;
|
||||||
} else {
|
} else {
|
||||||
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'a_fifth'));
|
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'a_fifth'));
|
||||||
@ -88,7 +87,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$ret = array('_route' => 'a_sixth');
|
$ret = array('_route' => 'a_sixth');
|
||||||
if ('/' === substr($pathinfo, -1)) {
|
if ('/' === substr($pathinfo, -1)) {
|
||||||
// no-op
|
// no-op
|
||||||
} elseif (!in_array($this->context->getMethod(), array('HEAD', 'GET'))) {
|
} elseif ('GET' !== $canonicalMethod) {
|
||||||
goto not_a_sixth;
|
goto not_a_sixth;
|
||||||
} else {
|
} else {
|
||||||
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'a_sixth'));
|
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'a_sixth'));
|
||||||
@ -111,7 +110,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$ret = array('_route' => 'nested_a');
|
$ret = array('_route' => 'nested_a');
|
||||||
if ('/' === substr($pathinfo, -1)) {
|
if ('/' === substr($pathinfo, -1)) {
|
||||||
// no-op
|
// no-op
|
||||||
} elseif (!in_array($this->context->getMethod(), array('HEAD', 'GET'))) {
|
} elseif ('GET' !== $canonicalMethod) {
|
||||||
goto not_nested_a;
|
goto not_nested_a;
|
||||||
} else {
|
} else {
|
||||||
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'nested_a'));
|
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'nested_a'));
|
||||||
@ -126,7 +125,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$ret = array('_route' => 'nested_b');
|
$ret = array('_route' => 'nested_b');
|
||||||
if ('/' === substr($pathinfo, -1)) {
|
if ('/' === substr($pathinfo, -1)) {
|
||||||
// no-op
|
// no-op
|
||||||
} elseif (!in_array($this->context->getMethod(), array('HEAD', 'GET'))) {
|
} elseif ('GET' !== $canonicalMethod) {
|
||||||
goto not_nested_b;
|
goto not_nested_b;
|
||||||
} else {
|
} else {
|
||||||
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'nested_b'));
|
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'nested_b'));
|
||||||
@ -141,7 +140,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$ret = array('_route' => 'nested_c');
|
$ret = array('_route' => 'nested_c');
|
||||||
if ('/' === substr($pathinfo, -1)) {
|
if ('/' === substr($pathinfo, -1)) {
|
||||||
// no-op
|
// no-op
|
||||||
} elseif (!in_array($this->context->getMethod(), array('HEAD', 'GET'))) {
|
} elseif ('GET' !== $canonicalMethod) {
|
||||||
goto not_nested_c;
|
goto not_nested_c;
|
||||||
} else {
|
} else {
|
||||||
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'nested_c'));
|
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'nested_c'));
|
||||||
@ -159,7 +158,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$ret = array('_route' => 'slashed_a');
|
$ret = array('_route' => 'slashed_a');
|
||||||
if ('/' === substr($pathinfo, -1)) {
|
if ('/' === substr($pathinfo, -1)) {
|
||||||
// no-op
|
// no-op
|
||||||
} elseif (!in_array($this->context->getMethod(), array('HEAD', 'GET'))) {
|
} elseif ('GET' !== $canonicalMethod) {
|
||||||
goto not_slashed_a;
|
goto not_slashed_a;
|
||||||
} else {
|
} else {
|
||||||
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'slashed_a'));
|
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'slashed_a'));
|
||||||
@ -174,7 +173,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$ret = array('_route' => 'slashed_b');
|
$ret = array('_route' => 'slashed_b');
|
||||||
if ('/' === substr($pathinfo, -1)) {
|
if ('/' === substr($pathinfo, -1)) {
|
||||||
// no-op
|
// no-op
|
||||||
} elseif (!in_array($this->context->getMethod(), array('HEAD', 'GET'))) {
|
} elseif ('GET' !== $canonicalMethod) {
|
||||||
goto not_slashed_b;
|
goto not_slashed_b;
|
||||||
} else {
|
} else {
|
||||||
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'slashed_b'));
|
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'slashed_b'));
|
||||||
@ -189,7 +188,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$ret = array('_route' => 'slashed_c');
|
$ret = array('_route' => 'slashed_c');
|
||||||
if ('/' === substr($pathinfo, -1)) {
|
if ('/' === substr($pathinfo, -1)) {
|
||||||
// no-op
|
// no-op
|
||||||
} elseif (!in_array($this->context->getMethod(), array('HEAD', 'GET'))) {
|
} elseif ('GET' !== $canonicalMethod) {
|
||||||
goto not_slashed_c;
|
goto not_slashed_c;
|
||||||
} else {
|
} else {
|
||||||
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'slashed_c'));
|
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'slashed_c'));
|
||||||
|
@ -23,7 +23,6 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|||||||
$context = $this->context;
|
$context = $this->context;
|
||||||
$request = $this->request ?: $this->createRequest($pathinfo);
|
$request = $this->request ?: $this->createRequest($pathinfo);
|
||||||
$requestMethod = $canonicalMethod = $context->getMethod();
|
$requestMethod = $canonicalMethod = $context->getMethod();
|
||||||
$scheme = $context->getScheme();
|
|
||||||
|
|
||||||
if ('HEAD' === $requestMethod) {
|
if ('HEAD' === $requestMethod) {
|
||||||
$canonicalMethod = 'GET';
|
$canonicalMethod = 'GET';
|
||||||
|
@ -23,7 +23,6 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$context = $this->context;
|
$context = $this->context;
|
||||||
$request = $this->request ?: $this->createRequest($pathinfo);
|
$request = $this->request ?: $this->createRequest($pathinfo);
|
||||||
$requestMethod = $canonicalMethod = $context->getMethod();
|
$requestMethod = $canonicalMethod = $context->getMethod();
|
||||||
$scheme = $context->getScheme();
|
|
||||||
|
|
||||||
if ('HEAD' === $requestMethod) {
|
if ('HEAD' === $requestMethod) {
|
||||||
$canonicalMethod = 'GET';
|
$canonicalMethod = 'GET';
|
||||||
@ -35,7 +34,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$ret = array('_route' => 'simple_trailing_slash_no_methods');
|
$ret = array('_route' => 'simple_trailing_slash_no_methods');
|
||||||
if ('/' === substr($pathinfo, -1)) {
|
if ('/' === substr($pathinfo, -1)) {
|
||||||
// no-op
|
// no-op
|
||||||
} elseif (!in_array($this->context->getMethod(), array('HEAD', 'GET'))) {
|
} elseif ('GET' !== $canonicalMethod) {
|
||||||
goto not_simple_trailing_slash_no_methods;
|
goto not_simple_trailing_slash_no_methods;
|
||||||
} else {
|
} else {
|
||||||
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'simple_trailing_slash_no_methods'));
|
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'simple_trailing_slash_no_methods'));
|
||||||
@ -55,7 +54,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$ret = array('_route' => 'simple_trailing_slash_GET_method');
|
$ret = array('_route' => 'simple_trailing_slash_GET_method');
|
||||||
if ('/' === substr($pathinfo, -1)) {
|
if ('/' === substr($pathinfo, -1)) {
|
||||||
// no-op
|
// no-op
|
||||||
} elseif (!in_array($this->context->getMethod(), array('HEAD', 'GET'))) {
|
} elseif ('GET' !== $canonicalMethod) {
|
||||||
goto not_simple_trailing_slash_GET_method;
|
goto not_simple_trailing_slash_GET_method;
|
||||||
} else {
|
} else {
|
||||||
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'simple_trailing_slash_GET_method'));
|
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'simple_trailing_slash_GET_method'));
|
||||||
@ -75,7 +74,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$ret = array('_route' => 'simple_trailing_slash_HEAD_method');
|
$ret = array('_route' => 'simple_trailing_slash_HEAD_method');
|
||||||
if ('/' === substr($pathinfo, -1)) {
|
if ('/' === substr($pathinfo, -1)) {
|
||||||
// no-op
|
// no-op
|
||||||
} elseif (!in_array($this->context->getMethod(), array('HEAD', 'GET'))) {
|
} elseif ('GET' !== $canonicalMethod) {
|
||||||
goto not_simple_trailing_slash_HEAD_method;
|
goto not_simple_trailing_slash_HEAD_method;
|
||||||
} else {
|
} else {
|
||||||
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'simple_trailing_slash_HEAD_method'));
|
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'simple_trailing_slash_HEAD_method'));
|
||||||
@ -104,7 +103,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_no_methods')), array ());
|
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_no_methods')), array ());
|
||||||
if ('/' === substr($pathinfo, -1)) {
|
if ('/' === substr($pathinfo, -1)) {
|
||||||
// no-op
|
// no-op
|
||||||
} elseif (!in_array($this->context->getMethod(), array('HEAD', 'GET'))) {
|
} elseif ('GET' !== $canonicalMethod) {
|
||||||
goto not_regex_trailing_slash_no_methods;
|
goto not_regex_trailing_slash_no_methods;
|
||||||
} else {
|
} else {
|
||||||
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'regex_trailing_slash_no_methods'));
|
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'regex_trailing_slash_no_methods'));
|
||||||
@ -124,7 +123,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_GET_method')), array ());
|
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_GET_method')), array ());
|
||||||
if ('/' === substr($pathinfo, -1)) {
|
if ('/' === substr($pathinfo, -1)) {
|
||||||
// no-op
|
// no-op
|
||||||
} elseif (!in_array($this->context->getMethod(), array('HEAD', 'GET'))) {
|
} elseif ('GET' !== $canonicalMethod) {
|
||||||
goto not_regex_trailing_slash_GET_method;
|
goto not_regex_trailing_slash_GET_method;
|
||||||
} else {
|
} else {
|
||||||
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'regex_trailing_slash_GET_method'));
|
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'regex_trailing_slash_GET_method'));
|
||||||
@ -144,7 +143,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_HEAD_method')), array ());
|
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_HEAD_method')), array ());
|
||||||
if ('/' === substr($pathinfo, -1)) {
|
if ('/' === substr($pathinfo, -1)) {
|
||||||
// no-op
|
// no-op
|
||||||
} elseif (!in_array($this->context->getMethod(), array('HEAD', 'GET'))) {
|
} elseif ('GET' !== $canonicalMethod) {
|
||||||
goto not_regex_trailing_slash_HEAD_method;
|
goto not_regex_trailing_slash_HEAD_method;
|
||||||
} else {
|
} else {
|
||||||
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'regex_trailing_slash_HEAD_method'));
|
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'regex_trailing_slash_HEAD_method'));
|
||||||
|
@ -435,7 +435,7 @@ class UrlMatcherTest extends TestCase
|
|||||||
{
|
{
|
||||||
$coll = new RouteCollection();
|
$coll = new RouteCollection();
|
||||||
|
|
||||||
$matcher = new UrlMatcher($coll, new RequestContext());
|
$matcher = $this->getUrlMatcher($coll);
|
||||||
$matcher->match('/');
|
$matcher->match('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user