Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of ob_start() #73

Closed
optimalisatie opened this issue Mar 30, 2018 · 1 comment
Closed

Use of ob_start() #73

optimalisatie opened this issue Mar 30, 2018 · 1 comment

Comments

@optimalisatie
Copy link

Hi!

We would like to include JShrink in our Javascript Optimization plugin for WordPress however it is currently impossible because JShrink is based on ob_start.

Most websites apply minification of assets based on a output buffer that for example extracts scripts from the HTML. It is impossible to start a new output buffer within the callback of an output buffer so this is likely an issue that prevents usage for many applications.

We hereby want to suggest to change the output buffer concept.

@DonaldDuck313
Copy link

It would be really nice if this could be fixed. Personally I use ob_start in my own code to use JShrink, so my code looks something like this:

function minifyJavascript(string $code): string{
    return \JShrink\Minifier::minify($code);
}
ob_start("minifyJavascript");

Since JShrink already uses ob_start internally, this causes problems and my above code doesn't work. It would be nice if you could fix this.

@tedivm tedivm closed this as completed in d4a072b Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants