Magento trying to autoload class unnecessarily

2019-09-06 16:05发布

问题:

I'm using a 3rd party php library to connect to Microsoft Dynamics CRM, which I've placed in the /lib folder of Magento.

I've created a controller for testing purposes, in which I'm including the files from the lib folder (which are being included, as changing the paths throws an error), but when I try and initiate the class defined in one of the included files, i get this warning:

Warning: include(DynamicsCRM2011\Connector.php) [function.include]: failed to open stream: No such file or directory.

It shouldn't be trying to include anything, the class is already defined in a previously included file!

Any ideas how I can prevent this from happening? I'd have thought it would only try to autoload the file if the class is undefined surely?