2

我正在尝试在 Symfony 2.1 上安装 PropelBundle 分支 1.1。我按照手动安装的说明进行操作,但不确定在哪里注册命名空间。

现在我收到此错误消息:Fatal error: Class 'Propel\PropelBundle\PropelBundle' not found in D:\www-files\Symfony\app\AppKernel.php on line 22

第 22 行如下所示:new Propel\PropelBundle\PropelBundle()

我的 autoload.php 看起来像这样:

use Doctrine\Common\Annotations\AnnotationRegistry;

$loader = require __DIR__.'/../vendor/autoload.php';

// intl
if (!function_exists('intl_get_error_code')) {
    require_once __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';

    $loader->add('', __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs');
}

AnnotationRegistry::registerLoader(array($loader, 'loadClass'));

return $loader;

我应该在 autoload.php 中添加一些东西吗?

4

1 回答 1

2

在 composer.json 中添加以下内容

"require" :  {
   .....
    "propel/propel-bundle" :  "1.1.*" 
} , 

并运行

php composer.phar update propel/propel-bundle

该教程是 http://www.mon-code.net/article/45/initialisation-dun-projet-symfony-2-1-avec-un-depot-git-et-composer

于 2012-12-20T06:34:28.803 回答