【问题标题】:codeigniter doctrine getRepository() working on local but not on servercodeigniter 学说 getRepository() 在本地工作但不在服务器上
【发布时间】:2018-04-27 12:21:22
【问题描述】:

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

$user = $this->em->getRepository('entities\AdminAuth')->findBy( 大批( '用户名' => $data['用户名'], '密码' => $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 功能:验证关联

文件: /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**

请帮帮我

【问题讨论】:

  • 可能是因为服务器上的文件名区分大小写不匹配,请仔细检查您的文件名是否有大小写
  • 检查了..但还是不行

标签: php codeigniter doctrine-orm codeigniter-3


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-03-05
    • 2023-03-21
    • 1970-01-01
    • 1970-01-01
    • 2018-09-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多