I am trying to create Drupal entity instances from an external script that is not part of Drupal or a Drupal module.
For Drupal 7 there was drupal_bootstrap
to load the required Drupal dependencies. However, after a long search all I found for Drupal 8 was a note that drupal_bootstrap
is deprecated for Drupal 8.
And indeed, I get a
Call to undefined function drupal_bootstrap()
when I try to call it after including as in
define('DRUPAL_ROOT', __DIR__ .'/../drupal');
require_once DRUPAL_ROOT . '/core/vendor/autoload.php';
require_once DRUPAL_ROOT . '/core/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
So how can I use the Drupal 8 API from an outside script?!