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", "type": "string",
"optional": true "optional": true
}, },
"installAs": { "target-dir": {
"description": "Override install location of package", "description": "Override install location of package",
"type": "string" "type": "string"
}, },

View File

@ -134,8 +134,8 @@ EOT
foreach ($installPaths as $item) { foreach ($installPaths as $item) {
list($package, $installPath) = $item; list($package, $installPath) = $item;
if (null !== $package->getInstallAs()) { if (null !== $package->getTargetDir()) {
$installPath = substr($installPath, 0, -strlen('/'.$package->getInstallAs())); $installPath = substr($installPath, 0, -strlen('/'.$package->getTargetDir()));
} }
foreach ($package->getAutoload() as $type => $mapping) { foreach ($package->getAutoload() as $type => $mapping) {

View File

@ -126,10 +126,10 @@ class LibraryInstaller implements InstallerInterface
public function getInstallPath(PackageInterface $package) 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->getName();
} }
return ($this->directory ? $this->directory.'/' : '').$package->getInstallAs(); return ($this->directory ? $this->directory.'/' : '').$package->getTargetDir();
} }
} }

View File

@ -40,11 +40,11 @@ class ArrayDumper
'recommends', 'recommends',
'suggests', 'suggests',
'autoload', 'autoload',
'installAs',
); );
$data = array(); $data = array();
$data['name'] = $package->getPrettyName(); $data['name'] = $package->getPrettyName();
$data['target-dir'] = $package->getTargetDir();
foreach ($keys as $key) { foreach ($keys as $key) {
$getter = 'get'.ucfirst($key); $getter = 'get'.ucfirst($key);
$value = $package->$getter(); $value = $package->$getter();

View File

@ -46,8 +46,8 @@ class ArrayLoader
$package->setType(isset($config['type']) ? $config['type'] : 'library'); $package->setType(isset($config['type']) ? $config['type'] : 'library');
if (isset($config['installAs'])) { if (isset($config['target-dir'])) {
$package->setInstallAs($config['installAs']); $package->setTargetDir($config['target-dir']);
} }
if (isset($config['extra'])) { if (isset($config['extra'])) {

View File

@ -20,7 +20,7 @@ namespace Composer\Package;
class MemoryPackage extends BasePackage class MemoryPackage extends BasePackage
{ {
protected $type; protected $type;
protected $installAs; protected $targetDir;
protected $installationSource; protected $installationSource;
protected $sourceType; protected $sourceType;
protected $sourceUrl; 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} * {@inheritDoc}
*/ */
public function getInstallAs() public function getTargetDir()
{ {
return $this->installAs; return $this->targetDir;
} }
/** /**

View File

@ -76,11 +76,11 @@ interface PackageInterface
function getType(); 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 * Returns the package extra data

View File

@ -67,8 +67,8 @@ class GitRepository extends ArrayRepository
$package->setSourceType('git'); $package->setSourceType('git');
$package->setSourceUrl($this->url); $package->setSourceUrl($this->url);
if (isset($data['installAs'])) { if (isset($data['target-dir'])) {
$package->setInstallAs($data['installAs']); $package->setTargetDir($data['target-dir']);
} }
if (isset($data['license'])) { if (isset($data['license'])) {