开发者

visual paradigm, reverse engineering PHP project

I get the following error when trying 开发者_StackOverflow社区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?


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


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


Wrap your ternary condition:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜