public static function mkdir($dir) { if (file_exists($dir)) { return is_dir($dir); } return (bool) @mkdir($dir, 0777, true); }