drupal / core
Drupal is an open source content management platform powering millions of websites and applications.
Installs: 46 924 654
Dependents: 1 043
Suggesters: 1
Security: 93
Stars: 189
Watchers: 21
Forks: 54
Type:drupal-core
Requires
- php: >=8.3.0
- composer-runtime-api: ^2.1
- ext-date: *
- ext-dom: *
- ext-filter: *
- ext-gd: *
- ext-hash: *
- ext-json: *
- ext-pcre: *
- ext-pdo: *
- ext-session: *
- ext-simplexml: *
- ext-spl: *
- ext-tokenizer: *
- ext-xml: *
- ext-zlib: *
- asm89/stack-cors: ^2.1
- composer/semver: ^3.3
- doctrine/annotations: ^2.0
- doctrine/lexer: ^2.0
- egulias/email-validator: ^3.2.1|^4.0
- guzzlehttp/guzzle: ^7.5
- guzzlehttp/psr7: ^2.4.5
- masterminds/html5: ^2.7
- mck89/peast: ^1.14
- pear/archive_tar: ^1.4.14
- php-tuf/composer-stager: ^2-rc5
- psr/log: ^3.0
- revolt/event-loop: ^1.0
- sebastian/diff: ^4|^5
- symfony/console: ^7.2@beta
- symfony/dependency-injection: ^7.2@beta
- symfony/event-dispatcher: ^7.2@beta
- symfony/filesystem: ^7.2@beta
- symfony/finder: ^7.2@beta
- symfony/http-foundation: ^7.2@beta
- symfony/http-kernel: ^7.2@beta
- symfony/mailer: ^7.2@beta
- symfony/mime: ^7.2@beta
- symfony/polyfill-iconv: ^1.26
- symfony/process: ^7.2@beta
- symfony/psr-http-message-bridge: ^7.2@beta
- symfony/routing: ^7.2@beta
- symfony/serializer: ^7.2@beta
- symfony/validator: ^7.2@beta
- symfony/yaml: ^7.2@beta
- twig/twig: ^3.14.2
Suggests
- ext-zip: Needed to extend the plugin.manager.archiver service capability with the handling of files in the ZIP format.
Conflicts
- drush/drush: <12.4.3
Replaces
- drupal/core-annotation: 11.1.0-beta1
- drupal/core-assertion: 11.1.0-beta1
- drupal/core-class-finder: 11.1.0-beta1
- drupal/core-datetime: 11.1.0-beta1
- drupal/core-dependency-injection: 11.1.0-beta1
- drupal/core-diff: 11.1.0-beta1
- drupal/core-discovery: 11.1.0-beta1
- drupal/core-event-dispatcher: 11.1.0-beta1
- drupal/core-file-cache: 11.1.0-beta1
- drupal/core-file-security: 11.1.0-beta1
- drupal/core-filesystem: 11.1.0-beta1
- drupal/core-front-matter: 11.1.0-beta1
- drupal/core-gettext: 11.1.0-beta1
- drupal/core-graph: 11.1.0-beta1
- drupal/core-http-foundation: 11.1.0-beta1
- drupal/core-php-storage: 11.1.0-beta1
- drupal/core-plugin: 11.1.0-beta1
- drupal/core-proxy-builder: 11.1.0-beta1
- drupal/core-render: 11.1.0-beta1
- drupal/core-serialization: 11.1.0-beta1
- drupal/core-transliteration: 11.1.0-beta1
- drupal/core-utility: 11.1.0-beta1
- drupal/core-uuid: 11.1.0-beta1
- drupal/core-version: 11.1.0-beta1
- 11.x-dev
- 11.1.x-dev
- 11.1.0-beta1
- 11.0.x-dev
- 11.0.8
- 11.0.7
- 11.0.6
- 11.0.5
- 11.0.4
- 11.0.3
- 11.0.2
- 11.0.1
- 11.0.0
- 11.0.0-rc1
- 11.0.0-beta1
- 11.0.0-alpha1
- 10.5.x-dev
- 10.4.x-dev
- 10.4.0-beta1
- 10.3.x-dev
- 10.3.9
- 10.3.8
- 10.3.7
- 10.3.6
- 10.3.5
- 10.3.4
- 10.3.3
- 10.3.2
- 10.3.1
- 10.3.0
- 10.3.0-rc1
- 10.3.0-beta1
- 10.2.x-dev
- 10.2.11
- 10.2.10
- 10.2.9
- 10.2.8
- 10.2.7
- 10.2.6
- 10.2.5
- 10.2.4
- 10.2.3
- 10.2.2
- 10.2.1
- 10.2.0
- 10.2.0-rc1
- 10.2.0-beta1
- 10.2.0-alpha1
- 10.1.x-dev
- 10.1.8
- 10.1.7
- 10.1.6
- 10.1.5
- 10.1.4
- 10.1.3
- 10.1.2
- 10.1.1
- 10.1.0
- 10.1.0-rc1
- 10.1.0-beta1
- 10.1.0-alpha1
- 10.0.x-dev
- 10.0.11
- 10.0.10
- 10.0.9
- 10.0.8
- 10.0.7
- 10.0.6
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-beta16
- 8.0.0-beta15
- 8.0.0-beta14
- 8.0.0-beta13
- 8.0.0-beta12
- 8.0.0-beta11
- 8.0.0-beta10
- 8.0.0-beta9
- 8.0.0-beta8
- 8.0.0-beta7
- 8.0.0-beta6
This package is auto-updated.
Last update: 2024-11-22 00:12:56 UTC
README
This is a [Git subtree] (https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt) split of [Drupal] (https://github.com/drupal/drupal) 8's core
directory which can be used to build the directory structure for a Drupal site and has the following advantages over pulling in the entire upstream Drupal repository:
- All the components of the Drupal site including Drupal, contributed modules and themes, as well as external libraries can be pulled in via [Composer] (https://getcomposer.org)
- Drupal and any external libraries can be bootstrapped via Composer (i.e. without installing any modules for the external libraries)
- One has full control over
index.php
,.htaccess
,robots.txt
, etc. as those files will not be overridden by a Drupal core update
Usage
Add the following to your site's composer.json
:
{ "require": { "composer/installers": "^1.0.20", "drupal/drupal-core": "8.0.*" }, }
(This repository is available on [Packagist] (https://packagist.org/packages/drupal/core), therefore the URL of this repository does not need to be specified explicitly.)
Directory layout
This will download Drupal's core
directory into the root of the repository. If a Drupal 8 modules ships with a composer.json
file, it will be downloaded into the modules
directory where Drupal expects it. This works analogously for themes or installation profiles. (That the packages do not get placed into the vendor
directory is a feature of the composer/installers
package, therefore it is required.)
If you want to place Drupal core or modules, themes or installation profiles into different directories you can provide an "installer-paths"
configuration directive in the "extra"
section of the composer.json
. To place the entire Drupal site in a subdirectory of the repository named web
, for example, use the following:
{ "extra": { "installer-paths": { "web/core": ["type:drupal-core"], "web/modules": ["type:drupal-module"], "web/profiles": ["type:drupal-profile"], "web/themes": ["type:drupal-theme"] } } }
Or to place modules into a contrib
subdirectory within the modules
directory use:
{ "extra": { "installer-paths": { "modules/contrib": ["type:drupal-module"] } } }
Site template
In order to actually install Drupal you need to copy some files from the upstream Drupal repository into your repository root. The index.php
, sites/default/default.services.yml
and sites/default/default.settings.php
files are required to operate Drupal and the .htaccess
or web.config
and the robots.txt
files are recommended to copy as well. Copy the rest of the files to your liking.
You can copy the files by cloning the upstream Drupal repository and copying them manually or by fetching them directly via the command line. For example:
# Copy index.php from the upstream Drupal repository
wget https://raw.githubusercontent.com/drupal/drupal/8.0.x/index.php
See my [Drupal Site Template] (https://github.com/tstoeckler/drupal-site-template) for an example directory layout with the files needed to install and run Drupal including a composer.json
file as given above. The template also includes the index.php
modification and the drushrc.php
in the way detailed below. Note that this site template follows the best practice of having the Drupal root be in a subdirectory of the repository, which is called web
in this particular case.
Drupal's autoloader
The upstream Drupal repository contains all Composer dependencies and the Composer autoloader in the core/vendor
directory. One of the purposes of this repository, however, is to take control of the autoloader used for bootstrapping Drupal. If you have pulled in additional libraries in your composer.json
you will not be able to autoload them using Drupal's hardcoded autoloader. To instead use the autoloader generated from your composer.json
for Drupal requests simply change the following line in index.php
:
$autoloader = require_once __DIR__ . '/core/vendor/autoload.php';
appropriately, for example into:
$autoloader = require_once __DIR__ . '/vendor/autoload.php';
Adapting install.php
(or authorize.php
or rebuild.php
) works in the same way, although those are in located in the core
directory [unfortunately] (https://www.drupal.org/node/2406681) and thus modifications to these files cannot be placed under version control.
Drush's Drupal autoloader
When bootstrapping a Drupal site [Drush] (https://github.com/drush-ops/drush) loads Drupal's autoloader and by default uses Drupal's shipped autoloader (core/vendor/autoload.php
). This, too, defies the purpose of this repository and will lead to fatal errors in case you are using a local Drush version installed from the same composer.json
as Drupal. To make Drush use the autoloader generated from your composer.json
call drush_drupal_load_autoloader()
with the $new_autoloader
argument from the site's drushrc.php
. For example:
// In drush/drushrc.php $autoloader = require __DIR__ . '/../../vendor/autoload.php'; drush_drupal_load_autoloader(NULL, $autoloader);
About this repository
This repository contains the Drupal core
subtree split explained above in the 8.0.x
branch mirroring the upstream branch. The master
branch contains this README.md
, an empty composer.json
which is required for this repository to work with [Packagist] (https://packagist.org) and the subtree-split
bash script which is used for maintaining the subtree split (and a .gitignore
file). The usage of this script is explained in detail below. The tags in this repository are subtree splits of the respective upstream tags.
Usage of ./subtree-split
Initializing the repository
# Clone the repository git clone https://github.com/tstoeckler/drupal-core.git cd drupal-core # Initialize the upstream repository ./subtree-split init
Updating the respository
./subtree-split fetch
Publishing the split repository
# Publish the 8.0.x branch ./subtree-split push branch 8.0.x # Publish the 8.0.0-beta2 tag ./subtree-split push tag 8.0.0-beta2
Configuration
To use different upstream and downstream repositories or a different directory,
place a subtree-split.config
file in the root of this repository, that looks
like the following:
UPSTREAM_REPOSITORY=https://github.com/drupal/drupal UPSTREAM_DIRECTORY=upstream DOWNSTREAM_REPOSITORY=git@github.com:tstoeckler/drupal-core.git
By default the DOWNSTREAM_REPOSITORY
variable is taken from the remote.origin.url
Git configuration value so that it does not need to be changed when forking this repository.