Skip to content
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

Added a configuration option for the data root. #46

Merged
merged 1 commit into from
Jan 17, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public function getConfigTreeBuilder()
->end()
->end()
->scalarNode('web_root')->defaultValue('%kernel.root_dir%/../web')->end()
->scalarNode('data_root')->defaultValue('%liip_imagine.web_root%')->end()
->scalarNode('cache_prefix')->defaultValue('/media/cache')->end()
->scalarNode('cache')->defaultValue('web_path')->end()
->scalarNode('data_loader')->defaultValue('filesystem')->end()
Expand Down
1 change: 1 addition & 0 deletions DependencyInjection/LiipImagineExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public function load(array $configs, ContainerBuilder $container)
$cachePrefix = $config['cache_prefix'] ? '/'.trim($config['cache_prefix'], '/') : '';
$container->setParameter('liip_imagine.cache_prefix', $cachePrefix);
$container->setParameter('liip_imagine.web_root', $config['web_root']);
$container->setParameter('liip_imagine.data_root', $config['data_root']);
$container->setParameter('liip_imagine.formats', $config['formats']);
$container->setParameter('liip_imagine.cache.resolver.default', $config['cache']);

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ The default configuration for the bundle looks like this:
``` yaml
liip_imagine:
web_root: %kernel.root_dir%/../web
data_root: %liip_imagine.web_root%
cache_prefix: /media/cache
cache: true
data_loader: ~
Expand All @@ -183,6 +184,11 @@ There are several configuration options available:

default: `%kernel.root_dir%/../web`

- `data_root` - the absolute path to the location that original files should
be sourced from. This option only changes the standard filesystem loader.

default: `%kernel.root_dir%/../web`

- `cache_prefix` - this is also used in the path for image generation, so
as to not clutter your web root with cached images. For example by default,
the images would be written to the `web/media/cache/` directory.
Expand Down
2 changes: 1 addition & 1 deletion Resources/config/imagine.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
<tag name="liip_imagine.data.loader" loader="filesystem" />
<argument type="service" id="liip_imagine" />
<argument>%liip_imagine.formats%</argument>
<argument>%liip_imagine.web_root%</argument>
<argument>%liip_imagine.data_root%</argument>
</service>

<!-- Cache resolver -->
Expand Down