I\'m trying to define a constant, but I don\'t want to redefine it if it\'s already been defined. Here\'s a C sample:
#ifndef BASEPATH
#define BASEPATH /mnt/www
This is condensed rewriting of Radu's answer above (and everyone else's).
defined('BASE_PATH') || define('BASE_PATH', '/mnt/www/');
That's it. If defined('BASE_PATH')
evaluates to true, the rest of the conditional never gets evaluated. If it returns false, the second half of the conditional is evaluated and BASE_PATH
gets defined.