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

Add support for PHP libraries on framework.dev #752

Open
kenslachtajr opened this issue Mar 21, 2023 · 0 comments
Open

Add support for PHP libraries on framework.dev #752

kenslachtajr opened this issue Mar 21, 2023 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@kenslachtajr
Copy link
Contributor

kenslachtajr commented Mar 21, 2023

Description

  • PHP is not supported out of the box and a research spike was conducted to determine the best way to add support for PHP libraries on framework.dev. This ticket involves and adding support for comparing different PHP libraries based on certain properties. At the end of this text, you can see some suggested properties for comparison which we can use.

  • Adding badges for PHP libraries is an additional need for this ticket. We are able to make use of the same properties in implementing badge functionality as well. Please refer to the original spike ticket for more context: SPIKE: Investigate fixing comparison tool #577

PHP

In PHP, Composer is most often used for managing dependencies. packagist.org is a repository of PHP packages, and they offer an API to get package stats. For example:

// GET https://packagist.org/packages/[vendor]/[package].json

{
  "package": {
    "name": "[vendor]/[package],
    "description": [description],
    "time": [packagist package creation datetime],
    "maintainers": [list of maintainers],
    "versions": [list of versions and their dependencies, the same data of composer.json]
    "type": [package type],
    "repository": [repository url],
    "downloads": {
      "total": [numbers of download],
      "monthly": [numbers of download per month],
      "daily": [numbers of download per day]
    },
    "favers": [number of favers]
    ...
  }
}

If the package is hosted on GitHub, additional properties are returned:

    "github_stars": X,
    "github_watchers": Y,
    "github_forks": Z,
    "github_open_issues": M,

Working example: https://packagist.org/packages/monolog/monolog.json

Some stats we could consider for framework.dev in the context of Packagist:

  • package.downloads.monthly
  • package.github_stars
  • package.favers (see below)
  • package.dependents (see below)
  • package.suggesters (see below)

Favers refers to the number of users who have marked a package as a favorite on the Packagist website. This feature allows users to keep track of packages they find useful or interesting, and can also be used as a way to discover new packages that have been well-received by the community. The number of "favers" for a package can be an indication of its popularity and usefulness.

Dependents in Packagist refers to the number of other packages that depend on a given package. This means that the dependent packages have specified the package as a requirement in their own composer.json file and thus have a dependency on it.

Suggests is a way for package maintainers to suggest other packages that may be used with the package they are publishing but are not required for it to function. It's a way to give users a heads-up of what else they might find useful. Suggesters is a number of package maintainers that have suggested this package.

@kenslachtajr kenslachtajr changed the title Add support for Ruby libraries on framework.dev Add support for PHP libraries on framework.dev Mar 21, 2023
@kenslachtajr kenslachtajr added the help wanted Extra attention is needed label Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant