Jump to content

[SOLVED] $config->debugIf doesn't work with custom function


nurkka
 Share

Recommended Posts

Hi everybody,
while testing $config->debugIf, I noticed, that it wouldn't work with custom functions. Example /site/config.php:

function custom_debug_if () {
    return true; // simply for test reasons
}
$config->debugIf = 'custom_debug_if';

This doesn't work because the if(is_callable($debugIf)) in ProcessWire.php returns false.

The debugIf-documentation says:

 * 2) Your own callable function name (i.e. "debug_mode") in /site/config.php that returns
 * true or false for debug mode;

How is it possible to use this feature?

Thanks and best regards!

Link to comment
Share on other sites

Thanks BitPoet, 
the following code worked:

function custom_debug_if () {
    return true; // simply for test reasons
}
$config->debugIf = 'ProcessWire\\custom_debug_if';

Using if(wireIsCallable($debugIf)) instead of if(is_callable($debugIf)) in ProcessWire.php made no difference.

Thanks again and best regards!

Link to comment
Share on other sites

  • nurkka changed the title to [SOLVED] $config->debugIf doesn't work with custom function

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...