php - 自动加载器类 "Zend\Loader\ClassMapAutoLoader"未加载

标签 php zend-framework2 autoloader

我正在使用 PHP 5.5.12 编写 Zend Framework 2.3.1 应用程序

我的应用程序包含多个模块,并且在每个模块的 Module.php 中我都有

public function getAutoloaderConfig()
{
    return array(
        'Zend\Loader\ClassMapAutoLoader' => array(
            __DIR__ . '/autoload_classmap.php'
        ),
        'Zend\Loader\StandardAutoloader' => array(
            'namespaces' => array(
                __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
            ),
        ),
    );
}

这是我看到的与 ClassMapAutoLoader 相关的唯一迹象。

当我尝试运行应用程序时,我得到:

Fatal error: Uncaught exception 'Zend\Loader\Exception\InvalidArgumentException' with message 'Autoloader class "Zend\Loader\ClassMapAutoLoader" not loaded' in /mnt/storage/home/ufk/work-projects/global-logic/project/xpogames/vendor/zendframework/zendframework/library/Zend/Loader/AutoloaderFactory.php on line 85

有什么想法吗?

最佳答案

我遇到了和你一样的问题,我找出了导致问题的原因:

'Zend\Loader\ClassMapAutoLoader' => array(
        __DIR__ . '/autoload_classmap.php'
    ),

需要:

'Zend\Loader\ClassMapAutoloader' => array(
        __DIR__ . '/autoload_classmap.php'
    ),

自动加载器中的小L。我们都在不该这么做的时候陷入了困境。这为我澄清了。让我知道它是否适合您。

关于php - 自动加载器类 "Zend\Loader\ClassMapAutoLoader"未加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23721178/

相关文章:

php - ChargeBee - PHP 创建订阅中断 PHP 加载页面

php - yii2: Unable to determine the entry script file path - 将PHP服务器环境从cgi改为cli

php - 从 PHP 调用时 pip 包导入失败

zend-framework2 - ZF2 翻译

zend-framework2 - 有没有关于 Zend Framework 2 如何组合在一起的高级解释?

javascript - Zend2 导航删除 "href"

php - 限制我的 spl_autoloader 只加载我的命名空间中的类?

php - $data=mysqli_fetch_array($result) 不起作用

ruby-on-rails-3 - 如何自动加载 Rails 应用程序根目录下的文件夹中的文件

php - Laravel 路由缓存