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

Add support for WP_Http class #15

Closed
raamdev opened this issue May 13, 2014 · 9 comments
Closed

Add support for WP_Http class #15

raamdev opened this issue May 13, 2014 · 9 comments
Labels

Comments

@raamdev
Copy link
Contributor

@raamdev raamdev commented May 13, 2014

Currently the HTML Compressor requires cURL. It would be nice to fall back on the WP_Http class in those cases where the HTML Compressor is being used within a WordPress environment (as is the case for the Quick Cache plugin; see wpsharks/comet-cache#156).

@raamdev raamdev added the enhancement label May 13, 2014
@jaswrks
Copy link

@jaswrks jaswrks commented May 19, 2014

I'm working on this together as part of my work on #16

jaswrks pushed a commit that referenced this issue May 19, 2014
jaswrks pushed a commit that referenced this issue May 19, 2014
jaswrks pushed a commit that referenced this issue May 19, 2014
@jaswrks
Copy link

@jaswrks jaswrks commented May 20, 2014

This may not be possible. See comments here: 2330f51

jaswrks pushed a commit that referenced this issue May 20, 2014
jaswrks pushed a commit that referenced this issue May 20, 2014
jaswrks pushed a commit that referenced this issue May 20, 2014
jaswrks pushed a commit that referenced this issue May 20, 2014
jaswrks pushed a commit that referenced this issue May 20, 2014
jaswrks pushed a commit that referenced this issue May 20, 2014
jaswrks pushed a commit that referenced this issue May 20, 2014
jaswrks pushed a commit that referenced this issue May 20, 2014
Working to resolve #16, #13, #17, #15
@jaswrks
Copy link

@jaswrks jaswrks commented May 20, 2014

This was implemented in v140520 of the HTML Compressor. However, it's not working with Quick Cache yet, since it runs in the shutdown phase and most objects have been destructed at this point. I'm going to leave this open until a proper workaround can be established.

In summary, support for WP_Http made it into 140520, but it's disabled internally until we get this working with plugins like Quick Cache. Until then, cURL is there to provide the needed functionality.

@raamdev
Copy link
Contributor Author

@raamdev raamdev commented May 20, 2014

Understood. Thanks!

@raamdev
Copy link
Contributor Author

@raamdev raamdev commented May 20, 2014

Hmm, just thinking about this a little more. Does this mean using WP_Http is a no-go here, or is there a workaround you have in mind?

I'm just wondering if I should open a new Quick Cache issue to track this or if I should abandon the idea and just work with the cURL detection and notice on the UI panel.

@jaswrks
Copy link

@jaswrks jaswrks commented May 20, 2014

a workaround you have in mind

I'm thinking that WP_Http might be a no-go here. However, what we could do is add support for FOPEN streams when cURL is not available. This is what WP_Http does anyway. Of course it goes a bit further than that, but really the most common transports are either cURL or FOPEN. So if we support both of those, we'll already be very close to what WP_Http does.

Another slight possibility (still researching this), is that we might be able to hold an object reference to WP_Http open so that we force it to remain available in the shutdown phase. I'm not sure if I like that option yet. It just seems to work against what the shutdown phase is all about.

@raamdev
Copy link
Contributor Author

@raamdev raamdev commented May 20, 2014

Got it. Thanks. Falling back to FOPEN would be great if the WP_Http route doesn't make sense. I'll just leave this open for you and won't open a Quick Cache issue until you've come to some conclusion here. :)

jaswrks pushed a commit that referenced this issue Aug 15, 2014
@jaswrks jaswrks mentioned this issue Aug 15, 2014
@jaswrks
Copy link

@jaswrks jaswrks commented Aug 15, 2014

FOPEN as a fallback transport layer has been implemented.
@raamdev You can do a git pull from Quick Cache if you like.
https://github.com/websharks/html-compressor/releases/tag/140816

@jaswrks jaswrks closed this Aug 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants