持久数据库连接如何存储在PHP中? [英] How are persistent database connections stored in PHP?

查看:85
本文介绍了持久数据库连接如何存储在PHP中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

sqlite_popen php尝试文档中所述利用持久资源机制.该机制在哪里详细描述?是否可以查看当前存储/使用的所有资源?是否可以访问此机制并存储/读取其他值?

As stated in the documentation on sqlite_popen php tries to make use of a persistent resource mechanism. Where is this mechanism described in detail? Is it possible to view all resources currently stored/used? Is it possible to access this mechanism and store/read other values?

推荐答案

sqlite_popen使用(执行程序)全局哈希表"persistent_list"存储连接资源.此哈希表不是执行脚本的php实例"的一部分,而是php运行时"的一部分,这意味着脚本完成后不会清除/删除它,但只要将php .so/.dll/保留在内存中,该哈希表就不会被清除/删除. fastcgi.exe.
您无法从php脚本中访问EG(persistent_list),但任何php模块/扩展名都可以.

sqlite_popen uses the (executor) global hashtable "persistent_list" to store the connection resource. This hashtable is not part of the php "instance" which executes your script but of the php "runtime", which means it's not cleared/removed after the script is done but held in memory as long as the php .so/.dll/fastcgi.exe.
You cannot access EG(persistent_list) from within a php script but any php module/extension can.

这篇关于持久数据库连接如何存储在PHP中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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