[TASK] Use autoload map instead of aliases in sysext form 99/35599/2
authorHelmut Hummel <helmut.hummel@typo3.org>
Fri, 5 Dec 2014 10:41:39 +0000 (11:41 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Sat, 20 Dec 2014 12:47:04 +0000 (13:47 +0100)
Using the alias map is misleading as it is only used
to force the class loader to cache class names with
lowercased identifier to be able to load the class
with "wrong" casing.

Use the autoload map for that instead and clarify
in that file that it must not be removed for now.

Resolves: #63999
Related: #63576 #63577
Releases: master
Change-Id: I8f683ff1d68480a3530a8d2fea62208e66ca947d
Reviewed-on: http://review.typo3.org/35599
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/form/Migrations/Code/ClassAliasMap.php [deleted file]
typo3/sysext/form/ext_autoload.php [new file with mode: 0644]

diff --git a/typo3/sysext/form/Migrations/Code/ClassAliasMap.php b/typo3/sysext/form/Migrations/Code/ClassAliasMap.php
deleted file mode 100644 (file)
index 488bdc3..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-return array(
-       'TYPO3\\CMS\\Form\\Domain\\Model\\Attribute\\AcceptcharsetAttribute' => \TYPO3\CMS\Form\Domain\Model\Attribute\AcceptCharsetAttribute::class,
-       'TYPO3\\CMS\\Form\\Domain\\Model\\Element\\CheckboxgroupElement' => \TYPO3\CMS\Form\Domain\Model\Element\CheckboxGroupElement::class,
-       'TYPO3\\CMS\\Form\\Domain\\Model\\Element\\RadiogroupElement' => \TYPO3\CMS\Form\Domain\Model\Element\RadioGroupElement::class,
-       'TYPO3\\CMS\\Form\\Domain\\Model\\Json\\CheckboxgroupJsonElement' => \TYPO3\CMS\Form\Domain\Model\Json\CheckboxGroupJsonElement::class,
-       'TYPO3\\CMS\\Form\\Domain\\Model\\Json\\RadiogroupJsonElement' => \TYPO3\CMS\Form\Domain\Model\Json\RadioGroupJsonElement::class,
-       'TYPO3\\CMS\\Form\\Filter\\RegexpFilter' => \TYPO3\CMS\Form\Filter\RegExpFilter::class,
-       'TYPO3\\CMS\\Form\\Filter\\StripnewlinesFilter' => \TYPO3\CMS\Form\Filter\StripNewLinesFilter::class,
-       'TYPO3\\CMS\\Form\\Filter\\TitlecaseFilter' => \TYPO3\CMS\Form\Filter\TitleCaseFilter::class,
-       'TYPO3\\CMS\\Form\\Filter\\UppercaseFilter' => \TYPO3\CMS\Form\Filter\UpperCaseFilter::class,
-       'TYPO3\\CMS\\Form\\Validation\\FileallowedtypesValidator' => \TYPO3\CMS\Form\Validation\FileAllowedTypesValidator::class,
-       'TYPO3\\CMS\\Form\\Validation\\FilemaximumsizeValidator' => \TYPO3\CMS\Form\Validation\FileMaximumSizeValidator::class,
-       'TYPO3\\CMS\\Form\\Validation\\FileminimumsizeValidator' => \TYPO3\CMS\Form\Validation\FileMinimumSizeValidator::class,
-       'TYPO3\\CMS\\Form\\Validation\\GreaterthanValidator' => \TYPO3\CMS\Form\Validation\GreaterThanValidator::class,
-       'TYPO3\\CMS\\Form\\Validation\\InarrayValidator' => \TYPO3\CMS\Form\Validation\InArrayValidator::class,
-       'TYPO3\\CMS\\Form\\Validation\\RegexpValidator' => \TYPO3\CMS\Form\Validation\RegExpValidator::class,
-       'TYPO3\\CMS\\Form\\View\\Confirmation\\Element\\CheckboxgroupElementView' => \TYPO3\CMS\Form\View\Confirmation\Element\CheckboxGroupElementView::class,
-       'TYPO3\\CMS\\Form\\View\\Confirmation\\Element\\RadiogroupElementView' => \TYPO3\CMS\Form\View\Confirmation\Element\RadioGroupElementView::class,
-       'TYPO3\\CMS\\Form\\View\\Form\\Element\\CheckboxgroupElementView' => \TYPO3\CMS\Form\View\Form\Element\CheckboxGroupElementView::class,
-       'TYPO3\\CMS\\Form\\View\\Form\\Element\\RadiogroupElementView' => \TYPO3\CMS\Form\View\Form\Element\RadioGroupElementView::class,
-       'TYPO3\\CMS\\Form\\View\\Mail\\Html\\Element\\CheckboxgroupElementView' => \TYPO3\CMS\Form\View\Mail\Html\Element\CheckboxGroupElementView::class,
-       'TYPO3\\CMS\\Form\\View\\Mail\\Html\\Element\\RadiogroupElementView' => \TYPO3\CMS\Form\View\Mail\Html\Element\RadioGroupElementView::class,
-       'TYPO3\\CMS\\Form\\View\\Mail\\Plain\\Element\\CheckboxgroupElementView' => \TYPO3\CMS\Form\View\Mail\Plain\Element\CheckboxGroupElementView::class,
-       'TYPO3\\CMS\\Form\\View\\Mail\\Plain\\Element\\RadiogroupElementView' => \TYPO3\CMS\Form\View\Mail\Plain\Element\RadioGroupElementView::class,
-       'TYPO3\\CMS\\Form\\Filter\\RemovexssFilter' => \TYPO3\CMS\Form\Filter\RemoveXssFilter::class,
-);
\ No newline at end of file
diff --git a/typo3/sysext/form/ext_autoload.php b/typo3/sysext/form/ext_autoload.php
new file mode 100644 (file)
index 0000000..9981d8f
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+$extPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('form');
+/*
+ * These are classes which may be looked up with different casing than the original class
+ * which is no issue with PHP as class names are case insensitive, but is an issue with our class loader
+ * as it makes assumptions on the file location from the looked up class name, which fails on case sensitive file systems.
+ * This file must stay as long as our class loader has to look up class files during runtime.
+ */
+return array(
+       'typo3\\cms\\form\\domain\\model\\attribute\\acceptcharsetattribute' => $extPath . 'Classes/Domain/Model/Attribute/AcceptCharsetAttribute.php',
+       'typo3\\cms\\form\\domain\\model\\element\\checkboxgroupelement' => $extPath . 'Classes/Domain/Model/Element/CheckboxGroupElement.php',
+       'typo3\\cms\\form\\domain\\model\\element\\radiogroupelement' => $extPath . 'Classes/Domain/Model/Element/RadioGroupElement.php',
+       'typo3\\cms\\form\\domain\\model\\json\\checkboxgroupjsonelement' => $extPath . 'Classes/Domain/Model/Json/CheckboxGroupJsonElement.php',
+       'typo3\\cms\\form\\domain\\model\\json\\radiogroupjsonelement' => $extPath . 'Classes/Domain/Model/Json/RadioGroupJsonElement.php',
+       'typo3\\cms\\form\\filter\\regexpfilter' => $extPath . 'Classes/Filter/RegExpFilter.php',
+       'typo3\\cms\\form\\filter\\stripnewlinesfilter' => $extPath . 'Classes/Filter/StripNewLinesFilter.php',
+       'typo3\\cms\\form\\filter\\titlecasefilter' => $extPath . 'Classes/Filter/TitleCaseFilter.php',
+       'typo3\\cms\\form\\filter\\uppercasefilter' => $extPath . 'Classes/Filter/UpperCaseFilter.php',
+       'typo3\\cms\\form\\filter\\removexssfilter' => $extPath . 'Classes/Filter/RemoveXssFilter.php',
+       'typo3\\cms\\form\\validation\\fileallowedtypesvalidator' => $extPath . 'Classes/Validation/FileAllowedTypesValidator.php',
+       'typo3\\cms\\form\\validation\\filemaximumsizevalidator' => $extPath . 'Classes/Validation/FileMaximumSizeValidator.php',
+       'typo3\\cms\\form\\validation\\fileminimumsizevalidator' => $extPath . 'Classes/Validation/FileMinimumSizeValidator.php',
+       'typo3\\cms\\form\\validation\\greaterthanvalidator' => $extPath . 'Classes/Validation/GreaterThanValidator.php',
+       'typo3\\cms\\form\\validation\\inarrayvalidator' => $extPath . 'Classes/Validation/InArrayValidator.php',
+       'typo3\\cms\\form\\validation\\regexpvalidator' => $extPath . 'Classes/Validation/RegExpValidator.php',
+       'typo3\\cms\\form\\view\\confirmation\\element\\checkboxgroupelementview' => $extPath . 'Classes/View/Confirmation/Element/CheckboxGroupElementView.php',
+       'typo3\\cms\\form\\view\\confirmation\\element\\radiogroupelementview' => $extPath . 'Classes/View/Confirmation/Element/RadioGroupElementView.php',
+       'typo3\\cms\\form\\view\\form\\element\\checkboxgroupelementview' => $extPath . 'Classes/View/Form/Element/CheckboxGroupElementView.php',
+       'typo3\\cms\\form\\view\\form\\element\\radiogroupelementview' => $extPath . 'Classes/View/Form/Element/RadioGroupElementView.php',
+       'typo3\\cms\\form\\view\\mail\\html\\element\\checkboxgroupelementview' => $extPath . 'Classes/View/Mail/Html/Element/CheckboxGroupElementView.php',
+       'typo3\\cms\\form\\view\\mail\\html\\element\\radiogroupelementview' => $extPath . 'Classes/View/Mail/Html/Element/RadioGroupElementView.php',
+       'typo3\\cms\\form\\view\\mail\\plain\\element\\checkboxgroupelementview' => $extPath . 'Classes/View/Mail/Plain/Element/CheckboxGroupElementView.php',
+       'typo3\\cms\\form\\view\\mail\\plain\\element\\radiogroupelementview' => $extPath . 'Classes/View/Mail/Plain/Element/RadioGroupElementView.php',
+);