Question

I get the following error when trying to do reverse engineering with visual-paradigm:

Reason : Error occured when analysis: includes/config.php. Encountered "define" at line 6, column 66

this is the line:

defined('DB_SERVER')                    ? null : define("DB_SERVER", "localhost");

Does someone know whats wrong?

Was it helpful?

Solution

Seems weird. Normally when I do short if/else in that fashion, I render the value to a variable. Change it up to use a proper if.

if(!defined('DB_SERVER')) define('DB_SERVER', 'localhost');

EDIT This is probably a better way maybe?

defined('CONSTANT') or define('CONSTANT', 'SomeDefaultValue');

Took from here: http://www.php.net/manual/en/function.defined.php#84439

OTHER TIPS

Use define('DB_SERVER') not defined('DB_SERVER'), i think so

Wrap your ternary condition:

 (defined('DB_SERVER'))? null:define("DB_SERVER", "localhost"); 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top