Skip to content

Instantly share code, notes, and snippets.

@tobi-pb
Created November 2, 2015 16:49
Show Gist options
  • Save tobi-pb/de7381e4fceecca0d5c7 to your computer and use it in GitHub Desktop.
Save tobi-pb/de7381e4fceecca0d5c7 to your computer and use it in GitHub Desktop.
Repack Magento Extension after running `tar xfvz extension.tgz`
<?php
require_once 'abstract.php';
//
//
// PLEASE SET EDIT packages.xml and update md5 hashes!
class Mage_Shell_Archive extends Mage_Shell_Abstract
{
public function run()
{
if ( $this->getArg('source') && $this->getArg('dest') ) {
$archive = new Mage_Archive_Tar();
$archive->pack( $this->getArg('source'), $this->getArg('dest'), true );
//$archive = new Mage_Archive_Gz();
//$archive->pack( $this->getArg('dest').'.tmp' , $this->getArg('dest') );
} else {
echo $this->usageHelp();
}
}
public function usageHelp()
{
return <<<USAGE
Usage: php -f archive.php -- [options]
--source source dir
--dest dest modulename.tgz
USAGE;
}
}
$shell = new Mage_Shell_Archive();
$shell->run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment