PHPackages                             davidbarratt/drupal-structure - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. davidbarratt/drupal-structure

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

davidbarratt/drupal-structure
=============================

Giving Drupal 6 &amp; 7 a Directory Sturcture like Drupal 8 via Composer

1.0.0-alpha1(11y ago)52431Apache-2.0PHP

Since Sep 27Pushed 11y ago1 watchersCompare

[ Source](https://github.com/davidbarratt/drupal-structure)[ Packagist](https://packagist.org/packages/davidbarratt/drupal-structure)[ Docs](https://github.com/davidbarratt/drupal-structure)[ RSS](/packages/davidbarratt-drupal-structure/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

Drupal Structure
================

[](#drupal-structure)

Giving Drupal 6 &amp; 7 a Directory Sturcture like Drupal 8 via Composer

This script does the following tasks when Composer `install` and `update` is run:

1. Creates the folders `libraries`, `modules`, `themes`, and `sites` in the `root`
2. Copies `core/sites/README.txt` and `core/sites/example.sites.php` to `sites`
3. Copies `core/sites/default/default.settings.php` to `sites/default/default.settings.php`
4. Removes each folder in `core/sites` that is present in `sites`
5. Creates a symbolic link for each site from `core/sites` to `sites`
6. Copies `core/sites/all/modules/README.txt` to `modules/README.txt`
7. Copies `core/sites/all/themes/README.txt` to `themes/README.txt`
8. Create symbolic link from `core/sites/all/modules` to `modules`
9. Create symbolic link from `core/sites/all/themes` to `themes`
10. Create symbolic link from `core/sites/all/libraries` to `libraries`
11. Create `sites/sites.php` if the file doesn’t already exist
12. Create symbolic link from `core/sites/sites.php` to `sites/sites.php`

Installation
------------

[](#installation)

Require this library in your `composer.json` file

```
{
  "require": {
    "davidbarratt/drupal-structure": "1.0.*@alpha",
  }
}
```

Add the scripts

```
{
  "scripts": {
    "post-install-cmd": [
      "DavidBarratt\\DrupalStructure\\ScriptHandler::postUpdate"
    ],
    "post-update-cmd": [
      "DavidBarratt\\DrupalStructure\\ScriptHandler::postUpdate"
    ]
  }
}
```

Configuration
-------------

[](#configuration)

By default, the script assumes that Drupal core is located in the `core` directory and the resources (modules, themes, etc.) are located in the same directory as your `composer.json` file.

However, if you’d like to customize this, you can simply add the parameters in the `extra`. Here are the defaults (which are not necessary to add):

```
{
  "extra": {
      "drupal-structure": {
        "root": "",
        "core": "core"
      }
  }
}
```

Usage
-----

[](#usage)

You can use this script by simply executing `composer install` or `composer update`. Composer will execute the script when the process is finished.

Example
-------

[](#example)

Here is a more practical example of how you might use this script in a real `composer.json` file. This setup assumes that the web root is `core`. However, you could copy `index.php` and `.htaccess` and alter them to fit your needs.

```
{
  "repositories": [
    {
      "type": "composer",
      "url": "http://static.drupal-packagist.org/v0.2.0/"
    }
  ],
  "require": {
    "mnsami/composer-custom-directory-installer": "1.0.*",
    "drupal/drupal": "~7.0",
    "davidbarratt/drupal-structure": "1.0.*@alpha"
  },
  "extra": {
      "installer-paths":{
        "core/": ["drupal/drupal"]
      }
  },
  "scripts": {
    "post-install-cmd": [
      "DavidBarratt\\DrupalStructure\\ScriptHandler::postUpdate"
    ],
    "post-update-cmd": [
      "DavidBarratt\\DrupalStructure\\ScriptHandler::postUpdate"
    ]
  }
}
```

For a more complicated example, please see:

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4249d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e6fc8ba46d236d5a86fb070602b551af9b5d138de701e3254082eff4dbe6f201?d=identicon)[davidbarratt](/maintainers/davidbarratt)

---

Top Contributors

[![davidbarratt](https://avatars.githubusercontent.com/u/868364?v=4)](https://github.com/davidbarratt "davidbarratt (9 commits)")

### Embed Badge

![Health badge](/badges/davidbarratt-drupal-structure/health.svg)

```
[![Health](https://phpackages.com/badges/davidbarratt-drupal-structure/health.svg)](https://phpackages.com/packages/davidbarratt-drupal-structure)
```

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

96374.6k23](/packages/friendsoftypo3-content-blocks)[nativephp/desktop

NativePHP for Desktop

34020.6k3](/packages/nativephp-desktop)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

52664.9k12](/packages/solspace-craft-freeform)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
