Download the PHP package joachim-n/drupal-core-development-project without Composer

On this page you can find all versions of the php package joachim-n/drupal-core-development-project. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package drupal-core-development-project

Drupal Core Development Composer Project

This is a Composer project template for developing Drupal core.

It allows the following:

Roadmap

Get this into Drupal core! See https://www.drupal.org/project/drupal/issues/1792310.

Installation

Basic installation

To install a Drupal project for working on Drupal core:

Composer will clone Drupal core into a 'repos/drupal' directory within the project, and then symlink that into the project when it installs Drupal core.

Drupal core is checked out to its default branch, which is currently 11.x. To start on a different branch without first checking out 11.x, you can use the --no-install option with the composer create-project command, then change the branch of the Drupal core clone, then do composer install.

Once the Composer installation is complete, you can install Drupal as normal, either with drush si or with the web UI.

Installation on DDEV

First, make sure your DDEV version is at least 1.23.0. Next, create a new folder for your project and cd into it. Then:

Installation on DDEV with the justafish/ddev-drupal-core-dev DDEV addon

To use the justafish/ddev-drupal-core-dev DDEV addon, you need to make the following changes to the installation instructions for that addon:

To run PHPUnit tests, you will need to tweak the DDEV phpunit command until https://github.com/justafish/ddev-drupal-core-dev/pull/37 is fixed.

Installing other packages

You can install any Composer package as you would with a normal project. This will not affect Drupal core.

To work with Composer, you need to be in the root directory of the project, not in the Drupal core folders.

If Drupal core is checked out at a feature branch, Composer may complain that dependencies are not met, because it does not see the feature branch as satisfying the dependency. You can either:

Installing other packages from path repositories

You can install additional packages from a path repository, in the same way that Drupal core is installed (although other packages will no require all the tweaks that Drupal core does!). This can be useful to develop packages and modules in tandem with core.

  1. Create a git clone of the module or package. The repos/ folder can be used for this. It's simplest to start off from a main branch so that Composer sees this as the installed version, and dependencies work properly.
  2. Define a path respository for the package. See https://getcomposer.org/doc/05-repositories.md#path for details.
  3. Do composer require for the package.

You can now switch the package to a feature branch, such as one from a merge request, in order to work on a feature or bug.

If you need to perform Composer operations, Composer may complain that the feature branch does not satisfy requirements. You can do one of:

Limitations

Contrib and custom tests

Contrib and custom module tests can't be run. For details, see https://github.com/joachim-n/drupal-core-development-project/issues/14.

'Could not scan for classes' error messages

During some Composer commands you may see multiple copies of this error message:

Could not scan for classes inside [Drupal class filename].

These are harmless and can be ignored.

Developing Drupal core

You can use the Drupal core git clone at repos/drupal/ in any way you like: create feature branches, clone from drupal.org issue forks, and so on. Changes you make to files in the git clone affect the project, since the git clone is symlinked into it.

Managing the Composer project

Changes to the Drupal core git clone's composer.json will be taken into account by Composer. So for example, if pulling from the main branch of Drupal core changes Composer dependencies, and in particular if you change to a different core major or minor branch, you should run composer update on the project to install these.

Running tests

The following are required to run tests.

PHPUnit configuration

The simplest way to run tests with this setup is to put the phpunit.xml file in the project root and then run tests from there:

On DDEV
  1. Copy the phpunit-ddev.xml file that this template provides and rename it to phpunit.xml:

  2. Change the BROWSERTEST_OUTPUT_BASE_URL value to the host URL of the project.
On other platforms
  1. Copy Drupal core's sample phpunit.xml.dist`` file to the project root and rename it tophpunit.xml`:

  2. Change the bootstrap attribute so the path is correct:

Debugging

You can set up debugging in an IDE that's open at the repos/drupal folder, so that it recognises the process being run from the project root.

For example, in VSCode, this is done as follows in the debugger configuration:

Technical details

The rest of this document is gory technical details you only need to know if you're working on this project template or debugging it.

How it works

The composer.json at the project root uses a Composer path repository so that when the drupal/drupal package is installed, it's symlinked in from the Drupal core git clone, at the branch that the clone has checked out.

Drupal core itself defines path repositories in its top-level composer.json. These need to be overridden in the project root composer.json so they point to inside the Drupal core git clone.

Additionally, the paths to the drupal/core-recommended and drupal/core-dev packages are defined as path repositories, so that the package versions which are fixed in those metapackages are respected in the project. This means the same versions are installed as if installing Composer packages on a plain git clone of Drupal core.

Contrib modules are made installable with the ComposerCoreVersionsLeniency Composer script.

Manual Installation

Clone the repository for this template into, say, 'drupal-dev'.

The Drupal core git clone will be clean apart from:

Since it doesn't have a .gitignore at the top level, you can add one to ignore those files if you like.

Project template development installation

To test how Composer creates a new project from the template, you need a git clone of the template repository.

In a separate location, do:

Workarounds

Several workarounds are necessary to make Drupal core work correctly when symlinked into the project. These are all taken care of by Composer scripts during installation. Details are below.

Most if not all of these will no longer be needed once https://www.drupal.org/project/drupal/issues/1792310 is fixed.

Vendor folder

The vendor folder has to be symlinked into the Drupal core repository, because otherwise code in core that expects to find a Composer autoloader fails.

This is done by a Composer script after initial installation. The manual command is:

App root files patches

The index.php and update.php scaffold files have to be patched after they have been copied to web/index.php, because otherwise DrupalKernel guesses the Drupal app root as incorrectly being inside the Drupal core git clone, which means it can't find the settings.php file.

This is done by a Composer script after initial installation. The manual commands are:

See https://www.drupal.org/project/drupal/issues/3188703 for more detail.

Drush rebuild command

The Drush cache:rebuild command does not work correctly if contrib modules are present, because it calls drupal_rebuild() which lets DrupalKernel guess the app root incorrectly.

This project template contains a /drush folder which has a command class which replaces that command with custom code to correctly handle the app root.

Simpletest folder

When running browser tests, the initial setup of Drupal in FunctionalTestSetupTrait::prepareEnvironment() creates a site folder using the real file locations with symlinks resolved, thus repos/drupal/sites/simpletest, but during the request to the test site, Drupal looks in /web/sites/simpletest.

Additionally, the HTML files output from Browser tests are written into the Drupal core git clone, and so the URLs shown in PHPUnit output are incorrect.

The fix for both of these is to create the simpletest site folder in the web root and symlink it into the Drupal core git clone.

This is done by a Composer script after initial installation. The manual command is:

Autoload of Drupal composer testing classes

Drupal's /composer folder is not symlinked and therefore isn't visible to Composer. It's needed for some tests, and so is declared as an autoload location.


All versions of drupal-core-development-project with dependencies

PHP Build Version
Package Version
Requires composer/installers Version ^1.9 | ^2
drupal/core-composer-scaffold Version *
drupal/drupal Version *
drupal/core Version *
drupal/core-dev Version *
drupal/core-recommended Version *
drush/drush Version ^13
phpspec/prophecy-phpunit Version *
symfony/var-dumper Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package joachim-n/drupal-core-development-project contains the following files

Loading the files please wait ....