当前位置: 首页>>代码示例>>PHP>>正文


PHP LibraryInstaller::install方法代码示例

本文整理汇总了PHP中Composer\Installer\LibraryInstaller::install方法的典型用法代码示例。如果您正苦于以下问题:PHP LibraryInstaller::install方法的具体用法?PHP LibraryInstaller::install怎么用?PHP LibraryInstaller::install使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Composer\Installer\LibraryInstaller的用法示例。


在下文中一共展示了LibraryInstaller::install方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: install

 /**
  * @param InstalledRepositoryInterface $repo
  * @param PackageInterface             $package
  */
 public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if ($package->isDev()) {
         $this->symlinkInstaller->install($repo, $package);
     } else {
         $this->defaultInstaller->install($repo, $package);
     }
 }
开发者ID:JasLin,项目名称:composer-shared-package-plugin,代码行数:12,代码来源:SharedPackageInstallerSolver.php

示例2: install

 public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $pluginName = self::assertBarberryPlugin($package);
     parent::install($repo, $package);
     $this->registerAutoloader($package);
     $this->installPlugin($package, $pluginName);
 }
开发者ID:lionjsa,项目名称:barberry-plugin-installer,代码行数:7,代码来源:ComposerInstaller.php

示例3: install

 /**
  * {@inheritDoc}
  */
 public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     parent::install($repo, $package);
     $path = $this->getInstallPath($package);
     $ns = $this->primaryNamespace($package);
     $this->updateConfig($ns, $path);
 }
开发者ID:CoreTyson,项目名称:plugin-installer,代码行数:10,代码来源:Installer.php

示例4: install

 /**
  * {@inheritDoc}
  */
 public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $this->rcubeVersionCheck($package);
     parent::install($repo, $package);
     // post-install: activate plugin in Roundcube config
     $config_file = $this->rcubeConfigFile();
     $extra = $package->getExtra();
     $plugin_name = $this->getPluginName($package);
     if (is_writeable($config_file) && php_sapi_name() == 'cli') {
         $answer = $this->io->askConfirmation("Do you want to activate the plugin {$plugin_name}? [N|y] ", false);
         if (true === $answer) {
             $this->rcubeAlterConfig($plugin_name, true);
         }
     }
     // initialize database schema
     if (!empty($extra['roundcube']['sql-dir'])) {
         if ($sqldir = realpath($this->getVendorDir() . "/{$plugin_name}/" . $extra['roundcube']['sql-dir'])) {
             system(getcwd() . "/vendor/bin/rcubeinitdb.sh --package={$plugin_name} --dir={$sqldir}");
         }
     }
     // run post-install script
     if (!empty($extra['roundcube']['post-install-script'])) {
         $this->rcubeRunScript($extra['roundcube']['post-install-script'], $package);
     }
 }
开发者ID:vStone,项目名称:plugin-installer,代码行数:28,代码来源:PluginInstaller.php

示例5: install

 /**
  * {@inheritdoc}
  */
 public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if ($this->isInstallFromSpressRoot() && self::TYPE_PLUGIN === $package->getType()) {
         return;
     }
     parent::install($repo, $package);
 }
开发者ID:spress,项目名称:spress-installer,代码行数:10,代码来源:Installer.php

示例6: install

 /**
  * Installs specific package.
  *
  * @param  InstalledRepositoryInterface $repo    repository in which to check
  * @param  PackageInterface             $package package instance
  * @throws InvalidArgumentException
  */
 public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if (substr($package->getPrettyName(), -strlen('-component')) !== '-component') {
         throw new \InvalidArgumentException('The name of any package typed `nooku-component` must be formatted as `vendor/name-component`. Aborting.');
     }
     parent::install($repo, $package);
     $this->_installAutoloader($package);
 }
开发者ID:oligriffiths,项目名称:nooku-installer,代码行数:15,代码来源:NookuComponent.php

示例7: install

 /**
  * Installs specific package.
  *
  * @param InstalledRepositoryInterface $repo repository in which to check
  * @param PackageInterface $package package instance
  */
 public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $extra = $package->getExtra();
     if (array_key_exists('pxb-config', $extra)) {
         $this->loadModule($package, $extra['pxb-config']);
     }
     parent::install($repo, $package);
 }
开发者ID:DaGhostman,项目名称:pxb-composer,代码行数:14,代码来源:ModuleInstaller.php

示例8: install

 /**
  * {@inheritDoc}
  */
 public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $extra = $package->getExtra();
     if (empty($extra['class'])) {
         throw new \UnexpectedValueException('Error while installing ' . $package->getPrettyName() . ', composer-plugin packages should have a class defined in their extra key to be usable.');
     }
     parent::install($repo, $package);
     $this->composer->getPluginManager()->registerPackage($package, true);
 }
开发者ID:Flesh192,项目名称:magento,代码行数:12,代码来源:PluginInstaller.php

示例9: install

 /**
  * Add symlinks for Contao sources after installing a package.
  *
  * {@inheritdoc}
  */
 public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $this->logVerbose(sprintf('Installing Contao sources for %s', $package->getName()));
     parent::install($repo, $package);
     $this->addSymlinks($package, $this->getContaoRoot(), $this->getSources($package));
     $this->addCopies($package, $this->getFilesRoot(), $this->getUserFiles($package), self::DUPLICATE_IGNORE);
     $this->addRunonces($package, $this->getRunonces($package));
     $this->logVerbose('');
 }
开发者ID:contao-community-alliance,项目名称:composer-plugin,代码行数:14,代码来源:AbstractModuleInstaller.php

示例10: install

 /**
  * {@inheritDoc}
  */
 public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     parent::install($repo, $package);
     if (is_null($this->package_installer)) {
         $this->io->write('<error>PackageInstaller not ready or missing configuration: package could not be installed.</error>');
     } else {
         $this->packageInstall($package);
     }
 }
开发者ID:comodojo,项目名称:comodojo-installer,代码行数:12,代码来源:Installer.php

示例11: install

 /**
  * {@inheritDoc}
  */
 public function install(PackageInterface $package)
 {
     $extra = $package->getExtra();
     if (empty($extra['class'])) {
         throw new \UnexpectedValueException('Error while installing ' . $package->getPrettyName() . ', composer-installer packages should have a class defined in their extra key to be usable.');
     }
     parent::install($package);
     $this->registerInstaller($package);
 }
开发者ID:natxet,项目名称:composer,代码行数:12,代码来源:InstallerInstaller.php

示例12: install

 /**
  * @param InstalledRepositoryInterface $repo
  * @param PackageInterface             $package
  */
 public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if (!is_readable($this->getInstallPath($package))) {
         parent::install($repo, $package);
     } elseif (!$repo->hasPackage($package)) {
         $this->binaryInstaller->installBinaries($package, $this->getInstallPath($package));
         $repo->addPackage(clone $package);
     }
     $this->createPackageVendorSymlink($package);
     $this->packageDataManager->addPackageUsage($package);
 }
开发者ID:letudiant,项目名称:composer-shared-package-plugin,代码行数:15,代码来源:SharedPackageInstaller.php

示例13: install

 public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $this->initGingerBackend();
     $extra = $package->getExtra();
     if (!isset($extra['plugin-namespace'])) {
         throw new Exception\RuntimeException(sprintf('Missing the key -plugin-namespace- in the -extra- property of the plugin -%s- composer.json.', $package->getName()));
     }
     parent::install($repo, $package);
     $pluginInstalledEvent = new Cqrs\PluginInstalledEvent(array('plugin_name' => $package->getName(), 'plugin_type' => $package->getType(), 'plugin_version' => $package->getVersion(), 'plugin_namespace' => $extra['plugin-namespace']));
     $this->getServiceManager()->get('malocher.cqrs.gate')->getBus()->publishEvent($pluginInstalledEvent);
 }
开发者ID:gingerwfms,项目名称:ginger-plugin-installer,代码行数:11,代码来源:GingerInstaller.php

示例14: install

 /**
  * @inheritdoc
  */
 public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     // install the package the normal composer way
     parent::install($repo, $package);
     // add the package to yiisoft/extensions.php
     $this->addPackage($package);
     // ensure the yii2-dev package also provides Yii.php in the same place as yii2 does
     if ($package->getName() == 'yiisoft/yii2-dev') {
         $this->linkBaseYiiFiles();
     }
 }
开发者ID:selenzo,项目名称:bsuir,代码行数:14,代码来源:Installer.php

示例15: testInstall

 /**
  * @depends testInstallerCreationShouldNotCreateVendorDirectory
  * @depends testInstallerCreationShouldNotCreateBinDirectory
  */
 public function testInstall()
 {
     $library = new LibraryInstaller($this->vendorDir, $this->binDir, $this->dm, $this->repository, $this->io);
     $package = $this->createPackageMock();
     $package->expects($this->once())->method('getPrettyName')->will($this->returnValue('some/package'));
     $this->dm->expects($this->once())->method('download')->with($package, $this->vendorDir . '/some/package');
     $this->repository->expects($this->once())->method('addPackage')->with($package);
     $library->install($package);
     $this->assertFileExists($this->vendorDir, 'Vendor dir should be created');
     $this->assertFileExists($this->binDir, 'Bin dir should be created');
 }
开发者ID:natxet,项目名称:composer,代码行数:15,代码来源:LibraryInstallerTest.php


注:本文中的Composer\Installer\LibraryInstaller::install方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。