You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do not forget to add `extension=xz.so` to your `php.ini`.
29
101
30
102
### Windows
31
-
Windows builds are now done automatically on each push; you can download them from the [build artifacts](https://docs.github.com/en/actions/managing-workflow-runs/downloading-workflow-artifacts) or [releases](https://github.com/codemasher/php-ext-xz/releases) (after 1.1.2).
32
103
33
104
If you want to build it on your own, follow the steps under "[Build your own PHP on Windows](https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2)" to setup your build environment.
34
105
Before the compilation step, clone this repository to `[...]\php-src\ext\xz` and proceed.
@@ -56,26 +127,6 @@ nmake snap
56
127
57
128
Please note that the `liblzma` dependency is not included with PHP < 8, so you will need to [download it manually](https://windows.php.net/downloads/php-sdk/deps/vs16/x64/liblzma-5.2.5-vs16-x64.zip) and extract it into the `deps` directory.
58
129
59
-
Copy the `php_xz.dll` into the `/ext` directory of your PHP installation and add the line `extension=xz` to your `php.ini` or in case of the versioned .dll from the artifacts something like: `extension=xz-0eebbf2-8.2-ts-vs16-x64` - omit the `php_` and `.dll`.
60
-
61
-
## Basic usage
62
-
63
-
```php
64
-
$fh = xzopen('/tmp/test.xz', 'w');
65
-
xzwrite($fh, 'Data you would like compressed and written.');
66
-
xzclose($fh);
67
-
68
-
$fh = xzopen('/tmp/test.xz', 'r');
69
-
xzpassthru($fh);
70
-
xzclose($fh);
71
-
```
72
-
73
-
```php
74
-
$str = 'Data you would like compressed.';
75
-
76
-
$encoded = xzencode($str);
77
-
$decoded = xzdecode($encoded);
78
-
```
79
130
80
131
## Disclaimer
81
132
May or may not contain bugs. Use at your own risk.
0 commit comments