public static function create($dir, $chmod = null)
    {
        if (!file_exists($dir)) {
            if ($chmod === null) {
                $chmod = self::$defaultChmod;
            }
            mkdir($dir, $chmod, true);
            // php mkdir apply umask on the given mode, so we must to
            // do a chmod manually.
            chmod($dir, $chmod);
            return true;
        }

        return false;
    }