-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provides a post download event to fix #8654
- Loading branch information
Lucas D Hedding
committed
Apr 9, 2020
1 parent
a7ad186
commit 2e78244
Showing
3 changed files
with
104 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of Composer. | ||
* | ||
* (c) Nils Adermann <naderman@naderman.de> | ||
* Jordi Boggiano <j.boggiano@seld.be> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Composer\Plugin; | ||
|
||
use Composer\EventDispatcher\Event; | ||
use Composer\Util\RemoteFilesystem; | ||
|
||
/** | ||
* The post file download event. | ||
* | ||
* @author Nils Adermann <naderman@naderman.de> | ||
*/ | ||
class PostFileDownloadEvent extends Event | ||
{ | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $fileName; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $checksum; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
private $url; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param string $name The event name | ||
* @param string $fileName The file name | ||
* @param string $checksum The checksum | ||
* @param array $url The url | ||
*/ | ||
public function __construct($name, $fileName, $checksum, $url) | ||
{ | ||
parent::__construct($name); | ||
$this->fileName = $fileName; | ||
$this->checksum = $checksum; | ||
$this->url = $url; | ||
} | ||
|
||
/** | ||
* Retrieves the target file name location. | ||
* | ||
* @return string | ||
*/ | ||
public function getFileName() | ||
{ | ||
return $this->fileName; | ||
} | ||
|
||
/** | ||
* Gets the checksum. | ||
* | ||
* @return string | ||
*/ | ||
public function getChecksum() { | ||
return $this->checksum; | ||
} | ||
|
||
/** | ||
* Gets the URL. | ||
* | ||
* The URL array has keys of base, processed and cacheKey. | ||
* | ||
* @return array | ||
*/ | ||
public function getUrl() { | ||
return $this->url; | ||
} | ||
|
||
} |