瀏覽代碼

Create a separate InternalDescriptorPool method to see if that fixes preloading.

Joshua Haberman 5 年之前
父節點
當前提交
5a98ff98d7
共有 1 個文件被更改,包括 14 次插入1 次删除
  1. 14 1
      php/ext/google/protobuf/def.c

+ 14 - 1
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)
 };