當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。