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


PHP LibraryInstaller::installCode方法代码示例

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


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

示例1: installCode

 /**
  * Override LibraryInstaller::installCode() to hook in additional post-download steps.
  *
  * @param PackageInterface $package Package instance
  */
 protected function installCode(PackageInterface $package)
 {
     parent::installCode($package);
     if (!$this->supports($package->getType())) {
         return;
     }
     $this->mirrorReleaseItems($package);
     $this->checkGitignore($package);
 }
开发者ID:loadsys,项目名称:puphpet-release-composer-installer,代码行数:14,代码来源:PuphpetReleaseInstaller.php

示例2: installCode

 /**
  * {@inheritDoc}
  *
  * @throws \Exception if the symbolic link fails
  */
 protected function installCode(PackageInterface $package)
 {
     $localPath = $this->getLocalPathForPackage($package);
     if (is_null($localPath)) {
         return parent::installCode($package);
     }
     $this->io->write("  - Symlinking <info>" . $package->getName() . "</info>");
     $this->debug("Symlinking to local path <comment>{$localPath}</comment>");
     $this->initializeVendorSubdir($package);
     if (true !== @symlink($localPath, $this->getInstallPath($package))) {
         throw new \Exception('Symlinking of "' . $localPath . '" failed');
     }
     return true;
 }
开发者ID:far-blue,项目名称:dev-linker,代码行数:19,代码来源:DevLinker.php

示例3: installCode

 protected function installCode(PackageInterface $package)
 {
     parent::installCode($package);
     $isWindows = Platform::isWindows();
     $php_bin = $this->binDir . ($isWindows ? '/composer-php.bat' : '/composer-php');
     if (!$isWindows) {
         $php_bin = '/usr/bin/env ' . $php_bin;
     }
     $installPath = $this->getInstallPath($package);
     $vars = array('os' => $isWindows ? 'windows' : 'linux', 'php_bin' => $php_bin, 'pear_php' => $installPath, 'php_dir' => $installPath, 'bin_dir' => $installPath . '/bin', 'data_dir' => $installPath . '/data', 'version' => $package->getPrettyVersion());
     $packageArchive = $this->getInstallPath($package) . '/' . pathinfo($package->getDistUrl(), PATHINFO_BASENAME);
     $pearExtractor = new PearPackageExtractor($packageArchive);
     $pearExtractor->extractTo($this->getInstallPath($package), array('php' => '/', 'script' => '/bin', 'data' => '/data'), $vars);
     $this->io->writeError('    Cleaning up', true, IOInterface::VERBOSE);
     $this->filesystem->unlink($packageArchive);
 }
开发者ID:radykal-com,项目名称:composer,代码行数:16,代码来源:PearInstaller.php

示例4: installCode

 protected function installCode(PackageInterface $package)
 {
     parent::installCode($package);
     parent::initializeBinDir();
     $isWindows = defined('PHP_WINDOWS_VERSION_BUILD');
     $php_bin = $this->binDir . ($isWindows ? '/composer-php.bat' : '/composer-php');
     $installPath = $this->getInstallPath($package);
     $vars = array('os' => $isWindows ? 'windows' : 'linux', 'php_bin' => $php_bin, 'pear_php' => $installPath, 'php_dir' => $installPath, 'bin_dir' => $installPath . '/bin', 'data_dir' => $installPath . '/data', 'version' => $package->getPrettyVersion());
     $packageArchive = $this->getInstallPath($package) . '/' . pathinfo($package->getDistUrl(), PATHINFO_BASENAME);
     $pearExtractor = new PearPackageExtractor($packageArchive);
     $pearExtractor->extractTo($this->getInstallPath($package), array('php' => '/', 'script' => '/bin', 'data' => '/data'), $vars);
     if ($this->io->isVerbose()) {
         $this->io->write('    Cleaning up');
     }
     unlink($packageArchive);
 }
开发者ID:4rejin,项目名称:composer,代码行数:16,代码来源:PearInstaller.php

示例5: installCode

 protected function installCode(PackageInterface $package)
 {
     parent::installCode($package);
     $name = $package->getNames()[0];
     $downloadPath = $this->getInstallPath($package);
     $extra = $this->composer->getPackage()->getExtra();
     if (isset($extra['redistribute']) && isset($extra['redistribute'][$name])) {
         $rules = $extra['redistribute'][$name];
         foreach ($rules as $rule) {
             $basePath = $downloadPath . "/" . $rule['path'];
             if (file_exists($basePath)) {
                 $destinationPath = $downloadPath . "/" . $rule['destination'];
                 rename($basePath, $destinationPath);
             }
         }
     }
 }
开发者ID:3runoDesign,项目名称:composer-custom-directory,代码行数:17,代码来源:LibraryInstaller.php

示例6: installCode

 /**
  * {@inheritDoc}
  */
 protected function installCode(PackageInterface $package)
 {
     $installPath = $this->getInstallPath($package);
     $publicPath = $this->getPublicPath();
     $local = $this->getLocalRepositoryPath();
     $installed = false;
     if ($local !== null) {
         $path = $local . DIRECTORY_SEPARATOR . $package->getName();
         if (!$this->filesystem->isAbsolutePath($path)) {
             $path = $this->filesystem->normalizePath(getcwd() . '/' . $path);
         }
         if (file_exists($path)) {
             try {
                 $this->symlink($path, $installPath);
                 $installed = true;
             } catch (\Exception $e) {
                 $installed = false;
             }
         }
     }
     if (!$installed) {
         parent::installCode($package);
     }
     // symlink package public folder to keeko's public folder
     $type = $package->getType();
     if ($type !== 'keeko-core') {
         $packagePublicPath = $this->filesystem->normalizePath($installPath . '/public');
         if (!$this->filesystem->isAbsolutePath($packagePublicPath)) {
             $packagePublicPath = $this->filesystem->normalizePath(getcwd() . '/' . $packagePublicPath);
         }
         if (file_exists($packagePublicPath) && file_exists($publicPath)) {
             $target = $this->filesystem->normalizePath($publicPath . '/' . $this->getPackageDir($type) . '/' . $package->getName());
             $this->filesystem->ensureDirectoryExists(dirname($target));
             $this->symlink($packagePublicPath, $target);
         }
     }
 }
开发者ID:JasLin,项目名称:composer-installer,代码行数:40,代码来源:KeekoComposerInstaller.php

示例7: installCode

 /**
  * {@inheritDoc}
  */
 protected function installCode(PackageInterface $package)
 {
     parent::installCode($package);
     $this->deleteIgnoredFiles($package);
 }
开发者ID:cychenyin,项目名称:postmill,代码行数:8,代码来源:AssetInstaller.php

示例8: installCode

 /**
  * {@inheritDoc}
  *
  * @throws \ComposerSymlinker\FilesystemSymlinkerException if the symbolic link fails
  *
  * @link    https://github.com/symfony/Filesystem/blob/master/Filesystem.php#L310
  */
 protected function installCode(PackageInterface $package)
 {
     $local_path = $this->getLocalPackagePath($package);
     if (!is_null($local_path)) {
         $this->io->write("  - Installing <info>" . $package->getName() . "</info> (<comment>as a symbolic link of " . $local_path . "</comment>)");
         $this->initializeVendorSubdir($package);
         if (true !== @symlink($local_path, $this->getInstallPath($package))) {
             throw new FilesystemSymlinkerException(sprintf('Symlink fails: "%s" => "%s"', $local_path, $this->getInstallPath($package)));
         }
         return true;
     }
     return parent::installCode($package);
 }
开发者ID:piwi,项目名称:composer-symlinker,代码行数:20,代码来源:LocalInstaller.php

示例9: installCode

 /**
  * Before installing the Component, be sure its destination is clear first.
  *
  * @param PackageInterface $package
  */
 public function installCode(PackageInterface $package)
 {
     $this->removeComponent($package);
     parent::installCode($package);
 }
开发者ID:robloach,项目名称:component-installer,代码行数:10,代码来源:Installer.php

示例10: installCode

 /**
  * {@inheritdoc}
  */
 public function installCode(PackageInterface $package)
 {
     $map = $this->mapSources($package);
     parent::installCode($package);
     $this->updateSources($map, $package);
     $this->updateUserfiles($package);
     $this->updateRootFiles($package);
     $root = $this->plugin->getContaoRoot($this->composer->getPackage()) . DIRECTORY_SEPARATOR;
     $installPath = self::unprefixPath($root, $this->getInstallPath($package));
     RunonceManager::addRunonces($package, $installPath);
 }
开发者ID:Jobu,项目名称:core,代码行数:14,代码来源:AbstractInstaller.php

示例11: installCode

 protected function installCode(PackageInterface $package)
 {
     if (!is_readable($this->getInstallPath($package))) {
         parent::installCode($package);
     }
 }
开发者ID:itscaro,项目名称:composer-global-installer,代码行数:6,代码来源:GlobalInstaller.php

示例12: installCode

 /**
  * {@inheritdoc}
  */
 protected function installCode(PackageInterface $package)
 {
     $package = AssetPlugin::addMainFiles($this->composer, $package);
     parent::installCode($package);
     $this->deleteIgnoredFiles($package);
 }
开发者ID:DYFeng,项目名称:composer-asset-plugin,代码行数:9,代码来源:AssetInstaller.php

示例13: installCode

 public function installCode(PackageInterface $package)
 {
     list($config_file, $contents) = $this->preCodeUpdate($package);
     parent::installCode($package);
     $this->postCodeUpdate($config_file, $contents);
 }
开发者ID:passbolt,项目名称:passbolt_selenium,代码行数:6,代码来源:SausageInstaller.php

示例14: installCode

 /**
  * {@inheritDoc}
  */
 protected function installCode(PackageInterface $package)
 {
     parent::installCode($package);
     $this->postInstallActions($package, $this->getInstallPath($package));
 }
开发者ID:projek-xyz,项目名称:ci-installer,代码行数:8,代码来源:ComposerInstaller.php

示例15: installCode

 public function installCode(PackageInterface $package)
 {
     $map = $this->mapSources($package);
     parent::installCode($package);
     $this->updateSources($map, $package);
     $this->updateUserfiles($package);
     $this->updateRunonce($package);
 }
开发者ID:contao-community-alliance,项目名称:composer-installer,代码行数:8,代码来源:ModuleInstaller.php


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