Bug #69476

Declaration of TYPO3\CMS\Core\Package\PackageManager::injectClassLoader() should be compatible with TYPO3\Flow\Package\PackageManager::injectClassLoader(TYPO3\Flow\Core\ClassLoader $classLoader)

Added by Martin Helmich about 4 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2015-09-02
Due date:
% Done:

100%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

The class TYPO3\CMS\Core\Package\PackageManager overwrites the method injectClassLoader from it's parent class with a different signature (the type hint is TYPO3\CMS\Core\Core\ClassLoader instead of TYPO3\Flow\Core\ClassLoader). This violates the Liskov Substitution Principle and triggers warnings when PHP's error level includes the E_STRICT bit (this single issue fills our error logs with ~140 million lines per day).

Proposed fix on Gerrit will follow shortly.

Associated revisions

Revision 6db8afe6 (diff)
Added by Helmut Hummel about 4 years ago

[BUGFIX] Fix Liskov substitution violation in PackageManager

TYPO3's `PackageManager` class changes the signature of a method
defined in it's parent class. This causes warnings when PHP's strict
mode is enabled. Fix this in the same way, we established compatibility
with the Flow core bootstrap class and establish an alias for the
Flow core class loader.

This brings strict free TYPO3 front end rendering without having
to change the method signature.

When doing so, we can also remove the Flow class loader class from
the class map and the file system.

Change-Id: I29ce35339823126bbba0c951da11122e16b4e052
Fixes: #69476
Releases: 6.2
Reviewed-on: http://review.typo3.org/42983
Reviewed-by: Helmut Hummel <>
Tested-by: Helmut Hummel <>
Reviewed-by: Nicole Cordes <>
Tested-by: Nicole Cordes <>
Reviewed-by: Markus Klein <>
Reviewed-by: Martin Helmich <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision 2a1ecdc5 (diff)
Added by Helmut Hummel almost 4 years ago

[BUGFIX] Add class alias of class loader to alias map

Instead of hardcoding the class_alias call to alias the Flow
class loader, we must use the class alias API,
which in turn triggers the integrated composer
class loader to properly establish the alias.

This avoids a fatal error in the install tool clear cache action
which calls Bootstrap::initializeClassLoader() twice.

Resolves: #71057
Related: #69476
Releases: 6.2
Change-Id: I83310f9f9668c2ce0cdd07497036b406e94decc7
Reviewed-on: https://review.typo3.org/44302
Reviewed-by: Andreas Fernandez <>
Reviewed-by: Stefan Neufeind <>
Reviewed-by: Nicole Cordes <>
Tested-by: Nicole Cordes <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

History

#1 Updated by Gerrit Code Review about 4 years ago

  • Status changed from New to Under Review

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42983

#2 Updated by Markus Sommer about 4 years ago

  • Assignee set to Martin Helmich

#3 Updated by Gerrit Code Review about 4 years ago

Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42983

#4 Updated by Helmut Hummel about 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#5 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF