@@ -28,43 +28,47 @@ The API documentation is available at: http://violet.riimu.net/api/streaming-jso
28
28
29
29
## Requirements ##
30
30
31
- In order to use this library, the following requirements must be met:
32
-
33
- * PHP version 5.6, 7.0 or later
34
- * The PHP library ` psr/http-message ` must be available
31
+ * The minimum supported PHP version is 5.6
32
+ * The library depends on the following external PHP libraries:
33
+ * [ psr/http-message] ( https://packagist.org/packages/psr/http-message ) (` ^1.0 ` )
35
34
36
35
## Installation ##
37
36
37
+ ### Installation with Composer ###
38
+
38
39
The easiest way to install this library is to use Composer to handle your
39
40
dependencies. In order to install this library via Composer, simply follow
40
- the following two steps:
41
+ these two steps:
41
42
42
- 1 . Acquire the ` composer.phar ` by running the Composer [ Command-line
43
- installation script] ( https://getcomposer.org/download/ ) in your project
44
- root.
45
- 2 . Once you've run the installation script, you should have a ` composer.phar `
43
+ 1 . Acquire the ` composer.phar ` by running the Composer
44
+ [ Command-line installation script] ( https://getcomposer.org/download/ )
45
+ in your project root.
46
+
47
+ 2 . Once you have run the installation script, you should have the ` composer.phar `
46
48
file in you project root and you can run the following command:
47
-
49
+
48
50
```
49
- php composer.phar require "violet/streaming-json-encoder:^1.0 "
51
+ php composer.phar require "violet/streaming-json-encoder:^1.1 "
50
52
```
53
+
54
+ After installing this library via Composer, you can load the library by
55
+ including the `vendor/autoload.php` file that was generated by Composer during
56
+ the installation.
57
+
58
+ ### Adding the library as a dependency ###
51
59
52
- If you are already familiar with how to use Composer, you may also alternatively
53
- simply add the library as a dependency by adding the following `composer.json`
54
- file to your project and running the `composer install` command:
60
+ If you are already familiar with how to use Composer, you may alternatively add
61
+ the library as a dependency by adding the following `composer.json` file to your
62
+ project and running the `composer install` command:
55
63
56
64
```json
57
65
{
58
66
"require": {
59
- "violet/streaming-json-encoder": "^1.0 "
67
+ "violet/streaming-json-encoder": "^1.1 "
60
68
}
61
69
}
62
70
```
63
71
64
- After installing this library via Composer, you can load the library by
65
- including the ` vendor/autoload.php ` file that was generated by Composer during
66
- the installation.
67
-
68
72
### Manual installation ###
69
73
70
74
If you do not wish to use Composer to load the library, you may also download
@@ -73,8 +77,8 @@ and extracting the `src` folder to your project. You may then include the
73
77
provided ` src/autoload.php ` file to load the library classes.
74
78
75
79
Please note that using Composer will also automatically download the other
76
- required PHP libraries. If you install this library manually, you will need to
77
- also make those other required libraries available.
80
+ required PHP libraries. If you install this library manually, you will also need
81
+ to make those other required libraries available.
78
82
79
83
## Usage ##
80
84
@@ -171,7 +175,7 @@ write the JSON to file in a streaming manner. For example:
171
175
172
176
require 'vendor/autoload.php';
173
177
174
- $fp = fopen('test.json', 'w ');
178
+ $fp = fopen('test.json', 'wb ');
175
179
$encoder = new \Violet\StreamingJsonEncoder\StreamJsonEncoder(
176
180
range(1, 100),
177
181
function ($json) use ($fp) {
0 commit comments