Skip to content

Instantly share code, notes, and snippets.

@stmh
Last active January 4, 2016 22:01
Show Gist options
  • Save stmh/e5b3774598ea6a33c2d4 to your computer and use it in GitHub Desktop.
Save stmh/e5b3774598ea6a33c2d4 to your computer and use it in GitHub Desktop.
a barebone composer.json to install drupal 8.0 in a subfolder of a project-folder.The included autoload.php replaces the autoload.php from drupal, so all dependencies gets resolved.
<?php
/**
* @file
* Includes the autoloader created by Composer.
*
* @see composer.json
* @see index.php
* @see core/install.php
* @see core/rebuild.php
* @see core/modules/statistics/statistics.php
*
* This is a custom autoload-file, as we want, that drupal uses our vendor-lib,
* not the one provided by drupal.
*/
return require __DIR__ . '/../vendor/autoload.php';
{
"name": "factorial/composer-in-drupal",
"description": "using composer with drupal 8",
"repositories": [
{
"type": "composer",
"url": "https://packagist.drupal-composer.org/"
}
],
"require": {
"composer/installers": "~1.0",
"derhasi/composer-preserve-paths": "0.1.*",
"wikimedia/composer-merge-plugin": "^1.3.0",
"drupal/drupal": "8.*",
"drupal/bootstrap": "8.x"
},
"extra": {
"installer-paths": {
"public": ["type:drupal-core"],
"public/modules/contrib/{$name}": ["type:drupal-module"],
"public/profiles/contrib/{$name}": ["type:drupal-profile"],
"public/themes/contrib/{$name}": ["type:drupal-theme"],
"public/themes/engines/{$name}": ["type:drupal-theme-engine"],
"public/drush/commands/{$name}": ["type:drupal-drush"]
},
"preserve-paths": [
"public/modules/contrib",
"public/themes/contrib",
"public/themes/engines",
"public/themes/custom",
"public/modules/custom",
"public/libraries",
"public/sites/default/settings.php",
"public/sites/default/files"
],
"merge-plugin": {
"include": [
"public/core/composer.json"
],
"recurse": false,
"replace": false,
"merge-extra": false
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-install-cmd": [
"cp autoload.php public/autoload.php"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment