PHP code example of drupal / drupal-driver

1. Go to this page and download the library: Download drupal/drupal-driver 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/ */

    

drupal / drupal-driver example snippets

 bash
$> curl -sS http://getcomposer.org/installer | php
$> php composer.phar install
 php


use Drupal\Driver\DrupalDriver;

// Host.
$uri = 'http://d8.devl';

$driver = new DrupalDriver($path, $uri);
$driver->setCoreFromVersion();

// Bootstrap Drupal.
$driver->bootstrap();

// Create a node.
$node = (object) array(
  'type' => 'article',
  'uid' => 1,
  'title' => $driver->getRandom()->name(),
);
$driver->createNode($node);


/**
 * @file
 */