谷歌镜像 伍佰目录 短网址
  当前位置:海洋目录网 » 站长资讯 » 站长资讯 » 文章详细 订阅RssFeed

PHP - Manual: apc_bin_dump

来源:网络转载 浏览:41546次 时间:2024-02-25
apc_bin_dumpfile » « apc_add
  • PHP 手册
  • 函数参考
  • 影响 PHP 行为的扩展
  • APC
  • APC 函数

apc_bin_dump

(PECL apc >= 3.1.4)

apc_bin_dump — 获取给定文件和变量的二进制文件转储。

说明

apc_bin_dump ([ array $files = NULL [, array $user_vars = NULL ]] ) : string

从 APC 缓存中返回给定文件和用户变量的二进制打印。 一个 NULL 给文件或者用户变量符号表示每个条目的打印,而 array()则不会转储任何内容。

参数

files

文件,在 NULL传入array() 时传递每个条目的转储都不会转储任何内容。

user_vars

用户变量,在NULL传入array()时传递每个条目的转储信号都不会转储任何内容。

返回值

FALSE 如果 APC 未启用,或者NULL 遇到未知错误,则返回 APC 缓存中给定文件和用户变量的二进制转储。

参见

  • apc_bin_dumpfile() - Output a binary dump of cached files and user variables to a file
  • apc_bin_load() - Load a binary dump into the APC file/user cache
add a note

User Contributed Notes 1 note

up down -2 mightye+php at gmail dot com7 years ago These items aren't clear to me from the documentation.

In order to store file opcodes (the first parameter), you MUST have apc.stat set to 0, and filenames passed into the first parameter MUST be absolute (full) paths.  Any other configuration will generate a warning and will not dump the files.  Also, apc.stat cannot be changed at runtime (so you can't do ini_set('apc.stat', 0) prior to executing the apc_bin_dump* functions), it must be set in php.ini (or otherwise defined prior to execution of your script; for example for PHP CLI you can do "php -d apc.stat=0"). 

The files passed to apc_bin_dump*() must already exist in the opcode cache; you should do apc_compile_file() on any filenames you're not certain will be in the cache already (best practice is to do it for all files to be certain they are up to date since the mandatory apc.stat=0 disables checking whether the files are up to date, but apc_compile_file() will always refresh the file's cache).

When doing apc_bin_load*(), you do not have to have apc.stat=0, but failing to have this value may overwrite your restored value with a newly created opcode from the file on the disk if anything attempts to include that file again (even other scripts at a later time).

If you're intending to just store variables (not file opcodes), you don't have to have apc.stat=0, but you will still get a warning about apc.stat not being the correct value, even if the first parameter is an empty array() or null.

The format for the $user_vars parameter is array('varname1',..,'varnameN').  The values which are stored come out of the APC data store (not the local variable scope, nor can these be values which are passed into this function).  You must first apc_store() any value you wish to persist with these functions.  Likewise, these variables are restored to the APC data store by apc_bin_load*() rather than the local scope or as a return value in some form. 

So if your intent is to store a local variable for later use, first apc_store('varname', $varname) (assuming you have no collisions with other scopes using the same 'varname') before calling apc_bin_dump*().  When restoring, you'll need to do $varname = apc_fetch('varname') after calling apc_bin_load*()
add a note

官方地址:https://www.php.net/manual/en/function.apc-bin-dump.php

  推荐站点

  • At-lib分类目录At-lib分类目录

    At-lib网站分类目录汇集全国所有高质量网站,是中国权威的中文网站分类目录,给站长提供免费网址目录提交收录和推荐最新最全的优秀网站大全是名站导航之家

    www.at-lib.cn
  • 中国链接目录中国链接目录

    中国链接目录简称链接目录,是收录优秀网站和淘宝网店的网站分类目录,为您提供优质的网址导航服务,也是网店进行收录推广,站长免费推广网站、加快百度收录、增加友情链接和网站外链的平台。

    www.cnlink.org
  • 35目录网35目录网

    35目录免费收录各类优秀网站,全力打造互动式网站目录,提供网站分类目录检索,关键字搜索功能。欢迎您向35目录推荐、提交优秀网站。

    www.35mulu.com
  • 就要爱网站目录就要爱网站目录

    就要爱网站目录,按主题和类别列出网站。所有提交的网站都经过人工审查,确保质量和无垃圾邮件的结果。

    www.912219.com
  • 伍佰目录伍佰目录

    伍佰网站目录免费收录各类优秀网站,全力打造互动式网站目录,提供网站分类目录检索,关键字搜索功能。欢迎您向伍佰目录推荐、提交优秀网站。

    www.wbwb.net