PHP APC基本使用 (Alternative PHP Cache(可选PHP缓存))
来源:互联网 发布:多玩我的世界工业js 编辑:程序博客网 时间:2024/06/06 02:36
http://cn2.php.net/apc
官方手册中已经给你详细的说明
Alternative PHP Cache(可选PHP缓存)
- 简介
- 安装/配置
- 需求
- 安装
- 运行时配置
- 资源类型
- 预定义常量
- APC 函数
- apc_add — 缓存一个变量到数据存储
- apc_bin_dump — Get a binary dump of the given files and user variables
- 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
- apc_bin_loadfile — Load a binary dump from a file into the APC file/user cache
- apc_cache_info — Retrieves cached information from APC's data store
- apc_cas — Updates an old value with a new value
- apc_clear_cache — 清除APC缓存
- apc_compile_file — Stores a file in the bytecode cache, bypassing all filters.
- apc_dec — Decrease a stored number
- apc_define_constants — Defines a set of constants for retrieval and mass-definition
- apc_delete_file — Deletes files from the opcode cache
- apc_delete — Removes a stored variable from the cache
- apc_exists — 检查APC中是否存在某个或者某些key
- apc_fetch — 从缓存中取出存储的变量
- apc_inc — Increase a stored number
- apc_load_constants — Loads a set of constants from the cache
- apc_sma_info — Retrieves APC's Shared Memory Allocation information
- apc_store — Cache a variable in the data store
- APCIterator — The APCIterator class
- APCIterator::__construct — Constructs an APCIterator iterator object
- APCIterator::current — Get current item
- APCIterator::getTotalCount — Get total count
- APCIterator::getTotalHits — Get total cache hits
- APCIterator::getTotalSize — Get total cache size
- APCIterator::key — Get iterator key
- APCIterator::next — Move pointer to next item
- APCIterator::rewind — Rewinds iterator
- APCIterator::valid — Checks if current position is valid
例如
--TEST--
APC: apc_store/fetch with strings
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--INI--
apc.enabled=1
apc.enable_cli=1
apc.file_update_protection=0
--FILE--
<?php
$foo = 'hello world';
var_dump($foo);
apc_store('foo',$foo);
$bar = apc_fetch('foo');
var_dump($bar);
$bar = 'nice';
var_dump($bar);
apc_store('foo\x00bar', $foo);
$bar = apc_fetch('foo\x00bar');
var_dump($bar);
?>
===DONE===
<?php exit(0); ?>
--EXPECTF--
string(11) "hello world"
string(11) "hello world"
string(4) "nice"
string(11) "hello world"
===DONE===
apc_store
bool apc_store ( string $key , mixed $var [, int $ttl = 0 ] )
apc_add
bool apc_add ( string $key , mixed $var [, int $ttl = 0 ] )
apc_fetch
mixed apc_fetch ( mixed $key [, bool &$success ] )
apc_delete
mixed apc_delete ( string $key )
apc_clear_cache
bool apc_clear_cache ([ string $cache_type ] )
apc_exists
mixed apc_exists ( mixed $keys )
程序逻辑就是上述函数的排列组合
- PHP APC基本使用 (Alternative PHP Cache(可选PHP缓存))
- APC(Alternative PHP Cache)
- php apc cache 缓存
- 关于APC(Alternative PHP Cache)和MemCache
- CentOS 6 安装 APC(Alternative PHP Cache)
- 使用APC缓存PHP
- 安装 APC(Alternative PHP Cache) 提升 PHP 的解析速度
- PHP之APC缓存
- php apc 缓存
- PHP缓存函数apc
- php+apc 缓存
- php apc缓存
- php之apc缓存
- Install APC (Alternative PHP Cache) in RHEL/CentOS 6/5 & Fedora 20-12
- PHP缓存之模块缓存(APC)
- PHP APC缓存配置、使用详解
- PHP APC缓存配置、使用详解
- PHP APC缓存函数使用教程
- char * bstr CComBSTR 转换
- 在Windows中搭建iPhone开发环境
- java设计模式--单例模式--概述01
- ios利用MKMapView实现简单的地图
- oracle 常用sql语句
- PHP APC基本使用 (Alternative PHP Cache(可选PHP缓存))
- Eclipse环境中配置Editor代码格式、xml格式方法步骤
- 迎接2012之集合和泛型(1)------线性表的顺序结构基本实现
- SqlServer资料收集
- 【转】C#窗体中Invoke和BeginInvoke方法详解(二)
- 使用私有api改变UIPopoverController的边框背景
- 使用HttpClient实现申通快递查询
- 记支付宝面试的几道题
- 获取table的tr和td值