From 99be7b078bcda5627f7d19c1c5b8a699e161d891 Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Fri, 14 Mar 2025 23:39:31 +0800 Subject: [PATCH] Add conflict message when building protobuf and grpc (#653) --- src/SPC/builder/extension/protobuf.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/SPC/builder/extension/protobuf.php b/src/SPC/builder/extension/protobuf.php index 9bab1a32..3393ad43 100644 --- a/src/SPC/builder/extension/protobuf.php +++ b/src/SPC/builder/extension/protobuf.php @@ -15,5 +15,9 @@ class protobuf extends Extension if ($this->builder->getPHPVersionID() < 80000 && getenv('SPC_SKIP_PHP_VERSION_CHECK') !== 'yes') { throw new \RuntimeException('The latest protobuf extension requires PHP 8.0 or later'); } + // protobuf conflicts with grpc + if ($this->builder->getExt('grpc') !== null) { + throw new \RuntimeException('protobuf conflicts with grpc, please remove grpc or protobuf extension'); + } } }