Retrieves information about a specified project from Drupal.org.
$project_name = 'ctools';
$project_stats = new Balsama\DrupalOrgProject\Stats($project_name);
- Total downloads
$project->getTotalDownloads
- Total installs
$project->getTotalInstalls
- Drupal 8 Stability
$project_stats->getD8Stability
- Current Drupal 8 usage
$project_stats->getCurrentD8Usage
- Current Drupal 7 usage
$project_stats->getCurrentD7Usage
- All usage data
$project_stats->getAllUsage
- Human-readable name
$project_stats->getHumanReadableName
- Machine name
$project_stats->getMachineName
If you're only interested in getting the info from the usage table, you can use the Usage
class instead which only
fetches data from the /project/usage/{project_name} page. This is somewhat less likely to break as D.O seems to change
the markup of that page less frequently.
At the time this was created, there wasn't any public facing D.O API. Even now, there is some information that's either not available or is cumbersome to get via the API.