We use dirname() a lot in php to make relative paths work from multiple locations like so. The advantages are many: require dirname( dirname( __FILE__ ) ) . ‘/required-file.php’; $data = file_get_contents( dirname(__FILE__).’/data/info.dat’); But in bash we often dont do the same thing, we settle for the old standby “../”. Which is a shame because [...]
-
Home > Archives for June, 2008