rename installAs to target-dir
parent
3e12d2f64b
commit
774e8584fd
|
@ -13,7 +13,7 @@
|
|||
"type": "string",
|
||||
"optional": true
|
||||
},
|
||||
"installAs": {
|
||||
"target-dir": {
|
||||
"description": "Override install location of package",
|
||||
"type": "string"
|
||||
},
|
||||
|
|
|
@ -134,8 +134,8 @@ EOT
|
|||
foreach ($installPaths as $item) {
|
||||
list($package, $installPath) = $item;
|
||||
|
||||
if (null !== $package->getInstallAs()) {
|
||||
$installPath = substr($installPath, 0, -strlen('/'.$package->getInstallAs()));
|
||||
if (null !== $package->getTargetDir()) {
|
||||
$installPath = substr($installPath, 0, -strlen('/'.$package->getTargetDir()));
|
||||
}
|
||||
|
||||
foreach ($package->getAutoload() as $type => $mapping) {
|
||||
|
|
|
@ -126,10 +126,10 @@ class LibraryInstaller implements InstallerInterface
|
|||
|
||||
public function getInstallPath(PackageInterface $package)
|
||||
{
|
||||
if (null === $package->getInstallAs()) {
|
||||
if (null === $package->getTargetDir()) {
|
||||
return ($this->directory ? $this->directory.'/' : '').$package->getName();
|
||||
}
|
||||
|
||||
return ($this->directory ? $this->directory.'/' : '').$package->getInstallAs();
|
||||
return ($this->directory ? $this->directory.'/' : '').$package->getTargetDir();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,11 +40,11 @@ class ArrayDumper
|
|||
'recommends',
|
||||
'suggests',
|
||||
'autoload',
|
||||
'installAs',
|
||||
);
|
||||
|
||||
$data = array();
|
||||
$data['name'] = $package->getPrettyName();
|
||||
$data['target-dir'] = $package->getTargetDir();
|
||||
foreach ($keys as $key) {
|
||||
$getter = 'get'.ucfirst($key);
|
||||
$value = $package->$getter();
|
||||
|
|
|
@ -46,8 +46,8 @@ class ArrayLoader
|
|||
|
||||
$package->setType(isset($config['type']) ? $config['type'] : 'library');
|
||||
|
||||
if (isset($config['installAs'])) {
|
||||
$package->setInstallAs($config['installAs']);
|
||||
if (isset($config['target-dir'])) {
|
||||
$package->setTargetDir($config['target-dir']);
|
||||
}
|
||||
|
||||
if (isset($config['extra'])) {
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace Composer\Package;
|
|||
class MemoryPackage extends BasePackage
|
||||
{
|
||||
protected $type;
|
||||
protected $installAs;
|
||||
protected $targetDir;
|
||||
protected $installationSource;
|
||||
protected $sourceType;
|
||||
protected $sourceUrl;
|
||||
|
@ -74,19 +74,19 @@ class MemoryPackage extends BasePackage
|
|||
}
|
||||
|
||||
/**
|
||||
* @param string $installAs
|
||||
* @param string $targetDir
|
||||
*/
|
||||
public function setInstallAs($installAs)
|
||||
public function setTargetDir($targetDir)
|
||||
{
|
||||
$this->installAs = $installAs;
|
||||
$this->targetDir = $targetDir;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getInstallAs()
|
||||
public function getTargetDir()
|
||||
{
|
||||
return $this->installAs;
|
||||
return $this->targetDir;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -76,11 +76,11 @@ interface PackageInterface
|
|||
function getType();
|
||||
|
||||
/**
|
||||
* Returns the package installAs property
|
||||
* Returns the package targetDir property
|
||||
*
|
||||
* @return string The package installAs
|
||||
* @return string The package targetDir
|
||||
*/
|
||||
function getInstallAs();
|
||||
function getTargetDir();
|
||||
|
||||
/**
|
||||
* Returns the package extra data
|
||||
|
|
|
@ -67,8 +67,8 @@ class GitRepository extends ArrayRepository
|
|||
$package->setSourceType('git');
|
||||
$package->setSourceUrl($this->url);
|
||||
|
||||
if (isset($data['installAs'])) {
|
||||
$package->setInstallAs($data['installAs']);
|
||||
if (isset($data['target-dir'])) {
|
||||
$package->setTargetDir($data['target-dir']);
|
||||
}
|
||||
|
||||
if (isset($data['license'])) {
|
||||
|
|
Loading…
Reference in New Issue