Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Autoloader is not deterministic and possibly performs too many file stats #9619
When the autoloader currently receives a class to be loaded, it generates an array of possible paths that class may be found in. Furthermore it uses stream_resolve_include_path() to resolve these paths. This leads to a lot of unncessary "does that file exist" checks and provokes issues like #9524.
To fix this problem, the autoloader should be made entirely deterministic. That means, given a class name, the autoloader should take that class name and transform it into a file path (deterministically, without looking at the filesystem). Only this single file should be tried to be loaded.
Please note that deterministic does not mean that different prefixes can not be used. It will still allow mapping the OCP prefix to the lib/public folder and OC to the lib/private folder.
referenced this issue
Jul 14, 2014
The "searching in all possible paths" feature might be in use by core apps. See e.g. https://github.com/owncloud/core/blob/master/apps/files_external/lib/owncloud.php which defines a class