Skip to content

Commit 685f678

Browse files
author
cypherbits
committed
feat: try to packagist
1 parent ebdb37d commit 685f678

2 files changed

Lines changed: 64 additions & 4 deletions

File tree

README.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ PHP BLAKE3 Extension
33

44
BLAKE3 is an improved and faster version of BLAKE2.
55

6-
This extension uses the official BLAKE3 C implementation, thus is single-threaded, but still faster than SHA256 or SHA512 on my benchmark on PHP 7.4.
6+
This extension uses the official BLAKE3 C implementation, thus is single-threaded, but still faster than SHA256 or SHA512 on benchmark (PHP 7.4).
77

8-
Installation
9-
------------
8+
Installation (manual)
9+
---------------------
1010
Clone the repository and compile it:
1111
```sh
1212
$ git clone https://github.com/cypherbits/php-blake3.git
@@ -175,4 +175,30 @@ Donate
175175
https://ko-fi.com/cypherbits
176176

177177
Monero address:
178-
`4BCveGZaPM7FejGkhFyHgtjVXZw52RrYxKs7znZdmnWLfB3xDKAW6SkYZPpNhqBvJA8crE8Tug8y7hx8U9KAmq83PwLtVLe`
178+
`4BCveGZaPM7FejGkhFyHgtjVXZw52RrYxKs7znZdmnWLfB3xDKAW6SkYZPpNhqBvJA8crE8Tug8y7hx8U9KAmq83PwLtVLe`
179+
180+
Packagist & PIE Installation
181+
----------------------------
182+
183+
This extension ships with a `composer.json` compatible with PIE. Once the repository is published on Packagist (for example as `cypherbits/php-blake3` and tagged, e.g. `v0.1.0`), you can install it with PIE:
184+
185+
```sh
186+
pie install cypherbits/php-blake3 --enable-blake3
187+
```
188+
189+
PIE will perform the usual non-Windows extension build steps:
190+
191+
1. `phpize`
192+
2. `./configure --enable-blake3`
193+
3. `make`
194+
4. `make install`
195+
5. Enable the extension via an INI file (for example `extension=blake3`).
196+
197+
You can still install it manually without PIE using the steps in the "Installation (manual)" section above.
198+
199+
Publishing to Packagist
200+
-----------------------
201+
1. Create a tag, for example: `git tag v0.1.0 && git push --tags`.
202+
2. Go to https://packagist.org/packages/submit and submit `https://github.com/cypherbits/php-blake3`.
203+
3. Optionally configure auto-updates for GitHub so new tags are picked up automatically.
204+
4. Test in a clean project using PIE: `pie install cypherbits/php-blake3 --enable-blake3`.

composer.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "cypherbits/php-blake3",
3+
"description": "BLAKE3 hashing algorithm PHP extension (native C, SIMD) for fast cryptographic hashing.",
4+
"keywords": ["blake3", "hash", "crypto", "php-extension", "simd"],
5+
"homepage": "https://github.com/cypherbits/php-blake3",
6+
"license": "MIT",
7+
"type": "php-ext",
8+
"support": {
9+
"issues": "https://github.com/cypherbits/php-blake3/issues",
10+
"source": "https://github.com/cypherbits/php-blake3"
11+
},
12+
"funding": [
13+
{"type": "ko-fi", "url": "https://ko-fi.com/cypherbits"}
14+
],
15+
"authors": [
16+
{
17+
"name": "cypherbits",
18+
"role": "Maintainer"
19+
}
20+
],
21+
"require": {
22+
"php": ">=8.3"
23+
},
24+
"php-ext": {
25+
"extension-name": "blake3",
26+
"configure-options": [
27+
{
28+
"name": "enable-blake3",
29+
"description": "Enable the BLAKE3 extension (--enable-blake3)",
30+
"needs-value": false
31+
}
32+
]
33+
}
34+
}

0 commit comments

Comments
 (0)