1. Go to this page and download the library: Download ghostwriter/libraries-io library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ghostwriter / libraries-io example snippets
declare(strict_types=1);
use Ghostwriter\LibrariesIo\LibrariesIoClient;
// This will attempt to resolve the API token from the `LIBRARIES_IO_TOKEN` environment variable
$client = LibrariesIoClient::new();
// or manually provide the API token from https://libraries.io/account
$client = LibrariesIoClient::new('Valid40CharactersLongNonEmptyTokenString');
$response = $client->get('search', [
'platforms' => 'Packagist',
'q' => 'ghostwriter/container',
'per_page' => 30, // default is 30, max is 100
'page' => 1, // default is 1
]);
$payload = $response->getBody()->getContents();
echo $payload;
// Platforms: Get a list of supported package managers.
$client->get('platforms');
// Project: Get information about a package and its versions.
$client->get('Packagist/ghostwriter/container');
// Project Dependencies: Get a list of dependencies for a version of a project, pass latest to get dependency info for the latest available version
$client->get('Packagist/ghostwriter/container/dependencies');
// Project Dependents: Get packages that have at least one version that depends on a given project.
$client->get('Packagist/ghostwriter/container/dependents');
// Project Dependent Repositories: Get repositories that depend on a given project.
$client->get('Packagist/ghostwriter/container/dependent_repositories');
// Project Contributors: Get users that have contributed to a given project.
$client->get('Packagist/ghostwriter/container/contributors');
// Project SourceRank: Get breakdown of SourceRank score for a given project.
$client->get('Packagist/ghostwriter/container/sourcerank');
// Project Search: Search for projects by name
$client->get('search', [
'q' => 'ghostwriter/container',
'keywords' => 'container',
'platforms' => 'Packagist',
'languages' => 'PHP',
'licenses' => 'BSD-3-Clause',
]);
// Repository: Get info for a repository. (only works for open source repositories)
$client->get('github/ghostwriter/container');
// Repository Dependencies: Get a list of dependencies for all of a repository's projects. (only works for open source repositories)
$client->get('github/ghostwriter/container/dependencies');
// Repository Projects: Get a list of packages referencing the given repository.
$client->get('github/ghostwriter/container/projects');
// User: Get information for a given user or organization.
$client->get('github/ghostwriter');
// User Repositories: Get repositories owned by a user.
$client->get('github/ghostwriter/repositories');
// User Packages: Get a list of packages referencing the given user's repositories.
$client->get('github/ghostwriter/projects');
// User Packages Contributions: Get a list of packages that the given user has contributed to.
$client->get('github/ghostwriter/project-contributions');
// User Repository Contributions: Get a list of repositories that the given user has contributed to.
$client->get('repositories/github/ghostwriter/repository-contributions');
// User Dependencies: Get a list of unique packages that the given user's repositories list as a dependency. Ordered by frequency of use in those repositories.
$client->get('dependencies/github/ghostwriter/dependencies');
// User Subscriptions: List packages that a user is subscribed to receive notifications about new releases.
$client->get('subscriptions/Packagist/ghostwriter/container');
// Subscribe to a project: Subscribe to receive notifications about new releases of a project.
$client->post('subscriptions/Packagist/ghostwriter/container');
// Check if subscribed to a project: Check if a users is subscribed to receive notifications about new releases of a project.
$client->get('subscriptions/Packagist/ghostwriter/container');
// Update a subscription: Update the options for a subscription.
$client->put('subscriptions/Packagist/ghostwriter/container');
// Unsubscribe from a project: Stop receiving release notifications from a project.
$client->delete('subscriptions/Packagist/ghostwriter/container');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.