Bug #52945

Excluded classes should only be excluded from reflection but still autoloaded

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

Status:
New
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2013-10-18
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

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 namespaceResolved2013-10-18

Actions
#1

Updated by Philipp Maier almost 8 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 8 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 8 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 8 years ago

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

#5

Updated by Hendrik Frahmann almost 8 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 8 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