2

我正在使用 Zend Framework 2 并安装了模块 ZfcUser。

一切正常,直到我决定在我的config/autoload/global.php

<?php
return array(
  'db' => array(
    'adapters' => array(
      'cleardb' => array(
        'driver'         => 'Pdo',
        'dsn'            => 'mysql:dbname=secret;host=secret.com',
        'driver_options' => array(
          ...
        ),
      ),
      'other' => array(...)
    )
  ),
  'service_manager' => array(
    'abstract_factories' => array(
      'Zend\Db\Adapter\AdapterAbstract'
      => 'Zend\Db\Adapter\AdapterAbstractServiceFactory',
    ),
  ),
);

现在,ZfcUser 找不到我的默认数据库适配器。

zfcuser.global.php我更新了这一行:

'zend_db_adapter' => 'cleardb'

这是我尝试登录时遇到的错误:

An alias "zfcuser_zend_db_adapter" was requested but no service could be found.

非常感谢您的帮助。

4

0 回答 0