Skip to content
Snippets Groups Projects

packagist: Improve extract package metadata information algorithm

  1. Aug 02, 2023
    • Antoine R. Dumont's avatar
      packagist: Improve extract package metadata information algorithm · f1ae6825
      Antoine R. Dumont authored
      The current lister implementation lists very few metadata with the hard-coded /p/ base
      url (404 on mostly all packages). The packagist api implementation must have evolved
      since the initial implementation of the lister (and the first deployment on staging).
      
      Following the upstream documentation [1], it's sensible to first use the /p2/ as it's
      performant from the packagist api side. It's then fallbacking to use /p2/+~dev url
      scheme, then the /p/ scheme and finally the /packages/ base url if previous result are
      either not found or empty (different than no modification since the last visit).
      
      It keeps the initial implementation behavior of stopping immediately if a 304
      NotModifiedSince is returned by the server.
      
      [1] https://repo.packagist.org/apidoc
      Verified
      f1ae6825
Loading