box2-lib
box2-lib copied to clipboard
Unexpected behaviour when using webPhar
I can't pass a custom rewrite function, because it gets escaped and inserted in as a string. It's not passed to Phar::webPhar as a callable
.
The PHP docs seem to suggest that if I pass an empty array of mimetypes, then it will use the default. If I pass an empty array, then I get the default, but my custom rewrite is not added.
This might work?
https://github.com/box-project/box2-lib/blob/master/src/lib/Herrera/Box/StubGenerator.php#L416
if ($this->mimetypes) {
$stub .= ', ' . var_export(
$this->mimetypes,
true
);
if ($this->rewrite) {
$stub .= ', ' . $this->rewrite;
}
}
else {
if ($this->rewrite) {
$stub .= ', array(), ' . $this->rewrite;
}
}