Jump to content
thirty bees forum
  • 0

Can we use the PS way of profiling and error reporting with TB?


the.rampage.rado

Question

I want to use this:

```php/* Debug only / if ($_SERVER['QUERY_STRING'] == 'error') { define('_PS_MODE_DEV_', true); }else{ define('_PS_MODE_DEV_', false); } / Compatibility warning */ define('_PS_DISPLAY_COMPATIBILITY_WARNING_', false); if (_PS_MODE_DEV_ === true) { @ini_set('display_errors', 'on'); @error_reporting(E_ALL | E_STRICT); define('_PS_DEBUG_SQL_', true); } else { @ini_set('display_errors', 'off');

define('_PS_DEBUG_SQL_', false);

}

if ($SERVER['QUERYSTRING'] == 'profile') { define('PSDEBUGPROFILING', true); }else{

define('PSDEBUGPROFILING', false); } ``` in my defines.inc.php but when I replace the coresponding lines in the file I can't install modules. It gives 'this functionality has been disabled'. I would like to use this function that way instead of the BO option because it quicker and more convenient.

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

@lesley - today I tested again - when adding this code I'm unable to install modules. The system says: This functionality has been disabled.

EDIT- the same message is shown in Performance also and profiling and debug are ON and can't be turned off?

Probably there are other changes than those in Performance controller that affect how defines is processed?

Link to comment
Share on other sites

  • 0

Make sure you didn't remove this by accident, it directly follows the code section you posted above: php if (!defined('_PS_MODE_DEMO_')) { define('_PS_MODE_DEMO_', false); } Having _PS_MODE_DEMO_ undefined means that PHP takes this sequence of characters as a string and a non-empty string other than '0' evaluates to true.

Link to comment
Share on other sites

  • 0

A very simple & basic way to check is to add the following code: if ($_SERVER['QUERY_STRING'] == 'democheck') { if (defined('_PS_MODE_DEMO_')) { echo '_PS_MODE_DEMO_ is defined'; }else{ echo '_PS_MODE_DEMO_ is NOT defined'; } exit; } Right above: if (!defined('_PS_MODE_DEMO_')) { define('_PS_MODE_DEMO_', false); }

Then load your homepage adding ?democheck to the end of the url, like so: www.example.com?democheck It will output on the screen if it's defined or not.

Link to comment
Share on other sites

  • 0

OMG What a lame mistake!!! :D I've deleted the demo row .... :D Sorry guys!

Now it's not giving this notice but it acting again strange. If I have the code pasted the Performance page shows both options as ON. If I turn them off the code is also changed and If I turn them on again the code is true else true... :)

Link to comment
Share on other sites

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
×
×
  • Create New...