// Copyright: Copyright (C) 2002-2007 Pristine Communications // Set the include path if (!defined("INCPATH_SET")) { require_once dirname(__FILE__) . "/incpath.inc.php"; } // Referenced subroutines require_once "monica/rel2abs.inc.php"; // mkalldir: Create all the components of a directory // Input: Directory name $dir. It won't check at all. // Output: true if success, false if failed function mkalldir($dir) { // Standardize it $dir = stdpath($dir); // Directories to create $dirs = array(); // Find all the directories to create while ($dir != "" && !file_exists($dir)) { $dirs[] = $dir; $dir = dirname($dir); } // Create from the last one for ($i = count($dirs) - 1; $i >= 0; $i--) { if (mkdir($dirs[$i], 0755) === false) { return false; } } return true; } ?>