How do I change the timeout for PHP ApaiIO Amazon library? -
how change timeout amazon product library php client? searched code timeout
, it's not obvious how pass different timeout value.
https://github.com/exeu/apai-io/search?utf8=%e2%9c%93&q=timeout
based on link provided, there no way pass in parameter timeout. can see it's hardcoded right there in constructor. can extend class , re-write constructor this. call erequest
instead of request
.
you can see $options
private, know it's not being edited elsewhere , simple ctrl-f can tell it's not being changed anywhere else in class, these options changing it.
class erequest extends request{ __construct(array $options = array(), $timeout=10){ $this->options = array( self::useragent => "apaiio [" . apaiio::version . "]", self::connection_timeout => $timeout, self::timeout => $timeout, self::follow_location => 1 ); $this->setoptions($options); } }
..or if there other parts of library use this, have alter actual source of library.
Comments
Post a Comment