How to activate debug mode ?

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
A Bindi
Veteran Member
Posts: 70
Joined: 2018-01-04 18:45

How to activate debug mode ?

Post by A Bindi » 2025-04-07 16:32

I create a file named settings.php in the application root folder containing:

Code: Select all

<?php
$debug_mode = true;
it doesn’t seem to work :(

ALex.

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1944
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: How to activate debug mode ?

Post by jsetzer » 2025-04-07 16:54

I create a file named settings.php in the application root folder [...] it doesn’t seem to work :(
What exactly does not work? Creating the file? Including the file in your PHP Script? Evaluating the value or your variable for your own logging-scripts? Are there any error messages/exceptions?

Did you include('CORRECT_PATH/settings.php');?

Just placing a file somewhere will not load it between REQUEST and RESPONSE. You have to include('...') or require('...') that file.

Alternatively, create hooks/__bootstrap.php, if not already exists, declare your variable there. That specific file gets loaded automatically by AppGini generated code. Note: at this place you don't have any library functions available, yet, because loading __bootstrap.php takes place just after REQUEST.

Or place your variable declaration in hooks/header-extras.php.

After including your settings.php your variable should be available. You can check it with var_dump($debug_mode); exit; for example. This should print out true.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 25.10 + all AppGini Helper tools

A Bindi
Veteran Member
Posts: 70
Joined: 2018-01-04 18:45

Re: How to activate debug mode ?

Post by A Bindi » 2025-04-08 13:01

Thank you for reply.
Due very slow queries I would want to activate the Appgini debug mode and I read somewhere to edit the file <webroot>\settings.php adding the string:

<?php
$debug_mode = true;

In my installation there was no that file so I created it, edited and saved, but the debug mode does not seem to work, or maybe I did not understand how it works.

ALex.

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1944
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: How to activate debug mode ?

Post by jsetzer » 2025-04-08 15:01

[...] activate the Appgini debug mode and I read somewhere [...]
in definitions.php there is a constant named DEBUG_MODE. Perhaps this is what you have seen?!

According to function-description, you can set that constant to true and use built-in breakpoint(...)-function within your PHP code. This will write a file named breakpoint.csv in /WEBROOT/YOUR_APP_PATH/admin/-subdirectory with your specific debug information.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 25.10 + all AppGini Helper tools

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1944
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: How to activate debug mode ?

Post by jsetzer » 2025-04-09 06:40

I should have mentioned that definitions.php gets overwritten on next code generation.

I may be wrong, but I don't see any project specific setting in AppGini project itself nor in Admin area, which, from my point of view, would be nice to have.

Anyway, for efficient logging, debugging or error-tracing you may consider using a third-party tool or write your own logging-class.

Just my 2 cents.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 25.10 + all AppGini Helper tools

Post Reply