. */ declare(strict_types=1); namespace Fisharebest\Webtrees; use Throwable; /** * File manipulation utilities. */ class File { /** * Create a folder, and sub-folders, if it does not already exist * * @param string $path * * @return bool Does the folder now exist */ public static function mkdir($path) { if (is_dir($path)) { return true; } if (dirname($path) && !is_dir(dirname($path))) { self::mkdir(dirname($path)); } try { mkdir($path); return true; } catch (Throwable $ex) { return false; } } }