-
Notifications
You must be signed in to change notification settings - Fork 84
Merge bundles #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge bundles #16
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<?php | ||
|
||
namespace Driebit\HttpCacheBundle; | ||
namespace FOS\HttpCacheBundle; | ||
|
||
use Driebit\HttpCacheBundle\HttpCache\HttpCacheInterface; | ||
use FOS\HttpCacheBundle\HttpCache\HttpCacheInterface; | ||
use Symfony\Component\Routing\RouterInterface; | ||
|
||
/** | ||
|
@@ -47,9 +47,9 @@ public function __construct(HttpCacheInterface $cache, RouterInterface $router) | |
* | ||
* @return $this | ||
*/ | ||
public function invalidatePath($path) | ||
public function invalidatePath($path, array $headers = array()) | ||
{ | ||
$this->invalidationQueue[$path] = $path; | ||
$this->invalidationQueue[$path] = $headers; | ||
|
||
return $this; | ||
} | ||
|
@@ -69,6 +69,19 @@ public function invalidateRoute($name, $parameters = array()) | |
return $this; | ||
} | ||
|
||
public function refreshPath($path, $headers) | ||
{ | ||
$headers = array("Cache-Control: no-cache, no-store, max-age=0, must-revalidate"); | ||
|
||
} | ||
|
||
|
||
|
||
public function invalidateRegex($regex) | ||
{ | ||
|
||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this looks incomplete. can you create an issue and a TODO with a link to the issue so we can keep track of this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
/** | ||
* Flush all paths queued for invalidation | ||
* | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,32 @@ | ||
<?php | ||
|
||
namespace Liip\CacheControlBundle\DependencyInjection; | ||
|
||
use Symfony\Component\Config\Definition\Processor, | ||
Symfony\Component\Config\FileLocator, | ||
Symfony\Component\HttpKernel\DependencyInjection\Extension, | ||
Symfony\Component\DependencyInjection\Loader\XmlFileLoader, | ||
Symfony\Component\DependencyInjection\ContainerBuilder, | ||
Symfony\Component\DependencyInjection\Reference, | ||
Symfony\Component\DependencyInjection\DefinitionDecorator, | ||
Symfony\Component\DependencyInjection\Exception\RuntimeException; | ||
|
||
class LiipCacheControlExtension extends Extension | ||
namespace FOS\HttpCacheBundle\DependencyInjection; | ||
|
||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\Config\FileLocator; | ||
use Symfony\Component\DependencyInjection\DefinitionDecorator; | ||
use Symfony\Component\DependencyInjection\Reference; | ||
use Symfony\Component\HttpKernel\DependencyInjection\Extension; | ||
use Symfony\Component\DependencyInjection\Loader; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we just have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep. |
||
class FOSHttpCacheExtension extends Extension | ||
{ | ||
/** | ||
* Loads the services based on your application configuration. | ||
* | ||
* @param array $configs | ||
* @param ContainerBuilder $container | ||
* {@inheritDoc} | ||
*/ | ||
public function load(array $configs, ContainerBuilder $container) | ||
{ | ||
$processor = new Processor(); | ||
$configuration = new Configuration(); | ||
$config = $processor->processConfiguration($configuration, $configs); | ||
$config = $this->processConfiguration($configuration, $configs); | ||
|
||
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); | ||
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); | ||
$loader->load('services.xml'); | ||
|
||
$container->setParameter($this->getAlias().'.debug', $config['debug']); | ||
$container->setParameter($this->getAlias().'.invalidators', $config['invalidators']); | ||
|
||
if (!empty($config['rules'])) { | ||
$loader->load('rule_response_listener.xml'); | ||
|
@@ -61,21 +60,10 @@ public function load(array $configs, ContainerBuilder $container) | |
} | ||
} | ||
|
||
if (!empty($config['varnish'])) { | ||
|
||
if (!extension_loaded('curl')) { | ||
throw new RuntimeException('Varnish Helper requires cUrl php extension. Please install it to continue'); | ||
|
||
} | ||
|
||
// domain is depreciated and will be removed in future | ||
$host = is_null($config['varnish']['host']) && $config['varnish']['domain'] ? $config['varnish']['domain'] : $config['varnish']['host']; | ||
|
||
$loader->load('varnish_helper.xml'); | ||
if (isset($config['varnish'])) { | ||
$loader->load('varnish.xml'); | ||
$container->setParameter($this->getAlias().'.varnish.ips', $config['varnish']['ips']); | ||
$container->setParameter($this->getAlias().'.varnish.host', $host); | ||
$container->setParameter($this->getAlias().'.varnish.port', $config['varnish']['port']); | ||
$container->setParameter($this->getAlias().'.varnish.purge_instruction', $config['varnish']['purge_instruction']); | ||
$container->setParameter($this->getAlias().'.varnish.host', $config['varnish']['host']); | ||
} | ||
|
||
if ($config['authorization_listener']) { | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
namespace FOS\HttpCacheBundle; | ||
|
||
use Symfony\Component\HttpKernel\Bundle\Bundle; | ||
|
||
class FOSHttpCacheBundle extends Bundle | ||
{ | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
symfony 2.4 is out, so that should be in this list too.
do we still care about symfony < 2.3? i would suggest to ditch those, they are EOL and people still on symfony 2.1/2.2 can use the old LiipCacheControlBundle which will remain available for legacy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.