Add conflict message when building protobuf and grpc (#653)

This commit is contained in:
Jerry Ma 2025-03-14 23:39:31 +08:00 committed by GitHub
parent 8925e97e62
commit 99be7b078b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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');
}
}
}