SOAP--Transport
[ class tree: SOAP--Transport ] [ index: SOAP--Transport ] [ all elements ]

Source for file Transport.php

Documentation is available at Transport.php

  1. <?php
  2. //
  3. // +----------------------------------------------------------------------+
  4. // | PHP Version 4                                                        |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 1997-2003 The PHP Group                                |
  7. // +----------------------------------------------------------------------+
  8. // | This source file is subject to version 2.02 of the PHP license,      |
  9. // | that is bundled with this package in the file LICENSE, and is        |
  10. // | available at through the world-wide-web at                           |
  11. // | http://www.php.net/license/2_02.txt.                                 |
  12. // | If you did not receive a copy of the PHP license and are unable to   |
  13. // | obtain it through the world-wide-web, please send a note to          |
  14. // | license@php.net so we can mail you a copy immediately.               |
  15. // +----------------------------------------------------------------------+
  16. // | Authors: Shane Caraveo <Shane@Caraveo.com>   Port to PEAR and more   |
  17. // | Authors: Dietrich Ayala <dietrich@ganx4.com> Original Author         |
  18. // +----------------------------------------------------------------------+
  19. //
  20. // $Id: Transport.php,v 1.25 2005/05/03 21:12:43 chagenbu Exp $
  21. //
  22.  
  23. require_once 'SOAP/Base.php';
  24.  
  25. /**
  26.  * SOAP Transport Layer
  27.  *
  28.  * This layer can use different protocols dependant on the endpoint url provided
  29.  * no knowlege of the SOAP protocol is available at this level
  30.  * no knowlege of the transport protocols is available at this level
  31.  *
  32.  * @access   public
  33.  * @package  SOAP::Transport
  34.  * @author   Shane Caraveo <shane@php.net>
  35.  */
  36. {
  37.     function &getTransport($url$encoding = SOAP_DEFAULT_ENCODING)
  38.     {
  39.         $urlparts @parse_url($url);
  40.  
  41.         if (!$urlparts['scheme']{
  42.             return SOAP_Base_Object::_raiseSoapFault("Invalid transport URI: $url");
  43.         }
  44.  
  45.         if (strcasecmp($urlparts['scheme']'mailto'== 0{
  46.             $transport_type 'SMTP';
  47.         elseif (strcasecmp($urlparts['scheme']'https'== 0{
  48.             $transport_type 'HTTP';
  49.         else {
  50.             /* handle other transport types */
  51.             $transport_type strtoupper($urlparts['scheme']);
  52.         }
  53.         $transport_include 'SOAP/Transport/' $transport_type '.php';
  54.         $res @include_once($transport_include);
  55.         if (!$res && !in_array($transport_includeget_included_files())) {
  56.             return SOAP_Base_Object::_raiseSoapFault("No Transport for {$urlparts['scheme']}");
  57.         }
  58.         $transport_class = "SOAP_Transport_$transport_type";
  59.         if (!class_exists($transport_class)) {
  60.             return SOAP_Base_Object::_raiseSoapFault("No Transport class $transport_class");
  61.         }
  62.         return $t =new $transport_class($url$encoding);
  63.     }
  64.  
  65. }

Documentation generated on Mon, 11 Mar 2019 14:20:05 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.