Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
9cd048c7
Commit
9cd048c7
authored
Oct 30, 2013
by
Dave Marshall
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Default HttpCache debug option to that of
parent
87e0a836
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
src/Silex/Provider/HttpCacheServiceProvider.php
src/Silex/Provider/HttpCacheServiceProvider.php
+6
-0
tests/Silex/Tests/Provider/HttpCacheServiceProviderTest.php
tests/Silex/Tests/Provider/HttpCacheServiceProviderTest.php
+13
-0
No files found.
src/Silex/Provider/HttpCacheServiceProvider.php
View file @
9cd048c7
...
...
@@ -28,6 +28,12 @@ class HttpCacheServiceProvider implements ServiceProviderInterface
public
function
register
(
Application
$app
)
{
$app
[
'http_cache'
]
=
$app
->
share
(
function
(
$app
)
{
$app
[
'http_cache.options'
]
=
array_replace
(
array
(
'debug'
=>
$app
[
'debug'
],
),
$app
[
'http_cache.options'
]
);
return
new
HttpCache
(
$app
,
$app
[
'http_cache.store'
],
$app
[
'http_cache.esi'
],
$app
[
'http_cache.options'
]);
});
...
...
tests/Silex/Tests/Provider/HttpCacheServiceProviderTest.php
View file @
9cd048c7
...
...
@@ -57,6 +57,19 @@ class HttpCacheServiceProviderTest extends \PHPUnit_Framework_TestCase
$this
->
assertTrue
(
$finished
);
}
public
function
testDebugDefaultsToThatOfApp
()
{
$app
=
new
Application
();
$app
->
register
(
new
HttpCacheServiceProvider
(),
array
(
'http_cache.cache_dir'
=>
sys_get_temp_dir
()
.
'/silex_http_cache_'
.
uniqid
(),
));
$app
[
'debug'
]
=
true
;
$app
[
'http_cache'
];
$this
->
assertTrue
(
$app
[
'http_cache.options'
][
'debug'
]);
}
}
class
UnsendableResponse
extends
Response
...
...
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