Skip to content

Instantly share code, notes, and snippets.

@tobi-pb
Created Nov 2, 2015
Embed
What would you like to do?
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