Last active
August 29, 2015 14:02
-
-
Save rskuipers/87ba0e0daede7ce24e7c to your computer and use it in GitHub Desktop.
Magento CLI create package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'abstract.php'; | |
class RSKuipers_Shell_Packager extends Mage_Shell_Abstract | |
{ | |
public function run() | |
{ | |
$package = $this->getArg('package'); | |
$outputDir = $this->getArg('output'); | |
$root = $this->getArg('root'); | |
if (!$package || !$outputDir) { | |
die($this->usageHelp()); | |
} | |
if ($root) { | |
chdir($root); | |
} | |
$package = new Mage_Connect_Package($package); | |
$package->save($outputDir); | |
} | |
public function usageHelp() | |
{ | |
return <<<USAGE | |
Usage: php -f packager.php -- [options] | |
--root <dir> Root directory where the files to package are | |
--package <file> package.xml to use | |
--output <dir> directory to output the .tgz | |
USAGE; | |
} | |
} | |
$shell = new RSKuipers_Shell_Packager(); | |
$shell->run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment