PHP code example of php-skir / runtime

1. Go to this page and download the library: Download php-skir/runtime library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

php-skir / runtime example snippets


use Skir\Runtime\DenseJson;
use Skir\Runtime\Field;
use Skir\Runtime\Type;

$user = Type::struct([
    Field::value('id', 0, Type::int32()),
    Field::value('name', 1, Type::string()),
]);

$json = DenseJson::toJson($user, [
    'id' => 1,
    'name' => 'Jane',
]);

$data = DenseJson::fromJson($user, $json);

use Skir\Runtime\Cbor;

$body = Cbor::encodeEnvelope($methodDescriptor, $request);
$payload = Cbor::decodeEnvelope($body);
bash
composer 
bash
composer