Using Composer's Autoload

后端 未结 6 657
挽巷
挽巷 2020-11-30 19:55

I have been looking around the net with no luck on this issue. I am using composer\'s autoload with this code in my composer.json:

\"autoload\":         


        
6条回答
  •  北荒
    北荒 (楼主)
    2020-11-30 20:13

    Every package should be responsible for autoloading itself, what are you trying to achieve with autoloading classes that are out of the package you define?

    One workaround if it's for your application itself is to add a namespace to the loader instance, something like this:

    add('AppName', __DIR__.'/../src/');
    

提交回复
热议问题