From 175e158863e621bc269e64cd739b4d8462354eab Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 23 Oct 2019 09:03:08 +0200 Subject: FFI::load() doesn't work in conjunction with "opcache.preload_user". Use "ffi.preload" instead. --- preload-foo.inc | 1 + preload-zstd.inc | 2 ++ preload.php | 3 --- zstd.php | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/preload-foo.inc b/preload-foo.inc index 31be7d6..af509e2 100644 --- a/preload-foo.inc +++ b/preload-foo.inc @@ -2,5 +2,6 @@ namespace Remi; class Foo { + static private $single = NULL; } diff --git a/preload-zstd.inc b/preload-zstd.inc index de8abd0..f56c833 100644 --- a/preload-zstd.inc +++ b/preload-zstd.inc @@ -19,10 +19,12 @@ class Zstd { // Try if preloaded try { self::$ffi = \FFI::scope("_REMI_ZSTD_"); + echo "Using FFI::scope OK\n"; } catch (\FFI\Exception $e) { // Try direct load if (PHP_SAPI === 'cli' || (int)ini_get("ffi.enable")) { self::$ffi = \FFI::load(__DIR__ . '/preload-zstd.h'); + echo "Using FFI::load OK\n"; } else { throw $e; } diff --git a/preload.php b/preload.php index 1af70d6..d442e15 100644 --- a/preload.php +++ b/preload.php @@ -1,7 +1,4 @@