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.22 2003/04/20 01:05:34 shane 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. @version  $Id: Transport.php,v 1.22 2003/04/20 01:05:34 shane Exp $
  34. @package  SOAP::Transport
  35. @author   Shane Caraveo <shane@php.net>
  36. */
  37. {
  38.     function &getTransport($url$encoding = SOAP_DEFAULT_ENCODING)
  39.     {
  40.         $urlparts @parse_url($url);
  41.         
  42.         if (!$urlparts['scheme']{
  43.             return SOAP_Base_Object::_raiseSoapFault("Invalid transport URI: $url");
  44.         }
  45.         
  46.         if (strcasecmp($urlparts['scheme']'mailto'== 0{
  47.             $transport_type 'SMTP';
  48.         else if (strcasecmp($urlparts['scheme']'https'== 0{
  49.             $transport_type 'HTTP';
  50.         else {
  51.             /* handle other transport types */
  52.             $transport_type strtoupper($urlparts['scheme']);
  53.         }
  54.         $transport_include 'SOAP/Transport/'.$transport_type.'.php';
  55.         $res @include_once($transport_include);
  56.         if(!$res && !in_array($transport_includeget_included_files())) {
  57.             return SOAP_Base_Object::_raiseSoapFault("No Transport for {$urlparts['scheme']}");
  58.         }
  59.         $transport_class = "SOAP_Transport_$transport_type";
  60.         if (!class_exists($transport_class)) {
  61.             return SOAP_Base_Object::_raiseSoapFault("No Transport class $transport_class");
  62.         }
  63.         return new $transport_class($url$encoding);
  64.     }
  65. // end SOAP_Transport
  66. ?>

Documentation generated on Mon, 11 Mar 2019 13:59:47 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.