Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
294
Merge Requests
294
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
66b964dd
Commit
66b964dd
authored
Sep 04, 2015
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2400407
by DuaelFr: Ensure vendor stack/builder is on latest stable release
parent
a8d4b648
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
149 additions
and
67 deletions
+149
-67
core/composer.lock
core/composer.lock
+6
-7
core/vendor/composer/installed.json
core/vendor/composer/installed.json
+51
-52
core/vendor/stack/builder/.gitignore
core/vendor/stack/builder/.gitignore
+1
-0
core/vendor/stack/builder/.travis.yml
core/vendor/stack/builder/.travis.yml
+1
-0
core/vendor/stack/builder/CHANGELOG.md
core/vendor/stack/builder/CHANGELOG.md
+5
-1
core/vendor/stack/builder/src/Stack/StackedHttpKernel.php
core/vendor/stack/builder/src/Stack/StackedHttpKernel.php
+4
-1
core/vendor/stack/builder/tests/unit/Stack/StackedHttpKernelTest.php
.../stack/builder/tests/unit/Stack/StackedHttpKernelTest.php
+81
-6
No files found.
core/composer.lock
View file @
66b964dd
...
...
@@ -2003,16 +2003,16 @@
},
{
"name": "stack/builder",
"version": "v1.0.
2
",
"version": "v1.0.
3
",
"source": {
"type": "git",
"url": "https://github.com/stackphp/builder.git",
"reference": "
b4af43e7b7f3f7fac919ff475b29f7c5dc7b23b7
"
"reference": "
c1f8a4693b55c563405024f708a76ef576c3b276
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/stackphp/builder/zipball/
b4af43e7b7f3f7fac919ff475b29f7c5dc7b23b7
",
"reference": "
b4af43e7b7f3f7fac919ff475b29f7c5dc7b23b7
",
"url": "https://api.github.com/repos/stackphp/builder/zipball/
c1f8a4693b55c563405024f708a76ef576c3b276
",
"reference": "
c1f8a4693b55c563405024f708a76ef576c3b276
",
"shasum": ""
},
"require": {
...
...
@@ -2041,15 +2041,14 @@
"authors": [
{
"name": "Igor Wiedler",
"email": "igor@wiedler.ch",
"homepage": "http://wiedler.ch/igor/"
"email": "igor@wiedler.ch"
}
],
"description": "Builder for stack middlewares based on HttpKernelInterface.",
"keywords": [
"stack"
],
"time": "2014-
01-28 19:42:24
"
"time": "2014-
11-23 20:37:11
"
},
{
"name": "symfony-cmf/routing",
...
...
core/vendor/composer/installed.json
View file @
66b964dd
...
...
@@ -39,58 +39,6 @@
"psr-3"
]
},
{
"name"
:
"stack/builder"
,
"version"
:
"v1.0.2"
,
"version_normalized"
:
"1.0.2.0"
,
"source"
:
{
"type"
:
"git"
,
"url"
:
"https://github.com/stackphp/builder.git"
,
"reference"
:
"b4af43e7b7f3f7fac919ff475b29f7c5dc7b23b7"
},
"dist"
:
{
"type"
:
"zip"
,
"url"
:
"https://api.github.com/repos/stackphp/builder/zipball/b4af43e7b7f3f7fac919ff475b29f7c5dc7b23b7"
,
"reference"
:
"b4af43e7b7f3f7fac919ff475b29f7c5dc7b23b7"
,
"shasum"
:
""
},
"require"
:
{
"php"
:
">=5.3.0"
,
"symfony/http-foundation"
:
"~2.1"
,
"symfony/http-kernel"
:
"~2.1"
},
"require-dev"
:
{
"silex/silex"
:
"~1.0"
},
"time"
:
"2014-01-28 19:42:24"
,
"type"
:
"library"
,
"extra"
:
{
"branch-alias"
:
{
"dev-master"
:
"1.0-dev"
}
},
"installation-source"
:
"dist"
,
"autoload"
:
{
"psr-0"
:
{
"Stack"
:
"src"
}
},
"notification-url"
:
"https://packagist.org/downloads/"
,
"license"
:
[
"MIT"
],
"authors"
:
[
{
"name"
:
"Igor Wiedler"
,
"email"
:
"igor@wiedler.ch"
,
"homepage"
:
"http://wiedler.ch/igor/"
}
],
"description"
:
"Builder for stack middlewares based on HttpKernelInterface."
,
"keywords"
:
[
"stack"
]
},
{
"name"
:
"symfony-cmf/routing"
,
"version"
:
"1.3.0"
,
...
...
@@ -3484,5 +3432,56 @@
],
"description"
:
"Library that helps with managing the version number of Git-hosted PHP projects"
,
"homepage"
:
"https://github.com/sebastianbergmann/version"
},
{
"name"
:
"stack/builder"
,
"version"
:
"v1.0.3"
,
"version_normalized"
:
"1.0.3.0"
,
"source"
:
{
"type"
:
"git"
,
"url"
:
"https://github.com/stackphp/builder.git"
,
"reference"
:
"c1f8a4693b55c563405024f708a76ef576c3b276"
},
"dist"
:
{
"type"
:
"zip"
,
"url"
:
"https://api.github.com/repos/stackphp/builder/zipball/c1f8a4693b55c563405024f708a76ef576c3b276"
,
"reference"
:
"c1f8a4693b55c563405024f708a76ef576c3b276"
,
"shasum"
:
""
},
"require"
:
{
"php"
:
">=5.3.0"
,
"symfony/http-foundation"
:
"~2.1"
,
"symfony/http-kernel"
:
"~2.1"
},
"require-dev"
:
{
"silex/silex"
:
"~1.0"
},
"time"
:
"2014-11-23 20:37:11"
,
"type"
:
"library"
,
"extra"
:
{
"branch-alias"
:
{
"dev-master"
:
"1.0-dev"
}
},
"installation-source"
:
"dist"
,
"autoload"
:
{
"psr-0"
:
{
"Stack"
:
"src"
}
},
"notification-url"
:
"https://packagist.org/downloads/"
,
"license"
:
[
"MIT"
],
"authors"
:
[
{
"name"
:
"Igor Wiedler"
,
"email"
:
"igor@wiedler.ch"
}
],
"description"
:
"Builder for stack middlewares based on HttpKernelInterface."
,
"keywords"
:
[
"stack"
]
}
]
core/vendor/stack/builder/.gitignore
0 → 100644
View file @
66b964dd
vendor
core/vendor/stack/builder/.travis.yml
View file @
66b964dd
...
...
@@ -5,6 +5,7 @@ php:
-
5.3
-
5.4
-
5.5
-
5.6
-
hhvm
before_script
:
...
...
core/vendor/stack/builder/CHANGELOG.md
View file @
66b964dd
CHANGELOG
=========
*
1.0.2 (2014-xx-xx)
*
1.0.3 (2014-11-23)
*
Only call Terminable middlewares once.
*
1.0.2 (2014-05-18)
*
Validate missing arguments (@bajbnet).
...
...
core/vendor/stack/builder/src/Stack/StackedHttpKernel.php
View file @
66b964dd
...
...
@@ -25,10 +25,13 @@ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQ
public
function
terminate
(
Request
$request
,
Response
$response
)
{
$prevKernel
=
null
;
foreach
(
$this
->
middlewares
as
$kernel
)
{
if
(
$kernel
instanceof
TerminableInterface
)
{
// if prev kernel was terminable we can assume this middleware has already been called
if
(
!
$prevKernel
instanceof
TerminableInterface
&&
$kernel
instanceof
TerminableInterface
)
{
$kernel
->
terminate
(
$request
,
$response
);
}
$prevKernel
=
$kernel
;
}
}
}
core/vendor/stack/builder/tests/unit/Stack/StackedHttpKernelTest.php
View file @
66b964dd
...
...
@@ -25,9 +25,9 @@ public function handleShouldDelegateToApp()
public
function
handleShouldStillDelegateToAppWithMiddlewares
()
{
$app
=
$this
->
getHttpKernelMock
(
new
Response
(
'ok'
));
$foo
=
$this
->
getHttpKernelMock
(
new
Response
(
'foo'
));
$bar
=
$this
->
getHttpKernelMock
(
new
Response
(
'bar'
));
$kernel
=
new
StackedHttpKernel
(
$app
,
array
(
$app
,
$foo
,
$bar
));
$foo
=
$this
->
getHttpKernelMock
(
new
Response
(
'foo'
));
$kernel
=
new
StackedHttpKernel
(
$app
,
array
(
$foo
,
$bar
,
$app
));
$request
=
Request
::
create
(
'/'
);
$response
=
$kernel
->
handle
(
$request
);
...
...
@@ -38,14 +38,28 @@ public function handleShouldStillDelegateToAppWithMiddlewares()
/** @test */
public
function
terminateShouldDelegateToMiddlewares
()
{
$app
=
$this
->
getTerminableMock
(
new
Response
(
'ok'
));
$foo
=
$this
->
getTerminableMock
();
$bar
=
$this
->
getTerminableMock
();
$kernel
=
new
StackedHttpKernel
(
$app
,
array
(
$app
,
$foo
,
$bar
));
$first
=
new
TerminableKernelSpy
();
$second
=
new
TerminableKernelSpy
(
$first
);
$third
=
new
KernelSpy
(
$second
);
$fourth
=
new
TerminableKernelSpy
(
$third
);
$fifth
=
new
TerminableKernelSpy
(
$fourth
);
$kernel
=
new
StackedHttpKernel
(
$fifth
,
$middlewares
=
array
(
$fifth
,
$fourth
,
$third
,
$second
,
$first
));
$request
=
Request
::
create
(
'/'
);
$response
=
$kernel
->
handle
(
$request
);
$kernel
->
terminate
(
$request
,
$response
);
$this
->
assertTerminablesCalledOnce
(
$middlewares
);
}
private
function
assertTerminablesCalledOnce
(
array
$middlewares
)
{
foreach
(
$middlewares
as
$kernel
)
{
if
(
$kernel
instanceof
TerminableInterface
)
{
$this
->
assertEquals
(
1
,
$kernel
->
terminateCallCount
(),
"Terminate was called
{
$kernel
->
terminateCallCount
()
}
times"
);
}
}
}
private
function
getHttpKernelMock
(
Response
$response
)
...
...
@@ -77,4 +91,65 @@ private function getTerminableMock(Response $response = null)
return
$app
;
}
private
function
getDelegatingTerminableMock
(
TerminableInterface
$next
)
{
$app
=
$this
->
getMock
(
'Stack\TerminableHttpKernel'
);
$app
->
expects
(
$this
->
once
())
->
method
(
'terminate'
)
->
with
(
$this
->
isInstanceOf
(
'Symfony\Component\HttpFoundation\Request'
),
$this
->
isInstanceOf
(
'Symfony\Component\HttpFoundation\Response'
)
)
->
will
(
$this
->
returnCallback
(
function
(
$request
,
$response
)
use
(
$next
)
{
$next
->
terminate
(
$request
,
$response
);
}));
return
$app
;
}
}
class
KernelSpy
implements
HttpKernelInterface
{
private
$handleCallCount
=
0
;
public
function
__construct
(
HttpKernelInterface
$kernel
=
null
)
{
$this
->
kernel
=
$kernel
;
}
public
function
handle
(
Request
$request
,
$type
=
HttpKernelInterface
::
MASTER_REQUEST
,
$catch
=
true
)
{
$this
->
handleCallCount
++
;
if
(
$this
->
kernel
)
{
return
$this
->
kernel
->
handle
(
$request
,
$type
,
$catch
);
}
return
new
Response
(
'OK'
);
}
public
function
handleCallCount
()
{
return
$this
->
handleCallCount
;
}
}
class
TerminableKernelSpy
extends
KernelSpy
implements
TerminableInterface
{
private
$terminateCallCount
=
0
;
public
function
terminate
(
Request
$request
,
Response
$response
)
{
$this
->
terminateCallCount
++
;
if
(
$this
->
kernel
&&
$this
->
kernel
instanceof
TerminableInterface
)
{
return
$this
->
kernel
->
terminate
(
$request
,
$response
);
}
}
public
function
terminateCallCount
()
{
return
$this
->
terminateCallCount
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment