Each of my apps will have a config file that will be read. That config file can specify what url to use. You can use existing libraries to read config files. In this example I will use Zend_Config_Ini. Here's what your config file can look like for great app:
[settings]
urls.third_party = 'xxx.xxx.xxx.xxx'
This is one is for superapp
[settings]
urls.third_party = 'http://apis.example.com'
2.Read the url from a config file using Zend_Config_Ini for example:
发布评论
评论(2)
它不能直接完成:主机名称空间对于每个主机都是全局的。
您可以使用不同的
/etc/hosts
文件在虚拟机中运行其中一个 apache。It cannot be done directly: host name space is global per host.
You could run one of the apaches in a virtual machine with a different
/etc/hosts
file.我的做法如下:
这是一个用于超级应用的
2.使用 Zend_Config_Ini 从配置文件中读取 url,例如:
我认为这种方式更灵活,因为您可以轻松更改轻松查看相关应用程序的配置文件。
Here's how I would do it:
This is one is for superapp
2.Read the url from a config file using Zend_Config_Ini for example:
I think you're more flexible this way as you can easily change the url in the config file of the app concerned easily.