Php 在模块外部使用Zend类时找不到它们

Php 在模块外部使用Zend类时找不到它们,php,class,zend-framework,zend-framework2,Php,Class,Zend Framework,Zend Framework2,我有一个论坛,我已经把在公共目录,我想与网站和论坛的SSO。问题是,当我尝试使用Zend的AuthenticationService类获取用户会话时,会出现以下错误: 在C:\Users\Milen\Documents\site\public\forum\admin\sources\classes\session\ssPublicSessions.php中找不到类“Zend\Authentication\AuthenticationService” 我做错了什么? 守则: <?php u

我有一个论坛,我已经把在公共目录,我想与网站和论坛的SSO。问题是,当我尝试使用Zend的
AuthenticationService
类获取用户会话时,会出现以下错误:

在C:\Users\Milen\Documents\site\public\forum\admin\sources\classes\session\ssPublicSessions.php中找不到类“Zend\Authentication\AuthenticationService”

我做错了什么? 守则:

<?php

use Zend\Authentication\AuthenticationService;

class ssoPublicSessions extends publicSessions {
    public function __construct() {
        parent::__construct();

        if (self::$data_store['member_id'] OR $this->_member->is_not_human) {
            return;
        }

        $auth = new AuthenticationService();
        $member = $auth->getIdentity();

        if (!$member) {
            return;
        }

        self::setMember($member['member_id']);

        $this->_updateMemberSession();
        return;
    }
}

它应该如何找到类?这里需要更多的上下文。这门课的内容是什么?您是否已初始化ZF应用程序以设置自动加载?它是论坛应用程序中的一个sso文件,没有,我尚未初始化自动加载。没有自动加载?所以你的应用程序找不到该命名空间的文件。你需要设置一些自动加载。。。您是否在项目中使用
composer
?如果是这样,只需包含
/vendor/autoloader.php
文件,它就会启动(您可能需要通过放置