hasPackage()
hasPackage(\Composer\Package\PackageInterface $package) : boolean
Checks if specified package registered (installed).
Parameters
\Composer\Package\PackageInterface | $package | package instance |
Writable repository interface.
hasPackage(\Composer\Package\PackageInterface $package) : boolean
Checks if specified package registered (installed).
\Composer\Package\PackageInterface | $package | package instance |
findPackage(string $name, string|\Composer\Semver\Constraint\ConstraintInterface $constraint) : \Composer\Package\PackageInterface|null
Searches for the first match of a package by name and version.
string | $name | package name |
string|\Composer\Semver\Constraint\ConstraintInterface | $constraint | package version or version constraint to match against |
findPackages(string $name, string|\Composer\Semver\Constraint\ConstraintInterface $constraint = null) : array<mixed,\Composer\Package\PackageInterface>
Searches for all packages matching a name and optionally a version.
string | $name | package name |
string|\Composer\Semver\Constraint\ConstraintInterface | $constraint | package version or version constraint to match against |
getPackages() : array<mixed,\Composer\Package\PackageInterface>
Returns list of registered packages.
search(string $query, integer $mode) : array<mixed,array>
Searches the repository for packages containing the query
string | $query | search query |
integer | $mode | a set of SEARCH_* constants to search on, implementations should do a best effort only |
an array of array('name' => '...', 'description' => '...')
addPackage(\Composer\Package\PackageInterface $package)
Adds package to the repository.
\Composer\Package\PackageInterface | $package | package instance |
removePackage(\Composer\Package\PackageInterface $package)
Removes package from the repository.
\Composer\Package\PackageInterface | $package | package instance |
getCanonicalPackages() : array<mixed,\Composer\Package\PackageInterface>
Get unique packages (at most one package of each name), with aliases resolved and removed.
<?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\Repository;
use Composer\Package\PackageInterface;
/**
* Writable repository interface.
*
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
interface WritableRepositoryInterface extends RepositoryInterface
{
/**
* Writes repository (f.e. to the disc).
*/
public function write();
/**
* Adds package to the repository.
*
* @param PackageInterface $package package instance
*/
public function addPackage(PackageInterface $package);
/**
* Removes package from the repository.
*
* @param PackageInterface $package package instance
*/
public function removePackage(PackageInterface $package);
/**
* Get unique packages (at most one package of each name), with aliases resolved and removed.
*
* @return PackageInterface[]
*/
public function getCanonicalPackages();
/**
* Forces a reload of all packages.
*/
public function reload();
}