From 5a98ff98d756e8b47c846924c8469a4abe608e6e Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Tue, 6 Oct 2020 10:57:33 -0700 Subject: [PATCH] Create a separate InternalDescriptorPool method to see if that fixes preloading. --- php/ext/google/protobuf/def.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/php/ext/google/protobuf/def.c b/php/ext/google/protobuf/def.c index 1ae5c4d67c..ac24400d95 100644 --- a/php/ext/google/protobuf/def.c +++ b/php/ext/google/protobuf/def.c @@ -1020,8 +1020,21 @@ static zend_function_entry DescriptorPool_methods[] = { zend_class_entry *InternalDescriptorPool_class_entry; +/* + * InternalDescriptorPool::getGeneratedPool() + * + * Returns the generated DescriptorPool. Note that this is identical to + * DescriptorPool::getGeneratedPool(), and in fact returns a DescriptorPool + * instance. + */ +PHP_METHOD(InternalDescriptorPool, getGeneratedPool) { + zval ret; + ZVAL_COPY(&ret, get_generated_pool()); + RETURN_ZVAL(&ret, 0, 1); +} + static zend_function_entry InternalDescriptorPool_methods[] = { - PHP_ME(DescriptorPool, getGeneratedPool, NULL, + PHP_ME(InternalDescriptorPool, getGeneratedPool, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) };