/** * Create a directory structure recursively * * @author Aidan Lister <*****@*****.**> (original name mkdirr) * @version 1.0.0 * @param string $pathname - The directory structure to create * @param int $mode - Security mode apply in directorys * @return bool - Returns TRUE on success, FALSE on failure */ public static function ForceDirectories($pathname, $mode = 0777) { // Crawl up the directory tree $next_pathname = substr($pathname, 0, strrpos($pathname, self::Slash())); if ($next_pathname != "") { self::ForceDirectories($next_pathname, $mode); } if (!file_exists($pathname)) { FileUtil::CreateDirectory($pathname, $mode); } }