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

WordPress Trac noreply at wordpress.org
Wed Nov 30 16:56:29 UTC 2022


#54504: Update Requests library to version 2.0.0
-------------------------------------------------+-------------------------
 Reporter:  jrf                                  |       Owner:
                                                 |  hellofromTonya
     Type:  task (blessed)                       |      Status:  assigned
 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 jrf):

 Replying to [comment:87 SergeyBiryukov]:
 > Replying to [comment:85 hellofromTonya]:
 > With the proposed plan, unless I'm missing something, the "from" and
 "to" Requests versions should no longer conflict, and the old version can
 be safely deleted as part of the general `$_old_files` cleanup after the
 update.
 >
 > So I was wondering, do we still need to keep the old files in that case?
 Is it for plugins that may have included them directly? Or is there a
 scenario where preloading Requests 1.x files into memory before the update
 is not enough, and they are still needed after the update?

 I had similar thoughts regarding yes/no leaving and redirecting the old
 Requests files.

 I mean, Requests has always included an autoloader (from the very
 beginning), so aside from the "entry" file, which is currently `wp-
 includes/class-requests.php`, no other file from Requests should even need
 to be "manually" included via an `include` or `require` statement, not by
 WP Core, not by plugins, so I don't think we'd need to keep the old files
 around.

 AFAICS the preloading of the "old" files should be sufficient for the
 upgrade process itself.
 * For updates from a WP version containing Requests 1.x to a WP version
 containing Requests 2.x, Requests 2.x will be used during the upgrade, so
 loading all 1.x classes into memory should be enough.
 * For updates in the future from a WP version containing Requests 2.x, the
 preloading doesn't do any harm as all 1.x classes have a 2.x counter-part.
 It may be a good idea though, just and only for the preloading, to set the
 `REQUESTS_SILENCE_PSR0_DEPRECATIONS` constant as the preloading would load
 the class names from 1.x, so would trigger the deprecation notices.

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


More information about the wp-trac mailing list