I hope someone here knows the answer to this question. I wrote a script that uses
basename( __DIR__ )
then uses the if file exists function.
On my server this works fine, however on another server it actually returns the word _DIR_ instead of the file path.
Has this changed with the version of PHP or is there some other parameter that makes it so that it does not work?
Finally, is there a better way to get the file path? Here is the entire Im line using:
define('NIFTY_CONSTANT', trailingslashit (WP_PLUGIN_DIR . '/'. basename( __DIR__ ) ). '/lib/mdetect.php' );
(yes, I know this is a WordPress feature, but this is not a WordPress question, this is PHP)
source share