Skip to content

Commit 3bdd211

Browse files
committed
Edited basic data and structure
1 parent 18b4f05 commit 3bdd211

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

README.md

+18-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ The algorithm was written using the XMLParser php library, which is capable of p
66

77
With 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
1127
The 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

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"autoload": {
2525
"psr-0": {
26-
"Chunker": "src/"
26+
"Chunker\\": "src/"
2727
}
2828
},
2929
"autoload-dev": {}
File renamed without changes.

0 commit comments

Comments
 (0)