是PHP的“虚拟目录支持”吗?我认为是什么? [英] Is PHP's "Virtual Directory Support" what I think it is?

查看:158
本文介绍了是PHP的“虚拟目录支持”吗?我认为是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在phpinfo()中看到了这个条目,如果它是我认为的那样,那就太棒了!我们在IIS上,因此我对虚拟目录非常熟悉,并且长期以来一直想在PHP中使用该功能。是的,我用谷歌搜索了它,但我发现的只是关于如何启用它的问题,但无处 - 甚至在php.net上 - 我能否找到该功能的描述。

I see the entry in phpinfo(), and if it's what I think it is, then that would be great! We're on IIS and so I'm well familiar with virtual directories and have wanted that feature in PHP for a long time. Yes, I've googled it, but all I find is questions about how to enable it, but nowhere - not even on php.net - can I find a description of the feature.

那么,PHP虚拟目录支持是..?

So, PHP "Virtual Directory Support" is..?

推荐答案

使用源代码,Luke!

以下是PHP源代码的相关部分(从PHP 5.5起,无特殊原因):

Here's the relevant parts of the PHP source (from PHP 5.5, for no particular reason):

  • check of VIRTUAL_DIR constant that causes that line in phpinfo output
  • definition of that constant based on the ZTS constant
  • decision made based on that constant in a directory called TSRM

我相信ZTS代表Zend Thread Safety,TSRM是线程安全资源管理器,记录在这里

I believe "ZTS" stands for "Zend Thread Safety", and TSRM is the Thread-Safe Resource Manager, documented here.

所以这里的虚拟似乎意味着Zend Engine将使用自己的目录访问函数实现(包括有状态的函数,如 cwd )而不是直接调用底层操作系统提供的本机函数,这可能不是线程安全的。

So the "virtual" here appears to mean that the Zend Engine will use its own implementations of directory access functions (including stateful ones like cwd) rather than directly calling the native functions provided by the underlying OS, which might not be thread-safe.

我不知道这是不是是你希望听到的,但至少现在你知道:)。

I don't know if this is what you were hoping to hear, but at least now you know :)

这篇关于是PHP的“虚拟目录支持”吗?我认为是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆