[!!!][TASK] Upgrade to composer installers 2.0.0 49/55049/10
authorHelmut Hummel <typo3@helhum.io>
Tue, 12 Dec 2017 14:16:57 +0000 (15:16 +0100)
committerBenni Mack <benni@typo3.org>
Tue, 12 Dec 2017 15:39:29 +0000 (16:39 +0100)
With this step, the typo3/cms package will not be
installable anymore with composer, but only the
single subtree splitted packages like typo3/cms-core.

To ease the usage, a new package typo3/minimal is
introduced, which has dependencies to all required
TYPO3 extensions, so that composer users can't install
an incomplete code base, at least not when using this package.

composer command used:

composer require typo3/cms-composer-installers ^2.0

Releases: master
Resolves: #83302
Change-Id: Ia1009f62d97be611a03cec5dd437b56cd7866eeb
Reviewed-on: https://review.typo3.org/55049
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
composer.json
composer.lock
typo3/sysext/core/Classes/Composer/InstallerScripts.php [deleted file]
typo3/sysext/core/Classes/Composer/InstallerScripts/WebDirectory.php [deleted file]
typo3/sysext/core/Documentation/Changelog/9.0/Breaking-83302-ComposerRestrictsInstallationOfTypo3cms.rst [new file with mode: 0644]
typo3/sysext/core/composer.json

index c760a33..68c9c63 100644 (file)
@@ -45,7 +45,7 @@
                "doctrine/annotations": "^1.3",
                "typo3/cms-cli": "^1.0",
                "typo3/class-alias-loader": "^1.0",
-               "typo3/cms-composer-installers": "^1.4",
+               "typo3/cms-composer-installers": "^2.0",
                "psr/http-message": "~1.0",
                "cogpowered/finediff": "~0.3.1",
                "mso/idna-convert": "^1.1.0",
index bf4b2b5..9878a93 100644 (file)
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "content-hash": "ee8fd70e59c3f86ff7728b866e54149c",
+    "content-hash": "f97dca50e21002a44cc3ede3fee3f025",
     "packages": [
         {
             "name": "cogpowered/finediff",
         },
         {
             "name": "typo3/cms-composer-installers",
-            "version": "1.4.5",
+            "version": "2.0.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/TYPO3/CmsComposerInstallers.git",
-                "reference": "0ef630f82f12aa611fb44a3e1e5491fc98b97e78"
+                "reference": "68a206451b8d479049a8886bdb0001134bfe03ac"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/TYPO3/CmsComposerInstallers/zipball/0ef630f82f12aa611fb44a3e1e5491fc98b97e78",
-                "reference": "0ef630f82f12aa611fb44a3e1e5491fc98b97e78",
+                "url": "https://api.github.com/repos/TYPO3/CmsComposerInstallers/zipball/68a206451b8d479049a8886bdb0001134bfe03ac",
+                "reference": "68a206451b8d479049a8886bdb0001134bfe03ac",
                 "shasum": ""
             },
             "require": {
             "extra": {
                 "class": "TYPO3\\CMS\\Composer\\Installer\\Plugin",
                 "branch-alias": {
-                    "dev-master": "1.4.x-dev"
+                    "dev-master": "2.0.x-dev"
                 }
             },
             "autoload": {
             ],
             "authors": [
                 {
-                    "name": "Christian Opitz",
-                    "email": "christian.opitz@netresearch.de"
-                },
-                {
-                    "name": "Lars Peipmann",
-                    "email": "lars@peipmann.de"
+                    "name": "The TYPO3 Community",
+                    "homepage": "https://typo3.org/community/",
+                    "role": "Contributor"
                 },
                 {
-                    "name": "Helmut Hummel",
-                    "email": "info@helhum.io"
+                    "name": "TYPO3 CMS Core Team",
+                    "homepage": "https://forge.typo3.org/projects/typo3cms-core",
+                    "role": "Developer"
                 }
             ],
             "description": "TYPO3 CMS Installers",
                 "installer",
                 "typo3"
             ],
-            "time": "2017-11-06T11:44:16+00:00"
+            "time": "2017-12-12T14:04:22+00:00"
         },
         {
             "name": "typo3fluid/fluid",
diff --git a/typo3/sysext/core/Classes/Composer/InstallerScripts.php b/typo3/sysext/core/Classes/Composer/InstallerScripts.php
deleted file mode 100644 (file)
index df5d396..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-declare(strict_types=1);
-namespace TYPO3\CMS\Core\Composer;
-
-/*
- * This file is part of the TYPO3 project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use Composer\Script\Event;
-use Composer\Semver\Constraint\EmptyConstraint;
-use TYPO3\CMS\Composer\Plugin\Core\InstallerScriptsRegistration;
-use TYPO3\CMS\Composer\Plugin\Core\ScriptDispatcher;
-use TYPO3\CMS\Core\Composer\InstallerScripts\WebDirectory;
-
-/**
- * Hook into Composer build to set up TYPO3 web directory if necessary
- */
-class InstallerScripts implements InstallerScriptsRegistration
-{
-    /**
-     * @param Event $event
-     * @param ScriptDispatcher $scriptDispatcher
-     */
-    public static function register(Event $event, ScriptDispatcher $scriptDispatcher)
-    {
-        if (null !== $event->getComposer()->getRepositoryManager()->getLocalRepository()->findPackage('typo3/cms', new EmptyConstraint())) {
-            $scriptDispatcher->addInstallerScript(
-                new WebDirectory(),
-                60
-            );
-        }
-    }
-}
diff --git a/typo3/sysext/core/Classes/Composer/InstallerScripts/WebDirectory.php b/typo3/sysext/core/Classes/Composer/InstallerScripts/WebDirectory.php
deleted file mode 100644 (file)
index 2c7a1dc..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-<?php
-declare(strict_types=1);
-namespace TYPO3\CMS\Core\Composer\InstallerScripts;
-
-/*
- * This file is part of the TYPO3 project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use Composer\Composer;
-use Composer\IO\IOInterface;
-use Composer\Script\Event;
-use Composer\Semver\Constraint\EmptyConstraint;
-use TYPO3\CMS\Composer\Plugin\Config;
-use TYPO3\CMS\Composer\Plugin\Core\InstallerScript;
-use TYPO3\CMS\Composer\Plugin\Util\Filesystem;
-
-/**
- * Setting up TYPO3 web directory
- */
-class WebDirectory implements InstallerScript
-{
-    /**
-     * @var string
-     */
-    private static $typo3Dir = '/typo3';
-
-    /**
-     * @var string
-     */
-    private static $systemExtensionsDir = '/sysext';
-
-    /**
-     * @var IOInterface
-     */
-    private $io;
-
-    /**
-     * @var Composer
-     */
-    private $composer;
-
-    /**
-     * @var Filesystem
-     */
-    private $filesystem;
-
-    /**
-     * @var Config
-     */
-    private $pluginConfig;
-
-    /**
-     * Prepare the web directory with symlinks
-     *
-     * @param Event $event
-     * @return bool
-     */
-    public function run(Event $event): bool
-    {
-        $this->io = $event->getIO();
-        $this->composer = $event->getComposer();
-        $this->filesystem = new Filesystem();
-        $this->pluginConfig = Config::load($this->composer);
-
-        $symlinks = $this->initializeSymlinks();
-        if ($this->filesystem->someFilesExist($symlinks)) {
-            $this->filesystem->removeSymlinks($symlinks);
-        }
-        $this->filesystem->establishSymlinks($symlinks);
-
-        return true;
-    }
-
-    /**
-     * Initialize symlinks from configuration
-     * @return array
-     */
-    private function initializeSymlinks(): array
-    {
-        $webDir = $this->filesystem->normalizePath($this->pluginConfig->get('web-dir'));
-        $backendDir = $webDir . self::$typo3Dir;
-        // Ensure we delete a previously existing symlink to typo3 folder in web directory
-        if ($this->filesystem->isSymlinkedDirectory($backendDir)) {
-            $this->filesystem->removeDirectory($backendDir);
-        }
-        $this->filesystem->ensureDirectoryExists($backendDir);
-        $localRepository = $this->composer->getRepositoryManager()->getLocalRepository();
-        $package = $localRepository->findPackage('typo3/cms', new EmptyConstraint());
-        $sourcesDir = $this->composer->getInstallationManager()->getInstallPath($package);
-        return [
-            $sourcesDir . self::$typo3Dir . self::$systemExtensionsDir => $backendDir . self::$systemExtensionsDir,
-        ];
-    }
-}
diff --git a/typo3/sysext/core/Documentation/Changelog/9.0/Breaking-83302-ComposerRestrictsInstallationOfTypo3cms.rst b/typo3/sysext/core/Documentation/Changelog/9.0/Breaking-83302-ComposerRestrictsInstallationOfTypo3cms.rst
new file mode 100644 (file)
index 0000000..c9d93a8
--- /dev/null
@@ -0,0 +1,55 @@
+.. include:: ../../Includes.txt
+
+===============================================================
+Breaking: #83302 - Composer restricts installation of typo3/cms
+===============================================================
+
+See :issue:`83302`
+
+Description
+===========
+
+When running a composer-based TYPO3 instance, it is not possible anymore to require the whole
+TYPO3 Core via `composer require typo3/cms`. This package is solely used for Core-development purposes
+from now on.
+
+Instead, all system extensions maintained by the TYPO3 Core Team must be required individually.
+
+Some examples:
+
+* `composer require typo3/cms-core:^9`
+* `composer require typo3/cms-fluid-styled-content:^9`
+* `composer require typo3/cms-extbase:^9`
+* `composer require typo3/cms-workspaces:^9`
+* `composer require typo3/cms-sys-note:^9`
+
+For convenience, TYPO3 projects can simply require `composer require typo3/minimal` to get the main
+system extensions that are needed for a running TYPO3 instance, and add custom system extensions
+as mentioned above.
+
+
+Impact
+======
+
+Installing or updating the composer package `typo3/cms` will show an error for TYPO3 v9.
+
+
+Affected Installations
+======================
+
+Composer-based TYPO3 installations that previously required `typo3/cms` in the projects'
+`composer.json` file or in any required extension `composer.json` file.
+
+
+Migration
+=========
+
+Extension authors should specifically define their dependencies of system extensions in their
+`composer.json` file, if they have previously added `typo3/cms`.
+
+Site administrators / developers should require only the necessary `typo3/cms-*` packages that they
+have installed in their projects. In order to find out, which system extensions have been installed,
+have a look at `typo3conf/PackageStates.php` and look for all extensions that are located under
+`typo3/sysext/`.
+
+.. index:: CLI, NotScanned
index ffea89e..fcb7896 100644 (file)
@@ -26,7 +26,7 @@
                "doctrine/annotations": "^1.3",
                "typo3/cms-cli": "^1.0",
                "typo3/class-alias-loader": "^1.0",
-               "typo3/cms-composer-installers": "^1.4",
+               "typo3/cms-composer-installers": "^2.0",
                "psr/http-message": "~1.0",
                "cogpowered/finediff": "~0.3.1",
                "mso/idna-convert": "^1.1.0",