PreFileDownloadEvent.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. /*
  3. * This file is part of Composer.
  4. *
  5. * (c) Nils Adermann <naderman@naderman.de>
  6. * Jordi Boggiano <j.boggiano@seld.be>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace Composer\Plugin;
  12. use Composer\EventDispatcher\Event;
  13. use Composer\Util\RemoteFilesystem;
  14. /**
  15. * The pre file download event.
  16. *
  17. * @author Nils Adermann <naderman@naderman.de>
  18. */
  19. class PreFileDownloadEvent extends Event
  20. {
  21. /**
  22. * @var RemoteFilesystem
  23. */
  24. private $rfs;
  25. /**
  26. * @var string
  27. */
  28. private $processedUrl;
  29. /**
  30. * Constructor.
  31. *
  32. * @param string $name The event name
  33. * @param RemoteFilesystem $rfs
  34. * @param string $processedUrl
  35. */
  36. public function __construct($name, RemoteFilesystem $rfs, $processedUrl)
  37. {
  38. parent::__construct($name);
  39. $this->rfs = $rfs;
  40. $this->processedUrl = $processedUrl;
  41. }
  42. /**
  43. * Returns the remote filesystem
  44. *
  45. * @return RemoteFilesystem
  46. */
  47. public function getRemoteFilesystem()
  48. {
  49. return $this->rfs;
  50. }
  51. /**
  52. * Sets the remote filesystem
  53. *
  54. * @param RemoteFilesystem $rfs
  55. */
  56. public function setRemoteFilesystem(RemoteFilesystem $rfs)
  57. {
  58. $this->rfs = $rfs;
  59. }
  60. /**
  61. * Retrieves the processed URL this remote filesystem will be used for
  62. *
  63. * @return string
  64. */
  65. public function getProcessedUrl()
  66. {
  67. return $this->processedUrl;
  68. }
  69. }