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;
    }
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;
    }
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 ; }
Checks if an event name matches the given pattern.

@param string $pattern The pattern to check the event name against
@param string $event The actual event name
@return bool Returns TRUE if the event name matches the pattern, FALSE otherwise.
Checks if an event name matches the given pattern .