public static function match($pattern, $event)
    {
        if (strpos($pattern, '*') === false) {
            return $event == $pattern;
        }

        $event   = explode('.', $event);
        $pattern = explode('.', $pattern);

        if (count($event) != ($count = count($pattern))) {
            return false;
        }

        for ($i = 0; $i < $count; $i++) {
            if ($pattern[$i] != '*' && $pattern[$i] != $event[$i]) {
                return false;
            }
        }

        return true;
    }