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

v2.0 #157

Merged
merged 17 commits into from
Oct 15, 2024
Merged

v2.0 #157

merged 17 commits into from
Oct 15, 2024

Conversation

otsch
Copy link
Member

@otsch otsch commented Aug 6, 2024

  • Restrict retrying cached error responses
    The HttpLoader::retryCachedErrorResponses() method now returns an instance of the new RetryManager class, providing the methods only() and except() that can be used to restrict retries to certain HTTP response status codes.
  • Remove the methods Step::addToResult(), Step::addLaterToResult() and everything connected to them.
  • It is no longer possible to provide multiple loaders via the crawler. Instead you can now manually provide customized loaders directly to steps via the new Step::withLoader() method.
  • Remove the PaginatorInterface and the old version of the AbstractPaginator. Also remove an unnecessary argument from the processLoaded method and the default implementation of thegetNextRequest() method (child classes have to implement it themselves.
  • Remove 4 deprecated methods interacting with the headless browser helper. Users can directly call the methods on the browser helper.
  • Remove the Microseconds util class, which is now part of the crwlr/utils package.

otsch added 17 commits August 6, 2024 00:33
The `HttpLoader::retryCachedErrorResponses()` method now returns an
instance of the new `RetryManager` class, providing the methods `only()`
and `except()` that can be used to restrict retries to certain HTTP
response status codes.
Start v2.0 block and improve the note for the retry cached error
responses change.
Remove the methods addToResult(), addLaterToResult() and everything
connected to that.

Also, it is no longer possible to provide multiple loaders via the
crawler. Instead you can now manually provide customized loaders
directly to steps via the new withLoader() method.

Further, also remove the Microseconds util class, which is now part of
the crwlr/utils package.
Removes the `PaginatorInterface` and the old version of the
`AbstractPaginator`. Also remove an unnecessary argument from the
`processLoaded` method and the default implementation of the
`getNextRequest()` method (child classes have to implement it
themselves.
Remove 4 deprecated methods interacting with the headless browser
helper. Users can directly call the methods on the browser helper.

Also remove deprecated method `RespondedRequest::cacheKeyFromRequest()`.
Add new methods `FileCache::prolong()` and `FileCache::prolongAll()` to
allow prolonging the time to live for cached responses.
Move most functionality from `Step` to `BaseStep` and make it work with
`Group` steps.
Add info about changed `Crawler::addStep()` signature and removal of the
`UnknownLoaderKeyException`.
When no Exception is thrown, the user could think it was a successful
crawler run, without looking at the log messages, so re-throw it to the
user.
Add phpdoc template tags for a generic loader type in the `LoadingStep`
trait. So wherever it is used, the user can narrow down the loader type
that will be used, to improve static analysis and IDE autocompletion.
Therefor also fix set_error_handler() / restore_error_handler()
occurences, because the old version lead to phpunit warnings with the
new version. And also add a rule to phpstan config.
PEST 3 requires PHP 8.2. As the package still supports 8.1 and tests
also need to run on 8.1, allow either PEST 2 or 3.
As the new error "call to protected method..." only happens when PEST 3
is used, phpstan gives an error when running with PEST 2 on PHP 8.1. So,
just don't report unmatched ignored error messages.
@otsch otsch merged commit 464d42b into main Oct 15, 2024
8 checks passed
@otsch otsch deleted the v2-0 branch October 15, 2024 15:04
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.

1 participant