Search code examples
phpreverse-engineeringvisual-paradigm

visual paradigm, reverse engineering PHP project


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?


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