From 1ae5f2a93f3e68fe8b31c9ec38e403034b7e306d Mon Sep 17 00:00:00 2001
From: Christian Kuhn <lolli@schwarzbu.ch>
Date: Thu, 12 Oct 2017 13:11:02 +0200
Subject: [PATCH] [TASK] Rename ext:lowlevel/View to ext:lowlevel/Controller

The two "view" classes are clearly controllers and are
renamed with this patch accordingly.

Change-Id: Ic1cdc405ae24b87aa6224cda79b7226ce5eeec64
Resolves: #82744
Releases: master
Reviewed-on: https://review.typo3.org/54375
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
---
 composer.json                                 |  1 +
 composer.lock                                 |  2 +-
 .../Integrity/DatabaseIntegrityCheck.php      |  2 +-
 ...ameExtlowlevelViewToLowlevelController.rst | 37 +++++++++++++++++++
 .../ExtensionScanner/Php/ClassNameMatcher.php | 10 +++++
 .../ConfigurationController.php}              |  4 +-
 .../DatabaseIntegrityController.php}          |  4 +-
 .../Migrations/Code/ClassAliasMap.php         |  5 +++
 typo3/sysext/lowlevel/composer.json           |  5 +++
 typo3/sysext/lowlevel/ext_tables.php          |  4 +-
 10 files changed, 66 insertions(+), 8 deletions(-)
 create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Deprecation-82744-RenameExtlowlevelViewToLowlevelController.rst
 rename typo3/sysext/lowlevel/Classes/{View/ConfigurationView.php => Controller/ConfigurationController.php} (99%)
 rename typo3/sysext/lowlevel/Classes/{View/DatabaseIntegrityView.php => Controller/DatabaseIntegrityController.php} (99%)
 create mode 100644 typo3/sysext/lowlevel/Migrations/Code/ClassAliasMap.php

diff --git a/composer.json b/composer.json
index f97622d0e4f0..c7f27a03990f 100644
--- a/composer.json
+++ b/composer.json
@@ -75,6 +75,7 @@
 				"typo3/sysext/extbase/Migrations/Code/ClassAliasMap.php",
 				"typo3/sysext/fluid/Migrations/Code/ClassAliasMap.php",
 				"typo3/sysext/info/Migrations/Code/ClassAliasMap.php",
+				"typo3/sysext/lowlevel/Migrations/Code/ClassAliasMap.php",
 				"typo3/sysext/version/Migrations/Code/ClassAliasMap.php",
 				"typo3/sysext/workspaces/Migrations/Code/ClassAliasMap.php"
 			]
diff --git a/composer.lock b/composer.lock
index c75b571ecf78..3170386e9854 100644
--- a/composer.lock
+++ b/composer.lock
@@ -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": "35c4d8cf070c5caf16b0faa1d7ccf03f",
+    "content-hash": "39981f9ff5c2b39ddf83a87ac8fc5d15",
     "packages": [
         {
             "name": "cogpowered/finediff",
diff --git a/typo3/sysext/core/Classes/Integrity/DatabaseIntegrityCheck.php b/typo3/sysext/core/Classes/Integrity/DatabaseIntegrityCheck.php
index d61ceed537b7..9c6aa0ed6c15 100644
--- a/typo3/sysext/core/Classes/Integrity/DatabaseIntegrityCheck.php
+++ b/typo3/sysext/core/Classes/Integrity/DatabaseIntegrityCheck.php
@@ -29,7 +29,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
  * Depends on \TYPO3\CMS\Core\Database\RelationHandler
  *
  * @todo Need to really extend this class when the DataHandler library has been updated and the whole API is better defined. There are some known bugs in this library. Further it would be nice with a facility to not only analyze but also clean up!
- * @see \TYPO3\CMS\Lowlevel\View\DatabaseIntegrityView::func_relations(), \TYPO3\CMS\Lowlevel\View\DatabaseIntegrityView::func_records()
+ * @see \TYPO3\CMS\Lowlevel\Controller\DatabaseIntegrityController::func_relations(), \TYPO3\CMS\Lowlevel\Controller\DatabaseIntegrityController::func_records()
  */
 class DatabaseIntegrityCheck
 {
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-82744-RenameExtlowlevelViewToLowlevelController.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-82744-RenameExtlowlevelViewToLowlevelController.rst
new file mode 100644
index 000000000000..ed2ab4bacb8c
--- /dev/null
+++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-82744-RenameExtlowlevelViewToLowlevelController.rst
@@ -0,0 +1,37 @@
+.. include:: ../../Includes.txt
+
+=====================================================================
+Deprecation: #82744 - Rename ext:lowlevel/View to lowlevel/Controller
+=====================================================================
+
+See :issue:`82744`
+
+Description
+===========
+
+Two classes of extension lowlevel have been renamed:
+* :php:`TYPO3\CMS\Lowlevel\View\ConfigurationView` to :php:`TYPO3\CMS\Lowlevel\Controller\ConfigurationController`
+* :php:`TYPO3\CMS\Lowlevel\View\DatabaseIntegrityView` to :php:`TYPO3\CMS\Lowlevel\Controller\DatabaseIntegrityController`
+
+
+Impact
+======
+
+Old class usages will still work: Class aliases are in place for TYPO3 v9,
+but will be removed in v10.
+
+
+Affected Installations
+======================
+
+Extensions that call or instantiate the old class names. It is however rather unlikely
+extensions depend on these controller classes directly. The extension scanner will find
+any usages within extensions.
+
+
+Migration
+=========
+
+Use new class names instead.
+
+.. index:: Backend, PHP-API, FullyScanned
\ No newline at end of file
diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php
index db71de87bc80..a2028be9f7ae 100644
--- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php
+++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php
@@ -394,6 +394,16 @@ return [
             'Deprecation-82725-DeprecateConfigurationForm.rst',
         ],
     ],
+    'TYPO3\CMS\Lowlevel\View\ConfigurationView' => [
+        'restFiles' => [
+            'Deprecation-82744-RenameExtlowlevelViewToLowlevelController.rst',
+        ],
+    ],
+    'TYPO3\CMS\Lowlevel\View\DatabaseIntegrityView' => [
+        'restFiles' => [
+            'Deprecation-82744-RenameExtlowlevelViewToLowlevelController.rst',
+        ],
+    ],
 
     // Removed interfaces
     'TYPO3\CMS\Backend\Form\DatabaseFileIconsHookInterface' => [
diff --git a/typo3/sysext/lowlevel/Classes/View/ConfigurationView.php b/typo3/sysext/lowlevel/Classes/Controller/ConfigurationController.php
similarity index 99%
rename from typo3/sysext/lowlevel/Classes/View/ConfigurationView.php
rename to typo3/sysext/lowlevel/Classes/Controller/ConfigurationController.php
index 4f2b81563e3f..7139496e0d38 100644
--- a/typo3/sysext/lowlevel/Classes/View/ConfigurationView.php
+++ b/typo3/sysext/lowlevel/Classes/Controller/ConfigurationController.php
@@ -1,5 +1,5 @@
 <?php
-namespace TYPO3\CMS\Lowlevel\View;
+namespace TYPO3\CMS\Lowlevel\Controller;
 
 /*
  * This file is part of the TYPO3 CMS project.
@@ -29,7 +29,7 @@ use TYPO3\CMS\Lowlevel\Utility\ArrayBrowser;
 /**
  * Script class for the Config module
  */
-class ConfigurationView
+class ConfigurationController
 {
     /**
      * The name of the module
diff --git a/typo3/sysext/lowlevel/Classes/View/DatabaseIntegrityView.php b/typo3/sysext/lowlevel/Classes/Controller/DatabaseIntegrityController.php
similarity index 99%
rename from typo3/sysext/lowlevel/Classes/View/DatabaseIntegrityView.php
rename to typo3/sysext/lowlevel/Classes/Controller/DatabaseIntegrityController.php
index fe5c6fc967bc..6e8a8df505b9 100644
--- a/typo3/sysext/lowlevel/Classes/View/DatabaseIntegrityView.php
+++ b/typo3/sysext/lowlevel/Classes/Controller/DatabaseIntegrityController.php
@@ -1,5 +1,5 @@
 <?php
-namespace TYPO3\CMS\Lowlevel\View;
+namespace TYPO3\CMS\Lowlevel\Controller;
 
 /*
  * This file is part of the TYPO3 CMS project.
@@ -34,7 +34,7 @@ use TYPO3\CMS\Fluid\View\StandaloneView;
 /**
  * Script class for the DB int module
  */
-class DatabaseIntegrityView
+class DatabaseIntegrityController
 {
     /**
      * @var string
diff --git a/typo3/sysext/lowlevel/Migrations/Code/ClassAliasMap.php b/typo3/sysext/lowlevel/Migrations/Code/ClassAliasMap.php
new file mode 100644
index 000000000000..783d9d942970
--- /dev/null
+++ b/typo3/sysext/lowlevel/Migrations/Code/ClassAliasMap.php
@@ -0,0 +1,5 @@
+<?php
+return [
+    'TYPO3\\CMS\\Lowlevel\\View\\ConfigurationView' => \TYPO3\CMS\Lowlevel\Controller\ConfigurationController::class,
+    'TYPO3\\CMS\\Lowlevel\\View\\DatabaseIntegrityView' => \TYPO3\CMS\Lowlevel\Controller\DatabaseIntegrityController::class,
+];
diff --git a/typo3/sysext/lowlevel/composer.json b/typo3/sysext/lowlevel/composer.json
index 5d930626eef8..6696554deed6 100644
--- a/typo3/sysext/lowlevel/composer.json
+++ b/typo3/sysext/lowlevel/composer.json
@@ -28,6 +28,11 @@
 				"partOfFactoryDefault": true
 			},
 			"extension-key": "lowlevel"
+		},
+		"typo3/class-alias-loader": {
+			"class-alias-maps": [
+				"Migrations/Code/ClassAliasMap.php"
+			]
 		}
 	},
 	"autoload": {
diff --git a/typo3/sysext/lowlevel/ext_tables.php b/typo3/sysext/lowlevel/ext_tables.php
index 61868fcc7352..7d22cb6db6a7 100644
--- a/typo3/sysext/lowlevel/ext_tables.php
+++ b/typo3/sysext/lowlevel/ext_tables.php
@@ -8,7 +8,7 @@ if (TYPO3_MODE === 'BE') {
         '',
         '',
         [
-            'routeTarget' => \TYPO3\CMS\Lowlevel\View\DatabaseIntegrityView::class . '::mainAction',
+            'routeTarget' => \TYPO3\CMS\Lowlevel\Controller\DatabaseIntegrityController::class . '::mainAction',
             'access' => 'admin',
             'name' => 'system_dbint',
             'workspaces' => 'online',
@@ -22,7 +22,7 @@ if (TYPO3_MODE === 'BE') {
         '',
         '',
         [
-            'routeTarget' => \TYPO3\CMS\Lowlevel\View\ConfigurationView::class . '::mainAction',
+            'routeTarget' => \TYPO3\CMS\Lowlevel\Controller\ConfigurationController::class . '::mainAction',
             'access' => 'admin',
             'name' => 'system_config',
             'workspaces' => 'online',
-- 
GitLab