@@ -6,6 +6,22 @@ The algorithm was written using the XMLParser php library, which is capable of p
66
77With the correct charset specified, it can handle special characters, and also parse them for validation.
88
9+ ## Installing
10+ You can use this library by downloading the ` src\Chunker.php ` file, and using it directly, or by ** using composer** as your package manager:
11+ ``` bash
12+ $ composer require borsodigerii/php-xml-chunker
13+ ```
14+
15+ Alternatively, you can add this library as a dependency in your ` composer.json ` file:
16+ ``` json
17+ "require" : {
18+ "borsodigerii/php-xml-chunker" : " 2.0.0"
19+ }
20+ ```
21+ Then you just have to run ` composer update ` .
22+
23+ The minimum PHP version for this library to work, is ** >= 7.4.0**
24+
925## Usage
1026### Simple Chunking
1127The implementation is Object-oriented, so in order to split the files, an instance of Chunker has to be created first.
@@ -20,7 +36,7 @@ $validationFunction = fn($data, $tag) => {
2036}
2137$checkingTags = array();
2238
23- $chunker = new Chunker($xmlfile, $chunkSize, $outputFilePrefix, $validationFunction, $checkingTags);
39+ $chunker = new Chunker\Chunker ($xmlfile, $chunkSize, $outputFilePrefix, $validationFunction, $checkingTags);
2440```
2541
2642
@@ -88,7 +104,7 @@ function validation($data, $tag) {
88104$mainTag = "shopItem";
89105$rootTag = "Shop";
90106
91- $chunker = new Chunker($xmlfile, $chunkSize, $outPrefix, "validation", $chekingTags);
107+ $chunker = new Chunker\Chunker ($xmlfile, $chunkSize, $outPrefix, "validation", $chekingTags);
92108$chunker.chunkXML($mainTag, $rootTag);
93109```
94110
0 commit comments