Added command line option to init config file

This commit is contained in:
2020-06-28 23:56:01 +02:00
parent cd3e399e55
commit dd0e6c6b58
5 changed files with 180 additions and 29 deletions

View File

@ -13,28 +13,44 @@ class ManifestObject
protected $localname;
protected $stripped = false;
public function __construct($filename, $localname=null)
{
$this->filename = $filename;
$this->localname = $localname;
}
public function getFilename()
public function setStripped(bool $stripped)
{
$this->stripped = $stripped;
}
public function getStripped():bool
{
return $this->stripped;
}
public function getFilename():string
{
return $this->filename;
}
public function getLocalName()
public function getLocalName():string
{
return $this->localname;
}
public function addToPhar(\Phar $phar)
{
$phar->addFile(
$this->getFilename(),
$this->getLocalName()
);
if ($this->stripped) {
// strip and add
} else {
$phar->addFile(
$this->getFilename(),
$this->getLocalName()
);
}
}
public function addFiltered(\Phar $phar, callable $filter)
@ -43,4 +59,9 @@ class ManifestObject
$body = call_user_func($filter, $body);
$phar->addFromString($this->getLocalName(), $body);
}
}
public function getFilesize()
{
return filesize($this->filename);
}
}