Opened 14 years ago
Closed 13 years ago
#10416 closed enhancement (wontfix)
Create filter and or constant for forcing use of a specific http transport
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.8.1 |
Component: | HTTP API | Keywords: | |
Focuses: | Cc: |
Description
While you can disable all of the transports you do not want to use there should be a constant and/or filter that allows you to specify the http transport you want to use. Perhaps 2, one for GET and one for POST.
This would provide similar functionality to the file system methods where you can set a constant or filter to specify which one to force.
Change History (13)
#2
follow-up:
↓ 3
@
14 years ago
No, for several reasons.
- That plugin does the same thing I mentioned, disabling all transports except for the one you want to use by means of filtering.
- Why would I want to use a plugin when a single define('WP_HTTP_TRANSPORT', 'fsockopen'); could be used, not to mention I am currently doing the same that that plugin does.
- In my current specific case I am checking to see if safe_mode and open_basedir are set and if they are I want to force use of fsockopen. However, to do this you have to run 4 filters to disable all of the other transports rather than being able to do one define or one filter to force use of a specific transport.
- Lets say for some reason the test for a specific transport returns false that it cannot be used but I want to force it to use that transport anyway. There is currently no way around this.
#3
in reply to:
↑ 2
@
14 years ago
Replying to sivel:
- In my current specific case I am checking to see if safe_mode and open_basedir are set and if they are I want to force use of fsockopen. However, to do this you have to run 4 filters to disable all of the other transports rather than being able to do one define or one filter to force use of a specific transport.
This is one area where, imo WP should be fixed. I've been playing with transports and filesystems for most of the day, and the concluding points are:
- FTP Filesystem times out, and is needing a longer timeout, perhaps through the use of ftp_set_option($wp_filesystem->link, FTP_TIMEOUT_SEC, 300); -- see #10407
- curl is a memory hog, and might need an ini_set() call to increase the memory limit when used
- the fopen transport returns the infamous PCLZIP_ERR_BAD_FORMAT thingy -- see http://forum.semiologic.com/discussion/5711/trying-to-do-a-reinstall-automatically/#Item_3
- Re your particular problem, it would make more sense to just enforce it in core imo
- Lets say for some reason the test for a specific transport returns false that it cannot be used but I want to force it to use that transport anyway. There is currently no way around this.
very true. but again, if it returns false and still works, we should fix the detection code in core.
#5
@
14 years ago
a -1 from me.
The transports need to be fixed if there are bugs. Report the bugs so that something can be done about them.
(One of the bugs: #10417 - safemode and redirects)
#6
@
14 years ago
-1 from me too in the current form. Perhaps in some cases one transport works better than another, so having a "preferred transport" filter would be better solution.
#7
@
14 years ago
so having a "preferred transport" filter would be better solution.
A filter on the order would actually accomplish both parties here..
If we keep the filter named to enforce that it should be used to re-order the list, then that'll prevent abuse by most developers.. But it would also allow for someone to return mearly 1 transport...
I'm still -1 though, I'd rather help others who might end up in the same server circumstances than help a developer or too.
#9
@
13 years ago
- Keywords 2nd-opinion dev-feedback added
Any feedback from core devs?
A filter could be added to the postTransports and getTransports Working and non-blocking arrays.. But i dont think theres much of a need for it still IMHO.
#10
@
13 years ago
I made that with a plugin for testings in another ticket (#11499):
http://core.trac.wordpress.org/attachment/ticket/11499/11499-curlforce.php
that plugin enforces the use of CURL methods which were not the first option on my server. Maybe it's of use.
#11
@
13 years ago
I'm still getting some PCLZIP_ERR_BAD_FORMAT(-10) issues. though only with the Streams and fopen() transports. Still investigating...
isn't the core control plugin good enough for this?