Skip to content

Commit de3cc93

Browse files
laruenceweltling
authored andcommitted
This only make sense on *nix
1 parent 83b22e0 commit de3cc93

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

ext/opcache/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,4 +215,4 @@ opcache.mmap_base
215215
errors.
216216

217217
opcache.lockfile_path (default "/tmp")
218-
Absolute path used to store shared lockfiles.
218+
Absolute path used to store shared lockfiles (for *nix only)

ext/opcache/ZendAccelerator.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,9 @@ typedef struct _zend_accel_directives {
217217
zend_long max_file_size;
218218
zend_long interned_strings_buffer;
219219
char *restrict_api;
220+
#ifndef ZEND_WIN32
220221
char *lockfile_path;
222+
#endif
221223
#ifdef HAVE_OPCACHE_FILE_CACHE
222224
char *file_cache;
223225
zend_bool file_cache_only;

ext/opcache/zend_accelerator_module.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,10 @@ ZEND_INI_BEGIN()
298298
STD_PHP_INI_BOOLEAN("opcache.enable_cli" , "0" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.enable_cli, zend_accel_globals, accel_globals)
299299
STD_PHP_INI_ENTRY("opcache.error_log" , "" , PHP_INI_SYSTEM, OnUpdateString, accel_directives.error_log, zend_accel_globals, accel_globals)
300300
STD_PHP_INI_ENTRY("opcache.restrict_api" , "" , PHP_INI_SYSTEM, OnUpdateString, accel_directives.restrict_api, zend_accel_globals, accel_globals)
301-
STD_PHP_INI_ENTRY("opcache.lockfile_path" , "/tmp" , PHP_INI_SYSTEM, OnUpdateString, accel_directives.lockfile_path, zend_accel_globals, accel_globals)
302301

303-
#ifdef ZEND_WIN32
302+
#ifndef ZEND_WIN32
303+
STD_PHP_INI_ENTRY("opcache.lockfile_path" , "/tmp" , PHP_INI_SYSTEM, OnUpdateString, accel_directives.lockfile_path, zend_accel_globals, accel_globals)
304+
#else
304305
STD_PHP_INI_ENTRY("opcache.mmap_base", NULL, PHP_INI_SYSTEM, OnUpdateString, accel_directives.mmap_base, zend_accel_globals, accel_globals)
305306
#endif
306307

@@ -711,7 +712,10 @@ static ZEND_FUNCTION(opcache_get_configuration)
711712
add_assoc_bool(&directives, "opcache.fast_shutdown", ZCG(accel_directives).fast_shutdown);
712713
add_assoc_bool(&directives, "opcache.enable_file_override", ZCG(accel_directives).file_override_enabled);
713714
add_assoc_long(&directives, "opcache.optimization_level", ZCG(accel_directives).optimization_level);
715+
716+
#ifndef ZEND_WIN32
714717
add_assoc_string(&directives, "opcache.lockfile_path", STRING_NOT_NULL(ZCG(accel_directives).lockfile_path));
718+
#endif
715719

716720
#ifdef HAVE_OPCACHE_FILE_CACHE
717721
add_assoc_string(&directives, "opcache.file_cache", ZCG(accel_directives).file_cache ? ZCG(accel_directives).file_cache : "");

0 commit comments

Comments
 (0)