View Source

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFPROP:Proposal Zone Template}

{zone-data:component-name}
Zend\Protobuff
{zone-data}

{zone-data:proposer-list}
[Rostyslav Mykhajliw|mailto:necromant2005@gmail.com]
{zone-data}

{zone-data:liaison}
https://github.com/necromant2005/zeus-proto
{zone-data}

{zone-data:revision}
1.0 - 31 December 2010: Beta.
{zone-data}

{zone-data:overview}
Zend\Protobuff is a simple component that provide encoding and decoding Google Protocol Buffers
{zone-data}

{zone-data:references}
* [Protocol Buffers Overview|http://code.google.com/intl/uk-UA/apis/protocolbuffers/docs/overview.html]
* [pb4php|http://code.google.com/p/pb4php/]
{zone-data}

{zone-data:requirements}
* This component *will* correctly reads .proto files
* The generated skeleton class *will* support Google Class API.
* This component *will* support encode data.
* This component *will* support decode data.
* This component *will* provide client through Google Protocol Buffers
* This component *will* provide server based on Google Protocol Buffers
{zone-data}

{zone-data:dependencies}
* Zend\Exception
{zone-data}

{zone-data:operation}
The component is instantiated with a mind-link that ...
{zone-data}

{zone-data:milestones}
* Milestone 1: [DONE] Create base abstract class
* Milestone 2: [DONE STAGE-1] Realize encoder Protocol buffers
* Milestone 3: [DONE STAGE-1]Realize decoder Protocol buffers
* Milestone 4: Add support .proto files specification
* Milestone 5: Add generation classes based on .proto file
{zone-data}

{zone-data:class-list}
* Zend\Protobuff\AbstractProtobuff
* Zend\Protobuff\Encoder
* Zend\Protobuff\Decoder
* Zend\Protobuff\Code\Generator
{zone-data}

{zone-data:use-cases}
||UC-01||
{code}
$encoder = new Zend\Protobuff\Encoder;
$encoder->encode(array(
'name'=> array(
'required'=>true,
'type' => Zend\Protobuff\AbstractProtobuff::TYPE_STRING,
),
'age'=> array(
'required'=>false,
'type' => Zend\Protobuff\AbstractProtobuff::TYPE_INT32,
'default'=>0,
),
), array(
'name'=>'peter',
'age'=>25,
));
{code}

||UC-02||
{code}
$decoder = new Zend\Protobuff\Decoder;
$decoder->decode(array(
'name'=> array(
'required'=>true,
'type' => Zend\Protobuff\AbstractProtobuff::TYPE_STRING,
),
'age'=> array(
'required'=>false,
'type' => Zend\Protobuff\AbstractProtobuff::TYPE_INT32,
'default'=>0,
),
), $buffer);
{code}

||UC-01||
{code}
$encoder = new Zend\Protobuff\Encoder;
$encoder->encode('path/to/user.proto', array(
'name'=>'peter',
'age'=>25,
));
{code}

||UC-02||
{code}
$decoder = new Zend\Protobuff\Decoder;
$decoder->decode('path/to/user.proto', $buffer);
{code}


{zone-data}

{zone-data:skeletons}
{code}
abstract class Zend\Protobuff\AbstractProtobuff
{
public function getWireTypeClass(array $options)
}
{code}

{code}
class Zend\Protobuff\Encoder extends \Zend\Protobuff\AbstractProtobuff
{
public function encode($map, $values)
}
{code}

{code}
class Zend\Protobuff\Decoder extends \Zend\Protobuff\AbstractProtobuff
{
public function decode($map, $buffer)
}
{code}

{zone-data}

{zone-template-instance}]]></ac:plain-text-body></ac:macro>