Skip to content

Commit b8a7106

Browse files
committed
Edited README
1 parent 233ec9d commit b8a7106

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The algorithm was written using the XMLParser php library, which is capable of p
99
The implementation is Object-oriented, so in order to split the files, an instance of Chunker has to be created first.
1010

1111
An example of a simple Chunker instance without validation, with **maximum 100 main tags**/chunk, and with outputfile names of *"out-{CHUNK}.xml"*:
12-
```
12+
```php
1313
$chunkSize = 100;
1414
$outputFilePrefix = "out-";
1515
$xmlfile = "bigFile.xml";
@@ -38,7 +38,7 @@ If any of the required parameters are empty/not specified, a Fatal error will be
3838
### Launch the chunking!
3939

4040
After you created an instance of Chunker, and all the parameters were set, you can start the chunking process. You can do this with the `Chunker::chunkXML` method. An example is shown below:
41-
```
41+
```php
4242
// ... the instance is created in $chunker
4343
$chunker.chunkXML("item", "root");
4444
```
@@ -50,7 +50,7 @@ THe method returns the logging session's string conversion (see below for more i
5050
## Logging
5151

5252
The class has an implemented logging feature. Everytime the `Chunker::chunkXML` is run, a new logging session is launched, which can be retrieved with the very same function. After its run, it returns the logging session converted into string:
53-
```
53+
```php
5454
// ...
5555
$log = $chunker.chunkXML(....);
5656
echo $log;
@@ -71,7 +71,7 @@ It is really helpful, when something is not working for your needs, and has to b
7171

7272
Lets say, that you have an XML file (*"feed.xml"*) with a **Shop** root element, and multiple **shopItem** elements inside it (10.000+). You want it to split into files named *"feed-{chunk}.xml"* containing 1000 **shopItem**s maximum. And you also want to only include **shopItem**s, that has a *weight_kg* tag inside, which can only be greater than 10 (or '10 kgs'). The solution is like the following:
7373

74-
```
74+
```php
7575
$chunkSize = 1000;
7676
$xmlfile = "feed.xml";
7777
$outPrefix = "feed-";

0 commit comments

Comments
 (0)