PHP - most lightweight psr-0 compliant autoloader

后端 未结 7 853
猫巷女王i
猫巷女王i 2020-12-01 09:55

I have a tiny application that i need an autoloader for. I could easily use the symfony2 class loader but it seems like overkill.

Is there a stable extremely lightw

7条回答
  •  醉酒成梦
    2020-12-01 10:23

    This is not a direct answer to the question, but I found that the above answers worked great on standalone PHP scripts, but were causing issues when used in certain frameworks, such as Joomla.

    For anyone using Joomla, it turns out that there is a compatible autoloader already built into the framework, therefore you won't need to use the above functions. In that instance, just call JLoader::registerNamespace().... for example:

    JLoader::registerNamespace('Solarium', JPATH_LIBRARIES . DS . 'solarium-3.2.0' . DS . 'library');
    

提交回复
热议问题