2
+----------------------------------------------------------------------+
4
+----------------------------------------------------------------------+
5
| Copyright (c) 2006-2011 The PHP Group |
6
+----------------------------------------------------------------------+
7
| This source file is subject to version 3.01 of the PHP license, |
8
| that is bundled with this package in the file LICENSE, and is |
9
| available through the world-wide-web at the following url: |
10
| http://www.php.net/license/3_01.txt |
11
| If you did not receive a copy of the PHP license and are unable to |
12
| obtain it through the world-wide-web, please send a note to |
13
| license@php.net so we can mail you a copy immediately. |
14
+----------------------------------------------------------------------+
15
| Authors: Daniel Cowgill <dcowgill@communityconnect.com> |
16
| Rasmus Lerdorf <rasmus@php.net> |
17
+----------------------------------------------------------------------+
19
This software was contributed to PHP by Community Connect Inc. in 2002
20
and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1.
21
Future revisions and derivatives of this source code must acknowledge
22
Community Connect Inc. as the original contributor of this module by
23
leaving this note intact in the source code.
25
All other licensing and usage conditions are those of the PHP Group.
29
/* $Id: php_apc.c 328290 2012-11-09 03:30:09Z laruence $ */
35
#include "apc_cache.h"
36
#include "apc_iterator.h"
40
#include "php_globals.h"
42
#include "ext/standard/info.h"
43
#include "ext/standard/file.h"
44
#include "ext/standard/flock_compat.h"
45
#include "ext/standard/md5.h"
46
#include "ext/standard/php_var.h"
48
#ifdef HAVE_SYS_FILE_H
57
#include "apc_signal.h"
60
/* {{{ PHP_FUNCTION declarations */
61
PHP_FUNCTION(apcu_cache_info);
62
PHP_FUNCTION(apcu_clear_cache);
63
PHP_FUNCTION(apcu_sma_info);
64
PHP_FUNCTION(apcu_key_info);
65
PHP_FUNCTION(apcu_store);
66
PHP_FUNCTION(apcu_fetch);
67
PHP_FUNCTION(apcu_delete);
68
PHP_FUNCTION(apcu_add);
69
PHP_FUNCTION(apcu_inc);
70
PHP_FUNCTION(apcu_dec);
71
PHP_FUNCTION(apcu_cas);
72
PHP_FUNCTION(apcu_exists);
74
PHP_FUNCTION(apcu_bin_dump);
75
PHP_FUNCTION(apcu_bin_load);
76
PHP_FUNCTION(apcu_bin_dumpfile);
77
PHP_FUNCTION(apcu_bin_loadfile);
80
PHP_FUNCTION(apc_bin_dumpfile);
81
PHP_FUNCTION(apc_bin_dump);
85
/* {{{ ZEND_DECLARE_MODULE_GLOBALS(apcu) */
86
ZEND_DECLARE_MODULE_GLOBALS(apcu)
89
apc_cache_t* apc_user_cache = NULL;
91
/* External APC SMA */
92
apc_sma_api_extern(apc_sma);
94
/* Global init functions */
95
static void php_apc_init_globals(zend_apcu_globals* apcu_globals TSRMLS_DC)
97
apcu_globals->initialized = 0;
98
apcu_globals->slam_defense = 1;
99
apcu_globals->smart = 0;
101
#ifdef MULTIPART_EVENT_FORMDATA
102
apcu_globals->rfc1867 = 0;
103
memset(&(apcu_globals->rfc1867_data), 0, sizeof(apc_rfc1867_data));
106
apcu_globals->preload_path = NULL;
107
apcu_globals->coredump_unmap = 0;
108
apcu_globals->use_request_time = 1;
109
apcu_globals->serializer_name = NULL;
115
static PHP_INI_MH(OnUpdateShmSegments) /* {{{ */
118
if (zend_atoi(new_value, new_value_length)!=1) {
119
php_error_docref(NULL TSRMLS_CC, E_WARNING, "apc.shm_segments setting ignored in MMAP mode");
121
APCG(shm_segments) = 1;
123
APCG(shm_segments) = zend_atoi(new_value, new_value_length);
129
static PHP_INI_MH(OnUpdateShmSize) /* {{{ */
131
long s = zend_atol(new_value, new_value_length);
138
/* if it's less than 1Mb, they are probably using the old syntax */
140
NULL TSRMLS_CC, E_WARNING, "apc.shm_size now uses M/G suffixes, please update your ini files");
150
#ifdef MULTIPART_EVENT_FORMDATA
151
static PHP_INI_MH(OnUpdateRfc1867Freq) /* {{{ */
154
tmp = zend_atoi(new_value, new_value_length);
156
apc_error("rfc1867_freq must be greater than or equal to zero." TSRMLS_CC);
159
if (new_value[new_value_length-1] == '%') {
161
apc_error("rfc1867_freq cannot be over 100%%" TSRMLS_CC);
164
APCG(rfc1867_freq) = tmp / 100.0;
166
APCG(rfc1867_freq) = tmp;
174
STD_PHP_INI_BOOLEAN("apc.enabled", "1", PHP_INI_SYSTEM, OnUpdateBool, enabled, zend_apcu_globals, apcu_globals)
175
STD_PHP_INI_ENTRY("apc.shm_segments", "1", PHP_INI_SYSTEM, OnUpdateShmSegments, shm_segments, zend_apcu_globals, apcu_globals)
176
STD_PHP_INI_ENTRY("apc.shm_size", "32M", PHP_INI_SYSTEM, OnUpdateShmSize, shm_size, zend_apcu_globals, apcu_globals)
177
STD_PHP_INI_ENTRY("apc.entries_hint", "4096", PHP_INI_SYSTEM, OnUpdateLong, entries_hint, zend_apcu_globals, apcu_globals)
178
STD_PHP_INI_ENTRY("apc.gc_ttl", "3600", PHP_INI_SYSTEM, OnUpdateLong, gc_ttl, zend_apcu_globals, apcu_globals)
179
STD_PHP_INI_ENTRY("apc.ttl", "0", PHP_INI_SYSTEM, OnUpdateLong, ttl, zend_apcu_globals, apcu_globals)
180
STD_PHP_INI_ENTRY("apc.smart", "0", PHP_INI_SYSTEM, OnUpdateLong, smart, zend_apcu_globals, apcu_globals)
182
STD_PHP_INI_ENTRY("apc.mmap_file_mask", NULL, PHP_INI_SYSTEM, OnUpdateString, mmap_file_mask, zend_apcu_globals, apcu_globals)
184
STD_PHP_INI_BOOLEAN("apc.enable_cli", "0", PHP_INI_SYSTEM, OnUpdateBool, enable_cli, zend_apcu_globals, apcu_globals)
185
STD_PHP_INI_BOOLEAN("apc.slam_defense", "1", PHP_INI_SYSTEM, OnUpdateBool, slam_defense, zend_apcu_globals, apcu_globals)
186
#ifdef MULTIPART_EVENT_FORMDATA
187
STD_PHP_INI_BOOLEAN("apc.rfc1867", "0", PHP_INI_SYSTEM, OnUpdateBool, rfc1867, zend_apcu_globals, apcu_globals)
188
STD_PHP_INI_ENTRY("apc.rfc1867_prefix", "upload_", PHP_INI_SYSTEM, OnUpdateStringUnempty, rfc1867_prefix, zend_apcu_globals, apcu_globals)
189
STD_PHP_INI_ENTRY("apc.rfc1867_name", "APC_UPLOAD_PROGRESS", PHP_INI_SYSTEM, OnUpdateStringUnempty, rfc1867_name, zend_apcu_globals, apcu_globals)
190
STD_PHP_INI_ENTRY("apc.rfc1867_freq", "0", PHP_INI_SYSTEM, OnUpdateRfc1867Freq, rfc1867_freq, zend_apcu_globals, apcu_globals)
191
STD_PHP_INI_ENTRY("apc.rfc1867_ttl", "3600", PHP_INI_SYSTEM, OnUpdateLong, rfc1867_ttl, zend_apcu_globals, apcu_globals)
193
STD_PHP_INI_ENTRY("apc.preload_path", (char*)NULL, PHP_INI_SYSTEM, OnUpdateString, preload_path, zend_apcu_globals, apcu_globals)
194
STD_PHP_INI_BOOLEAN("apc.coredump_unmap", "0", PHP_INI_SYSTEM, OnUpdateBool, coredump_unmap, zend_apcu_globals, apcu_globals)
195
STD_PHP_INI_BOOLEAN("apc.use_request_time", "1", PHP_INI_ALL, OnUpdateBool, use_request_time, zend_apcu_globals, apcu_globals)
196
STD_PHP_INI_ENTRY("apc.serializer", "php", PHP_INI_SYSTEM, OnUpdateStringUnempty, serializer_name, zend_apcu_globals, apcu_globals)
197
STD_PHP_INI_ENTRY("apc.writable", "/tmp", PHP_INI_SYSTEM, OnUpdateStringUnempty, writable, zend_apcu_globals, apcu_globals)
202
/* {{{ PHP_MINFO_FUNCTION(apcu) */
203
static PHP_MINFO_FUNCTION(apcu)
205
php_info_print_table_start();
206
php_info_print_table_header(2, "APCu Support", APCG(enabled) ? "Enabled" : "Disabled");
207
php_info_print_table_row(2, "Version", PHP_APCU_VERSION);
209
php_info_print_table_row(2, "APCu Debugging", "Enabled");
211
php_info_print_table_row(2, "APCu Debugging", "Disabled");
214
php_info_print_table_row(2, "MMAP Support", "Enabled");
215
php_info_print_table_row(2, "MMAP File Mask", APCG(mmap_file_mask));
217
php_info_print_table_row(2, "MMAP Support", "Disabled");
221
apc_serializer_t *serializer = NULL;
222
smart_str names = {0,};
225
for( i = 0, serializer = apc_get_serializers(TSRMLS_C);
226
serializer->name != NULL;
229
smart_str_appends(&names, ", ");
231
smart_str_appends(&names, serializer->name);
236
php_info_print_table_row(2, "Serialization Support", names.c);
237
smart_str_free(&names);
239
php_info_print_table_row(2, "Serialization Support", "Broken");
242
php_info_print_table_row(2, "Serialization Support", "Disabled");
245
php_info_print_table_row(2, "Revision", "$Revision: 328290 $");
246
php_info_print_table_row(2, "Build Date", __DATE__ " " __TIME__);
247
php_info_print_table_end();
248
DISPLAY_INI_ENTRIES();
252
#ifdef MULTIPART_EVENT_FORMDATA
253
extern int apc_rfc1867_progress(unsigned int event, void *event_data, void **extra TSRMLS_DC);
257
static void apc_init(INIT_FUNC_ARGS);
260
/* {{{ PHP_MINIT_FUNCTION(apcu) */
261
static PHP_MINIT_FUNCTION(apcu)
263
ZEND_INIT_MODULE_GLOBALS(apcu, php_apc_init_globals, NULL);
265
REGISTER_INI_ENTRIES();
267
/* locks initialized regardless of settings */
268
apc_lock_init(TSRMLS_C);
270
/* Disable APC in cli mode unless overridden by apc.enable_cli */
271
if (!APCG(enable_cli) && !strcmp(sapi_module.name, "cli")) {
275
/* only run initialization if APC is enabled */
278
if (!APCG(initialized)) {
279
/* ensure this runs only once */
280
APCG(initialized) = 1;
282
/* initialize shared memory allocator */
284
apc_sma.init(APCG(shm_segments), APCG(shm_size), APCG(mmap_file_mask) TSRMLS_CC);
286
apc_sma.init(APCG(shm_segments), APCG(shm_size), NULL TSRMLS_CC);
289
/* XXX pack this into macros when there are more hooks to handle */
290
#if defined(PHP_WIN32) && defined(_WIN64)
294
if (!_i64toa_s((__int64)_apc_register_serializer, buf, 65, 10)) {
295
REGISTER_STRING_CONSTANT(APC_SERIALIZER_CONSTANT, buf, CONST_PERSISTENT | CONST_CS);
297
/* subsequent apc_register_serializer() calls will be void */
298
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Serializer hook init failed");
302
REGISTER_LONG_CONSTANT(APC_SERIALIZER_CONSTANT, (long)&_apc_register_serializer, CONST_PERSISTENT | CONST_CS);
305
/* register default serializer */
306
_apc_register_serializer(
307
"php", APC_SERIALIZER_NAME(php), APC_UNSERIALIZER_NAME(php), NULL TSRMLS_CC);
309
/* test out the constant function pointer */
310
assert(apc_get_serializers(TSRMLS_C)->name != NULL);
312
/* create user cache */
313
apc_user_cache = apc_cache_create(
315
apc_find_serializer(APCG(serializer_name) TSRMLS_CC),
316
APCG(entries_hint), APCG(gc_ttl), APCG(ttl), APCG(smart), APCG(slam_defense)
320
/* initialize pooling */
323
/* preload data from path specified in configuration */
324
if (APCG(preload_path)) {
326
apc_user_cache, APCG(preload_path) TSRMLS_CC);
329
#ifdef MULTIPART_EVENT_FORMDATA
330
/* File upload progress tracking */
332
php_rfc1867_callback = apc_rfc1867_progress;
336
/* initialize iterator object */
337
apc_iterator_init(module_number TSRMLS_CC);
340
REGISTER_LONG_CONSTANT("APC_BIN_VERIFY_MD5", APC_BIN_VERIFY_MD5, CONST_CS | CONST_PERSISTENT);
341
REGISTER_LONG_CONSTANT("APC_BIN_VERIFY_CRC32", APC_BIN_VERIFY_CRC32, CONST_CS | CONST_PERSISTENT);
344
#ifndef REGISTER_BOOL_CONSTANT
346
zend_constant apc_bc;
347
Z_TYPE(apc_bc.value) = IS_BOOL;
348
#if defined(APC_FULL_BC) && APC_FULL_BC
349
Z_LVAL(apc_bc.value) = 1;
351
Z_LVAL(apc_bc.value) = 0;
353
apc_bc.flags = (CONST_CS | CONST_PERSISTENT);
354
apc_bc.name = zend_strndup(ZEND_STRL("APCU_APC_FULL_BC"));
355
apc_bc.name_len = sizeof("APCU_APC_FULL_BC");
356
apc_bc.module_number = module_number;
357
zend_register_constant(&apc_bc TSRMLS_CC);
360
#if defined(APC_FULL_BC) && APC_FULL_BC
361
REGISTER_BOOL_CONSTANT("APCU_APC_FULL_BC", 1, CONST_CS | CONST_PERSISTENT);
363
REGISTER_BOOL_CONSTANT("APCU_APC_FULL_BC", 0, CONST_CS | CONST_PERSISTENT);
368
apc_init(INIT_FUNC_ARGS_PASSTHRU);
375
/* {{{ PHP_MSHUTDOWN_FUNCTION(apcu) */
376
static PHP_MSHUTDOWN_FUNCTION(apcu)
378
/* locks shutdown regardless of settings */
379
apc_lock_cleanup(TSRMLS_C);
381
/* only shut down if APC is enabled */
383
if (APCG(initialized)) {
385
/* destroy cache pointer */
386
apc_cache_destroy(apc_user_cache TSRMLS_CC);
387
/* cleanup shared memory */
388
apc_sma.cleanup(TSRMLS_C);
390
APCG(initialized) = 0;
394
apc_shutdown_signals(TSRMLS_C);
399
ts_free_id(apcu_globals_id);
402
UNREGISTER_INI_ENTRIES();
406
/* {{{ PHP_RINIT_FUNCTION(apcu) */
407
static PHP_RINIT_FUNCTION(apcu)
410
if (APCG(serializer_name)) {
411
/* Avoid race conditions between MINIT of apc and serializer exts like igbinary */
412
apc_cache_serializer(apc_user_cache, APCG(serializer_name) TSRMLS_CC);
416
apc_set_signals(TSRMLS_C);
424
/* {{{ proto void apc_clear_cache([string cache]) */
425
PHP_FUNCTION(apcu_clear_cache)
430
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &ignored, &ignlen) == FAILURE) {
434
if (0 == ignlen || APC_CACHE_IS_USER(ignored, ignlen)) {
435
apc_cache_clear(apc_user_cache TSRMLS_CC);
442
/* {{{ proto array apc_cache_info(string cache_type, [bool limited]) */
443
PHP_FUNCTION(apcu_cache_info)
446
zend_bool limited = 0;
450
if (ZEND_NUM_ARGS()) {
451
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &ct, &ctlen, &limited) == FAILURE) {
456
info = apc_cache_info(apc_user_cache, limited TSRMLS_CC);
459
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No APC info available. Perhaps APC is not enabled? Check apc.enabled in your ini file");
463
RETURN_ZVAL(info, 0, 1);
468
/* {{{ proto void apc_clear_cache() */
469
PHP_FUNCTION(apcu_clear_cache)
471
if (zend_parse_parameters_none() == FAILURE) {
476
apc_user_cache TSRMLS_CC);
481
/* {{{ proto array apc_cache_info([bool limited]) */
482
PHP_FUNCTION(apcu_cache_info)
485
zend_bool limited = 0;
487
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &limited) == FAILURE) {
491
info = apc_cache_info(apc_user_cache, limited TSRMLS_CC);
494
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No APC info available. Perhaps APC is not enabled? Check apc.enabled in your ini file");
498
RETURN_ZVAL(info, 0, 1);
504
PHP_FUNCTION(apcu_key_info)
510
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &strkey, &keylen) == FAILURE) {
514
stat = apc_cache_stat(
515
apc_user_cache, strkey, keylen+1 TSRMLS_CC);
517
RETURN_ZVAL(stat, 0, 1);
520
/* {{{ proto array apc_sma_info([bool limited]) */
521
PHP_FUNCTION(apcu_sma_info)
523
apc_sma_info_t* info;
526
zend_bool limited = 0;
528
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &limited) == FAILURE) {
532
info = apc_sma.info(limited TSRMLS_CC);
535
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No APC SMA info available. Perhaps APC is disabled via apc.enabled?");
538
array_init(return_value);
540
add_assoc_long(return_value, "num_seg", info->num_seg);
541
add_assoc_double(return_value, "seg_size", (double)info->seg_size);
542
add_assoc_double(return_value, "avail_mem", (double)apc_sma.get_avail_mem());
545
apc_sma.free_info(info TSRMLS_CC);
549
ALLOC_INIT_ZVAL(block_lists);
550
array_init(block_lists);
552
for (i = 0; i < info->num_seg; i++) {
556
ALLOC_INIT_ZVAL(list);
559
for (p = info->list[i]; p != NULL; p = p->next) {
562
ALLOC_INIT_ZVAL(link);
565
add_assoc_long(link, "size", p->size);
566
add_assoc_long(link, "offset", p->offset);
567
add_next_index_zval(list, link);
569
add_next_index_zval(block_lists, list);
571
add_assoc_zval(return_value, "block_lists", block_lists);
572
apc_sma.free_info(info TSRMLS_CC);
576
/* {{{ php_apc_update */
577
int php_apc_update(char *strkey, int strkey_len, apc_cache_updater_t updater, void* data TSRMLS_DC)
579
if (!APCG(enabled)) {
583
if (APCG(serializer_name)) {
584
/* Avoid race conditions between MINIT of apc and serializer exts like igbinary */
585
apc_cache_serializer(apc_user_cache, APCG(serializer_name) TSRMLS_CC);
588
HANDLE_BLOCK_INTERRUPTIONS();
590
if (!apc_cache_update(apc_user_cache, strkey, strkey_len + 1, updater, data TSRMLS_CC)) {
591
HANDLE_UNBLOCK_INTERRUPTIONS();
595
HANDLE_UNBLOCK_INTERRUPTIONS();
601
/* {{{ apc_store_helper(INTERNAL_FUNCTION_PARAMETERS, const zend_bool exclusive)
603
static void apc_store_helper(INTERNAL_FUNCTION_PARAMETERS, const zend_bool exclusive)
609
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|zl", &key, &val, &ttl) == FAILURE) {
613
if (!key || !APCG(enabled)) {
614
/* cannot work without key */
618
HANDLE_BLOCK_INTERRUPTIONS();
622
if (APCG(serializer_name)) {
623
/* Avoid race conditions between MINIT of apc and serializer exts like igbinary */
624
apc_cache_serializer(apc_user_cache, APCG(serializer_name) TSRMLS_CC);
627
if (Z_TYPE_P(key) == IS_ARRAY) {
635
HashTable* hash = Z_ARRVAL_P(key);
637
/* note: only indicative of error */
638
array_init(return_value);
639
zend_hash_internal_pointer_reset_ex(hash, &hpos);
640
while(zend_hash_get_current_data_ex(hash, (void**)&hentry, &hpos) == SUCCESS) {
641
zend_hash_get_current_key_ex(hash, &hkey, &hkey_len, &hkey_idx, 0, &hpos);
643
if(!apc_cache_store(apc_user_cache, hkey, hkey_len, *hentry, (zend_uint) ttl, exclusive TSRMLS_CC)) {
644
add_assoc_long_ex(return_value, hkey, hkey_len, -1); /* -1: insertion error */
646
/* reset key for next element */
649
add_index_long(return_value, hkey_idx, -1); /* -1: insertion error */
651
zend_hash_move_forward_ex(hash, &hpos);
655
if (Z_TYPE_P(key) == IS_STRING) {
657
/* nothing to store */
658
HANDLE_UNBLOCK_INTERRUPTIONS();
661
/* return true on success */
662
if(apc_cache_store(apc_user_cache, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, val, (zend_uint) ttl, exclusive TSRMLS_CC)) {
663
HANDLE_UNBLOCK_INTERRUPTIONS();
667
apc_warning("apc_store expects key parameter to be a string or an array of key/value pairs." TSRMLS_CC);
672
HANDLE_UNBLOCK_INTERRUPTIONS();
679
/* {{{ proto bool apcu_enabled(void)
680
returns true when apcu is usable in the current environment */
681
PHP_FUNCTION(apcu_enabled) {
682
RETURN_BOOL(APCG(enabled));
685
/* {{{ proto int apc_store(mixed key, mixed var [, long ttl ])
687
PHP_FUNCTION(apcu_store) {
688
apc_store_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
692
/* {{{ proto int apc_add(mixed key, mixed var [, long ttl ])
694
PHP_FUNCTION(apcu_add) {
695
apc_store_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
699
/* {{{ php_inc_updater */
701
struct php_inc_updater_args {
706
static zend_bool php_inc_updater(apc_cache_t* cache, apc_cache_entry_t* entry, void* data) {
708
struct php_inc_updater_args *args = (struct php_inc_updater_args*) data;
710
zval* val = entry->val;
712
if (Z_TYPE_P(val) == IS_LONG) {
713
Z_LVAL_P(val) += args->step;
714
args->lval = Z_LVAL_P(val);
722
/* {{{ proto long apc_inc(string key [, long step [, bool& success]])
724
PHP_FUNCTION(apcu_inc) {
727
struct php_inc_updater_args args = {1L, -1};
728
zval *success = NULL;
730
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz", &strkey, &strkey_len, &(args.step), &success) == FAILURE) {
738
if (php_apc_update(strkey, strkey_len, php_inc_updater, &args TSRMLS_CC)) {
743
RETURN_LONG(args.lval);
754
/* {{{ proto long apc_dec(string key [, long step [, bool &success]])
756
PHP_FUNCTION(apcu_dec) {
759
struct php_inc_updater_args args = {1L, -1};
760
zval *success = NULL;
762
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz", &strkey, &strkey_len, &(args.step), &success) == FAILURE) {
770
args.step = args.step * -1;
772
if (php_apc_update(strkey, strkey_len, php_inc_updater, &args TSRMLS_CC)) {
773
if (success) ZVAL_TRUE(success);
774
RETURN_LONG(args.lval);
785
/* {{{ php_cas_updater */
786
static zend_bool php_cas_updater(apc_cache_t* cache, apc_cache_entry_t* entry, void* data) {
787
long* vals = ((long*)data);
790
zval* val = entry->val;
792
if (Z_TYPE_P(val) == IS_LONG) {
793
if (Z_LVAL_P(val) == old) {
803
/* {{{ proto int apc_cas(string key, int old, int new)
805
PHP_FUNCTION(apcu_cas) {
810
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sll", &strkey, &strkey_len, &vals[0], &vals[1]) == FAILURE) {
814
if (php_apc_update(strkey, strkey_len, php_cas_updater, &vals TSRMLS_CC)) {
822
void *apc_erealloc_wrapper(void *ptr, size_t size) {
823
return _erealloc(ptr, size, 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC);
826
/* {{{ proto mixed apc_fetch(mixed key[, bool &success])
828
PHP_FUNCTION(apcu_fetch) {
830
zval *success = NULL;
831
apc_cache_entry_t* entry;
833
apc_context_t ctxt = {0,};
835
if (!APCG(enabled)) {
839
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|z", &key, &success) == FAILURE) {
846
ZVAL_BOOL(success, 0);
849
if (Z_TYPE_P(key) != IS_STRING && Z_TYPE_P(key) != IS_ARRAY) {
850
convert_to_string(key);
853
/* check for a string, or array of strings */
854
if (Z_TYPE_P(key) == IS_ARRAY || (Z_TYPE_P(key) == IS_STRING && Z_STRLEN_P(key) > 0)) {
856
/* initialize a context */
857
if (apc_cache_make_context(apc_user_cache, &ctxt, APC_CONTEXT_NOSHARE, APC_UNPOOL, APC_COPY_OUT, 0 TSRMLS_CC)) {
859
if (Z_TYPE_P(key) == IS_STRING) {
861
/* do find using string as key */
862
if ((entry = apc_cache_find(apc_user_cache, Z_STRVAL_P(key), (Z_STRLEN_P(key) + 1), t TSRMLS_CC))) {
863
/* deep-copy returned shm zval to emalloc'ed return_value */
864
apc_cache_fetch_zval(
865
&ctxt, return_value, entry->val TSRMLS_CC);
866
/* decrement refcount of entry */
868
apc_user_cache, entry TSRMLS_CC);
871
ZVAL_BOOL(success, 1);
874
} else { ZVAL_BOOL(return_value, 0); }
876
} else if (Z_TYPE_P(key) == IS_ARRAY) {
878
/* do find using key as array of strings */
883
MAKE_STD_ZVAL(result);
886
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(key), &hpos);
887
while(zend_hash_get_current_data_ex(Z_ARRVAL_P(key), (void**)&hentry, &hpos) == SUCCESS) {
889
if (Z_TYPE_PP(hentry) == IS_STRING) {
891
/* perform find using this index as key */
892
if ((entry = apc_cache_find(apc_user_cache, Z_STRVAL_PP(hentry), (Z_STRLEN_PP(hentry) + 1), t TSRMLS_CC))) {
895
/* deep-copy returned shm zval to emalloc'ed return_value */
896
MAKE_STD_ZVAL(result_entry);
897
apc_cache_fetch_zval(
898
&ctxt, result_entry, entry->val TSRMLS_CC);
899
/* decrement refcount of entry */
901
apc_user_cache, entry TSRMLS_CC);
902
/* add the emalloced value to return array */
904
Z_ARRVAL_P(result), Z_STRVAL_PP(hentry), Z_STRLEN_PP(hentry) +1, &result_entry, sizeof(zval*), NULL);
908
/* we do not break loop, we just skip the key */
910
"apc_fetch() expects a string or array of strings." TSRMLS_CC);
913
/* don't set values we didn't find */
914
zend_hash_move_forward_ex(Z_ARRVAL_P(key), &hpos);
917
RETVAL_ZVAL(result, 0, 1);
920
ZVAL_BOOL(success, 1);
924
apc_cache_destroy_context(&ctxt TSRMLS_CC );
928
apc_warning("apc_fetch() expects a string or array of strings." TSRMLS_CC);
935
/* {{{ proto mixed apc_exists(mixed key)
937
PHP_FUNCTION(apcu_exists) {
941
if (!APCG(enabled)) {
945
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &key) == FAILURE) {
951
if (Z_TYPE_P(key) != IS_STRING && Z_TYPE_P(key) != IS_ARRAY) {
952
convert_to_string(key);
955
if (Z_TYPE_P(key) == IS_STRING) {
956
if (Z_STRLEN_P(key)) {
957
if (apc_cache_exists(apc_user_cache, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, t TSRMLS_CC)) {
963
} else if (Z_TYPE_P(key) == IS_ARRAY) {
968
MAKE_STD_ZVAL(result);
971
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(key), &hpos);
972
while (zend_hash_get_current_data_ex(Z_ARRVAL_P(key), (void**)&hentry, &hpos) == SUCCESS) {
973
if (Z_TYPE_PP(hentry) == IS_STRING) {
974
if (apc_cache_exists(apc_user_cache, Z_STRVAL_PP(hentry), Z_STRLEN_PP(hentry) + 1, t TSRMLS_CC)) {
977
MAKE_STD_ZVAL(result_entry);
978
ZVAL_BOOL(result_entry, 1);
982
Z_STRVAL_PP(hentry), Z_STRLEN_PP(hentry) +1,
983
&result_entry, sizeof(zval*), NULL
988
"apc_exists() expects a string or array of strings." TSRMLS_CC);
991
/* don't set values we didn't find */
992
zend_hash_move_forward_ex(Z_ARRVAL_P(key), &hpos);
994
RETURN_ZVAL(result, 0, 1);
996
apc_warning("apc_exists() expects a string or array of strings." TSRMLS_CC);
1003
/* {{{ proto mixed apc_delete(mixed keys)
1005
PHP_FUNCTION(apcu_delete) {
1008
if (!APCG(enabled)) {
1012
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &keys) == FAILURE) {
1016
if (Z_TYPE_P(keys) == IS_STRING) {
1017
if (!Z_STRLEN_P(keys)) {
1021
if (apc_cache_delete(apc_user_cache, Z_STRVAL_P(keys), (Z_STRLEN_P(keys) + 1) TSRMLS_CC)) {
1027
} else if (Z_TYPE_P(keys) == IS_ARRAY) {
1031
array_init(return_value);
1032
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(keys), &hpos);
1034
while (zend_hash_get_current_data_ex(Z_ARRVAL_P(keys), (void**)&hentry, &hpos) == SUCCESS) {
1035
if (Z_TYPE_PP(hentry) != IS_STRING) {
1036
apc_warning("apc_delete() expects a string, array of strings, or APCIterator instance." TSRMLS_CC);
1037
add_next_index_zval(return_value, *hentry);
1038
Z_ADDREF_PP(hentry);
1039
} else if (apc_cache_delete(apc_user_cache, Z_STRVAL_PP(hentry), (Z_STRLEN_PP(hentry) + 1) TSRMLS_CC) != 1) {
1040
add_next_index_zval(return_value, *hentry);
1041
Z_ADDREF_PP(hentry);
1043
zend_hash_move_forward_ex(Z_ARRVAL_P(keys), &hpos);
1045
} else if (Z_TYPE_P(keys) == IS_OBJECT) {
1047
if (apc_iterator_delete(keys TSRMLS_CC)) {
1053
apc_warning("apc_delete() expects a string, array of strings, or APCIterator instance." TSRMLS_CC);
1058
/* {{{ proto mixed apcu_bin_dump([array vars])
1059
Returns a binary dump of the given user variables from the APC cache.
1060
A NULL for vars signals a dump of every entry, while array() will dump nothing.
1062
PHP_FUNCTION(apcu_bin_dump) {
1064
zval *z_vars = NULL;
1068
if (!APCG(enabled)) {
1069
apc_warning("APC is not enabled, apc_bin_dump not available." TSRMLS_CC);
1073
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!", &z_vars) == FAILURE) {
1077
h_vars = z_vars ? Z_ARRVAL_P(z_vars) : NULL;
1078
bd = apc_bin_dump(apc_user_cache, h_vars TSRMLS_CC);
1080
RETVAL_STRINGL((char*)bd, bd->size-1, 0);
1082
apc_error("Unknown error encountered during apc_bin_dump." TSRMLS_CC);
1091
/* {{{ proto mixed apc_bin_dump([array files [, array user_vars]])
1092
Compatibility mode for old APC
1094
PHP_FUNCTION(apc_bin_dump) {
1096
zval *z_files = NULL, *z_user_vars = NULL;
1097
HashTable *h_user_vars;
1100
if(!APCG(enabled)) {
1101
apc_warning("APC is not enabled, apc_bin_dump not available." TSRMLS_CC);
1105
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!a!", &z_files, &z_user_vars) == FAILURE) {
1109
h_user_vars = z_user_vars ? Z_ARRVAL_P(z_user_vars) : NULL;
1110
bd = apc_bin_dump(apc_user_cache, h_user_vars TSRMLS_CC);
1112
RETVAL_STRINGL((char*)bd, bd->size-1, 0);
1114
apc_error("Unknown error encountered during apc_bin_dump." TSRMLS_CC);
1123
/* {{{ proto mixed apcu_bin_dumpfile(array vars, string filename, [int flags [, resource context]])
1124
Output a binary dump of the given user variables from the APC cache to the named file.
1126
PHP_FUNCTION(apcu_bin_dumpfile) {
1128
zval *z_vars = NULL;
1130
char *filename = NULL;
1133
zval *zcontext = NULL;
1134
php_stream_context *context = NULL;
1139
if (!APCG(enabled)) {
1140
apc_warning("APC is not enabled, apc_bin_dumpfile not available." TSRMLS_CC);
1144
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!s|lr!", &z_vars, &filename, &filename_len, &flags, &zcontext) == FAILURE) {
1148
if (!filename_len) {
1149
apc_error("apc_bin_dumpfile filename argument must be a valid filename." TSRMLS_CC);
1153
h_vars = z_vars ? Z_ARRVAL_P(z_vars) : NULL;
1154
bd = apc_bin_dump(apc_user_cache, h_vars TSRMLS_CC);
1156
apc_error("Unknown error encountered during apc_bin_dumpfile." TSRMLS_CC);
1161
/* Most of the following has been taken from the file_get/put_contents functions */
1163
context = php_stream_context_from_zval(zcontext, flags & PHP_FILE_NO_DEFAULT_CONTEXT);
1164
stream = php_stream_open_wrapper_ex(filename, (flags & PHP_FILE_APPEND) ? "ab" : "wb",
1165
ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context);
1166
if (stream == NULL) {
1168
apc_error("Unable to write to file in apc_bin_dumpfile." TSRMLS_CC);
1172
if (flags & LOCK_EX && php_stream_lock(stream, LOCK_EX)) {
1173
php_stream_close(stream);
1175
apc_error("Unable to get a lock on file in apc_bin_dumpfile." TSRMLS_CC);
1179
numbytes = php_stream_write(stream, (char*)bd, bd->size);
1180
if (numbytes != bd->size) {
1184
php_stream_close(stream);
1188
apc_error("Only %d of %d bytes written, possibly out of free disk space" TSRMLS_CC, numbytes, bd->size);
1192
RETURN_LONG(numbytes);
1197
/* {{{ proto mixed apc_bin_dumpfile(array files, array user_vars, string filename, [int flags [, resource context]])
1198
Compatibility mode for old APC
1200
PHP_FUNCTION(apc_bin_dumpfile) {
1202
zval *z_files = NULL, *z_user_vars = NULL;
1203
HashTable *h_user_vars;
1204
char *filename = NULL;
1207
zval *zcontext = NULL;
1208
php_stream_context *context = NULL;
1213
if(!APCG(enabled)) {
1214
apc_warning("APC is not enabled, apc_bin_dumpfile not available." TSRMLS_CC);
1219
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!a!s|lr!", &z_files, &z_user_vars, &filename, &filename_len, &flags, &zcontext) ==
1225
apc_error("apc_bin_dumpfile filename argument must be a valid filename." TSRMLS_CC);
1229
h_user_vars = z_user_vars ? Z_ARRVAL_P(z_user_vars) : NULL;
1230
bd = apc_bin_dump(apc_user_cache, h_user_vars TSRMLS_CC);
1232
apc_error("Unknown error encountered during apc_bin_dumpfile." TSRMLS_CC);
1237
/* Most of the following has been taken from the file_get/put_contents functions */
1239
context = php_stream_context_from_zval(zcontext, flags & PHP_FILE_NO_DEFAULT_CONTEXT);
1240
stream = php_stream_open_wrapper_ex(filename, (flags & PHP_FILE_APPEND) ? "ab" : "wb",
1241
ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context);
1242
if (stream == NULL) {
1244
apc_error("Unable to write to file in apc_bin_dumpfile." TSRMLS_CC);
1248
if (flags & LOCK_EX && php_stream_lock(stream, LOCK_EX)) {
1249
php_stream_close(stream);
1251
apc_error("Unable to get a lock on file in apc_bin_dumpfile." TSRMLS_CC);
1255
numbytes = php_stream_write(stream, (char*)bd, bd->size);
1256
if(numbytes != bd->size) {
1260
php_stream_close(stream);
1264
apc_error("Only %d of %d bytes written, possibly out of free disk space" TSRMLS_CC, numbytes, bd->size);
1268
RETURN_LONG(numbytes);
1273
/* {{{ proto mixed apcu_bin_load(string data, [int flags])
1274
Load the given binary dump into the APC file/user cache.
1276
PHP_FUNCTION(apcu_bin_load) {
1282
if (!APCG(enabled)) {
1283
apc_warning("APC is not enabled, apc_bin_load not available." TSRMLS_CC);
1287
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &flags) == FAILURE) {
1291
if (!data_len || data_len != ((apc_bd_t*)data)->size -1) {
1292
apc_error("apc_bin_load string argument does not appear to be a valid APC binary dump due to size (%d vs expected %d)." TSRMLS_CC, data_len,
1293
((apc_bd_t*)data)->size -1);
1297
apc_bin_load(apc_user_cache, (apc_bd_t*)data, (int)flags TSRMLS_CC);
1303
/* {{{ proto mixed apc_bin_loadfile(string filename, [resource context, [int flags]])
1304
Load the given binary dump from the named file into the APC file/user cache.
1306
PHP_FUNCTION(apcu_bin_loadfile) {
1310
zval *zcontext = NULL;
1312
php_stream_context *context = NULL;
1317
if (!APCG(enabled)) {
1318
apc_warning("APC is not enabled, apc_bin_loadfile not available." TSRMLS_CC);
1322
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r!l", &filename, &filename_len, &zcontext, &flags) == FAILURE) {
1326
if (!filename_len) {
1327
apc_error("apc_bin_loadfile filename argument must be a valid filename." TSRMLS_CC);
1331
context = php_stream_context_from_zval(zcontext, 0);
1332
stream = php_stream_open_wrapper_ex(filename, "rb",
1333
ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context);
1335
apc_error("Unable to read from file in apc_bin_loadfile." TSRMLS_CC);
1339
len = php_stream_copy_to_mem(stream, &data, PHP_STREAM_COPY_ALL, 0);
1341
apc_warning("File passed to apc_bin_loadfile was empty: %s." TSRMLS_CC, filename);
1343
} else if (len < 0) {
1344
apc_warning("Error reading file passed to apc_bin_loadfile: %s." TSRMLS_CC, filename);
1346
} else if (len != ((apc_bd_t*)data)->size) {
1347
apc_warning("file passed to apc_bin_loadfile does not appear to be valid due to size (%d vs expected %d)." TSRMLS_CC, len,
1348
((apc_bd_t*)data)->size -1);
1351
php_stream_close(stream);
1353
apc_bin_load(apc_user_cache, (apc_bd_t*)data, (int)flags TSRMLS_CC);
1361
#if (PHP_MAJOR_VERSION >= 6 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3))
1362
# define PHP_APC_ARGINFO
1364
# define PHP_APC_ARGINFO static
1368
ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_store, 0, 0, 2)
1369
ZEND_ARG_INFO(0, key)
1370
ZEND_ARG_INFO(0, var)
1371
ZEND_ARG_INFO(0, ttl)
1375
ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_enabled, 0, 0, 0)
1380
/* this will generate different reflection but retains functional compatibility */
1381
ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_cache_info, 0, 0, 0)
1382
ZEND_ARG_INFO(0, type)
1383
ZEND_ARG_INFO(0, limited)
1386
ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_clear_cache, 0, 0, 0)
1387
ZEND_ARG_INFO(0, cache)
1391
ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_cache_info, 0, 0, 0)
1392
ZEND_ARG_INFO(0, limited)
1396
ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_clear_cache, 0, 0, 0)
1401
ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_key_info, 0, 0, 1)
1402
ZEND_ARG_INFO(0, key)
1406
ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_sma_info, 0, 0, 0)
1407
ZEND_ARG_INFO(0, limited)
1411
ZEND_BEGIN_ARG_INFO(arginfo_apcu_delete, 0)
1412
ZEND_ARG_INFO(0, keys)
1416
ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_fetch, 0, 0, 1)
1417
ZEND_ARG_INFO(0, key)
1418
ZEND_ARG_INFO(1, success)
1423
ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_inc, 0, 0, 1)
1424
ZEND_ARG_INFO(0, key)
1425
ZEND_ARG_INFO(0, step)
1426
ZEND_ARG_INFO(1, success)
1430
ZEND_BEGIN_ARG_INFO(arginfo_apcu_cas, 0)
1431
ZEND_ARG_INFO(0, key)
1432
ZEND_ARG_INFO(0, old)
1433
ZEND_ARG_INFO(0, new)
1437
ZEND_BEGIN_ARG_INFO(arginfo_apcu_exists, 0)
1438
ZEND_ARG_INFO(0, keys)
1442
ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_bin_dump, 0, 0, 0)
1443
ZEND_ARG_INFO(0, user_vars)
1447
ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_bin_dumpfile, 0, 0, 2)
1448
ZEND_ARG_INFO(0, user_vars)
1449
ZEND_ARG_INFO(0, filename)
1450
ZEND_ARG_INFO(0, flags)
1451
ZEND_ARG_INFO(0, context)
1455
ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_bin_load, 0, 0, 1)
1456
ZEND_ARG_INFO(0, data)
1457
ZEND_ARG_INFO(0, flags)
1461
ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_bin_loadfile, 0, 0, 1)
1462
ZEND_ARG_INFO(0, filename)
1463
ZEND_ARG_INFO(0, context)
1464
ZEND_ARG_INFO(0, flags)
1470
ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_bin_dump, 0, 0, 0)
1471
ZEND_ARG_INFO(0, files)
1472
ZEND_ARG_INFO(0, user_vars)
1476
ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_bin_dumpfile, 0, 0, 3)
1477
ZEND_ARG_INFO(0, files)
1478
ZEND_ARG_INFO(0, user_vars)
1479
ZEND_ARG_INFO(0, filename)
1480
ZEND_ARG_INFO(0, flags)
1481
ZEND_ARG_INFO(0, context)
1486
/* {{{ apcu_functions[] */
1487
zend_function_entry apcu_functions[] = {
1488
PHP_FE(apcu_cache_info, arginfo_apcu_cache_info)
1489
PHP_FE(apcu_clear_cache, arginfo_apcu_clear_cache)
1490
PHP_FE(apcu_sma_info, arginfo_apcu_sma_info)
1491
PHP_FE(apcu_key_info, arginfo_apcu_key_info)
1492
PHP_FE(apcu_enabled, arginfo_apcu_enabled)
1493
PHP_FE(apcu_store, arginfo_apcu_store)
1494
PHP_FE(apcu_fetch, arginfo_apcu_fetch)
1495
PHP_FE(apcu_delete, arginfo_apcu_delete)
1496
PHP_FE(apcu_add, arginfo_apcu_store)
1497
PHP_FE(apcu_inc, arginfo_apcu_inc)
1498
PHP_FE(apcu_dec, arginfo_apcu_inc)
1499
PHP_FE(apcu_cas, arginfo_apcu_cas)
1500
PHP_FE(apcu_exists, arginfo_apcu_exists)
1501
PHP_FE(apcu_bin_dump, arginfo_apcu_bin_dump)
1502
PHP_FE(apcu_bin_load, arginfo_apcu_bin_load)
1503
PHP_FE(apcu_bin_dumpfile, arginfo_apcu_bin_dumpfile)
1504
PHP_FE(apcu_bin_loadfile, arginfo_apcu_bin_loadfile)
1509
/* {{{ module definition structure */
1511
zend_module_entry apcu_module_entry = {
1512
STANDARD_MODULE_HEADER,
1516
PHP_MSHUTDOWN(apcu),
1521
STANDARD_MODULE_PROPERTIES
1526
PHP_MINFO_FUNCTION(apc)
1528
php_info_print_table_start();
1529
php_info_print_table_row(2, "APC support", "Emulated");
1530
php_info_print_table_end();
1533
/* {{{ apc_functions[] */
1534
zend_function_entry apc_functions[] = {
1535
PHP_FALIAS(apc_cache_info, apcu_cache_info, arginfo_apcu_cache_info)
1536
PHP_FALIAS(apc_clear_cache, apcu_clear_cache, arginfo_apcu_clear_cache)
1537
PHP_FALIAS(apc_sma_info, apcu_sma_info, arginfo_apcu_sma_info)
1538
PHP_FALIAS(apc_store, apcu_store, arginfo_apcu_store)
1539
PHP_FALIAS(apc_fetch, apcu_fetch, arginfo_apcu_fetch)
1540
PHP_FALIAS(apc_delete, apcu_delete, arginfo_apcu_delete)
1541
PHP_FALIAS(apc_add, apcu_add, arginfo_apcu_store)
1542
PHP_FALIAS(apc_inc, apcu_inc, arginfo_apcu_inc)
1543
PHP_FALIAS(apc_dec, apcu_dec, arginfo_apcu_inc)
1544
PHP_FALIAS(apc_cas, apcu_cas, arginfo_apcu_cas)
1545
PHP_FALIAS(apc_exists, apcu_exists, arginfo_apcu_exists)
1546
PHP_FE(apc_bin_dump, arginfo_apc_bin_dump)
1547
PHP_FE(apc_bin_dumpfile, arginfo_apc_bin_dumpfile)
1548
PHP_FALIAS(apc_bin_load, apcu_bin_load, arginfo_apcu_bin_load)
1549
PHP_FALIAS(apc_bin_loadfile, apcu_bin_loadfile, arginfo_apcu_bin_loadfile)
1553
zend_module_entry apc_module_entry = {
1554
STANDARD_MODULE_HEADER,
1563
STANDARD_MODULE_PROPERTIES,
1566
static void apc_init(INIT_FUNC_ARGS)
1568
zend_register_internal_module(&apc_module_entry TSRMLS_CC);
1574
#ifdef COMPILE_DL_APCU
1575
ZEND_GET_MODULE(apcu)
1584
* vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker
1585
* vim<600: expandtab sw=4 ts=4 sts=4