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

Unexpected behaviour when using webPhar #24

@darrenmothersele

Description

@darrenmothersele

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;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions