私は Cakephp 3.0.x-dev を使用しており、プラグイン Cakephp-imagine-plugin ( https://github.com/burzum/cakephp-imagine-plugin/tree/3.0 ) を使用したいと考えています。
このプラグインを使用すると、cakephp ビューで次のエラーが表示されます
エラー: Imagick がインストールされていません
私のコントローラーは次のようになります
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);
}
}
php composer.phar のおかげでプラグイン ビューをインストールしました。composer.json ファイルは次のようになります。
{
"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
}
プラグインは vendor/imagine/imagine/ にインストールされました
何が間違っているのかわかりません。それまで作曲家を使ったことはありません。だから私は composer.json ファイルに何を書いたのか分かりません。誰かが私を助けることができますか?
よろしく、
スヌーピー