Skip to content
This repository has been archived by the owner on May 19, 2021. It is now read-only.

Unexpected behaviour when using webPhar #24

Open
darrenmothersele opened this issue Jul 1, 2016 · 0 comments
Open

Unexpected behaviour when using webPhar #24

darrenmothersele opened this issue Jul 1, 2016 · 0 comments

Comments

@darrenmothersele
Copy link

darrenmothersele commented Jul 1, 2016

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;
    }
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant