New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maximum execution time exceeded $query->__debugInfo() in beforefind #7589
Comments
Just tried the same thing on Windows 7, xampp 3.2.1, Apache 2.4.16, php 5.6.12 here I am getting Allowed memory size error
|
AFAIK, you're not supposed to call Just use: See: http://php.net/manual/en/language.oop5.magic.php#object.debuginfo |
Ok, I have tried that as well - Thanks |
Can you raise the limit to 256+ MB just for trying to find out if that is just a lot of memory needed or some loop thing? |
Here are the results: I did both on windows 7 and Debian 8. I tried one by one by
|
Does it do this for any query, or only a specific one? What happens if you try something like |
I had tried for posts index action (btw I have only a few rows in posts table), just tried for posts view action as well, the same thing. Without
Btw, if I put e.g. |
So, just to make 100% I understand. You are only getting the max execution error if you |
Exactly, with PHP memory limit of
I am getting php error that maximum execution time was exceeded. However without |
I believe I know what's wrong. The ORM in CakePHP 3 is entirely lazily executed. This means that until the point where it is needed, basically is executed including One of the things that triggers Now, internally, CakePHP triggers the @lorenzo Would it be feasible to move https://github.com/cakephp/cakephp/blob/master/src/ORM/Query.php#L817a to above the event dispatch? I'm not sure if that would break anything else. |
It seems safe to move it there |
Will push a PR now. |
PR now open. |
I just changed in my local files to test. This commit dakota@ec6bec3 |
Hi,
When trying to get the information about the current query in
beforeFind
, similar to thisI am getting php error of maximum execution time to be exceeded. It is just a simple test application, nothing fancy: 2 tables (users and posts) baked with standard models, views and controllers. From components only
Auth
is loaded. There is no any other logic. All works fine, index of posts, adding, editing, deleting, but ASA I put that line inPostsTable.php => beforeFind
I get that execution time error. Same thing happens if I put$query->__toString()
. I think it is handy to get query's information in callback when making some changes, in cake 2.x$query
would contain that info and I had no issues debugging it.Debian 8.2, Apache/2.4.10, PHP 5.6.13, Cake 3.1.2
The text was updated successfully, but these errors were encountered: