PDA

View Full Version : What is CWD in require_once(CWD . '/includes/class_core.php');


doob
03-17-2014, 08:23 PM
Hacking external login today! And as always curious about some of the obscure code I'm finding.

Anyone know what CWD stands for or does in this line in init.php?
require_once(CWD . '/includes/class_core.php');

I imagine its functioning as a definition of a root directory, but its not readily obvious.

Also curious about lack of variable on DIR as in require_once(DIR . '/includes/class_database_slave.php');

Again, I imagine that DIR is definted somewhere as homeDirectory or Root or similar, but I'm not familiar with this being done in PHP without a $.

PinkMilk
03-17-2014, 08:26 PM
current working directory

doob
03-17-2014, 10:30 PM
That helps with the Acronym! What about the definition? Is CWD relative to the php document or something else?

Thanks! So much to learn Vbulletin's code!

Zachery
03-17-2014, 10:30 PM
Either we have (in vBulletin) or PHP has defined it as a Constant.

doob
03-17-2014, 11:03 PM
Thanks! I now see it is basically a Vbulletin constant defined in init.php which is basically using php's getcwd. Cool!