HipHop-Php VM and auto_prepend


HipHop-Php VM and auto_prepend

是否有人知道是否可以包含auto_prepend文件与HipHop hhvm(最新版本)?

我在选项或文档中没有看到关于这个特性的任何内容

不,目前没有办法做到这一点。我喜欢从你那里得到一个拉请求:)

在HHVM 3.1.0(2014年发布)中增加了对auto_prepend_fileauto_append_file的支持。它们的行为方式与Zend PHP相同。

如果运行较旧的HHVM版本,也有(现在仍然是)request_init_document设置类似于auto_prepend_file,因为它在执行此请求的主脚本之前执行。

然而,它有两个重要的区别:
    RequestInitDocument不会在每个web请求之前运行一次。相反,HHVM只运行request_init_document一次,作为一个较长的线程。在request_init_document完成后,虚拟机的状态被捕获到快照中,然后在以后的多个请求开始时恢复,直到它被回收并重新创建。HHVM 3.22.0 - Server Flow Documentation
  1. 仅适用于web请求,不适用于CLI。https://github.com/facebook/hhvm/issues/1323