2011-09-15 19:58:00 +00:00
|
|
|
<?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\Downloader;
|
|
|
|
|
|
|
|
use Composer\Package\PackageInterface;
|
|
|
|
|
|
|
|
/**
|
2011-09-23 23:18:41 +00:00
|
|
|
* Downloader interface.
|
|
|
|
*
|
2011-09-17 13:12:45 +00:00
|
|
|
* @author Konstantin Kudryashov <ever.zet@gmail.com>
|
|
|
|
*/
|
|
|
|
interface DownloaderInterface
|
2011-09-15 19:58:00 +00:00
|
|
|
{
|
2011-09-23 23:18:41 +00:00
|
|
|
/**
|
|
|
|
* Downloads specific package into specific folder.
|
|
|
|
*
|
|
|
|
* @param PackageInterface $package package instance
|
|
|
|
* @param string $path download path
|
|
|
|
* @param string $url download url
|
|
|
|
* @param string $checksum package checksum (for dists)
|
2011-09-25 15:56:05 +00:00
|
|
|
* @param Boolean $useSource download as source
|
2011-09-23 23:18:41 +00:00
|
|
|
*/
|
2011-09-25 15:56:05 +00:00
|
|
|
function download(PackageInterface $package, $path, $url, $checksum = null, $useSource = false);
|
2011-09-23 23:18:41 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Updates specific package in specific folder from initial to target version.
|
|
|
|
*
|
|
|
|
* @param PackageInterface $initial initial package
|
|
|
|
* @param PackageInterface $target updated package
|
|
|
|
* @param string $path download path
|
2011-09-25 15:56:05 +00:00
|
|
|
* @param Boolean $useSource download as source
|
2011-09-23 23:18:41 +00:00
|
|
|
*/
|
2011-09-25 15:56:05 +00:00
|
|
|
function update(PackageInterface $initial, PackageInterface $target, $path, $useSource = false);
|
2011-09-23 23:18:41 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes specific package from specific folder.
|
|
|
|
*
|
|
|
|
* @param PackageInterface $package package instance
|
|
|
|
* @param string $path download path
|
2011-09-25 15:56:05 +00:00
|
|
|
* @param Boolean $useSource download as source
|
2011-09-23 23:18:41 +00:00
|
|
|
*/
|
2011-09-25 15:56:05 +00:00
|
|
|
function remove(PackageInterface $package, $path, $useSource = false);
|
2011-09-15 19:58:00 +00:00
|
|
|
}
|