我想安装一个测验包(from this link),所以我在composer.json文件中添加了这个包作为依赖项
像这样: "require": {
"php": ">=5.3.9",
//...
"lms42/quiz-bundle":"dev-master"
},
然后我在命令行中运行composer update
命令
在安装说明之后,为了完成此捆绑包的安装:
1 /我应该在autoload.php中注册命名空间 像这样:
$loader->registerNamespaces(array(
...
'Smirik' => __DIR__.'/../vendor/bundles',
));
但是当我打开app / autoload.php时,我发现它就像这样
<?php
use Doctrine\Common\Annotations\AnnotationRegistry;
use Composer\Autoload\ClassLoader;
/**
* @var ClassLoader $loader
*/
$loader = require __DIR__.'/../vendor/autoload.php';
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
return $loader;
2 /我应该将此代码添加到config.yml
fos_user:
db_driver: orm # other valid values are 'mongodb', 'couchdb'
firewall_name: main
user_class: Smirik\QuizBundle\Entity\User
group:
group_class: Smirik\QuizBundle\Entity\Group
...
twig:
debug: %kernel.debug%
strict_variables: %kernel.debug%
form:
resources:
- 'SmirikQuizBundle:Form:fields.html.twig'
但在我的app / config / config.yml文件中,我有这个:
fos_user:
db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel'
firewall_name: main
user_class: UsersBundle\Entity\User
service:
user_manager: pugx_user_manager
registration:
confirmation:
enabled: true
from_email:
address: noreply@openagency.org
sender_name: Demo App
//...
twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"