Skip to content

Commit

Permalink
officially forked AvalancheImagineBundle to LiipImagineBundle
Browse files Browse the repository at this point in the history
  • Loading branch information
lsmith77 committed Oct 4, 2011
1 parent b3ac477 commit ae1c569
Show file tree
Hide file tree
Showing 20 changed files with 75 additions and 69 deletions.
20 changes: 10 additions & 10 deletions Controller/ImagineController.php
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
<?php

namespace Avalanche\Bundle\ImagineBundle\Controller;
namespace Liip\ImagineBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Avalanche\Bundle\ImagineBundle\Imagine\CachePathResolver;
use Avalanche\Bundle\ImagineBundle\Imagine\DataLoader\LoaderInterface;
use Avalanche\Bundle\ImagineBundle\Imagine\Filter\FilterManager;
use Liip\ImagineBundle\Imagine\CachePathResolver;
use Liip\ImagineBundle\Imagine\DataLoader\LoaderInterface;
use Liip\ImagineBundle\Imagine\Filter\FilterManager;

class ImagineController
{
/**
* @var Avalanche\Bundle\ImagineBundle\Imagine\DataLoader\LoaderInterface
* @var Liip\ImagineBundle\Imagine\DataLoader\LoaderInterface
*/
private $dataLoader;

/**
* @var Avalanche\Bundle\ImagineBundle\Imagine\Filter\FilterManager
* @var Liip\ImagineBundle\Imagine\Filter\FilterManager
*/
private $filterManager;

/**
* @var Avalanche\Bundle\ImagineBundle\Imagine\CachePathResolver
* @var Liip\ImagineBundle\Imagine\CachePathResolver
*/
private $cachePathResolver;

/**
* Constructor
*
* @param Avalanche\Bundle\ImagineBundle\Imagine\DataLoader\LoaderInterface $dataLoader
* @param Avalanche\Bundle\ImagineBundle\Imagine\Filter\FilterManager $filterManager
* @param Avalanche\Bundle\ImagineBundle\Imagine\CachePathResolver $cachePathResolver
* @param Liip\ImagineBundle\Imagine\DataLoader\LoaderInterface $dataLoader
* @param Liip\ImagineBundle\Imagine\Filter\FilterManager $filterManager
* @param Liip\ImagineBundle\Imagine\CachePathResolver $cachePathResolver
*/
public function __construct(LoaderInterface $dataLoader, FilterManager $filterManager, CachePathResolver $cachePathResolver = null)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Avalanche\Bundle\ImagineBundle\DependencyInjection\Compiler;
namespace Liip\ImagineBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand Down
2 changes: 1 addition & 1 deletion DependencyInjection/Compiler/LoadersCompilerPass.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Avalanche\Bundle\ImagineBundle\DependencyInjection\Compiler;
namespace Liip\ImagineBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand Down
4 changes: 2 additions & 2 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Avalanche\Bundle\ImagineBundle\DependencyInjection;
namespace Liip\ImagineBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder,
Symfony\Component\Config\Definition\ConfigurationInterface;
Expand All @@ -15,7 +15,7 @@ class Configuration implements ConfigurationInterface
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('avalanche_imagine', 'array');
$rootNode = $treeBuilder->root('liip_imagine', 'array');

$rootNode
->fixXmlConfig('format', 'formats')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Avalanche\Bundle\ImagineBundle\DependencyInjection;
namespace Liip\ImagineBundle\DependencyInjection;

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\Alias;
Expand All @@ -9,7 +9,7 @@
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Reference;

class AvalancheImagineExtension extends Extension
class LiipImagineExtension extends Extension
{
/**
* @see Symfony\Component\DependencyInjection\Extension.ExtensionInterface::load()
Expand Down
2 changes: 1 addition & 1 deletion Imagine/CachePathResolver.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Avalanche\Bundle\ImagineBundle\Imagine;
namespace Liip\ImagineBundle\Imagine;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
Expand Down
2 changes: 1 addition & 1 deletion Imagine/DataLoader/FileSystemLoader.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Avalanche\Bundle\ImagineBundle\Imagine\DataLoader;
namespace Liip\ImagineBundle\Imagine\DataLoader;

use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

Expand Down
2 changes: 1 addition & 1 deletion Imagine/DataLoader/LoaderInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Avalanche\Bundle\ImagineBundle\Imagine\DataLoader;
namespace Liip\ImagineBundle\Imagine\DataLoader;

interface LoaderInterface
{
Expand Down
4 changes: 2 additions & 2 deletions Imagine/Filter/FilterManager.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace Avalanche\Bundle\ImagineBundle\Imagine\Filter;
namespace Liip\ImagineBundle\Imagine\Filter;

use Avalanche\Bundle\ImagineBundle\Imagine\Filter\Loader\LoaderInterface;
use Liip\ImagineBundle\Imagine\Filter\Loader\LoaderInterface;

use Imagine\Exception\InvalidArgumentException;
use Imagine\Filter\FilterInterface;
Expand Down
2 changes: 1 addition & 1 deletion Imagine/Filter/Loader/LoaderInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Avalanche\Bundle\ImagineBundle\Imagine\Filter\Loader;
namespace Liip\ImagineBundle\Imagine\Filter\Loader;

use Imagine\Image\ImageInterface;

Expand Down
2 changes: 1 addition & 1 deletion Imagine/Filter/Loader/ThumbnailFilterLoader.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Avalanche\Bundle\ImagineBundle\Imagine\Filter\Loader;
namespace Liip\ImagineBundle\Imagine\Filter\Loader;

use Imagine\Image\Box;
use Imagine\Filter\Basic\Thumbnail;
Expand Down
6 changes: 3 additions & 3 deletions AvalancheImagineBundle.php → LiipImagineBundle.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace Avalanche\Bundle\ImagineBundle;
namespace Liip\ImagineBundle;

use Avalanche\Bundle\ImagineBundle\DependencyInjection\Compiler\LoadersCompilerPass;
use Liip\ImagineBundle\DependencyInjection\Compiler\LoadersCompilerPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;

class AvalancheImagineBundle extends Bundle
class LiipImagineBundle extends Bundle
{
/**
* @see Symfony\Component\HttpKernel\Bundle.Bundle::build()
Expand Down
40 changes: 23 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
AvalancheImagineBundle
======================
LiipImagineBundle
=================

This bundle provides easy image manipulation support for Symfony2. For example,
with this bundle, the following is possible:
This bundle is a fork of AvalancheImagineBundle which provides easy image
manipulation support for Symfony2. The goal of the fork is to make the
code more extensible and as a result applicable for more use cases.

For more details on the reason for the fork see:
https://github.com/avalanche123/AvalancheImagineBundle/pull/25

For example with this bundle the following is possible:

``` jinja
<img src="{{ '/relative/path/to/image.jpg' | apply_filter('thumbnail') }}" />
Expand All @@ -29,9 +35,9 @@ add the following entries to the `deps` in the root of your project file:
git=http://github.com/avalanche123/Imagine.git
target=imagine

[AvalancheImagineBundle]
git=http://github.com/avalanche123/AvalancheImagineBundle.git
target=bundles/Avalanche/Bundle/ImagineBundle
[LiipImagineBundle]
git=http://github.com/liip/LiipImagineBundle.git
target=bundles/Liip/ImagineBundle
```
**NOTE**: This location and syntax of the `deps` file changed after BETA4. If you're
Expand All @@ -49,17 +55,17 @@ Great! Now skip down to *Step 2*.
### Step 1 (alternative): Installation with submodules

If you're managing your vendor libraries with submodules, first create the
`vendor/bundles/Avalanche/Bundle` directory:
`vendor/bundles/Liip` directory:

``` bash
$ mkdir -pv vendor/bundles/Avalanche/Bundle
$ mkdir -pv vendor/bundles/Liip
```

Next, add the two necessary submodules:

``` bash
$ git submodule add git://github.com/avalanche123/Imagine.git vendor/imagine
$ git submodule add git://github.com/avalanche123/AvalancheImagineBundle.git vendor/bundles/Avalanche/Bundle/ImagineBundle
$ git submodule add git://github.com/liip/LiipImagineBundle.git vendor/bundles/Liip/ImagineBundle
```

### Step2: Configure the autoloader
Expand All @@ -73,8 +79,8 @@ Add the following entries to your autoloader:
$loader->registerNamespaces(array(
// ...

'Imagine' => __DIR__.'/../vendor/imagine/lib',
'Avalanche' => __DIR__.'/../vendor/bundles',
'Imagine' => __DIR__.'/../vendor/imagine/lib',
'Liip' => __DIR__.'/../vendor/bundles',
));
```

Expand All @@ -91,7 +97,7 @@ public function registerBundles()
$bundles = array(
// ...

new Avalanche\Bundle\ImagineBundle\AvalancheImagineBundle(),
new Liip\ImagineBundle\LiipImagineBundle(),
);
}
```
Expand Down Expand Up @@ -120,7 +126,7 @@ you want to thumbnail an image to a size of 120x90 pixels:
``` yaml
# app/config/config.yml

avalanche_imagine:
liip_imagine:
filters:
my_thumb:
type: thumbnail
Expand Down Expand Up @@ -154,7 +160,7 @@ would save the filtered image file.
The default configuration for the bundle looks like this:

``` yaml
avalanche_imagine:
liip_imagine:
web_root: %kernel.root_dir%/../web
cache_prefix: /media/cache
cache: true
Expand Down Expand Up @@ -223,7 +229,7 @@ The `mode` can be either `outbound` or `inset`.
The ImagineBundle allows you to load your own custom filter classes. The only
requirement is that each filter loader implement the following interface:

Avalanche\Bundle\ImagineBundle\Imagine\Filter\Loader\LoaderInterface
Liip\ImagineBundle\Imagine\Filter\Loader\LoaderInterface

To tell the bundle about your new filter loader, register it in the service
container and apply the following tag to it (example here in XML):
Expand All @@ -246,4 +252,4 @@ filters:
```

For an example of a filter loader implementation, refer to
`Avalanche\Bundle\ImagineBundle\Imagine\Filter\Loader\ThumbnailFilterLoader`.
`Liip\ImagineBundle\Imagine\Filter\Loader\ThumbnailFilterLoader`.
16 changes: 8 additions & 8 deletions Resources/config/imagine.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@

<!-- Utility classes -->

<parameter key="imagine.filter.manager.class">Avalanche\Bundle\ImagineBundle\Imagine\Filter\FilterManager</parameter>
<parameter key="imagine.cache.path.resolver.class">Avalanche\Bundle\ImagineBundle\Imagine\CachePathResolver</parameter>
<parameter key="imagine.loader.filesystem.class">Avalanche\Bundle\ImagineBundle\Imagine\DataLoader\FileSystemLoader</parameter>
<parameter key="imagine.filter.manager.class">Liip\ImagineBundle\Imagine\Filter\FilterManager</parameter>
<parameter key="imagine.cache.path.resolver.class">Liip\ImagineBundle\Imagine\CachePathResolver</parameter>
<parameter key="imagine.loader.filesystem.class">Liip\ImagineBundle\Imagine\DataLoader\FileSystemLoader</parameter>

<!-- Controller class -->

<parameter key="imagine.controller.class">Avalanche\Bundle\ImagineBundle\Controller\ImagineController</parameter>
<parameter key="imagine.controller.class">Liip\ImagineBundle\Controller\ImagineController</parameter>

<!-- Route loader class -->

<parameter key="imagine.routing.loader.class">Avalanche\Bundle\ImagineBundle\Routing\ImagineLoader</parameter>
<parameter key="imagine.routing.loader.class">Liip\ImagineBundle\Routing\ImagineLoader</parameter>

<!-- Templating classes -->

<parameter key="imagine.twig.extension.class">Avalanche\Bundle\ImagineBundle\Templating\ImagineExtension</parameter>
<parameter key="imagine.templating.helper.class">Avalanche\Bundle\ImagineBundle\Templating\Helper\ImagineHelper</parameter>
<parameter key="imagine.twig.extension.class">Liip\ImagineBundle\Templating\ImagineExtension</parameter>
<parameter key="imagine.templating.helper.class">Liip\ImagineBundle\Templating\Helper\ImagineHelper</parameter>

<!-- ImagineInterface implementations -->

Expand All @@ -32,7 +32,7 @@

<!-- Filter loaders' classes -->

<parameter key="imagine.filter.loader.thumbnail.class">Avalanche\Bundle\ImagineBundle\Imagine\Filter\Loader\ThumbnailFilterLoader</parameter>
<parameter key="imagine.filter.loader.thumbnail.class">Liip\ImagineBundle\Imagine\Filter\Loader\ThumbnailFilterLoader</parameter>

</parameters>

Expand Down
2 changes: 1 addition & 1 deletion Routing/ImagineLoader.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Avalanche\Bundle\ImagineBundle\Routing;
namespace Liip\ImagineBundle\Routing;

use Symfony\Component\Routing\Route;

Expand Down
8 changes: 4 additions & 4 deletions Templating/Helper/ImagineHelper.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<?php

namespace Avalanche\Bundle\ImagineBundle\Templating\Helper;
namespace Liip\ImagineBundle\Templating\Helper;

use Avalanche\Bundle\ImagineBundle\Imagine\CachePathResolver;
use Liip\ImagineBundle\Imagine\CachePathResolver;
use Symfony\Component\Templating\Helper\Helper;

class ImagineHelper extends Helper
{
/**
* @var Avalanche\Bundle\ImagineBundle\Imagine\CachePathResolver
* @var Liip\ImagineBundle\Imagine\CachePathResolver
*/
private $cachePathResolver;

/**
* Constructs by setting $cachePathResolver
*
* @param Avalanche\Bundle\ImagineBundle\Imagine\CachePathResolver $cachePathResolver
* @param Liip\ImagineBundle\Imagine\CachePathResolver $cachePathResolver
*/
public function __construct(CachePathResolver $cachePathResolver)
{
Expand Down
8 changes: 4 additions & 4 deletions Templating/ImagineExtension.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<?php

namespace Avalanche\Bundle\ImagineBundle\Templating;
namespace Liip\ImagineBundle\Templating;

use Avalanche\Bundle\ImagineBundle\Imagine\CachePathResolver;
use Liip\ImagineBundle\Imagine\CachePathResolver;
use Symfony\Component\HttpKernel\Util\Filesystem;

class ImagineExtension extends \Twig_Extension
{
/**
* @var Avalanche\Bundle\ImagineBundle\Imagine\CachePathResolver
* @var Liip\ImagineBundle\Imagine\CachePathResolver
*/
private $cachePathResolver;

/**
* Constructs by setting $cachePathResolver
*
* @param Avalanche\Bundle\ImagineBundle\Imagine\CachePathResolver $cachePathResolver
* @param Liip\ImagineBundle\Imagine\CachePathResolver $cachePathResolver
*/
public function __construct(CachePathResolver $cachePathResolver)
{
Expand Down
Loading

0 comments on commit ae1c569

Please sign in to comment.