autoload and multiple directories

前端 未结 6 1615
醉酒成梦
醉酒成梦 2020-12-14 21:36

I\'ve just been looking at php\'s autoload() function. Seems a nice idea, but I\'m not sure how it handles multiple directories. My current development basically has a libra

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-14 22:08

    Unfortunately, you do have to explicitly add each directory. This can either be done programmatically in a script that recursively traverses your directories, or you can specify a list.

    Probably the most efficient way is to specify a list of directories and subdirectories to search, and add these to your 'include_path' using ini_set().

提交回复
热议问题