It's based on the Composer template.
First you need to install composer.
Note: The instructions below refer to the global composer installation. You might need to replace
composer
withphp composer.phar
(or similar) for your setup.
After that you can create the project:
git clone [email protected]:OzConseil/drupal-project.git my-new-drupal
Install all dependencies with composer create-project
cd my-new-drupal
composer create-project --stability dev --no-interaction
Use drush si to install Drupal.
If you launch drush without the composer script you must specify the root directory: ./vendor/bin/drush --root=html site-install
.
// with local sqlite db
composer drush -- site-install --db-url=sqlite://site/default/files/.ht.db.sqlite
// with MySQL db
composer drush -- site-install --db-url=mysql://user:pass@server:port/dbname
With composer require ...
you can download new dependencies to your installation.
cd some-dir
composer require drupal/media_entity:8.1.*
When installing the given composer.json
some tasks are taken care of:
- Drupal will be installed in the
html
-directory. - Autoloader is implemented to use the generated composer autoloader in
vendor/autoload.php
, instead of the one provided by Drupal (web/vendor/autoload.php
). - Modules (packages of type
drupal-module
) will be placed inhtml/modules/contrib/
- Theme (packages of type
drupal-module
) will be placed inhtml/themes/contrib/
- Profiles (packages of type
drupal-profile
) will be placed inhtml/profiles/contrib/
- Latest version of drush is installed locally for use at
vendor/bin/drush
.
With using the "Composer Generate" drush extension
you can now generate a basic composer.json
file from an existing project. Note
that the generated composer.json
might differ from this project's file.
Composer recommends no. They provide argumentation against but also workrounds if a project decides to do it anyway.