Skip to content

Commit 41e6e29

Browse files
committed
add missing files
1 parent aa99005 commit 41e6e29

File tree

4 files changed

+105
-0
lines changed

4 files changed

+105
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
spl_autoload_register(function($name){
3+
static $classmap;
4+
if (!$classmap) {
5+
$classmap = array(
6+
'pecl\protocolbuffers\User' => '/pecl/protocolbuffers/User.php',
7+
// @@protoc_insertion_point(autoloader_scope:classmap)
8+
);
9+
}
10+
if (isset($classmap[$name])) {
11+
require __DIR__ . DIRECTORY_SEPARATOR . $classmap[$name];
12+
}
13+
});
14+
15+
call_user_func(function(){
16+
$registry = \ProtocolBuffers\ExtensionRegistry::getInstance();
17+
// @@protoc_insertion_point(extension_scope:registry)
18+
});
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?php
2+
namespace pecl\protocolbuffers;
3+
4+
// @@protoc_insertion_point(namespace:.pecl.protocolbuffers.User)
5+
6+
/**
7+
* Generated by the protocol buffer compiler. DO NOT EDIT!
8+
* source: proto/user.proto
9+
*
10+
* -*- magic methods -*-
11+
*
12+
* @method string getUserId()
13+
* @method void setUserId(string $value)
14+
* @method string getName()
15+
* @method void setName(string $value)
16+
*/
17+
class User extends \ProtocolBuffers\Message
18+
{
19+
// @@protoc_insertion_point(traits:.pecl.protocolbuffers.User)
20+
21+
/**
22+
* @var string $user_id
23+
* @tag 1
24+
* @label optional
25+
* @type \ProtocolBuffers::TYPE_INT64
26+
**/
27+
protected $user_id;
28+
29+
/**
30+
* @var string $name
31+
* @tag 2
32+
* @label optional
33+
* @type \ProtocolBuffers::TYPE_BYTES
34+
**/
35+
protected $name;
36+
37+
38+
// @@protoc_insertion_point(properties_scope:.pecl.protocolbuffers.User)
39+
40+
// @@protoc_insertion_point(class_scope:.pecl.protocolbuffers.User)
41+
42+
/**
43+
* get descriptor for protocol buffers
44+
*
45+
* @return \ProtocolBuffersDescriptor
46+
*/
47+
public static function getDescriptor()
48+
{
49+
static $descriptor;
50+
51+
if (!isset($descriptor)) {
52+
$desc = new \ProtocolBuffers\DescriptorBuilder();
53+
$desc->addField(1, new \ProtocolBuffers\FieldDescriptor(array(
54+
"type" => \ProtocolBuffers::TYPE_INT64,
55+
"name" => "user_id",
56+
"required" => false,
57+
"optional" => true,
58+
"repeated" => false,
59+
"packable" => false,
60+
"default" => null,
61+
)));
62+
$desc->addField(2, new \ProtocolBuffers\FieldDescriptor(array(
63+
"type" => \ProtocolBuffers::TYPE_BYTES,
64+
"name" => "name",
65+
"required" => false,
66+
"optional" => true,
67+
"repeated" => false,
68+
"packable" => false,
69+
"default" => null,
70+
)));
71+
// @@protoc_insertion_point(builder_scope:.pecl.protocolbuffers.User)
72+
73+
$descriptor = $desc->build();
74+
}
75+
return $descriptor;
76+
}
77+
78+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?php
2+
require_once __DIR__ . DIRECTORY_SEPARATOR . 'autoload.php';

tests/integration/proto/user.proto

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package pecl.protocolbuffers;
2+
3+
message User
4+
{
5+
optional int64 user_id = 1;
6+
optional bytes name = 2;
7+
}

0 commit comments

Comments
 (0)