php - 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**
请帮我
解决方案
教义类加载器的版本正在发生这种情况。我使用了以前项目中的旧版本 classLoader,这就是它显示错误的原因。
推荐阅读
- reactjs - 类型“{}”中缺少属性“className”,但类型“IPops”中是必需的
- android - 计算行程距离的解决方案
- excel - Excel 如何向我的 Delphi 应用程序发送通知?
- computer-vision - CNN如何减少参数和重用权重?
- python-3.x - 从 Detectron2 中提取对象特征
- prolog - Prolog 查询:加法对递归查询有何影响
- python-3.x - 异步和线程:为什么线程 ID 总是相同的?
- python - 尝试启动 Jupyter python 交互时 VSCode 抛出错误
- php - 使用 PHP 在 Google Drive API 中获取验证码的问题
- typescript - Type Guard 确保变量是 TypeScript 中的对象