php-pm / php-pm-httpkernel

HttpKernel adapter for use of Symfony and Laravel frameworks with PHP-PM
MIT License
246 stars 72 forks source link

Support Drupal built with Composer. #95

Closed mglaman closed 6 years ago

mglaman commented 6 years ago

In getApplication() for the Drupal boostrap class it assumes Drupal was not built with Composer.

It needs to be changed to something like

        //load drupals autoload.php, so their classes are available
        if (file_exists('./vendor/autoload.php')) {
            $autoloader = require './vendor/autoload.php';
        } else {
            $autoloader = require '../vendor/autoload.php';
        }
andig commented 6 years ago

In getApplication() for the Drupal boostrap class it assumes Drupal was not built with Composer.

I don't understand. Both cases above depend on composer?

mglaman commented 6 years ago

Sorry, I should have explained. There are two methods.

  1. Download Drupal, composer install.
  2. Manage Drupal via Composer using something like https://github.com/drupal-composer/drupal-project

This installs Drupal core via a subtree and puts Drupal in a web or docroot etc directory. Which means vendor is no longer in the same directory as Drupal.