Https.php 887 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * Origin filesystem driver
  4. *
  5. * Copyright © Magento, Inc. All rights reserved.
  6. * See COPYING.txt for license details.
  7. */
  8. namespace Magento\Framework\Filesystem\Driver;
  9. /**
  10. * Class Https
  11. *
  12. */
  13. class Https extends Http
  14. {
  15. /**
  16. * Scheme distinguisher
  17. *
  18. * @var string
  19. */
  20. protected $scheme = 'https';
  21. /**
  22. * Parse a https url
  23. *
  24. * @param string $path
  25. * @return array
  26. */
  27. protected function parseUrl($path)
  28. {
  29. $urlProp = parent::parseUrl($path);
  30. if (!isset($urlProp['port'])) {
  31. $urlProp['port'] = 443;
  32. }
  33. return $urlProp;
  34. }
  35. /**
  36. * Open a https url
  37. *
  38. * @param string $hostname
  39. * @param int $port
  40. * @return array
  41. */
  42. protected function open($hostname, $port)
  43. {
  44. return parent::open('ssl://' . $hostname, $port);
  45. }
  46. }