[wp-trac] [WordPress Trac] #54546: Fatal error receive while updating WP 5.8.2 to WP 5.9.

WordPress Trac noreply at wordpress.org
Wed Dec 1 17:30:28 UTC 2021


#54546: Fatal error receive while updating WP 5.8.2 to WP 5.9.
-------------------------------+---------------------
 Reporter:  apeksha10          |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  5.9
Component:  Upgrade/Install    |     Version:  trunk
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+---------------------

Comment (by jrf):

 Replying to [comment:4 hellofromTonya]:
 > Requests library:
 >
 > - Requests pre-2.0.0:
 >    * the "cURL" class was called `Requests_Transport_cURL` and was in a
 file named `wp-includes/Requests/Transport/cURL.php`.
 >    * [https://github.com/WordPress/wordpress-develop/blob/5.8/src/wp-
 includes/Requests/Transport/cURL.php#L443 Line 443] in `cURL.php` file
 throws a new `Requests_Exception()` error
 > - Requests 2.0.0:
 >    * the "cURL" class was renamed to `WpOrg\Requests\Transport\Curl` and
 its file renamed to `wp-includes/Requests/Transport/Curl.php`.
 >    * `Requests_Exception` class was removed in this version
 >    * [https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-
 includes/Requests/Transport/Curl.php#L492 The cURL error] was changed to
 throw a new `Exception`

 Just making sure the base information is correct:

 `Requests_Exception` was not removed. It became namespaced, just like
 every other class. The file was not renamed/moved as it was already called
 `Exception.php`.

 So the `Exception` you see being thrown in the `Curl` class is still the
 same exception, just namespaced now (and imported via a `use
 WpOrg\Requests\Exception` import statement).



 ----


 As for the issues you are seeing, yes, I agree, these are likely to do
 with file name casing and that not being taken into account properly
 during the upgrade.

 In the Requests repo itself, we moved all files. The "old" PSR-0 classes
 lived in a `library` directory, the new PSR-4 based classes live in a
 `src` directory.
 That prevents these kind of issues from happening as the files are seen as
 "new" files.

 Unfortunately, WP Core had nearly***** all the files in the `wp-
 includes/requests` directory, not in `wp-includes/requests/libary`, so
 that didn't really allow for making the same directory move.

 Would moving the files to `wp-includes/requests/src` be a potential
 solution ? (to make sure they are seen as new files, not updated files)

 ***** One exception to this: the original entry point class `Requests` was
 in WP Core in the `wp-includes/class-requests.php` file (in Requests that
 class was in `library/Requests.php`).
 In Requests 2.0 a stripped down version of the "old"
 `library/Requests.php` file still remains in place as part of the BC-
 layer.
 The actual functional code, however, lives in the "new" `src/Requests.php`
 file.
 For WP Core, the `wp-includes/class-requests.php` file now contains the
 stripped down version of the `library/Requests.php` file and along the
 same lines as in Requests itself, the ''real'' functional code now lives
 in the `wp-includes/requests/Requests.php` file.

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


More information about the wp-trac mailing list