Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
- You have a leading blank line at the top of the .info file.
- The uninstall hook should delete all variables used, missing
- httprl_background_callback
- httprl_dns_timeout
- httprl_connect_timeout
- httprl_ttfb_timeout
- httprl_timeout
- httprl_global_timeout
- httprl_url_inbound_alter
- There's many places that check to make sure the Drupal version is >= 7, that could be refactored in both the d6 and d7 versions.
- In httprl_build_url_self() you have an empty
if (empty($path_parts)) { // Bail out here. }
- should that do something, or can it be removed? - This is repeated a few times, consider refactoring or using a ternary operator instead
$t = function_exists('t') ? 't' : 'httprl_pr';
if (function_exists('t')) { $t = 't'; } else { $t = 'httprl_pr'; }
- In httprl_set_connection_flag(), start with
$flags = STREAM_CLIENT_CONNECT;
and the if blocks can be much simpler. - In httprl_handle_data(), instead of
$temp = $info; unset($info); $info[] = $temp;
,$info = array($info);
should be sufficient. Similarly in httprl_request(). - httprl_send_request() is almost 500 LoC. Consider refactoring into smaller functions.
- Instead of httprl_strlen(), how about using drupal_strlen()?
- I don't see where the "Reset to defaults" button is defined for httprl_admin_settings_form_validate()?
What do you think?
----
Top Shelf Modules - Crafted, Curated, Contributed.
Comment | File | Size | Author |
---|---|---|---|
#1 | httprl-2110695-1-tsm-review.patch | 5.07 KB | mikeytown2 |
Comments
Comment #1
mikeytown2 CreditAttribution: mikeytown2 commentedFollowing patch has been committed. Things not changed:
Refactoring Drupal version is >= 7 - Open to suggestions.
drupal_strlen - "Do not count UTF-8 continuation bytes". I need to count every bit that goes over the wire, thus I can't use this. Also would make httprl require Drupal which it currently doesn't (would need logic similar to the t() function).
Reset to defaults button - in D6 by default, but not in D7.
httprl_send_request 500 LoC - It contains a event driven loop; breaking up could be done but would require a lot of effort.
Thanks again for reviewing all the code :)
Comment #2
kscheirerThanks mikeytown2!
re: Drupal 7 specific code, can't you use the D7 code in 7.x-1.x and D6 code in 6.x-1.x? Seems odd to handle both cases when you already know which version you're writing for. Unless this is also about keeping the module Drupal agnostic.
Comment #3
mikeytown2 CreditAttribution: mikeytown2 commentedThat is the case. I want the minimal amount of work needed to maintain the 6.x & 7.x branch and for me making the code the same was the way to do it.
Comment #4
kscheirerSounds good, thanks mikeytown2!
Comment #5.0
(not verified) CreditAttribution: commentedadded bullet list