Skip to content

Commit 3c12ca0

Browse files
author
Tobias Seipke
committed
Merge pull request #7 from JuhaszAdam/master
Overhaul and refactor by JuhaszAdam
2 parents b30e0c6 + d4b8fd0 commit 3c12ca0

36 files changed

+525
-21504
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
.idea/

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ Based on the LZ-String javascript found here: http://pieroxy.net/blog/pages/lz-s
88
If you plan to exchange your data via AJAX use the base64 methods hence this is HTTP save.
99

1010
- 2014-05-09 Added support for special chars like é,È, ... [Thanks to @carlholmberg]
11-
- 2014-03-12 Small Bugfix added (Thanks to Filipe)
11+
- 2014-03-12 Small Bugfix added (Thanks to Filipe)
12+
13+
- 2016-02-04 Overhaul and refactor

composer.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "juhasz-adam/lz-compressor",
3+
"description": "PHP Class implementation of LZ-String javascript.",
4+
"require": {
5+
"php": ">=5.3.0"
6+
}
7+
}

src/LZCompressor/LZContext.php

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
3+
namespace LZCompressor;
4+
5+
class LZContext
6+
{
7+
/**
8+
* @var array
9+
*/
10+
public $dictionary = [];
11+
12+
/**
13+
* @var array
14+
*/
15+
public $dictionaryToCreate = [];
16+
17+
/**
18+
* @var string
19+
*/
20+
public $c = '';
21+
22+
/**
23+
* @var string
24+
*/
25+
public $wc = '';
26+
27+
/**
28+
* @var string
29+
*/
30+
public $w = '';
31+
32+
/**
33+
* @var int
34+
*/
35+
public $enlargeIn = 2;
36+
37+
/**
38+
* @var int
39+
*/
40+
public $dictSize = 3;
41+
42+
/**
43+
* @var int
44+
*/
45+
public $numBits = 2;
46+
47+
/**
48+
* @var LZData
49+
*/
50+
public $data;
51+
52+
function __construct()
53+
{
54+
$this->data = new LZData;
55+
}
56+
}

src/LZCompressor/LZData.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace LZCompressor;
4+
5+
class LZData
6+
{
7+
/**
8+
* @var
9+
*/
10+
public $str;
11+
12+
/**
13+
* @var
14+
*/
15+
public $val;
16+
17+
/**
18+
* @var int
19+
*/
20+
public $position = 0;
21+
22+
/**
23+
* @var int
24+
*/
25+
public $index = 1;
26+
}

0 commit comments

Comments
 (0)