(2003-2009) * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package Functions * @version $Id$ */ /** * Checks if a given directory is valid for multiple configurations * or should rather be used as a single file * * @param string The dir * @return bool true if usable as dir, false otherwise * * @author Florian Lippert */ function isConfigDir($dir, $ifexists = false) { if(file_exists($dir)) { if(is_dir($dir)) { $returnval = true; } else { $returnval = false; } } else { if(!$ifexists) { if(substr($dir, -1) == '/') { $returnval = true; } else { $returnval = false; } } else { $returnval = false; } } return $returnval; }