Skip to content

Commit

Permalink
require LiipImagineBundle 1.9 and symfony 3
Browse files Browse the repository at this point in the history
  • Loading branch information
baltruschat committed May 14, 2018
1 parent a3e9c49 commit e440e51
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 26 deletions.
14 changes: 9 additions & 5 deletions Imagine/Cache/CacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use Liip\ImagineBundle\Imagine\Cache\CacheManager as BaseCacheManager;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;

class CacheManager extends BaseCacheManager implements ContainerAwareInterface
{
Expand Down Expand Up @@ -35,14 +36,16 @@ public function setContainer(ContainerInterface $container = null) {
* @param $newName
*/
public function getBrowserPathWithNewName($path, $filter, array $runtimeConfig = array(), $newName = 'null') {


$this->newName = $newName;
$result = $this->getBrowserPath($path, $filter, $runtimeConfig);
//prevent accidental multiple usages
$this->newName = null;
return $result;
}

public function getBrowserPath($path, $filter, array $runtimeConfig = array())
public function getBrowserPath($path, $filter, array $runtimeConfig = array(), $resolver = null)
{

$newPath = $path;
Expand Down Expand Up @@ -91,10 +94,12 @@ public function getBrowserPath($path, $filter, array $runtimeConfig = array())
$path = $this->resolve($rcPath, $filter);
}
} catch (\Exception $e) {
$path = null;
$path = $filter . ': ' . json_encode($runtimeConfig) . ': ' . $e->getMessage();
}

return $path;
} else {

return $this->generateUrl($path, $filter, $runtimeConfig, $this->newName);
}
}
Expand All @@ -113,13 +118,12 @@ public function generateUrl($path, $filter, array $runtimeConfig = array(), $new
} else {
$params['newName'] = 'null';
}

if (empty($runtimeConfig)) {
$filterUrl = $this->router->generate('liip_imagine_filter', $params, false);
$filterUrl = $this->router->generate('liip_imagine_filter', $params, UrlGeneratorInterface::ABSOLUTE_URL);
} else {
$params['filters'] = $runtimeConfig;
$params['hash'] = $this->signer->sign($path, $runtimeConfig);
$filterUrl = $this->router->generate('liip_imagine_filter_runtime', $params, false);
$filterUrl = $this->router->generate('liip_imagine_filter_runtime', $params, UrlGeneratorInterface::ABSOLUTE_URL);
}

return $filterUrl;
Expand Down
2 changes: 1 addition & 1 deletion Templating/ImagineExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(CacheManager $cacheManager)
public function getFilters()
{
return array(
'imagine_filter' => new \Twig_Filter_Method($this, 'filter'),
new \Twig_SimpleFilter('imagine_filter', [$this, 'filter']),
);
}

Expand Down
44 changes: 24 additions & 20 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
{
"name" : "braune-digital/imagine-bundle",
"description" : "Imagine bundle",
"type" : "symfony-bundle",
"authors" : [{
"name" : "Braune Digital GmbH",
"email" : "[email protected]"
}],
"keywords" : [
"imagine bundle"
],
"license" : [
"MIT"
],
"require" : {
"liip/imagine-bundle": "1.2.2"
},
"autoload" : {
"psr-4" : {
"BrauneDigital\\ImagineBundle\\" : ""
}
"name": "braune-digital/imagine-bundle",
"description": "Imagine bundle",
"type": "symfony-bundle",
"authors": [
{
"name": "Braune Digital GmbH",
"email": "[email protected]"
}
],
"keywords": [
"imagine bundle"
],
"license": [
"MIT"
],
"require": {
"php": "^5.3.9|^7.0",
"liip/imagine-bundle": "^1.9",
"symfony/symfony": "~2.3|~3.0"
},
"autoload": {
"psr-4": {
"BrauneDigital\\ImagineBundle\\": ""
}
}
}

0 comments on commit e440e51

Please sign in to comment.