mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Make OPcache non-optional
This removes the --enable-opcache/--disable-opcache configure switch. OPcache is now always builtin. The default value of opcache.enable and opcache.enable_cli is unchanged. RFC: https://wiki.php.net/rfc/make_opcache_required Closes GH-18961. Co-authored-by: Tim Düsterhus <tim@tideways-gmbh.com>
This commit is contained in:
parent
6f3bc59950
commit
7b4c14dc10
21 changed files with 239 additions and 264 deletions
|
@ -90,7 +90,6 @@ jobs:
|
|||
--prefix=/usr \
|
||||
--enable-phpdbg \
|
||||
--enable-fpm \
|
||||
--enable-opcache \
|
||||
--with-pdo-mysql=mysqlnd \
|
||||
--with-mysqli=mysqlnd \
|
||||
--with-pgsql \
|
||||
|
@ -168,7 +167,6 @@ jobs:
|
|||
no_output_timeout: 30m
|
||||
command: |
|
||||
sapi/cli/php run-tests.php \
|
||||
-d zend_extension=opcache.so \
|
||||
-d opcache.enable_cli=1 \
|
||||
-d opcache.jit_buffer_size=64M \
|
||||
-d opcache.jit=tracing \
|
||||
|
|
3
.github/actions/freebsd/action.yml
vendored
3
.github/actions/freebsd/action.yml
vendored
|
@ -113,8 +113,7 @@ runs:
|
|||
--offline \
|
||||
--show-diff \
|
||||
--show-slow 1000 \
|
||||
--set-timeout 120 \
|
||||
-d zend_extension=opcache.so
|
||||
--set-timeout 120
|
||||
|
||||
if test "${{ inputs.runExtraTests }}" = "true"; then
|
||||
sapi/cli/php run-extra-tests.php
|
||||
|
|
1
.github/scripts/windows/test_task.bat
vendored
1
.github/scripts/windows/test_task.bat
vendored
|
@ -128,7 +128,6 @@ mkdir %PHP_BUILD_DIR%\test_file_cache
|
|||
rem generate php.ini
|
||||
echo extension_dir=%PHP_BUILD_DIR% > %PHP_BUILD_DIR%\php.ini
|
||||
echo opcache.file_cache=%PHP_BUILD_DIR%\test_file_cache >> %PHP_BUILD_DIR%\php.ini
|
||||
if "%OPCACHE%" equ "1" echo zend_extension=php_opcache.dll >> %PHP_BUILD_DIR%\php.ini
|
||||
rem work-around for some spawned PHP processes requiring OpenSSL and sockets
|
||||
echo extension=php_openssl.dll >> %PHP_BUILD_DIR%\php.ini
|
||||
echo extension=php_sockets.dll >> %PHP_BUILD_DIR%\php.ini
|
||||
|
|
18
.github/workflows/nightly.yml
vendored
18
.github/workflows/nightly.yml
vendored
|
@ -134,7 +134,6 @@ jobs:
|
|||
jitType: tracing
|
||||
runTestsParameters: >-
|
||||
--asan -x
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Extra tests
|
||||
uses: ./.github/actions/extra-tests
|
||||
|
@ -250,14 +249,12 @@ jobs:
|
|||
jitType: tracing
|
||||
runTestsParameters: >-
|
||||
${{ matrix.run_tests_parameters }}
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Test OpCache
|
||||
uses: ./.github/actions/test-linux
|
||||
with:
|
||||
runTestsParameters: >-
|
||||
${{ matrix.run_tests_parameters }}
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Test Function JIT
|
||||
# ASAN frequently timeouts. Each test run takes ~90 minutes, we can
|
||||
|
@ -268,7 +265,6 @@ jobs:
|
|||
jitType: function
|
||||
runTestsParameters: >-
|
||||
${{ matrix.run_tests_parameters }}
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Extra tests
|
||||
uses: ./.github/actions/extra-tests
|
||||
|
@ -344,14 +340,12 @@ jobs:
|
|||
jitType: tracing
|
||||
runTestsParameters: >-
|
||||
${{ matrix.run_tests_parameters }}
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Test OpCache
|
||||
uses: ./.github/actions/test-linux
|
||||
with:
|
||||
runTestsParameters: >-
|
||||
${{ matrix.run_tests_parameters }}
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Test Function JIT
|
||||
uses: ./.github/actions/test-linux
|
||||
|
@ -359,7 +353,6 @@ jobs:
|
|||
jitType: function
|
||||
runTestsParameters: >-
|
||||
${{ matrix.run_tests_parameters }}
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Extra tests
|
||||
uses: ./.github/actions/extra-tests
|
||||
|
@ -406,13 +399,11 @@ jobs:
|
|||
with:
|
||||
jitType: tracing
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Test OpCache
|
||||
uses: ./.github/actions/test-macos
|
||||
with:
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Test Function JIT
|
||||
if: matrix.os != '14' || !matrix.zts
|
||||
|
@ -420,7 +411,6 @@ jobs:
|
|||
with:
|
||||
jitType: function
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Extra tests
|
||||
uses: ./.github/actions/extra-tests
|
||||
|
@ -484,7 +474,6 @@ jobs:
|
|||
with:
|
||||
jitType: tracing
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- uses: codecov/codecov-action@v4
|
||||
if: ${{ !cancelled() }}
|
||||
|
@ -538,7 +527,6 @@ jobs:
|
|||
- name: Enable Opcache
|
||||
run: |
|
||||
echo memory_limit=-1 >> /etc/php.d/opcache.ini
|
||||
echo zend_extension=opcache.so > /etc/php.d/opcache.ini
|
||||
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
|
||||
echo opcache.enable=1 >> /etc/php.d/opcache.ini
|
||||
echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini
|
||||
|
@ -729,21 +717,18 @@ jobs:
|
|||
uses: ./.github/actions/test-linux
|
||||
with:
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
--file-cache-prime
|
||||
- name: Test File Cache (prime shm, use shm)
|
||||
uses: ./.github/actions/test-linux
|
||||
with:
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
--file-cache-use
|
||||
- name: Test File Cache (prime shm, use file)
|
||||
uses: ./.github/actions/test-linux
|
||||
with:
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
--file-cache-use
|
||||
-d opcache.file_cache_only=1
|
||||
|
@ -751,7 +736,6 @@ jobs:
|
|||
uses: ./.github/actions/test-linux
|
||||
with:
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
--file-cache-prime
|
||||
-d opcache.file_cache_only=1
|
||||
|
@ -759,7 +743,6 @@ jobs:
|
|||
uses: ./.github/actions/test-linux
|
||||
with:
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
--file-cache-use
|
||||
-d opcache.file_cache_only=1
|
||||
|
@ -853,7 +836,6 @@ jobs:
|
|||
with:
|
||||
runTestsParameters: >-
|
||||
--msan
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Verify generated files are up to date
|
||||
uses: ./.github/actions/verify-generated-files
|
||||
|
|
5
.github/workflows/push.yml
vendored
5
.github/workflows/push.yml
vendored
|
@ -130,7 +130,6 @@ jobs:
|
|||
with:
|
||||
jitType: tracing
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
${{ matrix.asan && '--asan -x' || '' }}
|
||||
- name: Verify generated files are up to date
|
||||
|
@ -190,7 +189,6 @@ jobs:
|
|||
with:
|
||||
jitType: tracing
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
MACOS_DEBUG_NTS:
|
||||
if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
|
||||
|
@ -229,7 +227,6 @@ jobs:
|
|||
with:
|
||||
jitType: tracing
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Verify generated files are up to date
|
||||
uses: ./.github/actions/verify-generated-files
|
||||
|
@ -299,7 +296,6 @@ jobs:
|
|||
./configure \
|
||||
--disable-debug \
|
||||
--enable-mbstring \
|
||||
--enable-opcache \
|
||||
--enable-option-checking=fatal \
|
||||
--enable-sockets \
|
||||
--enable-werror \
|
||||
|
@ -319,7 +315,6 @@ jobs:
|
|||
sudo mkdir -p /etc/php.d
|
||||
sudo chmod 777 /etc/php.d
|
||||
echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini
|
||||
echo zend_extension=opcache.so >> /etc/php.d/opcache.ini
|
||||
echo opcache.enable=1 >> /etc/php.d/opcache.ini
|
||||
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
|
||||
- name: Setup
|
||||
|
|
2
NEWS
2
NEWS
|
@ -15,6 +15,8 @@ PHP NEWS
|
|||
- OPcache:
|
||||
. Disallow changing opcache.memory_consumption when SHM is already set up.
|
||||
(timwolla)
|
||||
. Fixed GH-15074 (Compiling opcache statically into ZTS PHP fails). (Arnaud)
|
||||
. Make OPcache non-optional (Arnaud, timwolla)
|
||||
|
||||
- OpenSSL:
|
||||
. Add $digest_algo parameter to openssl_public_encrypt() and
|
||||
|
|
19
UPGRADING
19
UPGRADING
|
@ -71,6 +71,16 @@ PHP 8.5 UPGRADE NOTES
|
|||
. Calling the mysqli constructor on an already-constructed object
|
||||
is now no longer possible and throws an Error.
|
||||
|
||||
- Opcache:
|
||||
. The Opcache extension is now always built into the PHP binary and is always
|
||||
loaded. The INI directives opcache.enable and opcache.enable_cli are still
|
||||
honored.
|
||||
The --enable-opcache/--disable-opcache configure flags have been removed,
|
||||
and the build does not produce opcache.so or php_opcache.dll objects
|
||||
anymore.
|
||||
Using zend_extension=opcache.so or zend_extension=php_opcache.dll INI
|
||||
directives will emit a warning.
|
||||
|
||||
- PCNTL:
|
||||
. pcntl_exec() now throws ValueErrors when entries of the $args parameter
|
||||
contain null bytes.
|
||||
|
@ -522,6 +532,11 @@ PHP 8.5 UPGRADE NOTES
|
|||
library that was separated from ext/dom for being reused among other
|
||||
extensions. The new extension is not directly exposed to userland.
|
||||
|
||||
- Opcache:
|
||||
. The Opcache extension is now always built into the PHP binary and is always
|
||||
loaded. The INI directives opcache.enable and opcache.enable_cli are still
|
||||
honored.
|
||||
|
||||
- URI:
|
||||
. An always enabled uri extension is added that can be used for handling
|
||||
URIs and URLs according to RFC 3986 and WHATWG URL.
|
||||
|
@ -693,6 +708,10 @@ PHP 8.5 UPGRADE NOTES
|
|||
. The parts of the code that used SSE2 have been adapted to use SIMD
|
||||
with ARM NEON as well.
|
||||
|
||||
- Opcache:
|
||||
. Improved performance of fetching TLS variables in JIT'ed code in non-Glibc
|
||||
builds.
|
||||
|
||||
- ReflectionProperty:
|
||||
. Improved performance of the following methods: getValue(), getRawValue(),
|
||||
isInitialized(), setValue(), setRawValue().
|
||||
|
|
|
@ -219,7 +219,7 @@ slightly different steps. We'll call attention where the steps differ.
|
|||
# With ZTS
|
||||
make distclean || \
|
||||
./buildconf --force \
|
||||
&& ./configure --enable-zts --disable-all --enable-debug --enable-opcache --enable-opcache-jit \
|
||||
&& ./configure --enable-zts --disable-all --enable-debug --enable-opcache-jit \
|
||||
&& make -j$(nproc) \
|
||||
&& make test TEST_PHP_ARGS="-q -j$(nproc)" \
|
||||
|| ./sapi/cli/php -v
|
||||
|
@ -227,7 +227,7 @@ slightly different steps. We'll call attention where the steps differ.
|
|||
# Without ZTS
|
||||
make distclean || \
|
||||
./buildconf --force \
|
||||
&& ./configure --disable-all --enable-debug --enable-opcache --enable-opcache-jit \
|
||||
&& ./configure --disable-all --enable-debug --enable-opcache-jit \
|
||||
&& make -j$(nproc) \
|
||||
&& make test TEST_PHP_ARGS="-q -j$(nproc)" \
|
||||
|| ./sapi/cli/php -v
|
||||
|
@ -571,7 +571,7 @@ slightly different steps. We'll call attention where the steps differ.
|
|||
# With ZTS
|
||||
make distclean || \
|
||||
./buildconf --force \
|
||||
&& ./configure --enable-zts --disable-all --enable-debug --enable-opcache --enable-opcache-jit \
|
||||
&& ./configure --enable-zts --disable-all --enable-debug --enable-opcache-jit \
|
||||
&& make -j$(nproc) \
|
||||
&& make test TEST_PHP_ARGS="-q -j$(nproc)" \
|
||||
|| ./sapi/cli/php -v
|
||||
|
@ -579,7 +579,7 @@ slightly different steps. We'll call attention where the steps differ.
|
|||
# Without ZTS
|
||||
make distclean || \
|
||||
./buildconf --force \
|
||||
&& ./configure --disable-all --enable-debug --enable-opcache --enable-opcache-jit \
|
||||
&& ./configure --disable-all --enable-debug --enable-opcache-jit \
|
||||
&& make -j$(nproc) \
|
||||
&& make test TEST_PHP_ARGS="-q -j$(nproc)" \
|
||||
|| ./sapi/cli/php -v
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "zend_extensions.h"
|
||||
#include "zend_compile.h"
|
||||
#include "ZendAccelerator.h"
|
||||
#include "zend_modules.h"
|
||||
#include "zend_persist.h"
|
||||
#include "zend_shared_alloc.h"
|
||||
#include "zend_accelerator_module.h"
|
||||
|
@ -102,15 +103,12 @@ typedef int gid_t;
|
|||
|
||||
#include "zend_simd.h"
|
||||
|
||||
ZEND_EXTENSION();
|
||||
static zend_extension opcache_extension_entry;
|
||||
|
||||
#ifndef ZTS
|
||||
zend_accel_globals accel_globals;
|
||||
#else
|
||||
int accel_globals_id;
|
||||
#if defined(COMPILE_DL_OPCACHE)
|
||||
ZEND_TSRMLS_CACHE_DEFINE()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Points to the structure shared across all PHP processes */
|
||||
|
@ -2969,9 +2967,6 @@ static zend_result zend_accel_init_shm(void)
|
|||
|
||||
static void accel_globals_ctor(zend_accel_globals *accel_globals)
|
||||
{
|
||||
#if defined(COMPILE_DL_OPCACHE) && defined(ZTS)
|
||||
ZEND_TSRMLS_CACHE_UPDATE();
|
||||
#endif
|
||||
memset(accel_globals, 0, sizeof(zend_accel_globals));
|
||||
accel_globals->key = zend_string_alloc(ZCG_KEY_LEN, true);
|
||||
GC_MAKE_PERSISTENT_LOCAL(accel_globals->key);
|
||||
|
@ -3156,6 +3151,11 @@ static void accel_move_code_to_huge_pages(void)
|
|||
# endif /* defined(MAP_HUGETLB) || defined(MADV_HUGEPAGE) */
|
||||
#endif /* HAVE_HUGE_CODE_PAGES */
|
||||
|
||||
void start_accel_extension(void)
|
||||
{
|
||||
zend_register_extension(&opcache_extension_entry, NULL);
|
||||
}
|
||||
|
||||
static int accel_startup(zend_extension *extension)
|
||||
{
|
||||
#ifdef ZTS
|
||||
|
@ -3174,11 +3174,7 @@ static int accel_startup(zend_extension *extension)
|
|||
# endif
|
||||
#endif
|
||||
|
||||
if (start_accel_module() == FAILURE) {
|
||||
accel_startup_ok = false;
|
||||
zend_error(E_WARNING, ACCELERATOR_PRODUCT_NAME ": module registration failed!");
|
||||
return FAILURE;
|
||||
}
|
||||
zend_accel_register_ini_entries();
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
if (UNEXPECTED(accel_gen_uname_id() == FAILURE)) {
|
||||
|
@ -5086,7 +5082,7 @@ static void accel_activate(void) {
|
|||
}
|
||||
}
|
||||
|
||||
ZEND_EXT_API zend_extension zend_extension_entry = {
|
||||
static zend_extension opcache_extension_entry = {
|
||||
ACCELERATOR_PRODUCT_NAME, /* name */
|
||||
PHP_VERSION, /* version */
|
||||
"Zend Technologies", /* author */
|
||||
|
|
|
@ -302,9 +302,6 @@ extern zend_accel_shared_globals *accel_shared_globals;
|
|||
#ifdef ZTS
|
||||
# define ZCG(v) ZEND_TSRMG(accel_globals_id, zend_accel_globals *, v)
|
||||
extern int accel_globals_id;
|
||||
# ifdef COMPILE_DL_OPCACHE
|
||||
ZEND_TSRMLS_CACHE_EXTERN()
|
||||
# endif
|
||||
#else
|
||||
# define ZCG(v) (accel_globals.v)
|
||||
extern zend_accel_globals accel_globals;
|
||||
|
@ -314,6 +311,7 @@ extern const char *zps_api_failure_reason;
|
|||
|
||||
BEGIN_EXTERN_C()
|
||||
|
||||
void start_accel_extension(void);
|
||||
void accel_shutdown(void);
|
||||
ZEND_RINIT_FUNCTION(zend_accelerator);
|
||||
zend_result accel_post_deactivate(void);
|
||||
|
|
|
@ -1,9 +1,3 @@
|
|||
PHP_ARG_ENABLE([opcache],
|
||||
[whether to enable Zend OPcache support],
|
||||
[AS_HELP_STRING([--disable-opcache],
|
||||
[Disable Zend OPcache support])],
|
||||
[yes])
|
||||
|
||||
PHP_ARG_ENABLE([huge-code-pages],
|
||||
[whether to enable copying PHP CODE pages into HUGE PAGES],
|
||||
[AS_HELP_STRING([--disable-huge-code-pages],
|
||||
|
@ -25,10 +19,6 @@ PHP_ARG_WITH([capstone],
|
|||
[no],
|
||||
[no])
|
||||
|
||||
if test "$PHP_OPCACHE" != "no"; then
|
||||
dnl Always build as shared extension.
|
||||
ext_shared=yes
|
||||
|
||||
AS_VAR_IF([PHP_HUGE_CODE_PAGES], [yes],
|
||||
[AC_DEFINE([HAVE_HUGE_CODE_PAGES], [1],
|
||||
[Define to 1 to enable copying PHP CODE pages into HUGE PAGES.])])
|
||||
|
@ -347,7 +337,7 @@ int main(void) {
|
|||
ZendAccelerator.c
|
||||
$ZEND_JIT_SRC
|
||||
]),
|
||||
[$ext_shared],,
|
||||
[no],,
|
||||
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 $JIT_CFLAGS],,
|
||||
[yes])
|
||||
|
||||
|
@ -369,4 +359,3 @@ int main(void) {
|
|||
PHP_ADD_MAKEFILE_FRAGMENT([$ext_srcdir/jit/Makefile.frag])
|
||||
])
|
||||
PHP_SUBST([OPCACHE_SHARED_LIBADD])
|
||||
fi
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
ARG_ENABLE("opcache", "whether to enable Zend OPcache support", "yes");
|
||||
ARG_ENABLE("opcache-jit", "whether to enable JIT (not supported for ARM64)", "yes");
|
||||
|
||||
|
||||
if (PHP_OPCACHE != "no") {
|
||||
PHP_OPCACHE="yes";
|
||||
|
||||
ZEND_EXTENSION('opcache', "\
|
||||
ZendAccelerator.c \
|
||||
|
@ -15,7 +13,7 @@ if (PHP_OPCACHE != "no") {
|
|||
zend_persist_calc.c \
|
||||
zend_file_cache.c \
|
||||
zend_shared_alloc.c \
|
||||
shared_alloc_win32.c", true, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
|
||||
shared_alloc_win32.c", false, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
|
||||
|
||||
ADD_EXTENSION_DEP('opcache', 'date');
|
||||
ADD_EXTENSION_DEP('opcache', 'hash');
|
||||
|
@ -70,6 +68,3 @@ if (PHP_OPCACHE != "no") {
|
|||
}
|
||||
|
||||
ADD_FLAG('CFLAGS_OPCACHE', "/I " + configure_module_dirname);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -12,4 +12,4 @@ ADD . /php-src/
|
|||
WORKDIR /php-src
|
||||
RUN ./buildconf
|
||||
# Compile a minimal debug build. --enable-debug adds runtime assertions and is slower than regular builds.
|
||||
RUN ./configure --enable-debug --disable-all --enable-opcache && make clean && make -j$(nproc)
|
||||
RUN ./configure --enable-debug --disable-all && make clean && make -j$(nproc)
|
||||
|
|
|
@ -76,7 +76,7 @@ export LDFLAGS=-L/usr/lib/i386-linux-gnu
|
|||
export CFLAGS='-m32'
|
||||
export CXXFLAGS='-m32'
|
||||
export PKG_CONFIG=/usr/bin/i686-linux-gnu-pkg-config
|
||||
./configure --disable-all --enable-opcache --build=i686-pc-linux-gnu
|
||||
./configure --disable-all --build=i686-pc-linux-gnu
|
||||
make -j$(nproc)
|
||||
```
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ $proc = proc_open([
|
|||
PHP_BINARY,
|
||||
"-n",
|
||||
"-d", "extension_dir=$extension_dir",
|
||||
"-d", "zend_extension=opcache",
|
||||
"-d", "opcache.memory_consumption=$new_memory_consumption",
|
||||
"-d", "opcache.enable=1",
|
||||
"-d", "opcache.enable_cli=1",
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
#include "ZendAccelerator.h"
|
||||
#include "zend_API.h"
|
||||
#include "zend_closures.h"
|
||||
#include "zend_extensions.h"
|
||||
#include "zend_modules.h"
|
||||
#include "zend_shared_alloc.h"
|
||||
#include "zend_accelerator_blacklist.h"
|
||||
#include "zend_file_cache.h"
|
||||
|
@ -432,13 +434,19 @@ static ZEND_NAMED_FUNCTION(accel_is_readable)
|
|||
|
||||
static ZEND_MINIT_FUNCTION(zend_accelerator)
|
||||
{
|
||||
(void)type; /* keep the compiler happy */
|
||||
|
||||
REGISTER_INI_ENTRIES();
|
||||
start_accel_extension();
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
void zend_accel_register_ini_entries(void)
|
||||
{
|
||||
zend_module_entry *module = zend_hash_str_find_ptr_lc(&module_registry,
|
||||
ACCELERATOR_PRODUCT_NAME, strlen(ACCELERATOR_PRODUCT_NAME));
|
||||
|
||||
zend_register_ini_entries_ex(ini_entries, module->module_number, module->type);
|
||||
}
|
||||
|
||||
void zend_accel_override_file_functions(void)
|
||||
{
|
||||
zend_function *old_function;
|
||||
|
@ -469,6 +477,7 @@ static ZEND_MSHUTDOWN_FUNCTION(zend_accelerator)
|
|||
|
||||
UNREGISTER_INI_ENTRIES();
|
||||
accel_shutdown();
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -581,7 +590,7 @@ void zend_accel_info(ZEND_MODULE_INFO_FUNC_ARGS)
|
|||
DISPLAY_INI_ENTRIES();
|
||||
}
|
||||
|
||||
static zend_module_entry accel_module_entry = {
|
||||
zend_module_entry opcache_module_entry = {
|
||||
STANDARD_MODULE_HEADER,
|
||||
ACCELERATOR_PRODUCT_NAME,
|
||||
ext_functions,
|
||||
|
@ -596,11 +605,6 @@ static zend_module_entry accel_module_entry = {
|
|||
STANDARD_MODULE_PROPERTIES_EX
|
||||
};
|
||||
|
||||
int start_accel_module(void)
|
||||
{
|
||||
return zend_startup_module(&accel_module_entry);
|
||||
}
|
||||
|
||||
/* {{{ Get the scripts which are accelerated by ZendAccelerator */
|
||||
static int accelerator_get_scripts(zval *return_value)
|
||||
{
|
||||
|
|
|
@ -22,7 +22,12 @@
|
|||
#ifndef ZEND_ACCELERATOR_MODULE_H
|
||||
#define ZEND_ACCELERATOR_MODULE_H
|
||||
|
||||
int start_accel_module(void);
|
||||
#include "Zend/zend_modules.h"
|
||||
|
||||
#define phpext_opcache_ptr &opcache_module_entry
|
||||
extern zend_module_entry opcache_module_entry;
|
||||
|
||||
void zend_accel_register_ini_entries(void);
|
||||
|
||||
void zend_accel_override_file_functions(void);
|
||||
|
||||
|
|
|
@ -965,8 +965,6 @@ default_socket_timeout = 60
|
|||
;extension=xsl
|
||||
;extension=zip
|
||||
|
||||
;zend_extension=opcache
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;
|
||||
; Module Settings ;
|
||||
;;;;;;;;;;;;;;;;;;;
|
||||
|
|
|
@ -967,8 +967,6 @@ default_socket_timeout = 60
|
|||
;extension=xsl
|
||||
;extension=zip
|
||||
|
||||
;zend_extension=opcache
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;
|
||||
; Module Settings ;
|
||||
;;;;;;;;;;;;;;;;;;;
|
||||
|
|
|
@ -17,7 +17,6 @@ if (!file_exists($extDir . '/opcache.so')) {
|
|||
$cmd = [
|
||||
PHP_BINARY,
|
||||
'-dextension_dir=' . ini_get('extension_dir'),
|
||||
'-dzend_extension=opcache.so',
|
||||
'-dopcache.enable=1',
|
||||
'-dopcache.enable_cli=1',
|
||||
'-dopcache.preload=' . __DIR__ . '/preload.inc',
|
||||
|
|
|
@ -31,8 +31,8 @@ When running `make` it creates these binaries in `sapi/fuzzer/`:
|
|||
* `php-fuzz-mbstring`: Fuzzing `mb_convert_encoding()` (requires `--enable-mbstring`)
|
||||
* `php-fuzz-mbregex`: Fuzzing `mb_ereg[i]()` (requires --enable-mbstring)
|
||||
* `php-fuzz-execute`: Fuzzing the executor
|
||||
* `php-fuzz-function-jit`: Fuzzing the function JIT (requires --enable-opcache)
|
||||
* `php-fuzz-tracing-jit`: Fuzzing the tracing JIT (requires --enable-opcache)
|
||||
* `php-fuzz-function-jit`: Fuzzing the function JIT
|
||||
* `php-fuzz-tracing-jit`: Fuzzing the tracing JIT
|
||||
|
||||
Some fuzzers have a seed corpus in `sapi/fuzzer/corpus`. You can use it as follows:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue