CakePHP find返回包含缺少字段的结果 [英] CakePHP find returns results with missing fields

查看:245
本文介绍了CakePHP find返回包含缺少字段的结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要获取我的用户信息,当我调用

I need to get my User info and when I call

$ this - > User-> find('first',array('conditions'=> array('User.id'=> $ user_id)));

结果只包含一些字段。

我目前已更新数据库模式。在dev服务器上运行正常,并返回所有字段,但在生产服务器上缺少这些新字段。

I've currently updated database schema. On dev server it runs fine and returns all fields but on the production server those new fields are missing. Those servers have exactly the same configuration.

我已经尝试删除 app / tmp / cache / models 我使用 File 引擎进行缓存。

I've already tried to remove contents of app/tmp/cache/models and I am using File engine for caching.

schema.php 文件是最新的, app / tmp / cache / models 中的文件内容表明这些字段存在,但我无法在生产服务器上检索它们。唯一的区别可能是数据库和调试级别。我试过复制数据库,并使用它与开发服务器和工作得很好。

The schema.php file is up to date, the contents of files in app/tmp/cache/models indicate that those fields are present but I have not been able to retreive them on the production server. The only difference perhaps is database and debug level. I've tried copying the database and using it with the dev server and that worked well.

我不能在生产服务器上显然设置调试为2。

I cannot obviously set debug to 2 on the production server.

您有任何人遇到类似的行为吗?

Did anyone of you experience any sort of similar behavior?

PS我使用的是Cake 2.3.3

PS I am using Cake 2.3.3

推荐答案

答案其实很简单。我不得不删除 app / tmp / models 的内容,但实际上它的工作是删除的内容 app / tmp /持久

The answer was actually pretty simple. I had to remove not just the contents of app/tmp/models, but what actually made it work was removing of the contents of app/tmp/persistent.

这篇关于CakePHP find返回包含缺少字段的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆