psr-4

What Are the Differences Between PSR-0 and PSR-4?

醉酒当歌 提交于 2019-11-26 07:51:47
问题 Recently I\'ve read about namespaces and how they are beneficial. I\'m currently creating a project in Laravel and trying to move from class map autoloading to namespacing. However, I can\'t seem to grasp what the actual difference is between PSR-0 and PSR-4. Some resources that I\'ve read are... Battle of the Autoloaders Laracasts PSR-4 autoloading PSR-0 PSR-4 What I understand: PSR-4 does not convert underscores to directory separators Certain specific rules of composer cause the directory

Why use a PSR-0 or PSR-4 autoload in composer if classmap is actually faster?

╄→尐↘猪︶ㄣ 提交于 2019-11-26 04:18:44
问题 I understand that you can use either a PSR standard to locate files, or tell composer a directory to scan for classes. The documentation recommends using the PSR-4 standard. There is also an option for composer to create an optimized autoloader, which basically generates a full classmap. So why should one use PSR-4 at all if the best way to load is with a classmap? It makes sense to me to keep the directory structure, since that is a good way to organize anyway. However, it seems like the