2011-04-05 15:37:19 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of Composer.
|
|
|
|
*
|
|
|
|
* (c) Nils Adermann <naderman@naderman.de>
|
2011-04-16 12:42:35 +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 21:32:53 +00:00
|
|
|
namespace Composer\Repository;
|
2011-04-05 15:37:19 +00:00
|
|
|
|
2011-09-25 12:44:05 +00:00
|
|
|
use Composer\Package\PackageInterface;
|
|
|
|
|
2011-04-05 15:37:19 +00:00
|
|
|
/**
|
2011-09-25 12:44:05 +00:00
|
|
|
* Repository interface.
|
|
|
|
*
|
2011-04-05 15:37:19 +00:00
|
|
|
* @author Nils Adermann <naderman@naderman.de>
|
2011-09-25 12:44:05 +00:00
|
|
|
* @author Konstantin Kudryashov <ever.zet@gmail.com>
|
2011-04-05 15:37:19 +00:00
|
|
|
*/
|
|
|
|
interface RepositoryInterface extends \Countable
|
|
|
|
{
|
2011-09-25 12:44:05 +00:00
|
|
|
/**
|
|
|
|
* Checks if specified package registered (installed).
|
|
|
|
*
|
|
|
|
* @param PackageInterface $package package instance
|
|
|
|
*
|
|
|
|
* @return Boolean
|
|
|
|
*/
|
|
|
|
function hasPackage(PackageInterface $package);
|
|
|
|
|
2011-10-01 12:33:25 +00:00
|
|
|
/**
|
|
|
|
* Searches for a package by it's name and version (if has one).
|
|
|
|
*
|
|
|
|
* @param string $name package name
|
|
|
|
* @param string $version package version
|
|
|
|
*
|
|
|
|
* @return PackageInterface|null
|
|
|
|
*/
|
|
|
|
function findPackage($name, $version);
|
|
|
|
|
2012-01-16 11:44:47 +00:00
|
|
|
/**
|
2012-01-16 21:11:31 +00:00
|
|
|
* Searches for packages by it's name.
|
2012-01-16 11:44:47 +00:00
|
|
|
*
|
|
|
|
* @param string $name package name
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
function findPackagesByName($name);
|
|
|
|
|
2011-09-25 12:44:05 +00:00
|
|
|
/**
|
|
|
|
* Returns list of registered packages.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2011-04-05 15:37:19 +00:00
|
|
|
function getPackages();
|
|
|
|
}
|