我想通过 Composer 安装以下插件和助手:
https://github.com/cakephp/debug_kit
https://github.com/loadsys/twitter-bootstrap-helper
这是我的composer.json:
{
"repositories": [
{
"type": "package",
"package": {
"name": "cakephp/debug_kit",
"version": "2.0",
"source": {
"url": "https://github.com/cakephp/debug_kit",
"type": "git",
"reference": "origin/2.0"
}
}
},
{
"type": "package",
"package": {
"name": "loadsys/twitter-bootstrap-helper",
"version": "2.1",
"source": {
"url": "https://github.com/loadsys/twitter-bootstrap-helper",
"type": "git",
"reference": "origin/2.1"
}
}
}
],
"require": {
"loadsys/twitter-bootstrap-helper": "2.1.*",
"cakephp/debug_kit": "2.0"
},
"config": {
"vendor-dir": "Vendor/"
},
"autoload": {
"psr-0": {
"DebugKit": "/cakephp/debug_kit/",
"TwitterBootstrap" : "/loadsys/twitter-bootstrap-helper"
}
}
}
软件包已成功安装在 Vendor/cakephp/debug_kit 和 Vendor/loadsys/twitter-bootstrap-helper
我的问题在于如何在 CakePHP 中加载它们。我的 bootstrap.php 中有以下内容:
require APP . 'Vendor/autoload.php';
当我在要求自动加载后尝试加载插件时:
CakePlugin::load('DebugKit');
找不到。在我的 AppController.php 中加载帮助程序的结果类似
public $helpers = array('TiwtterBootstrap');
我是 Composer 的新手,可能会遗漏一些简单的东西,或者只是不了解如何从 Vendors 文件夹中正确加载它们。