本文整理汇总了PHP中Composer\Installer\LibraryInstaller::isInstalled方法的典型用法代码示例。如果您正苦于以下问题:PHP LibraryInstaller::isInstalled方法的具体用法?PHP LibraryInstaller::isInstalled怎么用?PHP LibraryInstaller::isInstalled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Composer\Installer\LibraryInstaller
的用法示例。
在下文中一共展示了LibraryInstaller::isInstalled方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isInstalled
/**
* @param InstalledRepositoryInterface $repo
* @param PackageInterface $package
*
* @return bool
*/
public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
{
if ($package->isDev()) {
return $this->symlinkInstaller->isInstalled($repo, $package);
}
return $this->defaultInstaller->isInstalled($repo, $package);
}
示例2: testIsInstalled
public function testIsInstalled()
{
$library = new LibraryInstaller($this->vendorDir, $this->binDir, $this->dm, $this->repository, $this->io);
$package = $this->createPackageMock();
$this->repository->expects($this->exactly(2))->method('hasPackage')->with($package)->will($this->onConsecutiveCalls(true, false));
$this->assertTrue($library->isInstalled($package));
$this->assertFalse($library->isInstalled($package));
}
示例3: isInstalled
/**
* {@inheritdoc}
*/
public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
{
if ($this->isInstallFromSpressRoot() && self::TYPE_PLUGIN === $package->getType()) {
return true;
}
return parent::isInstalled($repo, $package);
}
示例4: isInstalled
/**
* {@inheritDoc}
*/
public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
{
if ($this->alwaysInstall($package)) {
return false;
}
return parent::isInstalled($repo, $package);
}
开发者ID:azt3k,项目名称:non-destructive-archive-installer,代码行数:10,代码来源:NonDestructiveArchiveInstallerInstaller.php
示例5: isInstalled
/**
* {@inheritDoc}
*/
public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
{
if (parent::isInstalled($repo, $package) == false) {
return false;
}
return $repo->hasPackage($package) && $this->isInstalledBinaries($package);
}
示例6: isInstalled
/**
* {@inheritDoc}
*/
public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
{
$installed = parent::isInstalled($repo, $package);
if ($installed) {
foreach ($this->getEntryFileLocations($package) as $entryFile) {
if (!$this->filesystem->isFile($entryFile)) {
$installed = false;
break;
}
}
}
return $installed;
}
示例7: install
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
{
// install files
if (!parent::isInstalled($repo, $package)) {
parent::install($repo, $package);
}
// parse config xml
$dir = $this->composer->getConfig()->get('vendor-dir');
$config = $dir . '/' . $package->getName() . '/config.xml';
if (is_file($config)) {
// make service autoloadable
$classLoader = $this->getClassLoader($package);
$classLoader->register();
try {
// create service
$hm = $this->container->get('handlerManager');
$handler = $hm->getHandler('AmunService\\Core\\Service');
$record = $handler->getRecord();
if ($package->getInstallationSource() == 'source') {
$source = $package->getSourceUrl();
} else {
if ($package->getInstallationSource() == 'dist') {
$source = $package->getDistUrl();
}
}
$record->setSource($source);
$record->setAutoloadPath($this->getAutoloadPath($package, $config));
$record->setConfig($config);
$record->setName($package->getPrettyName());
$record->setLink($package->getHomepage());
$record->setLicense(implode(', ', $package->getLicense()));
$record->setVersion($package->getPrettyVersion());
$handler->create($record);
} catch (\Exception $e) {
$this->container->get('logger')->error($e->getMessage());
}
$classLoader->unregister();
}
}
示例8: isInstalled
/**
* {@inheritDoc}
*/
public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
{
$loader = $this->getLoaderFileInstallPath($package);
return parent::isInstalled($repo, $package) || is_readable($loader);
}
示例9: isInstalled
/**
* {@inheritDoc}
*/
public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
{
$parent = parent::isInstalled($repo, $package);
if (!$parent) {
return $parent;
}
return file_exists($this->getAssetsInstallPath($package)) && is_readable($this->getAssetsInstallPath($package));
}
示例10: isInstalled
/**
* {@inheritDoc}
*/
public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
{
$installer = $this->_application->getInstaller();
$installer->setPath('source', $this->getInstallPath($package));
$manifest = $installer->getManifest();
$manifestPath = $installer->getPath('manifest');
if (file_exists($manifestPath) && $manifest) {
$type = (string) $manifest->attributes()->type;
$element = $this->_getElementFromManifest($manifest, $manifestPath);
if (!empty($element)) {
return $this->_application->hasExtension($element, $type);
}
}
return parent::isInstalled($repo, $package);
}
示例11: isInstalled
/**
* {@inheritDoc}
*/
public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
{
return parent::isInstalled($repo, $package);
}
示例12: isInstalled
/**
* {@inheritdoc}
*/
public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
{
return parent::isInstalled($repo, $package) && is_dir($this->getInstallPath($package) . '/module/Rubedo');
}
示例13: isInstalled
/**
* Checks that provided package is installed.
*
* @param InstalledRepositoryInterface $repo
* repository in which to check
* @param PackageInterface $package
* package instance
*
* @return bool
*/
public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
{
return parent::isInstalled($repo, $package) && is_dir($this->getComponentPath());
}