1
0
Fork 0

added support section to composer.json

pull/426/head
digitalkaoz 2012-03-10 10:24:14 +01:00
parent 3fce97da89
commit 7cdb793b40
5 changed files with 67 additions and 0 deletions

View File

@ -191,6 +191,37 @@
"description": "Occurs after a package has been uninstalled, contains one or more Class::method callables." "description": "Occurs after a package has been uninstalled, contains one or more Class::method callables."
} }
} }
},
"support": {
"type": "object",
"additionalProperties": true,
"properties": {
"email": {
"type": "string",
"description": "Email address of the community.",
"format": "email"
},
"issues": {
"type": "string",
"description": "URL to the Issue Tracker.",
"format": "uri"
},
"forum": {
"type": "string",
"description": "URL to the Forum.",
"format": "uri"
},
"wiki": {
"type": "string",
"description": "URL to the Wiki.",
"format": "uri"
},
"irc": {
"type": "string",
"description": "Irc support channel"
} }
} }
}
}
} }

View File

@ -159,6 +159,13 @@ EOT
$output->writeln('<info>dist</info> : ' . sprintf('[%s] <comment>%s</comment> %s', $package->getDistType(), $package->getDistUrl(), $package->getDistReference())); $output->writeln('<info>dist</info> : ' . sprintf('[%s] <comment>%s</comment> %s', $package->getDistType(), $package->getDistUrl(), $package->getDistReference()));
$output->writeln('<info>names</info> : ' . implode(', ', $package->getNames())); $output->writeln('<info>names</info> : ' . implode(', ', $package->getNames()));
if ($package->getSupport()) {
$output->writeln("\n<info>support</info>");
foreach ($package->getSupport() as $type => $url) {
$output->writeln('<comment>' . $type . '</comment> : '.$url);
}
}
if ($package->getAutoload()) { if ($package->getAutoload()) {
$output->writeln("\n<info>autoload</info>"); $output->writeln("\n<info>autoload</info>");
foreach ($package->getAutoload() as $type => $autoloads) { foreach ($package->getAutoload() as $type => $autoloads) {

View File

@ -266,6 +266,10 @@ class AliasPackage extends BasePackage
{ {
return $this->aliasOf->getAuthors(); return $this->aliasOf->getAuthors();
} }
public function getSupport()
{
return $this->aliasOf->getSupport();
}
public function __toString() public function __toString()
{ {
return parent::__toString().' (alias of '.$this->aliasOf->getVersion().')'; return parent::__toString().' (alias of '.$this->aliasOf->getVersion().')';

View File

@ -171,6 +171,10 @@ class ArrayLoader
$package->setAutoload($config['autoload']); $package->setAutoload($config['autoload']);
} }
if (isset($config['support'])) {
$package->setSupport($config['support']);
}
return $package; return $package;
} }

View File

@ -56,6 +56,7 @@ class MemoryPackage extends BasePackage
protected $recommends = array(); protected $recommends = array();
protected $suggests = array(); protected $suggests = array();
protected $autoload = array(); protected $autoload = array();
protected $support = array();
/** /**
* Creates a new in memory package. * Creates a new in memory package.
@ -623,4 +624,24 @@ class MemoryPackage extends BasePackage
{ {
return $this->autoload; return $this->autoload;
} }
/**
* Set the support information
*
* @param array $support
*/
public function setSupport(array $support)
{
$this->support = $support;
}
/**
* Returns the support information
*
* @return array
*/
public function getSupport()
{
return $this->support;
}
} }