1
0
Fork 0

rename installAs to target-dir

pull/44/head
Igor Wiedler 2011-10-16 18:52:08 +02:00
parent 3e12d2f64b
commit 774e8584fd
8 changed files with 19 additions and 19 deletions

View File

@ -13,7 +13,7 @@
"type": "string",
"optional": true
},
"installAs": {
"target-dir": {
"description": "Override install location of package",
"type": "string"
},

View File

@ -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) {

View File

@ -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();
}
}

View File

@ -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();

View File

@ -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'])) {

View File

@ -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;
}
/**

View File

@ -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

View File

@ -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'])) {