public static function registerHandlers()
    {
        if (self::$registered === true) {
            return;
        }

        // @todo check a conf file to load from that instead of
        // hardcoding into the library?
        $handlers = array(
            \Httpful\Mime::JSON => new \Httpful\Handlers\JsonHandler(),
            \Httpful\Mime::XML  => new \Httpful\Handlers\XmlHandler(),
            \Httpful\Mime::FORM => new \Httpful\Handlers\FormHandler(),
            \Httpful\Mime::CSV  => new \Httpful\Handlers\CsvHandler(),
        );

        foreach ($handlers as $mime => $handler) {
            // Don't overwrite if the handler has already been registered
            if (Httpful::hasParserRegistered($mime))
                continue;
            Httpful::register($mime, $handler);
        }

        self::$registered = true;
    }
public static function registerHandlers()
    {
        if (self::$registered === true) {
            return;
        }

        // @todo check a conf file to load from that instead of
        // hardcoding into the library?
        $handlers = array(
            \Httpful\Mime::JSON => new \Httpful\Handlers\JsonHandler(),
            \Httpful\Mime::XML  => new \Httpful\Handlers\XmlHandler(),
            \Httpful\Mime::FORM => new \Httpful\Handlers\FormHandler(),
            \Httpful\Mime::CSV  => new \Httpful\Handlers\CsvHandler(),
        );

        foreach ($handlers as $mime => $handler) {
            // Don't overwrite if the handler has already been registered
            if (Httpful::hasParserRegistered($mime))
                continue;
            Httpful::register($mime, $handler);
        }

        self::$registered = true;
    }
public static function registerHandlers ( ) { if ( self :: $ registered === true ) { return ; } // @todo check a conf file to load from that instead of // hardcoding into the library? $ handlers = array ( \ Httpful \ Mime :: JSON => new \ Httpful \ Handlers \ JsonHandler ( ) , \ Httpful \ Mime :: XML => new \ Httpful \ Handlers \ XmlHandler ( ) , \ Httpful \ Mime :: FORM => new \ Httpful \ Handlers \ FormHandler ( ) , \ Httpful \ Mime :: CSV => new \ Httpful \ Handlers \ CsvHandler ( ) , ) ; foreach ( $ handlers as $ mime => $ handler ) { // Don't overwrite if the handler has already been registered if ( Httpful :: hasParserRegistered ( $ mime ) ) continue ; Httpful :: register ( $ mime , $ handler ) ; } self :: $ registered = true ; }
Register default mime handlers.  Is idempotent.
Register default mime handlers . Is idempotent .