Added command line option to init config file
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user