debug_kit | Debug Toolbar for CakePHP applications | Web Framework library
kandi X-RAY | debug_kit Summary
kandi X-RAY | debug_kit Summary
DebugKit provides a debugging toolbar and enhanced debugging tools for CakePHP applications. It lets you quickly see configuration data, log messages, SQL queries, and timing data for your application.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of debug_kit
debug_kit Key Features
debug_kit Examples and Code Snippets
Community Discussions
Trending Discussions on debug_kit
QUESTION
I'm studying the way Debug Kit stores data. I would like to see the full JSON of the content field, but it's obviously not displaying it in full. When running
...ANSWER
Answered 2021-Dec-03 at 14:21Interestingly-enough I solved this by writing a small PHP program of the like of
QUESTION
I have an app in cakephp 3 which started to report open_basedir restriction in effect. File(/) is not within the allowed path(s)
a few weeks ago. I tried to debug it but I wasn't successful in finding the reason why. The app worked okay for like 2.5 years and it just started to appear now but without any changes of code parts which use caching or changing config. In config I have "path" set correctly for every cache mode. And it also is not from consistent url/method. It appears randomly in like less than 1% of calls now. It was more often the first week or so. Is there any way how to debug this and find the reason? Do you know any possible reason for this behavior? I have tried everything I could think of but without success.
Example of config:
...ANSWER
Answered 2021-Mar-08 at 15:51Thanks to @ndm I was able to find the reason of this behavior and a solution. It happens cause of traffic with certain conditions - Multiple requests put the file in delete queue and after the first request deletes the file others fail - getRealPath()
returns false
which is then appended with /
so the result path is /
.
Worst case scenario if no basedir restriction in place (quoted @ndm): all files that the webserver user has permission to delete in / (which usually should be none) would be deleted
Solution 1 (recommended): Update your Cake app with patch 3.9.7 or 4.2.4
Solution 2:
Manually fix the code to check that getRealPath()
does not return false
QUESTION
I'm trying to get an ajax request working in CakePHP4, but keep running into the CSRF protection.
In my controller:
...ANSWER
Answered 2020-Jun-19 at 09:47As can be seen in the stacktrace, the error stems from the form protection component, not the security component, so unlocking actions on the security component won't do anything.
The security component is deprecated (the Cookbook doesn't seem to mention that), and the form protection component is one of the utilities that are ment to replace it (others are the CSRF middleware and the HTTPS enforcer middleware) - you shouldn't use both, drop the security component (and by that I mean to also remove the related loadComponent()
call), and configure the form protection component accordingly instead!
QUESTION
CakePHP Version: 4.0.1
Introduction
This problem follows on from another problem I had here where a not ideal solution was to redirect back to itself. Unfortunately the controller I was testing didn't have any associated columns so this new problem was not identified.
I referenced this in the cookbook.
Hopefully the below code will allow the problem to be reproduced.
Contacts Table
...ANSWER
Answered 2020-Jun-03 at 09:37The sort field whitelist must be passed in the config when using the paginator directly.
QUESTION
I set up CakePHP 4.0.6 on my Lubuntu. Using a local Apache Server. Installation went fine I can see the welcome page.
Then I startet the CMS Tutorial, created the tables in the database and then created everything with bake
./cake bake all --everything
This worked fine as well and I could see the /users/index
page.
Next of course I tried to play with the cms by adding an user, the form was shown and i filled in the requested information but upon submitting i got this error: Missing CSRF token body
Stacktrace:
[Cake\Http\Exception\InvalidCsrfTokenException] Missing CSRF token body in /home/david/Software/cakePhpTest/vendor/cakephp/cakephp/src/Http/Middleware/CsrfProtectionMiddleware.php on line 254 Stack Trace: - /home/david/Software/cakePhpTest/vendor/cakephp/cakephp/src/Http/Middleware/CsrfProtectionMiddleware.php:133 - /home/david/Software/cakePhpTest/vendor/cakephp/cakephp/src/Http/Runner.php:73 - /home/david/Software/cakePhpTest/vendor/cakephp/cakephp/src/Http/Runner.php:58 - /home/david/Software/cakePhpTest/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php:162 - /home/david/Software/cakePhpTest/vendor/cakephp/cakephp/src/Http/Runner.php:73 - /home/david/Software/cakePhpTest/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php:68 - /home/david/Software/cakePhpTest/vendor/cakephp/cakephp/src/Http/Runner.php:73 - /home/david/Software/cakePhpTest/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php:119 - /home/david/Software/cakePhpTest/vendor/cakephp/cakephp/src/Http/Runner.php:73 - /home/david/Software/cakePhpTest/vendor/cakephp/debug_kit/src/Middleware/DebugKitMiddleware.php:60 - /home/david/Software/cakePhpTest/vendor/cakephp/cakephp/src/Http/Runner.php:73 - /home/david/Software/cakePhpTest/vendor/cakephp/cakephp/src/Http/Runner.php:58 - /home/david/Software/cakePhpTest/vendor/cakephp/cakephp/src/Http/Server.php:90 - /home/david/Software/cakePhpTest/webroot/index.php:40 Request URL: /users/add Referer URL: http://localhost:8765/users/add Client IP: 127.0.0.1
What really puzzles me is that according to CakePHP Documentation cross site request forgery protection would have to be enabled in src/Application.php
which is not in a freshly installed project. I checked.
So how can something that is not enabled cause an error.
To see what happend if i would enable it, i copied the code from the documentation:
...ANSWER
Answered 2020-Apr-25 at 11:43In the default application skeleton, the CSRF middleware is being registered in a routing scope, something similar is shown in the second example of the docs that you've linked.
QUESTION
I'm following the upgrade instructions for moving a CakePHP project to version 4. All went well until the final command:
php composer.phar require --update-with-dependencies "cakephp/cakephp:4.0.*"
This resulted in
Problem 1
- cakephp/bake 1.11.2 requires cakephp/cakephp ^3.8.0 -> satisfiable by cakephp/cakephp[3.8.0, >>3.8.0-RC1, 3.8.0-RC2, 3.8.0-RC3, 3.8.0-beta1, 3.8.1, 3.8.10, 3.8.11, 3.8.2, 3.8.3, 3.8.4, >>3.8.5, 3.8.6, 3.8.7, 3.8.8, 3.8.9, 3.x-dev] but these conflict with your requirements or >.minimum-stability.
- cakephp/bake 1.11.2 requires cakephp/cakephp ^3.8.0 -> satisfiable by cakephp/cakephp[3.8.0, 3.8.0-RC1, 3.8.0-RC2, 3.8.0-RC3, 3.8.0-beta1, 3.8.1, 3.8.10, 3.8.11, 3.8.2, 3.8.3, 3.8.4, 3.8.5, 3.8.6, 3.8.7, 3.8.8, 3.8.9, 3.x-dev] but these conflict with your requirements or minimum-stability.
- cakephp/bake 1.11.2 requires cakephp/cakephp ^3.8.0 -> satisfiable by cakephp/cakephp[3.8.0, 3.8.0-RC1, 3.8.0-RC2, 3.8.0-RC3, 3.8.0-beta1, 3.8.1, 3.8.10, 3.8.11, 3.8.2, 3.8.3, 3.8.4, 3.8.5, 3.8.6, 3.8.7, 3.8.8, 3.8.9, 3.x-dev] but these conflict with your requirements or minimum-stability.
- Installation request for cakephp/bake (locked at 1.11.2, required as ^1.9.0) -> satisfiable by cakephp/bake[1.11.2].
The VERSION.txt for the project shows CakePHP at 3.8.11.
In the composer.json file:
...ANSWER
Answered 2020-Apr-24 at 07:31Without updating, change all requirements according to the latest 4.x application template's composer.json
file, change the requirements for other CakePHP plugins that you might have installed to a 4.x compatible version too, and then update your dependencies.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install debug_kit
Load the plugin
Set 'debug' => true, in config/app.php.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page