/**
  * @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
0
 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
0
 /**
  * {@inheritdoc}
  */
 public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if ($this->isInstallFromSpressRoot() && self::TYPE_PLUGIN === $package->getType()) {
         return true;
     }
     return parent::isInstalled($repo, $package);
 }
 /**
  * {@inheritDoc}
  */
 public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if ($this->alwaysInstall($package)) {
         return false;
     }
     return parent::isInstalled($repo, $package);
 }
 /**
  * {@inheritDoc}
  */
 public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if (parent::isInstalled($repo, $package) == false) {
         return false;
     }
     return $repo->hasPackage($package) && $this->isInstalledBinaries($package);
 }
 /**
  * {@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
0
 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();
     }
 }
 /**
  * {@inheritDoc}
  */
 public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $loader = $this->getLoaderFileInstallPath($package);
     return parent::isInstalled($repo, $package) || is_readable($loader);
 }
 /**
  * {@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));
 }
 /**
  * {@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);
 }
 /**
  * {@inheritDoc}
  */
 public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     return parent::isInstalled($repo, $package);
 }
 /**
  * {@inheritdoc}
  */
 public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     return parent::isInstalled($repo, $package) && is_dir($this->getInstallPath($package) . '/module/Rubedo');
 }
 /**
  * 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());
 }