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
|
|
|
|
|
|
|
use Composer\DependencyResolver\RelationConstraint\RelationConstraintInterface;
|
2011-04-17 20:59:23 +00:00
|
|
|
use Composer\DependencyResolver\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
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* @return array An array of strings refering to this package
|
|
|
|
*/
|
2011-04-17 19:36:05 +00:00
|
|
|
function getNames();
|
2011-04-05 15:37:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks if the package matches the given constraint directly or through
|
|
|
|
* provided or replaced packages
|
|
|
|
*
|
|
|
|
* @param string $name Name of the package to be matched
|
|
|
|
* @param RelationConstraintInterface $constraint The constraint to verify
|
|
|
|
* @return bool Whether this package matches the name and constraint
|
|
|
|
*/
|
2011-04-17 19:36:05 +00:00
|
|
|
function matches($name, RelationConstraintInterface $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();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the repository type of this package, e.g. git, svn, tar
|
|
|
|
*
|
|
|
|
* @return string The repository type
|
|
|
|
*/
|
|
|
|
function getRepositoryType();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the repository url of this package, e.g. git://github.com/naderman/composer.git
|
|
|
|
*
|
|
|
|
* @return string The repository url
|
|
|
|
*/
|
|
|
|
function getRepositoryUrl();
|
|
|
|
|
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
|
|
|
/**
|
|
|
|
* Returns a set of relations to packages which need to be installed before
|
|
|
|
* this package can be installed
|
|
|
|
*
|
|
|
|
* @return array An array of package relations defining required packages
|
|
|
|
*/
|
2011-04-17 19:36:05 +00:00
|
|
|
function getRequires();
|
2011-04-05 15:37:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a set of relations to packages which must not be installed at the
|
|
|
|
* same time as this package
|
|
|
|
*
|
|
|
|
* @return array An array of package relations defining conflicting packages
|
|
|
|
*/
|
2011-04-17 19:36:05 +00:00
|
|
|
function getConflicts();
|
2011-04-05 15:37:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a set of relations to virtual packages that are provided through
|
|
|
|
* this package
|
|
|
|
*
|
|
|
|
* @return array An array of package relations defining provided packages
|
|
|
|
*/
|
2011-04-17 19:36:05 +00:00
|
|
|
function getProvides();
|
2011-04-05 15:37:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a set of relations to packages which can alternatively be
|
|
|
|
* satisfied by installing this package
|
|
|
|
*
|
|
|
|
* @return array An array of package relations defining replaced packages
|
|
|
|
*/
|
2011-04-17 19:36:05 +00:00
|
|
|
function getReplaces();
|
2011-04-05 15:37:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a set of relations to packages which are recommended in
|
|
|
|
* combination with this package.
|
|
|
|
*
|
|
|
|
* @return array An array of package relations defining recommended packages
|
|
|
|
*/
|
2011-04-17 19:36:05 +00:00
|
|
|
function getRecommends();
|
2011-04-05 15:37:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a set of relations to packages which are suggested in combination
|
|
|
|
* with this package.
|
|
|
|
*
|
|
|
|
* @return array An array of package relations defining suggested packages
|
|
|
|
*/
|
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
|
|
|
}
|