I working with cakephp 3.0.x-dev and I would like to use the plugin cakephp-imagine-plugin ( https://github.com/burzum/cakephp-imagine-plugin/tree/3.0 ).
When I use this plugin I get the following error in my cakephp view
Error: Imagick not installed
My controller looks like
namespace App\Controller;
use App\Controller\AppController;
use Imagine\Imagick\Imagine;
class AccueilController extends AppController {
public function index() {
$directory = 'webroot'.DS.'img'.DS.'Carousel'.DS;
//get all image
$images = glob($directory . "*.{jpg,JPG,jpeg,JPEG,png,PNG}",GLOB_BRACE);
// resize image if necessary.. format(900x500)
$height = 500;
$width = 900;
foreach($images as $image)
{
$image = new Imagine();
//.. do some processing operation
}
// send data to the view
$this->set('images', $images);
}
}
I have installed the plugin view thanks to php composer.phar. The composer.json file looks like :
{
"name": "cakephp/app",
"description": "CakePHP skeleton app",
"homepage": "http://cakephp.org",
"type": "project",
"license": "MIT",
"require": {
"php": ">=5.4.16",
"cakephp/cakephp": "3.0.*-dev",
"composer/installers": "*",
"mobiledetect/mobiledetectlib": "2.*",
"cakephp/debug_kit": "3.0.*-dev",
"imagine/imagine": "*",
"composer/installers": "*"
},
"require-dev": {
"d11wtq/boris": "1.0.*"
},
"extra": {
"installer-name" : "Imagine"
},
"suggest": {
"phpunit/phpunit": "Allows automated tests to be run without system-wide install.",
"cakephp/cakephp-codesniffer": "Allows to check the code against the coding standards used in CakePHP."
},
"autoload": {
"psr-4": {
"App\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"App\\Test\\": "tests",
"Cake\\Test\\Fixture\\": "./vendor/cakephp/cakephp/tests/Fixture"
}
},
"scripts": {
"post-install-cmd": "App\\Console\\Installer::postInstall"
},
"config" : {
"bin-dir" : "bin"
},
"minimum-stability" : "dev",
"prefer-stable": true
}
The plugin was installed in vendor/imagine/imagine/
I don't know what I am doing wrong. I have never used composer before that. So I'm not sure what I have written in the composer.json file. Someone can help me ?
Regards,
Snoopy