-1

I was working on a module in Drupal 8, and came across this thread answering a question on class auto-loading for Doctrine annotations: https://stackoverflow.com/questions/14629137/jmsserializer-stand-alone-annotation-does-not-exist-or-cannot-be-auto-loaded

At multiple places in the above referenced thread, the OP or answerers reference to something like an application bootstrapper. For example, OP updated the question with:

EDIT: my final solution was to create a bootstrap file with the following content:

Another comment says:

I put this in my application bootrapper (/app/boostrap/app.php), although it could go in the autoloader (/app/boostrap/autoload.php) as well as long as it follows the composer autoload

Although I think I understand how class auto-loading works in Drupal 8, its relation to composer, Drupal's own bootstrapping (which afaik usually refers to Drupal initialising itself for a page load) and ability to use composer to add dependency on packages for a Drupal installation, I have no idea what "application bootstrapper" means in Drupal 8, or special significance of these files (/app/boostrap/app.php, /app/boostrap/autoload.php).

Am I missing something or were people referring to composer packages (and not a Drupal 8 concept) when they used these terms.

  • composer packages bro dont worry :) – Taggart Jensen Feb 4 '18 at 22:31
1

Yep this is because of composer ... you will see one if you install anything using composer. here is an example of an autoloader that is automatically created by Composer.

?php

/**
 * @file
 * Includes the autoloader created by Composer.
 *
 * This file was generated by drupal-composer/drupal-scaffold.
 * https://github.com/drupal-composer/drupal-scaffold
 *
 * @see composer.json
 * @see index.php
 * @see core/install.php
 * @see core/rebuild.php
 * @see core/modules/statistics/statistics.php
 */

return require __DIR__ . '/../vendor/autoload.php';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.