Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an issue where images won't be pulled with older versions of WordPress #608

Merged
merged 4 commits into from
Jan 8, 2024

Conversation

tynanbe
Copy link
Contributor

@tynanbe tynanbe commented Dec 23, 2023

  • The Requests class didn't always exist at the current namespace.
  • The Autoload class is a fairly recent addition.

Additionally, the Requests class doesn't support all the oldest PHP versions that LSCWP does.

This PR should limit parallel pull to only the most recent versions of WordPress.

Additionally, parallel pull won't be used for PHP < v5.6, as per the Requests changelog

@tynanbe tynanbe marked this pull request as ready for review December 29, 2023 01:56
@@ -1124,7 +1134,7 @@ public function pull($manual = false)
$total_pulled_ori++;
};

if (class_exists('Requests')) {
if (class_exists('\WpOrg\Requests\Requests') && class_exists('\WpOrg\Requests\Autoload') && !version_compare(PHP_VERSION, '5.6.0', '<')) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For !version_compare(PHP_VERSION, '5.6.0', '<'), why not use version_compare(PHP_VERSION, '5.6.0', '>=')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done~

@hi-hai hi-hai merged commit cdb75b0 into litespeedtech:dev Jan 8, 2024
1 check failed
@tynanbe tynanbe deleted the try_parallel_pull branch January 8, 2024 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants