Skip to content

Commit f0bfc32

Browse files
Better usage
1 parent d13ff3f commit f0bfc32

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,37 @@ Drupal.org API Component
33

44
Drupal.org provides a public API for retrieving common data includes all node types, users, comments and more. You can find documentation on that here: https://www.drupal.org/api
55

6+
Setup with composer
7+
===================
8+
9+
Run `composer init` but do not use its interactive require. Next edit composer.json and add
10+
11+
```json
12+
"repositories": [
13+
{
14+
"type": "vcs",
15+
"url": "https://github.com/EclipseGc/drupal-org-api"
16+
}
17+
],
18+
"require": {
19+
"EclipseGc/drupal-org-api": "dev-master"
20+
}
21+
```
22+
623
Using this SDK:
724
==============
825

26+
27+
928
This SDK provides a simple PHP layer for interacting with Drupal.org's API. Currently it supports Users and Nodes with special handling for Project Issue & Page Nodes.
1029

1130
Getting a new DrupalClient class is typically done through the static DrupalClient::create() method.
1231

1332
```php
1433
<?php
1534

35+
require __DIR__ . '/vendor/autoload.php';
36+
1637
use EclipseGc\DrupalOrg\Api\DrupalClient;
1738

1839
$client = DrupalClient::create();
@@ -25,6 +46,8 @@ This will provide you a fully instantiated DrupalClient that will return data ob
2546
```php
2647
<?php
2748

49+
require __DIR__ . '/vendor/autoload.php';
50+
2851
use EclipseGc\DrupalOrg\Api\DrupalClient;
2952

3053
$client = DrupalClient::create();
@@ -41,6 +64,8 @@ Retrieving Nodes is equally straight-forward:
4164
```php
4265
<?php
4366

67+
require __DIR__ . '/vendor/autoload.php';
68+
4469
use EclipseGc\DrupalOrg\Api\DrupalClient;
4570

4671
$client = DrupalClient::create();
@@ -55,6 +80,8 @@ What's nice about this though is that the returns are all object which can be ch
5580
```php
5681
<?php
5782

83+
require __DIR__ . '/vendor/autoload.php';
84+
5885
use EclipseGc\DrupalOrg\Api\DrupalClient;
5986

6087
$client = DrupalClient::create();
@@ -83,6 +110,8 @@ This can be simply through:
83110
```php
84111
<?php
85112

113+
require __DIR__ . '/vendor/autoload.php';
114+
86115
use EclipseGc\DrupalOrg\Api\DrupalClient;
87116

88117
$factory = DrupalClient::createFactory();

0 commit comments

Comments
 (0)