static function cli_cmd_arg_pack()
{
return array(
- 'f' => array('typ'=>'pharnew', 'val'=>NULL, 'required'=>1, 'inf'=>'<file> Specifies the phar file to work on.'),
'a' => array('typ'=>'alias', 'val'=>'newphar', 'required'=>1, 'inf'=>'<alias> Provide an alias name for the phar file.'),
- 's' => array('typ'=>'file', 'val'=>NULL, 'inf'=>'<stub> Select the stub file (excluded from list of input files/dirs).'),
+ 'c' => array('typ'=>'select', 'val'=>NULL, 'inf'=>'<algo> Compression algorithmus.', 'select'=>array('gz'=>'GZip compression','gzip'=>'GZip compression','bzip2'=>'BZip2 compression','bz'=>'BZip2 compression','bz2'=>'BZip2 compression','0'=>'No compression','none'=>'No compression')),
+ 'f' => array('typ'=>'pharnew', 'val'=>NULL, 'required'=>1, 'inf'=>'<file> Specifies the phar file to work on.'),
+ 'h' => array('typ'=>'select', 'val'=>NULL, 'inf'=>'<method> Selects the hash algorithmn.', 'select'=>array('md5'=>'MD5','sha1'=>'SHA1','sha256'=>'SHA256','sha512'=>'SHA512')),
'i' => array('typ'=>'regex', 'val'=>NULL, 'inf'=>'<regex> Specifies a regular expression for input files.'),
+ 's' => array('typ'=>'file', 'val'=>NULL, 'inf'=>'<stub> Select the stub file (excluded from list of input files/dirs).'),
'x' => array('typ'=>'regex', 'val'=>NULL, 'inf'=>'<regex> Regular expression for input files to exclude.'),
- 'c' => array('typ'=>'select', 'val'=>NULL, 'inf'=>'<algo> Compression algorithmus.', 'select'=>array('gz'=>'GZip compression','gzip'=>'GZip compression','bzip2'=>'BZip2 compression','bz'=>'BZip2 compression','bz2'=>'BZip2 compression','0'=>'No compression','none'=>'No compression')),
'' => array('typ'=>'any', 'val'=>NULL, 'required'=>1, 'inf'=>' Any number of input files and directories.'),
);
}
exit(1);
}
- $archive = $this->args['f']['val'];
$alias = $this->args['a']['val'];
- $stub = $this->args['s']['val'];
+ $archive = $this->args['f']['val'];
+ $hash = $this->args['h']['val'];
$regex = $this->args['i']['val'];
+ $stub = $this->args['s']['val'];
$invregex= $this->args['x']['val'];
$input = $this->args['']['val'];
}
}
- $phar->stopBuffering();
-
switch($this->args['c']['val'])
{
case 'gz':
default:
break;
}
+
+ if ($hash)
+ {
+ $phar->setSignatureAlgorithm($hash);
+ }
+
+ $phar->stopBuffering();
exit(0);
}