本文整理汇总了PHP中Composer\Installer\LibraryInstaller::getPackageBasePath方法的典型用法代码示例。如果您正苦于以下问题:PHP LibraryInstaller::getPackageBasePath方法的具体用法?PHP LibraryInstaller::getPackageBasePath怎么用?PHP LibraryInstaller::getPackageBasePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Composer\Installer\LibraryInstaller
的用法示例。
在下文中一共展示了LibraryInstaller::getPackageBasePath方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPackageBasePath
/**
* @param PackageInterface $package
*
* @return string
*/
public function getPackageBasePath(PackageInterface $package)
{
$extra = $package->getExtra();
print_r($extra);
// get dependency glue packages
return parent::getPackageBasePath($package);
}
示例2: getPackageBasePath
/**
* {@inheritDoc}
*/
public function getPackageBasePath(PackageInterface $package)
{
if (!$this->isSharedInstallEnabled($package)) {
return parent::getPackageBasePath($package);
}
return $this->getSharedDir() . DIRECTORY_SEPARATOR . $package->getUniqueName();
}
示例3: getPackageBasePath
/**
* {@inheritDoc}
*/
public function getPackageBasePath(PackageInterface $package)
{
if (empty($this->drupalLibraryMap[$package->getPrettyName()])) {
$path = parent::getPackageBasePath($package);
} else {
$path = $this->drupalLibrariesPath . $this->drupalLibraryMap[$package->getPrettyName()];
}
return $path;
}
示例4: getPackageBasePath
/**
* An override to return the correct destination for a package.
*
* @param PackageInterface $package
* @return string
*/
public function getPackageBasePath(PackageInterface $package)
{
$parts = explode('_', $package->getName());
if ('qcubed/plugin' === $parts[0]) {
$this->initializeVendorDir();
return ($this->vendorDir ? $this->vendorDir . '/' : '') . 'qcubed/plugin/' . $parts[1];
} else {
return parent::getPackageBasePath($package);
}
}
示例5: getPackageBasePath
/**
* @param PackageInterface $package
*
* @return string
*/
public function getPackageBasePath(PackageInterface $package)
{
$root = $this->composer->getPackage();
if ($rootPath = $this->getRootPath($root, $package)) {
return $rootPath . "/" . $package->getName();
}
if ($packagePath = $this->getPackagePath($package)) {
return $packagePath . "/" . $package->getName();
}
return parent::getPackageBasePath($package);
}
示例6: getPackageBasePath
/**
* {@inheritdoc}
*/
protected function getPackageBasePath(PackageInterface $package)
{
switch ($package->getType()) {
case self::TYPE_MOODLE_SOURCE:
$basePath = $this->getMoodleDir();
break;
default:
$basePath = parent::getPackageBasePath($package);
}
return $basePath;
}
示例7: getPackageBasePath
/**
* {@inheritDoc}
*/
public function getPackageBasePath(PackageInterface $package)
{
$packageName = strtolower($package->getName());
if (isset($this->cached[$packageName])) {
return $this->cached[$packageName];
}
if ($packageName === 'drupal/drupal') {
$path = $this->drupalRoot;
} else {
list($vendor, $name) = explode('/', $packageName);
$path = '';
foreach (array('module' => 'drupalModules', 'theme' => 'drupalThemes') as $type => $drupalType) {
if ($package->getType() === "drupal-{$type}") {
$subdir = "project";
foreach (array($packageName, "{$vendor}/*") as $key) {
if (isset($this->{$drupalType}[$key])) {
$subdir = $this->{$drupalType}[$key];
}
}
$path = "{$this->drupalRoot}/sites/all/{$type}s/{$subdir}/{$name}";
}
}
if (!$path) {
foreach (array($packageName, "{$vendor}/*") as $key) {
if (isset($this->drupalLibraries[$key])) {
$path = $this->drupalRoot . '/sites/all/libraries/';
$path .= empty($this->drupalLibraries[$key]) ? $name : $this->drupalLibraries[$key];
}
}
}
}
if ($path) {
$this->io->write("Installing <info>{$packageName}</info> in <info>{$path}.</info>");
} else {
$path = parent::getPackageBasePath($package);
}
$this->cached[$packageName] = $path;
return $path;
}
示例8: getPackageBasePath
/**
* {@inheritDoc}
*/
protected function getPackageBasePath(PackageInterface $package)
{
$this->initializeVendorDir();
$path = $this->getYiiPackageBasePath($package->getType(), $this->yiiPaths, $this->vendorDir, $package->getName());
if ($path === false) {
return parent::getPackageBasePath($package);
}
return $path;
}
示例9: getPackageBasePath
protected function getPackageBasePath(PackageInterface $package)
{
if ($this->_isInUse) {
// If certains packages are specified to be global
if (!empty($this->_globalPackages) && !in_array($package->getName(), $this->_globalPackages)) {
return parent::getPackageBasePath($package);
}
$this->initializeGlobalDir();
$this->initializeVendorDir();
return $this->_globalDir . '/' . $this->getPackagePath($package);
} else {
return parent::getPackageBasePath($package);
}
}