Permalink
Browse files

Changes:

* Updated composer dependencies
* Added an Exception to be thrown when extension curl is not present.
* Updated README.md
  • Loading branch information...
1 parent 99787ad commit da79dd1807c55153e8f330e7b14653725fefa704 Jonathan Nonon committed Oct 8, 2012
Showing with 29 additions and 1 deletion.
  1. +7 −0 DependencyInjection/LiipCacheControlExtension.php
  2. +15 −0 DependencyNotMetException.php
  3. +1 −1 README.md
  4. +6 −0 composer.json
@@ -2,6 +2,8 @@
namespace Liip\CacheControlBundle\DependencyInjection;
+use Liip\CacheControlBundle\DependencyNotMetException;
+
use Symfony\Component\Config\Definition\Processor,
Symfony\Component\Config\FileLocator,
Symfony\Component\HttpKernel\DependencyInjection\Extension,
@@ -46,6 +48,11 @@ public function load(array $configs, ContainerBuilder $container)
}
if (!empty($config['varnish'])) {
+
+ if (!extension_loaded('curl')) {
+ throw new DependencyNotMetException('Varnish Helper requires cUrl php extension. Please install it to continue');
+ }
+
$loader->load('varnish_helper.xml');
$container->setParameter($this->getAlias().'.varnish.ips', $config['varnish']['ips']);
$container->setParameter($this->getAlias().'.varnish.domain', $config['varnish']['domain']);
@@ -0,0 +1,15 @@
+<?php
+namespace Liip\CacheControlBundle;
+
+/**
+ * Thrown when a bundle dependency is not met.
+ *
+ * @author jnonon <jnonon@github.com>
+ *
+ */
+use Exception;
+
+class DependencyNotMetException extends Exception
+{
+
+}
View
@@ -4,7 +4,7 @@ CacheControlBundle
This Bundle provides a way to set path based cache expiration headers via the app configuration and provides
a helper to control the reverse proxy varnish.
-This bundle works with Symfony 2.0 as well as the upcoming release 2.1.
+This bundle works with Symfony 2.0 and 2.1.
[![Build Status](https://secure.travis-ci.org/liip/LiipCacheControlBundle.png)](http://travis-ci.org/liip/LiipCacheControlBundle)
View
@@ -5,6 +5,9 @@
"keywords": ["esi", "varnish", "caching", "http"],
"license": "MIT",
"minimum-stability": "dev",
+ "require-dev": {
+ "ext-curl": "*"
+ },
"authors": [
{
"name": "Liip AG",
@@ -22,5 +25,8 @@
"autoload": {
"psr-0": { "Liip\\CacheControlBundle": "" }
},
+ "suggest": {
+ "ext-curl": "Used by Varnish Helper to construct requests. See http://www.php.net/manual/en/curl.installation.php"
+ },
"target-dir": "Liip/CacheControlBundle"
}

0 comments on commit da79dd1

Please sign in to comment.