Bug #52945

Excluded classes should only be excluded from reflection but still autoloaded

Added by Hendrik Frahmann almost 2 years ago. Updated almost 2 years ago.

Status:New Start date:2013-10-18
Priority:Should have Due date:
Assigned To:- % Done:

0%

Category:-
Target version:-
PHP Version: Complexity:
Has patch:No Affected Flow version:Git master

Description

Classes that are excluded in the settings.yaml (Flow > object > excludeClasses) should still be able to autoload.


Related issues

related to TYPO3.Flow - Bug #52944: Generating correct proxy classes for classes without a na... Resolved 2013-10-18

History

#1 Updated by Philipp Maier almost 2 years ago

Needs to be verified yet. Could be related to this one #52944.
Will investigate both later today.

#2 Updated by Alexander Berl almost 2 years ago

I don't think those are related. The class loader only considers packages that are active (see PackageManager::initialize), either in PackageStates.php or by scanning Directories. The excludeClass on the other hand only comes in with (compileTime) ObjectManagement to decide for which classes proxies need to be generated. So in theory excludeClasses shouldn't interfere with autoloading at all.
However, I can see that the class loader currently doesn't handle empty namespaces - so if that is the connection, then that explains why the classes aren't loaded, not the excludeClasses.

Would be interesting to have a sample code and then check the generated PackageStates

#3 Updated by Hendrik Frahmann almost 2 years ago

Alexander Berl wrote:

However, I can see that the class loader currently doesn't handle empty namespaces - so if that is the connection, then that explains why the classes aren't loaded, not the excludeClasses.

When I remove the empty "namespace ;" line from the proxy class the class is being loaded and working.

#4 Updated by Alexander Berl almost 2 years ago

Issue should be updated then to "Class Loader doesn't handle empty namespaces" or similar

#5 Updated by Hendrik Frahmann almost 2 years ago

The reason for this issue belongs to the IRC chat.
Because I wanted to use the ChromePHP library but the ChromePHP class does not have a namespace.
So that gave me an error because the generated proxy class contained the empty namespace line.
In the IRC was said i should exclude the class with 'excludeClasses' and I should created this issue (and the other one).

I don't know if 'excludeClasses' should exclude the classes from all or just the reflection part.
Maybe this issue can be closed when #52944 is fixed.

#6 Updated by Alexander Berl almost 2 years ago

I'd still say it's a bug that namespace-less classes cannot be autoloaded. The same happens when trying to autoload Tcpdf library without special include/require statement in Packages.php

Also available in: Atom PDF