Skip to content

jhedstrom/DrupalDriver

Repository files navigation

Drupal Driver

Latest Stable Version Total Downloads License

ci GitHub Issues GitHub Pull Requests

Join our community

A collection of lightweight drivers with a common interface for interacting with Drupal. These are generally intended for testing and are not meant to be API-complete.

Note: This master branch is under heavy development for version 3.x. Drupal 6 and 7 support has been dropped. For the 2.x maintenance line, use the 2.x branch. See the 3.x epic for details and progress.

Drivers

Driver Description
Blackbox No Drupal bootstrap. Interacts only through HTTP.
Drupal API Bootstraps Drupal directly in PHP for programmatic access to entities, fields, users, and configuration.
Drush Interacts with Drupal through the Drush command line tool.

Installation

composer require drupal/drupal-driver

Usage

use Drupal\Driver\DrupalDriver;

require 'vendor/autoload.php';

$path = './web';           // Path to Drupal root.
$uri  = 'http://my-site';  // Site URI.

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

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

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

Credits

Additional resources

Release notes

See GitHub Releases.

Contributing

Features and bug fixes are welcome!

See CONTRIBUTING.md for more information.

About

A collection of drivers for controlling Drupal.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors

Languages