New PHP5 APC - version 3.0.19, using PHP5 5.2.0-8+etch11,
[php5-apc.git] / apc_globals.h
1 /*
2   +----------------------------------------------------------------------+
3   | APC                                                                  |
4   +----------------------------------------------------------------------+
5   | Copyright (c) 2008 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   |          George Schlossnagle <george@omniti.com>                     |
17   |          Rasmus Lerdorf <rasmus@php.net>                             |
18   |          Arun C. Murthy <arunc@yahoo-inc.com>                        |
19   |          Gopal Vijayaraghavan <gopalv@yahoo-inc.com>                 |
20   +----------------------------------------------------------------------+
21
22    This software was contributed to PHP by Community Connect Inc. in 2002
23    and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1.
24    Future revisions and derivatives of this source code must acknowledge
25    Community Connect Inc. as the original contributor of this module by
26    leaving this note intact in the source code.
27
28    All other licensing and usage conditions are those of the PHP Group.
29
30  */
31
32 /* $Id: apc_globals.h,v 3.70.2.8 2008/05/11 18:57:00 rasmus Exp $ */
33
34 #ifndef APC_GLOBALS_H
35 #define APC_GLOBALS_H
36
37 #define APC_VERSION "3.0.19"
38
39 #include "apc_cache.h"
40 #include "apc_stack.h"
41 #include "apc_php.h"
42
43 ZEND_BEGIN_MODULE_GLOBALS(apc)
44     /* configuration parameters */
45     zend_bool enabled;      /* if true, apc is enabled (defaults to true) */
46     long shm_segments;      /* number of shared memory segments to use */
47     long shm_size;          /* size of each shared memory segment (in MB) */
48     long num_files_hint;    /* parameter to apc_cache_create */
49     long user_entries_hint;
50     long gc_ttl;            /* parameter to apc_cache_create */
51     long ttl;               /* parameter to apc_cache_create */
52     long user_ttl;
53 #if APC_MMAP
54     char *mmap_file_mask;   /* mktemp-style file-mask to pass to mmap */
55 #endif
56     char** filters;         /* array of regex filters that prevent caching */
57
58     /* module variables */
59     zend_bool initialized;       /* true if module was initialized */
60     apc_stack_t* cache_stack;    /* the stack of cached executable code */
61     zend_bool cache_by_default;  /* true if files should be cached unless filtered out */
62                                  /* false if files should only be cached if filtered in */
63     long slam_defense;           /* Probability of a process not caching an uncached file */
64     size_t* mem_size_ptr;        /* size of blocks allocated to file being cached (NULL outside my_compile_file) */
65     long file_update_protection; /* Age in seconds before a file is eligible to be cached - 0 to disable */
66     zend_bool enable_cli;        /* Flag to override turning APC off for CLI */
67     long max_file_size;          /* Maximum size of file, in bytes that APC will be allowed to cache */
68     long slam_rand;              /* A place to store the slam rand value for the request */
69     zend_bool fpstat;            /* true if fullpath includes should be stat'ed */
70     zend_bool stat_ctime;        /* true if ctime in addition to mtime should be checked */
71     zend_bool write_lock;        /* true for a global write lock */
72     zend_bool report_autofilter; /* true for auto-filter warnings */
73     zend_bool include_once;          /* Override the ZEND_INCLUDE_OR_EVAL opcode handler to avoid pointless fopen()s [still experimental] */
74     apc_optimize_function_t apc_optimize_function;   /* optimizer function callback */
75 #ifdef MULTIPART_EVENT_FORMDATA
76     zend_bool rfc1867;           /* Flag to enable rfc1867 handler */
77     char* rfc1867_prefix;        /* Key prefix */
78     char* rfc1867_name;          /* Name of hidden field to activate upload progress/key suffix */
79     double rfc1867_freq;         /* Update frequency as percentage or bytes */
80 #endif
81     HashTable *copied_zvals;     /* my_copy recursion detection list */
82 #ifdef ZEND_ENGINE_2
83     int reserved_offset;         /* offset for apc info in op_array->reserved[] */
84 #endif
85     zend_bool force_file_update; /* force files to be updated during apc_compile_file */
86     char canon_path[MAXPATHLEN]; /* canonical path for key data */
87 #if APC_FILEHITS
88     zval *filehits;             /* Files that came from the cache for this request */
89 #endif
90     zend_bool coredump_unmap;    /* Trap signals that coredump and unmap shared memory */
91 ZEND_END_MODULE_GLOBALS(apc)
92
93 /* (the following declaration is defined in php_apc.c) */
94 ZEND_EXTERN_MODULE_GLOBALS(apc)
95
96 #ifdef ZTS
97 # define APCG(v) TSRMG(apc_globals_id, zend_apc_globals *, v)
98 #else
99 # define APCG(v) (apc_globals.v)
100 #endif
101
102 /* True globals */
103 extern apc_cache_t* apc_cache;       /* the global compiler cache */
104 extern apc_cache_t* apc_user_cache;  /* the global user content cache */
105 extern void* apc_compiled_filters;   /* compiled filters */
106
107 #endif
108
109 /*
110  * Local variables:
111  * tab-width: 4
112  * c-basic-offset: 4
113  * End:
114  * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
115  * vim<600: expandtab sw=4 ts=4 sts=4
116  */