Download the PHP package hussainweb/drupal-api-client without Composer

On this page you can find all versions of the php package hussainweb/drupal-api-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package drupal-api-client

Drupal.org API client

Latest Version Build Status Total Downloads

This is a simple wrapper on Guzzle 6 to access and use the API provided by drupal.org. It was built for DruStats which was built for a developer contest in DrupalCon Asia. You can refer to DruStats for example usage.

Installation

Use composer to install the package.

Drupal API client version 2+ no longer depends on Guzzle. It can work with any HTTP client that implements a HTTPlug compatible ClientInterface. Here's a list of providers.

For example, to use Guzzle, you would need the Guzzle 6 adapter. This will install Guzzle 6 as well.

Usage

The library provides a single client and multiple request classes to send requests to drupal.org API. To send a request, create a request object and call the getEntity method on the client class.

The above example uses Guzzle 6 Adapter but any HTTP client implementing php-http based clients will work. Construct the HTTP client and pass it when constructing the Hussainweb\DrupalApi\Client class.

There are various request classes to retrieve different types of entities and entity listings. Many of the entity request classes have a corresponding list request class as well, e.g. CommentRequest and CommentCollectionRequest.

User Agent

In accordance with responsible usage of Drupal.org API, it is important to set the user-agent header to indicate your application. You may set this request once globally using the static property on the Request class.

Request::$userAgent = 'Drupal Statistics Collector';

You have to do this only once as this user-agent is applied to all child requests as well. See the test in \Hussainweb\DrupalApi\Tests\Request\RequestTest::testRequestUserAgent for verifying the behaviour.

Note on HTTP client implementations

As noted above, Drupal API Client version 2+ no longer depends on Guzzle but any HTTP client which provides a php-http/client-implementation. This is a PSR-18 compatible HTTP client interface and you can read more about it at HTTPlug.

Since PSR-18 has been implemented in a different provider (psr/http-client-implementation), this client might move to that in the near future. Right now, almost all clients that support the HTTPlug interface also supports the PSR-18 interface and you would be able to use that client right now. The only notable exception is Guzzle 7 but there is discussion to add support for that in an adapter.


All versions of drupal-api-client with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
ext-json Version *
guzzlehttp/psr7 Version ^1.6 || ^2.4
php-http/client-implementation Version ^1.0
psr/http-client Version ^1.0
psr/http-message Version ^1.0 || ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hussainweb/drupal-api-client contains the following files

Loading the files please wait ....