首页 > 解决方案 > codeigniter 学说 getRepository() 在本地工作但不在服务器上

问题描述

我是用户 CodeIgniter 3 和 Doctrine2。现在,当我尝试查找记录时,它可以在我的本地服务器上运行,但在我的网络服务器上却没有;这是我的查找代码

$user = $this->em->getRepository('entities\AdminAuth')->findBy(array('username' => $data['username'], 'password' => $pwd));

它显示我的网络服务器上出现以下错误,

遇到未捕获的异常

类型:错误

消息:访问未声明的静态属性:Modules::$loader

文件名:/home/tiffintom/public_html/mgt/Master_Panel/application/third_party/Doctrine/Common/ClassLoader.php

行号:228

回溯:

文件:/home/tiffintom/public_html/mgt/Master_Panel/application/third_party/Doctrine/ORM/Mapping/ClassMetadataInfo.php 行:904 功能:classExists

文件:/home/tiffintom/public_html/mgt/Master_Panel/application/third_party/Doctrine/ORM/Mapping/ClassMetadataFactory.php 行:189 功能:validateAssociation

文件:/home/tiffintom/public_html/mgt/Master_Panel/application/third_party/Doctrine/ORM/Mapping/ClassMetadataFactory.php 行:171 功能:validateRuntimeMetadata

文件:/home/tiffintom/public_html/mgt/Master_Panel/application/third_party/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php 行:302 功能:doLoadMetadata

文件:/home/tiffintom/public_html/mgt/Master_Panel/application/third_party/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php 行:205 功能:loadMetadata

文件:/home/tiffintom/public_html/mgt/Master_Panel/application/third_party/Doctrine/ORM/EntityManager.php 行:268 功能:getMetadataFor

文件:/home/tiffintom/public_html/mgt/Master_Panel/application/third_party/Doctrine/ORM/EntityManager.php 行:682 功能:getClassMetadata

文件:/home/tiffintom/public_html/mgt/Master_Panel/application/modules/admin/controllers/Authentication.php 行:21 功能:getRepository

文件:/home/tiffintom/public_html/mgt/Master_Panel/index.php 行:322 功能:require_once**

请帮我

标签: phpcodeigniterdoctrine-ormcodeigniter-3

解决方案


教义类加载器的版本正在发生这种情况。我使用了以前项目中的旧版本 classLoader,这就是它显示错误的原因。


推荐阅读