本文整理汇总了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);
}
}
示例2: install
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
{
$pluginName = self::assertBarberryPlugin($package);
parent::install($repo, $package);
$this->registerAutoloader($package);
$this->installPlugin($package, $pluginName);
}
示例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);
}
示例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);
}
}
示例5: install
/**
* {@inheritdoc}
*/
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
{
if ($this->isInstallFromSpressRoot() && self::TYPE_PLUGIN === $package->getType()) {
return;
}
parent::install($repo, $package);
}
示例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);
}
示例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);
}
示例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);
}
示例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('');
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
}
示例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');
}