Bug #59031

Broken Reflection behavior on class-/filename mismatch

Added by Bastian Waidelich about 1 year ago. Updated 8 months ago.

Status:Closed Start date:2014-05-22
Priority:Must have Due date:
Assigned To:Bastian Waidelich % Done:

0%

Category:Reflection
Target version:-
PHP Version: Complexity:
Has patch:No Affected Flow version:(any)

Description

When a PHP class is not named exactly like the corresponding file, weird things happen:
  • If only the case doesn't match (e.g. "someclass" vs "SomeClass") the class is reflected but weird side effects happen during "runtime"
  • If the class name is different (e.g. "SomeClass" vs "SomeRenamedClass") the ReflectionService currently "silently" skips the class

Depending on what class is affected this can lead to a "Cannot redeclare class" error:

#1355480641:
Fatal error: Cannot redeclare class Some\Package\Domain\Model\SomeEntity in Packages/Application/Some.Package/Classes/Some/Package/Domain/Model/RenamedEntity.php on line xx

59031_cli.png (64 kB) Bastian Waidelich, 2014-05-22 14:58

59031_web.png (40.7 kB) Bastian Waidelich, 2014-05-22 14:58

Associated revisions

Revision b2653fda
Added by Christian Müller about 1 year ago

[BUGFIX] Throw exception if case of class- and filename don't match

Mismatching class- and filename case is now detected during compiletime
already and a helpful exception is thrown.

Change-Id: Id3f5b1d4f151a5e1acb6624ffbbad9ad0bca22cf
Related: #59031
Releases: master, 2.2, 2.1

Revision e29e6995
Added by Christian Müller about 1 year ago

[BUGFIX] Throw exception if case of class- and filename don't match

Mismatching class- and filename case is now detected during compiletime
already and a helpful exception is thrown.

Change-Id: Id3f5b1d4f151a5e1acb6624ffbbad9ad0bca22cf
Related: #59031
Releases: master, 2.2, 2.1

Revision 9408eb09
Added by Christian Müller about 1 year ago

[BUGFIX] Throw exception if case of class- and filename don't match

Mismatching class- and filename case is now detected during compiletime
already and a helpful exception is thrown.

Change-Id: Id3f5b1d4f151a5e1acb6624ffbbad9ad0bca22cf
Related: #59031
Releases: master, 2.2, 2.1

History

#1 Updated by Bastian Waidelich about 1 year ago

Fix of the ReflectionService leads to following exception:
CLI:

Web:

#2 Updated by Gerrit Code Review about 1 year ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.Flow has been pushed to the review server.
It is available at https://review.typo3.org/30332

#3 Updated by Gerrit Code Review 11 months ago

Patch set 2 for branch master of project Packages/TYPO3.Flow has been pushed to the review server.
It is available at http://review.typo3.org/30332

#4 Updated by Gerrit Code Review 11 months ago

Patch set 3 for branch master of project Packages/TYPO3.Flow has been pushed to the review server.
It is available at http://review.typo3.org/30332

#5 Updated by Bastian Waidelich 8 months ago

  • Status changed from Under Review to Closed

Also available in: Atom PDF