Using Composer's Autoload

后端 未结 6 634
挽巷
挽巷 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:09

    Just create a symlink in your src folder for the namespace pointing to the folder containing your classes...

    ln -s ../src/AppName ./src/AppName
    

    Your autoload in composer will look the same...

    "autoload": {
        "psr-0": {"AppName": "src/"}
    }
    

    And your AppName namespaced classes will start a directory up from your current working directory in a src folder now... that should work.

提交回复
热议问题