Skip to content

Commit a902fbf

Browse files
committed
improve README
1 parent 84f2840 commit a902fbf

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

README.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ But unlike JSON, it is very fast and small.
1414

1515
### Install from PECL
1616
Msgpack is an PECL extension, thus you can simply install it by:
17-
````
18-
pecl install msgpack
19-
````
17+
18+
```shell
19+
$ pecl install msgpack
20+
```
21+
2022
### Compile Msgpack from source
21-
````
22-
$/path/to/phpize
23-
$./configure
24-
$make && make install
25-
````
23+
```shell
24+
$ /path/to/phpize
25+
$ ./configure --with-php-config=/path/to/php-config
26+
$ make && make install
27+
```
2628

2729
### Example
2830
```php
@@ -32,22 +34,23 @@ $msg = msgpack_pack($data);
3234
$data = msgpack_unpack($msg);
3335
```
3436

35-
### Example Advanced
37+
### Advanced Example
3638
```php
3739
<?php
3840
$data = array(0 => 1, 1 => 2, 2 => 3);
39-
$packer = new \MessagePack(false); //same as $packer->setOption(\MessagePack::OPT_PHPONLY, false);
41+
$packer = new \MessagePack(false);
42+
// ^ same as $packer->setOption(\MessagePack::OPT_PHPONLY, false);
4043
$packed = $packer->pack($data);
4144

42-
$unpacker = new \MessagePackUnpacker(false); //same as $unpacker->setOption(\MessagePack::OPT_PHPONLY, false);
45+
$unpacker = new \MessagePackUnpacker(false);
46+
// ^ same as $unpacker->setOption(\MessagePack::OPT_PHPONLY, false);
4347
$unpacker->feed($packed);
4448
$unpacker->execute();
4549
$unpacked = $unpacker->data();
4650
$unpacker->reset();
47-
4851
```
4952

50-
### Example Advanced Streaming
53+
### Advanced Streaming Example
5154
```php
5255
<?php
5356
$data1 = array(0 => 1, 1 => 2, 2 => 3);
@@ -83,5 +86,5 @@ while(true) {
8386

8487
```
8588

86-
# Resources
89+
## Resources
8790
* [msgpack](http://msgpack.org/)

0 commit comments

Comments
 (0)