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
3f2d55a7
Commit
3f2d55a7
authored
May 09, 2011
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added a run() method to HttpCache to mimic Application
parent
e7c74a64
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
4 deletions
+36
-4
doc/extensions/http_cache.rst
doc/extensions/http_cache.rst
+3
-3
src/Silex/Extension/HttpCacheExtension.php
src/Silex/Extension/HttpCacheExtension.php
+1
-1
src/Silex/HttpCache.php
src/Silex/HttpCache.php
+32
-0
No files found.
doc/extensions/http_cache.rst
View file @
3f2d55a7
...
...
@@ -40,9 +40,9 @@ setting Response HTTP cache headers::
});
This extension allows you to use the Symfony2 reverse proxy natively with
Silex applications by using the `http_cache` service
to handle the Request
::
Silex applications by using the `http_cache` service::
$app['http_cache']->
handle()->send
();
$app['http_cache']->
run
();
The extension also provide `ESI
<http:
//
www
.
doctrine-project
.
org
/
docs
/
dbal
/
2
.
0
/
en
/>
`_ support::
...
...
@@ -69,7 +69,7 @@ The extension also provide `ESI
));
});
$app['http_cache']->
handle()->send
();
$app['http_cache']->
run
();
For more information, consult the `Symfony2 HTTP Cache documentation
<http:
//
symfony
.
com
/
doc
/
current
/
book
/
http_cache
.
html
>
`_.
src/Silex/Extension/HttpCacheExtension.php
View file @
3f2d55a7
...
...
@@ -13,7 +13,7 @@ namespace Silex\Extension;
use
Silex\Application
;
use
Silex\ExtensionInterface
;
use
S
ymfony\Component\HttpKernel\HttpCache
\HttpCache
;
use
S
ilex
\HttpCache
;
use
Symfony\Component\HttpKernel\HttpCache\Esi
;
use
Symfony\Component\HttpKernel\HttpCache\Store
;
...
...
src/Silex/HttpCache.php
0 → 100644
View file @
3f2d55a7
<?php
/*
* This file is part of the Silex framework.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace
Silex
;
use
Symfony\Component\HttpKernel\HttpCache\HttpCache
as
BaseHttpCache
;
use
Symfony\Component\HttpFoundation\Request
;
/**
* HTTP Cache extension to allow using the run() shortcut.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class
HttpCache
extends
BaseHttpCache
{
public
function
run
(
Request
$request
=
null
)
{
if
(
null
===
$request
)
{
$request
=
Request
::
createFromGlobals
();
}
$this
->
handle
(
$request
)
->
send
();
}
}
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