XenForo_Application::autoload vs class_exists

Shadab

Well-known member
What's the rationale behind using XenForo_Application::autoload() to check if a given class is autoload-able, instead of using a much simpler class_exists('', true) function?

It creates an additional (and unnecessary) dependency on the XenForo_Autoloader class.
 
Thanks for the reply, Mike. :)

Would it be possible to remove this particular dependency on the autoloader? Please?

As it stands, the XF autoloader doesn't support loading of namespaced classes and multiple library directories. This issue can be easily solved by using a custom autoloader. The real problem arises when trying to use those classes. Pretty much any handler class and every class that utilizes the dynamic proxy system cannot be loaded from any other autoloader due to this hard dependency.
 
Top Bottom