Skip to content
This repository was archived by the owner on Mar 9, 2023. It is now read-only.
Open
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
26 changes: 21 additions & 5 deletions src/shell/packager.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,15 @@ public function run()
if ($this->getArg('composer')) {
try {
$this->_pathToComposerJson = $this->getArg('composer');
$name = $this->getModuleName();
$this->getConfig()->setData('name', $name);
$extension_name = $this->getExtensionName();
$package_name = $this->getPackageName();
$this->getConfig()->setData('name', $package_name);
$this->getConfig()->setData('channel', $this->getChannel());
$this->getConfig()->setData('license', $this->getLicense());
$this->getConfig()->setData('license_uri', $this->getLicenseUri());
$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('version', (string)Mage::getConfig()->getNode()->modules->$extension_name->version);
$this->getConfig()->setData('stability', $this->getStability());
$this->getConfig()->setData('authors', $this->getAuthors());
$this->getConfig()->setData('depends_php_min', $this->getPhpMin());
Expand Down Expand Up @@ -134,9 +135,24 @@ public function getPathToComposerJSON()
*
* @return string
*/
public function getModuleName()
public function getPackageName()
{
$name = $this->getComposerJson()->extra->magento_connect->name;
$name = $this->getComposerJson()->extra->magento_connect->package_name;
if (!$name) {
$name = $this->getComposerJson()->name;
$name = join('_', array_map('ucfirst', explode('/', $name)));
}
return $name;
}

/**
* Parse module name out of composer module name file.
*
* @return string
*/
public function getExtensionName()
{
$name = $this->getComposerJson()->extra->magento_connect->extension_name;
if (!$name) {
$name = $this->getComposerJson()->name;
$name = join('_', array_map('ucfirst', explode('/', $name)));
Expand Down