$dirname

better method of getting script folder so it works if Joomla is in a
subfolder of document root on server