1

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?

Ryan
  • 13
  • 2

3 Answers3

1

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

iLLin
  • 759
  • 3
  • 7
0

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

devtut
  • 699
  • 4
  • 17
0

Wrap your ternary condition:

 (defined('DB_SERVER'))? null:define("DB_SERVER", "localhost"); 
Lawrence Cherone
  • 46,049
  • 7
  • 62
  • 106