如何安装测验包

时间:2016-07-27 04:19:55

标签: php symfony bundle

我想安装一个测验包(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;

问题1 /如何更改此文件以注册命名空间?

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%"

问题2 /我应该更改config.yml还是不?

0 个答案:

没有答案