[wp-trac] [WordPress Trac] #54504: Update Requests library to version 2.0.0

WordPress Trac noreply at wordpress.org
Thu Nov 24 01:37:03 UTC 2022


#54504: Update Requests library to version 2.0.0
-------------------------------------------------+-------------------------
 Reporter:  jrf                                  |       Owner:
                                                 |  SergeyBiryukov
     Type:  task (blessed)                       |      Status:  reopened
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  External Libraries                   |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  php80 php81 has-patch has-unit-      |     Focuses:
  tests early early-like-actually-early          |
-------------------------------------------------+-------------------------

Comment (by azaozz):

 Replying to [comment:81 jrf]:
 > **what you are saying is technically ''and'' factually incorrect.**
 > ...
 > To do a minimal update, this means **only commit 1 and 2 are needed**,
 which effectively changes **8 (!!) lines in WP Core**
 >
 > Realistically, you could even get away with just making the change on
 line 21 and line 478 of the `wp-includes/class-wp-http.php` file, which
 means **2 lines of code changed in WP core**. That's it. That's all that
 is required.
 >
 > To do a full ''upgrade'', **33 lines of code** need to be updated in WP
 Core and that includes updates to the tests.

 Thanks for the explanation! Yes, I understand, still a change is a change
 whether it is 2, 8, or 32 lines. But lets not concentrate on that.

 > Requests is still an EXTERNAL dependency.

 I think this is the big misconception here. Requests used to be an
 external dependency before it was moved from rmccue/Requests to
 WordPress/Requests. After moving there it became an internal
 dependency/library.

 This actually brings another question: why does the Requests library use
 `WpOrg\` namespace? As @dd32
 [https://core.trac.wordpress.org/ticket/54504#comment:8 above] I'm a bit
 unsure if that's the best choice. Of course, as a project under the
 WordPress umbrella it can use any form of the WordPress name, but perhaps
 may be better to use `Requests\`, similarly to other PHP libraries? Any
 other opinions on that?

 (BTW, seems WP is using an older version of SimplePie which is not
 namespaced. The latest version seems to be using `namespace SimplePie;`
 which seems to be appropriate for a library.)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54504#comment:82>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list