Skip to content
This repository was archived by the owner on May 7, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Example
],
"extra":{
"magento_connect":{
"license_uri":"http://www.gnu.org/licenses/gpl-3.0.html",
"summary":"",
"channel":"community",
"php_min":"5.3.0",
"php_max":"6.0.0",
Expand Down Expand Up @@ -78,17 +80,23 @@ If you would like to install extensions via [composer magento installer](https:/
you should use `magento-module`. The packager ignore this property.

### license
Please use some key from [http://www.spdx.org/licenses/].
The name of the license the package is covered by. Will also be used as a key from [http://www.spdx.org/licenses/], if an explicit URI is not provided in the `magento_connect` options.

### description
A detailed description of you module. It will be used as description and summery.
A detailed description of you module. It will be used as description and the summary, if an explicit summary is not provided in the `magento_connect` options.

### homepage
Nothing more to say

### authors
Who developed the module

### magento_connect license_uri
URI for a copy of the license text. If no value is provided the URI will default to using the value of `license` as a key from [http://www.spdx.org/licenses/].

### magento_connect summary
A brief summary of your module. If no value is provided then the `description` will be used.

### magento_connect channel
Which channel should be used in magento connect.

Expand Down
18 changes: 17 additions & 1 deletion src/shell/packager.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function run()
$this->getConfig()->setData('channel', $this->getChannel());
$this->getConfig()->setData('license', $this->getLicense());
$this->getConfig()->setData('license_uri', $this->getLicenseUri());
$this->getConfig()->setData('summary', $this->getDescription());
$this->getConfig()->setData('summary', $this->getSummary());
$this->getConfig()->setData('description', $this->getDescription());
$this->getConfig()->setData('version', (string)Mage::getConfig()->getNode()->modules->$name->version);
$this->getConfig()->setData('stability', $this->getStability());
Expand Down Expand Up @@ -196,9 +196,25 @@ public function getLicense()
*/
public function getLicenseUri()
{
if(isset($this->getComposerJson()->extra->magento_connect->license_uri)) {
return $this->getComposerJson()->extra->magento_connect->license_uri;
}
return "http://www.spdx.org/licenses/" . $this->getLicense();
}

/**
* Get the summary for the project. Falls back to description if summary is not explicitly set.
* @return mixed
*/
public function getSummary()
{
if(isset($this->getComposerJson()->extra->magento_connect->summary)) {
return $this->getComposerJson()->extra->magento_connect->summary;
}

return $this->getDescription();
}

/**
* Get description for the project.
*
Expand Down