Public Member Functions

ilBMFTransport Class Reference

Public Member Functions

getTransport ($url, $encoding=SOAP_DEFAULT_ENCODING)

Detailed Description

Definition at line 37 of file class.ilBMFTransport.php.


Member Function Documentation

& ilBMFTransport::getTransport ( url,
encoding = SOAP_DEFAULT_ENCODING 
)

Definition at line 39 of file class.ilBMFTransport.php.

References $res, and ilBMFBase_Object::_raiseSoapFault().

Referenced by ilBMFServer_Email_Gateway::service(), and ilBMFServer_Email::service().

    {
        $urlparts = @parse_url($url);
        
        if (!$urlparts['scheme']) {
            return ilBMFBase_Object::_raiseSoapFault("Invalid transport URI: $url");
        }
        
        if (strcasecmp($urlparts['scheme'], 'mailto') == 0) {
            $transport_type = 'SMTP';
        } else if (strcasecmp($urlparts['scheme'], 'https') == 0) {
            $transport_type = 'HTTP';
        } else {
            /* handle other transport types */
            $transport_type = strtoupper($urlparts['scheme']);
        }
        $transport_include = dirname(__FILE__).'/Transport/class.ilBMFTransport_'.$transport_type.'.php';
        $res = @include_once($transport_include);
        if(!$res && !in_array($transport_include, get_included_files())) {
            return ilBMFBase_Object::_raiseSoapFault("No Transport for {$urlparts['scheme']}");
        }
        $transport_class = "ilBMFTransport_$transport_type";
        if (!class_exists($transport_class)) {
            return ilBMFBase_Object::_raiseSoapFault("No Transport class $transport_class");
        }
        return new $transport_class($url, $encoding);
    }

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following file: