From ae1c569c513109f80eee9ab7d7fd98e990918cc9 Mon Sep 17 00:00:00 2001 From: Lukas Kahwe Smith Date: Tue, 4 Oct 2011 23:39:00 +0200 Subject: [PATCH] officially forked AvalancheImagineBundle to LiipImagineBundle --- Controller/ImagineController.php | 20 +++++----- .../CreateCacheDirectoriesCompilerPass.php | 2 +- .../Compiler/LoadersCompilerPass.php | 2 +- DependencyInjection/Configuration.php | 4 +- ...Extension.php => LiipImagineExtension.php} | 4 +- Imagine/CachePathResolver.php | 2 +- Imagine/DataLoader/FileSystemLoader.php | 2 +- Imagine/DataLoader/LoaderInterface.php | 2 +- Imagine/Filter/FilterManager.php | 4 +- Imagine/Filter/Loader/LoaderInterface.php | 2 +- .../Filter/Loader/ThumbnailFilterLoader.php | 2 +- ...ImagineBundle.php => LiipImagineBundle.php | 6 +-- README.md | 40 +++++++++++-------- Resources/config/imagine.xml | 16 ++++---- Routing/ImagineLoader.php | 2 +- Templating/Helper/ImagineHelper.php | 8 ++-- Templating/ImagineExtension.php | 8 ++-- ...nTest.php => LiipImagineExtensionTest.php} | 12 +++--- Tests/bootstrap.php | 4 +- phpunit.xml.dist | 2 +- 20 files changed, 75 insertions(+), 69 deletions(-) rename DependencyInjection/{AvalancheImagineExtension.php => LiipImagineExtension.php} (94%) rename AvalancheImagineBundle.php => LiipImagineBundle.php (68%) rename Tests/DependencyInjection/{AvalancheImagineExtensionTest.php => LiipImagineExtensionTest.php} (92%) diff --git a/Controller/ImagineController.php b/Controller/ImagineController.php index 94f92aa7c..9eb7d9ff4 100644 --- a/Controller/ImagineController.php +++ b/Controller/ImagineController.php @@ -1,37 +1,37 @@ root('avalanche_imagine', 'array'); + $rootNode = $treeBuilder->root('liip_imagine', 'array'); $rootNode ->fixXmlConfig('format', 'formats') diff --git a/DependencyInjection/AvalancheImagineExtension.php b/DependencyInjection/LiipImagineExtension.php similarity index 94% rename from DependencyInjection/AvalancheImagineExtension.php rename to DependencyInjection/LiipImagineExtension.php index 542b225e5..720a6d538 100644 --- a/DependencyInjection/AvalancheImagineExtension.php +++ b/DependencyInjection/LiipImagineExtension.php @@ -1,6 +1,6 @@ @@ -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 @@ -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 @@ -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', )); ``` @@ -91,7 +97,7 @@ public function registerBundles() $bundles = array( // ... - new Avalanche\Bundle\ImagineBundle\AvalancheImagineBundle(), + new Liip\ImagineBundle\LiipImagineBundle(), ); } ``` @@ -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 @@ -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 @@ -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): @@ -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`. diff --git a/Resources/config/imagine.xml b/Resources/config/imagine.xml index 9a55f8b6f..4094ec9c5 100644 --- a/Resources/config/imagine.xml +++ b/Resources/config/imagine.xml @@ -7,22 +7,22 @@ - Avalanche\Bundle\ImagineBundle\Imagine\Filter\FilterManager - Avalanche\Bundle\ImagineBundle\Imagine\CachePathResolver - Avalanche\Bundle\ImagineBundle\Imagine\DataLoader\FileSystemLoader + Liip\ImagineBundle\Imagine\Filter\FilterManager + Liip\ImagineBundle\Imagine\CachePathResolver + Liip\ImagineBundle\Imagine\DataLoader\FileSystemLoader - Avalanche\Bundle\ImagineBundle\Controller\ImagineController + Liip\ImagineBundle\Controller\ImagineController - Avalanche\Bundle\ImagineBundle\Routing\ImagineLoader + Liip\ImagineBundle\Routing\ImagineLoader - Avalanche\Bundle\ImagineBundle\Templating\ImagineExtension - Avalanche\Bundle\ImagineBundle\Templating\Helper\ImagineHelper + Liip\ImagineBundle\Templating\ImagineExtension + Liip\ImagineBundle\Templating\Helper\ImagineHelper @@ -32,7 +32,7 @@ - Avalanche\Bundle\ImagineBundle\Imagine\Filter\Loader\ThumbnailFilterLoader + Liip\ImagineBundle\Imagine\Filter\Loader\ThumbnailFilterLoader diff --git a/Routing/ImagineLoader.php b/Routing/ImagineLoader.php index ab2fda7bd..1e9c15768 100644 --- a/Routing/ImagineLoader.php +++ b/Routing/ImagineLoader.php @@ -1,6 +1,6 @@ 'foo'); $loader->load(array($config), new ContainerBuilder()); } @@ -65,7 +65,7 @@ public function testLoad() protected function createEmptyConfiguration() { $this->containerBuilder = new ContainerBuilder(); - $loader = new AvalancheImagineExtension(); + $loader = new LiipImagineExtension(); $loader->load(array(array()), $this->containerBuilder); $this->assertTrue($this->containerBuilder instanceof ContainerBuilder); } @@ -76,7 +76,7 @@ protected function createEmptyConfiguration() protected function createFullConfiguration() { $this->containerBuilder = new ContainerBuilder(); - $loader = new AvalancheImagineExtension(); + $loader = new LiipImagineExtension(); $loader->load(array($this->getFullConfig()), $this->containerBuilder); $this->assertTrue($this->containerBuilder instanceof ContainerBuilder); } diff --git a/Tests/bootstrap.php b/Tests/bootstrap.php index b52ec5c1e..56c074c0e 100644 --- a/Tests/bootstrap.php +++ b/Tests/bootstrap.php @@ -2,8 +2,8 @@ spl_autoload_register(function($class) { $class = ltrim($class, '\\'); - if (0 === strpos($class, 'Avalanche\Bundle\ImagineBundle\\')) { - $file = __DIR__.'/../'.str_replace('\\', '/', substr($class, strlen('Avalanche\Bundle\ImagineBundle\\'))).'.php'; + if (0 === strpos($class, 'Liip\ImagineBundle\\')) { + $file = __DIR__.'/../'.str_replace('\\', '/', substr($class, strlen('Liip\ImagineBundle\\'))).'.php'; if (file_exists($file)) { require $file; } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 1380396d4..e13f96dc5 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -12,7 +12,7 @@ bootstrap="Tests/bootstrap.php" > - + ./Tests/