Security update for permissions_by_term
[yaffs-website] / vendor / drupal / drupal-driver / doc / _static / snippets / usage-drupal.php
diff --git a/vendor/drupal/drupal-driver/doc/_static/snippets/usage-drupal.php b/vendor/drupal/drupal-driver/doc/_static/snippets/usage-drupal.php
new file mode 100644 (file)
index 0000000..e7ae9e2
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+
+use Drupal\Driver\DrupalDriver;
+use Drupal\Driver\Cores\Drupal8;
+
+require 'vendor/autoload.php';
+
+// Path to Drupal.
+$path = './drupal-8';
+
+// 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);