2011-04-05 15:37:19 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of Composer.
|
|
|
|
*
|
|
|
|
* (c) Nils Adermann <naderman@naderman.de>
|
2011-04-17 19:48:20 +00:00
|
|
|
* Jordi Boggiano <j.boggiano@seld.be>
|
2011-04-05 15:37:19 +00:00
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
2011-04-17 19:36:05 +00:00
|
|
|
namespace Composer\Package;
|
2011-04-05 15:37:19 +00:00
|
|
|
|
2011-04-17 22:16:12 +00:00
|
|
|
use Composer\Package\LinkConstraint\LinkConstraintInterface;
|
2011-04-17 21:45:37 +00:00
|
|
|
use Composer\Repository\RepositoryInterface;
|
2011-04-05 15:37:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Nils Adermann <naderman@naderman.de>
|
|
|
|
*/
|
2011-04-17 19:36:05 +00:00
|
|
|
interface PackageInterface
|
2011-04-05 15:37:19 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Returns the package's name without version info, thus not a unique identifier
|
|
|
|
*
|
|
|
|
* @return string package name
|
|
|
|
*/
|
2011-04-17 19:36:05 +00:00
|
|
|
function getName();
|
2011-04-05 15:37:19 +00:00
|
|
|
|
2011-09-15 09:50:50 +00:00
|
|
|
/**
|
|
|
|
* Returns the package's pretty (i.e. with proper case) name
|
|
|
|
*
|
|
|
|
* @return string package name
|
|
|
|
*/
|
|
|
|
function getPrettyName();
|
|
|
|
|
2011-04-05 15:37:19 +00:00
|
|
|
/**
|
|
|
|
* Returns a set of names that could refer to this package
|
|
|
|
*
|
|
|
|
* No version or release type information should be included in any of the
|
|
|
|
* names. Provided or replaced package names need to be returned as well.
|
|
|
|
*
|
2011-09-15 01:22:33 +00:00
|
|
|
* @return array An array of strings referring to this package
|
2011-04-05 15:37:19 +00:00
|
|
|
*/
|
2011-04-17 19:36:05 +00:00
|
|
|
function getNames();
|
2011-04-05 15:37:19 +00:00
|
|
|
|
2011-06-03 16:22:20 +00:00
|
|
|
/**
|
2011-08-21 11:11:42 +00:00
|
|
|
* Allows the solver to set an id for this package to refer to it.
|
|
|
|
*
|
|
|
|
* @param int $id
|
|
|
|
*/
|
2011-06-03 16:22:20 +00:00
|
|
|
function setId($id);
|
|
|
|
|
|
|
|
/**
|
2011-08-21 11:11:42 +00:00
|
|
|
* Retrieves the package's id set through setId
|
|
|
|
*
|
|
|
|
* @return int The previously set package id
|
|
|
|
*/
|
2011-06-03 16:22:20 +00:00
|
|
|
function getId();
|
|
|
|
|
2011-04-05 15:37:19 +00:00
|
|
|
/**
|
|
|
|
* Checks if the package matches the given constraint directly or through
|
|
|
|
* provided or replaced packages
|
|
|
|
*
|
2011-04-17 22:16:12 +00:00
|
|
|
* @param string $name Name of the package to be matched
|
|
|
|
* @param LinkConstraintInterface $constraint The constraint to verify
|
|
|
|
* @return bool Whether this package matches the name and constraint
|
2011-04-05 15:37:19 +00:00
|
|
|
*/
|
2011-04-17 22:16:12 +00:00
|
|
|
function matches($name, LinkConstraintInterface $constraint);
|
2011-04-05 15:37:19 +00:00
|
|
|
|
2011-04-17 19:48:20 +00:00
|
|
|
/**
|
2011-04-17 20:13:08 +00:00
|
|
|
* Returns the package type, e.g. library
|
2011-04-17 19:48:20 +00:00
|
|
|
*
|
|
|
|
* @return string The package type
|
|
|
|
*/
|
|
|
|
function getType();
|
|
|
|
|
2011-08-21 11:11:42 +00:00
|
|
|
/**
|
|
|
|
* Returns the package extra data
|
|
|
|
*
|
|
|
|
* @return array The package extra data
|
|
|
|
*/
|
|
|
|
function getExtra();
|
|
|
|
|
2011-04-17 19:48:20 +00:00
|
|
|
/**
|
2011-07-06 19:05:05 +00:00
|
|
|
* Returns the repository type of this package, e.g. git, svn
|
2011-04-17 19:48:20 +00:00
|
|
|
*
|
|
|
|
* @return string The repository type
|
|
|
|
*/
|
2011-04-17 21:45:37 +00:00
|
|
|
function getSourceType();
|
2011-04-17 19:48:20 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the repository url of this package, e.g. git://github.com/naderman/composer.git
|
|
|
|
*
|
|
|
|
* @return string The repository url
|
|
|
|
*/
|
2011-04-17 21:45:37 +00:00
|
|
|
function getSourceUrl();
|
2011-04-17 19:48:20 +00:00
|
|
|
|
2011-07-06 19:05:05 +00:00
|
|
|
/**
|
|
|
|
* Returns the type of the distribution archive of this version, e.g. zip, tarball
|
|
|
|
*
|
|
|
|
* @return string The repository type
|
|
|
|
*/
|
|
|
|
function getDistType();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the url of the distribution archive of this version
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
function getDistUrl();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the sha1 checksum for the distribution archive of this version
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
function getDistSha1Checksum();
|
|
|
|
|
2011-04-05 15:37:19 +00:00
|
|
|
/**
|
|
|
|
* Returns the release type of this package, e.g. stable or beta
|
|
|
|
*
|
|
|
|
* @return string The release type
|
|
|
|
*/
|
2011-04-17 19:36:05 +00:00
|
|
|
function getReleaseType();
|
2011-04-05 15:37:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the version of this package
|
|
|
|
*
|
|
|
|
* @return string version
|
|
|
|
*/
|
2011-04-17 19:36:05 +00:00
|
|
|
function getVersion();
|
2011-04-05 15:37:19 +00:00
|
|
|
|
2011-04-17 20:13:08 +00:00
|
|
|
/**
|
|
|
|
* Returns the package license, e.g. MIT, BSD, GPL
|
|
|
|
*
|
|
|
|
* @return string The package license
|
|
|
|
*/
|
|
|
|
function getLicense();
|
|
|
|
|
2011-04-05 15:37:19 +00:00
|
|
|
/**
|
2011-04-17 22:16:12 +00:00
|
|
|
* Returns a set of links to packages which need to be installed before
|
2011-04-05 15:37:19 +00:00
|
|
|
* this package can be installed
|
|
|
|
*
|
2011-04-17 22:16:12 +00:00
|
|
|
* @return array An array of package links defining required packages
|
2011-04-05 15:37:19 +00:00
|
|
|
*/
|
2011-04-17 19:36:05 +00:00
|
|
|
function getRequires();
|
2011-04-05 15:37:19 +00:00
|
|
|
|
|
|
|
/**
|
2011-04-17 22:16:12 +00:00
|
|
|
* Returns a set of links to packages which must not be installed at the
|
2011-04-05 15:37:19 +00:00
|
|
|
* same time as this package
|
|
|
|
*
|
2011-04-17 22:16:12 +00:00
|
|
|
* @return array An array of package links defining conflicting packages
|
2011-04-05 15:37:19 +00:00
|
|
|
*/
|
2011-04-17 19:36:05 +00:00
|
|
|
function getConflicts();
|
2011-04-05 15:37:19 +00:00
|
|
|
|
|
|
|
/**
|
2011-04-17 22:16:12 +00:00
|
|
|
* Returns a set of links to virtual packages that are provided through
|
2011-04-05 15:37:19 +00:00
|
|
|
* this package
|
|
|
|
*
|
2011-04-17 22:16:12 +00:00
|
|
|
* @return array An array of package links defining provided packages
|
2011-04-05 15:37:19 +00:00
|
|
|
*/
|
2011-04-17 19:36:05 +00:00
|
|
|
function getProvides();
|
2011-04-05 15:37:19 +00:00
|
|
|
|
|
|
|
/**
|
2011-04-17 22:16:12 +00:00
|
|
|
* Returns a set of links to packages which can alternatively be
|
2011-04-05 15:37:19 +00:00
|
|
|
* satisfied by installing this package
|
|
|
|
*
|
2011-04-17 22:16:12 +00:00
|
|
|
* @return array An array of package links defining replaced packages
|
2011-04-05 15:37:19 +00:00
|
|
|
*/
|
2011-04-17 19:36:05 +00:00
|
|
|
function getReplaces();
|
2011-04-05 15:37:19 +00:00
|
|
|
|
|
|
|
/**
|
2011-04-17 22:16:12 +00:00
|
|
|
* Returns a set of links to packages which are recommended in
|
2011-04-05 15:37:19 +00:00
|
|
|
* combination with this package.
|
|
|
|
*
|
2011-04-17 22:16:12 +00:00
|
|
|
* @return array An array of package links defining recommended packages
|
2011-04-05 15:37:19 +00:00
|
|
|
*/
|
2011-04-17 19:36:05 +00:00
|
|
|
function getRecommends();
|
2011-04-05 15:37:19 +00:00
|
|
|
|
|
|
|
/**
|
2011-04-17 22:16:12 +00:00
|
|
|
* Returns a set of links to packages which are suggested in combination
|
2011-04-05 15:37:19 +00:00
|
|
|
* with this package.
|
|
|
|
*
|
2011-04-17 22:16:12 +00:00
|
|
|
* @return array An array of package links defining suggested packages
|
2011-04-05 15:37:19 +00:00
|
|
|
*/
|
2011-04-17 19:36:05 +00:00
|
|
|
function getSuggests();
|
2011-04-05 15:37:19 +00:00
|
|
|
|
2011-04-17 20:59:23 +00:00
|
|
|
/**
|
|
|
|
* Stores a reference to the repository that owns the package
|
|
|
|
*
|
|
|
|
* @param RepositoryInterface $repository
|
|
|
|
*/
|
|
|
|
function setRepository(RepositoryInterface $repository);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a reference to the repository that owns the package
|
|
|
|
*
|
|
|
|
* @return RepositoryInterface
|
|
|
|
*/
|
|
|
|
function getRepository();
|
|
|
|
|
2011-04-05 15:37:19 +00:00
|
|
|
/**
|
|
|
|
* Converts the package into a readable and unique string
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
2011-04-17 19:36:05 +00:00
|
|
|
function __toString();
|
2011-04-05 15:37:19 +00:00
|
|
|
}
|