Skip to content

Commit c765c81

Browse files
committed
"ZendOptimizerPlus" is renamed to "opcache" to de merged into PHP-5.5 under ext/opcache (the product name is still "Zend Optimizer+")
1 parent be02063 commit c765c81

File tree

6 files changed

+125
-127
lines changed

6 files changed

+125
-127
lines changed

README

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -42,64 +42,64 @@ Speed Tuning
4242

4343
We recommend the following configuration options for best performance.
4444

45-
zend_optimizerplus.memory_consumption=128
46-
zend_optimizerplus.interned_strings_buffer=8
47-
zend_optimizerplus.max_accelerated_files=4000
48-
zend_optimizerplus.revalidate_freq=60
49-
zend_optimizerplus.fast_shutdown=1
50-
zend_optimizerplus.enable_cli=1
45+
opcache.memory_consumption=128
46+
opcache.interned_strings_buffer=8
47+
opcache.max_accelerated_files=4000
48+
opcache.revalidate_freq=60
49+
opcache.fast_shutdown=1
50+
opcache.enable_cli=1
5151

5252
You also may add the following, but it may break some applications and
5353
frameworks. Please, read description of these directives and add them on your
5454
own risk.
5555

56-
zend_optimizerplus.save_comments=0
57-
zend_optimizerplus.enable_file_override=1
56+
opcache.save_comments=0
57+
opcache.enable_file_override=1
5858

5959
In some cases you may like to prefer enabling/disabling some features
6060
to avoid incompatibilities at the cost of some performance degradation.
6161

6262
Configuration Directives
6363
------------------------
6464

65-
zend_optimizerplus.enable (default "1")
65+
opcache.enable (default "1")
6666
Optimizer+ On/Off switch. When set to Off, code is not optimized.
6767

68-
zend_optimizerplus.memory_consumption (default "64")
68+
opcache.memory_consumption (default "64")
6969
The Optimizer+ shared memory storage size. The amount of memory for storing
7070
precompiled PHP code in Mbytes.
7171

72-
zend_optimizerplus.interned_strings_buffer (default "4")
72+
opcache.interned_strings_buffer (default "4")
7373
The amount of memory for interned strings in Mbytes.
7474

75-
zend_optimizerplus.max_accelerated_files (default "2000")
75+
opcache.max_accelerated_files (default "2000")
7676
The maximum number of keys (scripts) in the Optimizer+ hash table.
7777
The number is actually the first one in the following set of prime
7878
numbers that is bigger than the one supplied: { 223, 463, 983, 1979, 3907,
7979
7963, 16229, 32531, 65407, 130987 }. Only numbers between 200 and 100000
8080
are allowed.
8181

82-
zend_optimizerplus.max_wasted_percentage (default "5")
82+
opcache.max_wasted_percentage (default "5")
8383
The maximum percentage of "wasted" memory until a restart is scheduled.
8484

85-
zend_optimizerplus.use_cwd (default "1")
85+
opcache.use_cwd (default "1")
8686
When this directive is enabled, the Optimizer+ appends the current working
8787
directory to the script key, thus eliminating possible collisions between
8888
files with the same name (basename). Disabling the directive improves
8989
performance, but may break existing applications.
9090

91-
zend_optimizerplus.validate_timestamps (default "1")
91+
opcache.validate_timestamps (default "1")
9292
When disabled, you must reset the Optimizer+ manually or restart the
9393
webserver for changes to the filesystem to take effect.
9494
The frequency of the check is controlled by the directive
95-
"zend_optimizerplus.revalidate_freq".
95+
"opcache.revalidate_freq".
9696

97-
zend_optimizerplus.revalidate_freq (default "2")
97+
opcache.revalidate_freq (default "2")
9898
How often (in seconds) to check file timestamps for changes to the shared
9999
memory storage allocation. ("1" means validate once per second, but only
100100
once per request. "0" means always validate)
101101

102-
zend_optimizerplus.revalidate_path (default "0")
102+
opcache.revalidate_path (default "0")
103103
Enables or disables file search in include_path optimization
104104
If the file search is disabled and a cached file is found that uses
105105
the same include_path, the file is not searched again. Thus, if a file
@@ -108,29 +108,29 @@ zend_optimizerplus.revalidate_path (default "0")
108108
your applications. The default for this directive is disabled, which means
109109
that optimization is active.
110110

111-
zend_optimizerplus.save_comments (default "1")
111+
opcache.save_comments (default "1")
112112
If disabled, all PHPDoc comments are dropped from the code to reduce the
113113
size of the optimized code. Disabling "Doc Comments" may break some
114114
existing applications and frameworks (e.g. Doctrine, ZF2, PHPUnit)
115115

116-
zend_optimizerplus.load_comments (default "1")
116+
opcache.load_comments (default "1")
117117
If disabled, PHPDoc comments are not loaded from SHM, so "Doc Comments"
118118
may be always stored (save_comments=1), but not loaded by applications
119119
that don't need them anyway.
120120

121-
zend_optimizerplus.fast_shutdown (default "0")
121+
opcache.fast_shutdown (default "0")
122122
If enabled, a fast shutdown sequence is used for the accelerated code
123123
The fast shutdown sequence doesn't free each allocated block, but lets
124124
the Zend Engine Memory Manager do the work.
125125

126-
zend_optimizerplus.enable_file_override (default "0")
126+
opcache.enable_file_override (default "0")
127127
Allow file existence override (file_exists, etc.) performance feature.
128128

129-
zend_optimizerplus.optimization_level (default "0xffffffff")
129+
opcache.optimization_level (default "0xffffffff")
130130
A bitmask, where each bit enables or disables the appropriate Optimizer+
131131
passes
132132

133-
zend_optimizerplus.inherited_hack (default "1")
133+
opcache.inherited_hack (default "1")
134134
Enable this hack as a workaround for "can't redeclare class" errors.
135135
The Optimizer+ stores the places where DECLARE_CLASS opcodes use
136136
inheritance (These are the only opcodes that can be executed by PHP,
@@ -143,10 +143,10 @@ zend_optimizerplus.inherited_hack (default "1")
143143
that optimization is active. In php-5.3 and above this hack is not needed
144144
anymore and this setting has no effect.
145145

146-
zend_optimizerplus.dups_fix (default "0")
146+
opcache.dups_fix (default "0")
147147
Enable this hack as a workaround for "Cannot redeclare class" errors.
148148

149-
zend_optimizerplus.blacklist_filename
149+
opcache.blacklist_filename
150150
The location of the Optimizer+ blacklist file.
151151
The Optimizer+ blacklist file is a text file that holds the names of files
152152
that should not be accelerated. The file format is to add each filename
@@ -159,17 +159,17 @@ zend_optimizerplus.blacklist_filename
159159
compile time evaluation.
160160
3) Code that triggers an Optimizer+ bug.
161161

162-
zend_optimizerplus.max_file_size (default "0")
162+
opcache.max_file_size (default "0")
163163
Allows exclusion of large files from being cached. By default all files
164164
are cached.
165165

166-
zend_optimizerplus.consistency_checks (default "0")
166+
opcache.consistency_checks (default "0")
167167
Check the cache checksum each N requests.
168168
The default value of "0" means that the checks are disabled.
169169
Because calculating the checksum impairs performance, this directive should
170170
be enabled only as part of a debugging process.
171171

172-
zend_optimizerplus.force_restart_timeout (default "180")
172+
opcache.force_restart_timeout (default "180")
173173
How long to wait (in seconds) for a scheduled restart to begin if the cache
174174
is not being accessed.
175175
The Optimizer+ uses this directive to identify a situation where there may
@@ -179,23 +179,23 @@ zend_optimizerplus.force_restart_timeout (default "180")
179179
If the log level is 3 or above, a "killed locker" error is recorded
180180
in the Apache logs when this happens.
181181

182-
zend_optimizerplus.error_log
182+
opcache.error_log
183183
Optimizer+ error_log file name. Empty string assumes "stderr".
184184

185-
zend_optimizerplus.log_verbosity_level (default "1")
185+
opcache.log_verbosity_level (default "1")
186186
All Optimizer+ errors go to the Web server log.
187187
By default, only fatal errors (level 0) or errors (level 1) are logged.
188188
You can also enable warnings (level 2), info messages (level 3) or
189189
debug messages (level 4).
190190

191-
zend_optimizerplus.preferred_memory_model
191+
opcache.preferred_memory_model
192192
Preferred Shared Memory back-end. Leave empty and let the system decide.
193193

194-
zend_optimizerplus.protect_memory (default "0")
194+
opcache.protect_memory (default "0")
195195
Protect the shared memory from unexpected writing during script execution.
196196
Useful for internal debugging only.
197197

198-
zend_optimizerplus.mmap_base
198+
opcache.mmap_base
199199
Mapping base of shared memory segments (for Windows only). All the PHP
200200
processes have to map shared memory into the same address space. This
201201
directive allows to manually fix the "Unable to reattach to base address"

ZendAccelerator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ char *accel_make_persistent_key_ex(zend_file_handle *file_handle, int path_lengt
913913

914914
if ((cwd = accel_getcwd(&cwd_len TSRMLS_CC)) == NULL) {
915915
/* we don't handle this well for now. */
916-
zend_accel_error(ACCEL_LOG_INFO, "getcwd() failed for '%s' (%d), please try to set zend_optimizerplus.use_cwd to 0 in ini file", file_handle->filename, errno);
916+
zend_accel_error(ACCEL_LOG_INFO, "getcwd() failed for '%s' (%d), please try to set opcache.use_cwd to 0 in ini file", file_handle->filename, errno);
917917
if (file_handle->opened_path) {
918918
cwd = file_handle->opened_path;
919919
cwd_len = strlen(cwd);

config.m4

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ dnl
22
dnl $Id$
33
dnl
44

5-
PHP_ARG_ENABLE(optimizer-plus, whether to enable Zend OptimizerPlus support,
6-
[ --enable-optimizer-plus Enable Zend OptimizerPlus support])
5+
PHP_ARG_ENABLE(opcache, whether to enable Zend Optimizer+ support,
6+
[ --enable-opcache Enable Zend Optimizer+ support])
77

8-
if test "$PHP_OPTIMIZER_PLUS" != "no"; then
9-
AC_DEFINE(HAVE_OPTIMIZER_PLUS, 1, [ ])
8+
if test "$PHP_OPCACHE" != "no"; then
109

1110
AC_CHECK_FUNC(mprotect,[
1211
AC_DEFINE(HAVE_MPROTECT, 1, [Define if you have mprotect() function])
@@ -327,7 +326,7 @@ int main() {
327326
msg=yes,msg=no,msg=no)
328327
AC_MSG_RESULT([$msg])
329328

330-
PHP_NEW_EXTENSION(ZendOptimizerPlus,
329+
PHP_NEW_EXTENSION(opcache,
331330
ZendAccelerator.c \
332331
zend_accelerator_blacklist.c \
333332
zend_accelerator_debug.c \

config.w32

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
ARG_ENABLE("optimizer-plus", "whether to enable Zend OptimizerPlus support", "yes");
1+
ARG_ENABLE("opcache", "whether to enable Zend Optimizer+ support", "yes");
22

3-
if (PHP_OPTIMIZER_PLUS != "no") {
3+
if (PHP_OPCACHE != "no") {
44

55
PHP_PGI = "no"; // workaround
66
PHP_PGO = "no"; // workaround
77

8-
EXTENSION('ZendOptimizerPlus', "\
8+
EXTENSION('opcache', "\
99
ZendAccelerator.c \
1010
zend_accelerator_blacklist.c \
1111
zend_accelerator_debug.c \
@@ -17,12 +17,11 @@ if (PHP_OPTIMIZER_PLUS != "no") {
1717
zend_shared_alloc.c \
1818
shared_alloc_win32.c", true);
1919

20-
ADD_SOURCES(configure_module_dirname + "/Optimizer", "zend_optimizer.c", "ZendOptimizerPlus", "OptimizerObj");
20+
ADD_SOURCES(configure_module_dirname + "/Optimizer", "zend_optimizer.c", "opcache", "OptimizerObj");
2121

2222

23-
ADD_FLAG('CFLAGS_ZENDOPTIMIZERPLUS', "/I " + configure_module_dirname);
24-
ADD_FLAG('CFLAGS_ZENDOPTIMIZERPLUS', "/D HAVE_OPTIMIZER_PLUS=1");
23+
ADD_FLAG('CFLAGS_OPCACHE', "/I " + configure_module_dirname);
2524

26-
ADD_FLAG('CFLAGS_ZENDOPTIMIZERPLUS', "/Dregexec=php_regexec /Dregerror=php_regerror /Dregfree=php_regfree /Dregcomp=php_regcomp /Iext/ereg/regex");
25+
ADD_FLAG('CFLAGS_OPCACHE', "/Dregexec=php_regexec /Dregerror=php_regerror /Dregfree=php_regfree /Dregcomp=php_regcomp /Iext/ereg/regex");
2726

2827
}

shared_alloc_win32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
275275
}
276276
if (sscanf(s, "%p", &default_mapping_base_set[0]) != 1) {
277277
zend_shared_alloc_unlock_win32();
278-
zend_win_error_message(ACCEL_LOG_FATAL, "Bad mapping address specified in zend_optimizerplus.mmap_base", err);
278+
zend_win_error_message(ACCEL_LOG_FATAL, "Bad mapping address specified in opcache.mmap_base", err);
279279
return ALLOC_FAILURE;
280280
}
281281
}

0 commit comments

Comments
 (0)