本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
}
}
}
示例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);
}
}
}
示例7: installCode
/**
* {@inheritDoc}
*/
protected function installCode(PackageInterface $package)
{
parent::installCode($package);
$this->deleteIgnoredFiles($package);
}
示例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);
}
示例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);
}
示例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);
}
示例11: installCode
protected function installCode(PackageInterface $package)
{
if (!is_readable($this->getInstallPath($package))) {
parent::installCode($package);
}
}
示例12: installCode
/**
* {@inheritdoc}
*/
protected function installCode(PackageInterface $package)
{
$package = AssetPlugin::addMainFiles($this->composer, $package);
parent::installCode($package);
$this->deleteIgnoredFiles($package);
}
示例13: installCode
public function installCode(PackageInterface $package)
{
list($config_file, $contents) = $this->preCodeUpdate($package);
parent::installCode($package);
$this->postCodeUpdate($config_file, $contents);
}
示例14: installCode
/**
* {@inheritDoc}
*/
protected function installCode(PackageInterface $package)
{
parent::installCode($package);
$this->postInstallActions($package, $this->getInstallPath($package));
}
示例15: installCode
public function installCode(PackageInterface $package)
{
$map = $this->mapSources($package);
parent::installCode($package);
$this->updateSources($map, $package);
$this->updateUserfiles($package);
$this->updateRunonce($package);
}