forked from liip/LiipImagineBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
94 changed files
with
5,896 additions
and
597 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
/phpunit.xml | ||
composer.lock | ||
composer.phar | ||
vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
language: php | ||
|
||
php: | ||
- 5.3 | ||
- 5.4 | ||
- 5.5 | ||
|
||
env: | ||
- SYMFONY_VERSION=2.0.* | ||
- SYMFONY_VERSION=2.1.* | ||
- SYMFONY_VERSION=2.2.* | ||
- SYMFONY_VERSION=2.3.* | ||
- SYMFONY_VERSION=dev-master | ||
|
||
before_script: | ||
- composer require symfony/framework-bundle:${SYMFONY_VERSION} --prefer-source | ||
- composer install --dev --prefer-source | ||
|
||
script: phpunit --coverage-text | ||
|
||
notifications: | ||
email: | ||
- [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Changelog | ||
========= | ||
|
||
* **2013-09-17**: [PHPCR loader] DoctrinePHPCRLoader is now deprecated, as the | ||
CmfMediaBundle provides a more reliable loader that is already provided as a | ||
service. See http://symfony.com/doc/master/cmf/bundles/media.html#liipimagine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
namespace Liip\ImagineBundle\Form\Type; | ||
|
||
use Symfony\Component\Form\AbstractType; | ||
use Symfony\Component\Form\FormInterface; | ||
use Symfony\Component\Form\FormView; | ||
|
||
use Symfony\Component\OptionsResolver\OptionsResolverInterface; | ||
|
||
/** | ||
* ImageType | ||
* | ||
* @author Emmanuel Vella <[email protected]> | ||
*/ | ||
class ImageType extends AbstractType | ||
{ | ||
public function buildView(FormView $view, FormInterface $form, array $options) | ||
{ | ||
$view->vars['image_path'] = $options['image_path']; | ||
$view->vars['image_filter'] = $options['image_filter']; | ||
$view->vars['image_attr'] = $options['image_attr']; | ||
$view->vars['link_url'] = $options['link_url']; | ||
$view->vars['link_filter'] = $options['link_filter']; | ||
$view->vars['link_attr'] = $options['link_attr']; | ||
} | ||
|
||
public function setDefaultOptions(OptionsResolverInterface $resolver) | ||
{ | ||
$resolver->setRequired(array( | ||
'image_path', | ||
'image_filter', | ||
)); | ||
|
||
$resolver->setDefaults(array( | ||
'image_attr' => array(), | ||
'link_url' => null, | ||
'link_filter' => null, | ||
'link_attr' => array(), | ||
)); | ||
} | ||
|
||
public function getParent() | ||
{ | ||
return 'file'; | ||
} | ||
|
||
public function getName() | ||
{ | ||
return 'liip_imagine_image'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace Liip\ImagineBundle\Imagine\Cache; | ||
|
||
use Symfony\Component\HttpKernel\CacheClearer\CacheClearerInterface; | ||
|
||
/** | ||
* Clears the Liip Imagine Bundle cache | ||
* | ||
* @author Josiah <[email protected]> | ||
*/ | ||
class CacheClearer implements CacheClearerInterface | ||
{ | ||
/** | ||
* @var CacheManager | ||
*/ | ||
protected $cacheManager; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $cachePrefix; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param CacheManager $cacheManager | ||
* @param string $cachePrefix The prefix applied to all cached images. | ||
*/ | ||
public function __construct(CacheManager $cacheManager, $cachePrefix) | ||
{ | ||
$this->cacheManager = $cacheManager; | ||
$this->cachePrefix = $cachePrefix; | ||
} | ||
|
||
/** | ||
* (non-PHPdoc) | ||
* @see Symfony\Component\HttpKernel\CacheClearer\CacheClearerInterface::clear() | ||
*/ | ||
public function clear($cacheDir) | ||
{ | ||
// $cacheDir contains the application cache, which we don't care about | ||
$this->cacheManager->clearResolversCache($this->cachePrefix); | ||
} | ||
} |
Oops, something went wrong.