dongpao1905 2012-10-19 14:33
浏览 6
已采纳

检查脚本需要的是什么

I've got few scripts, which use require to the same script (it is main configration script). Can I determine somehow which script used require, and depends on it load specific configuration from main file? I think that it cant be done, but it worth a shoot!

  • 写回答

1条回答 默认 最新

  • dpno17028 2012-10-19 14:35
    关注

    Well, you could set some parameters before the require call, and then read them to determine what to load.

    Or you could use $_SERVER['PHP_SELF'], but it's a messy variable.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?