The main scenario for myself was a possible migration for a project from ULIDs to UUIDs since UUIDs got a little bit of support in MySQL 8.
<?php use Arokettu\Uuid\UuidParser; // Just a random ULID $ulid = UuidParser::fromBase32('01H44RDYXJPFCF895N3BBXCZRC'); var_dump($ulid->isUuidV7Compatible()); // false // $uuid = $ulid->toUuidV7(); // UnexpectedValueException: This ULID cannot be converted to UUID v7 losslessly $uuid = $ulid->toUuidV7(lossy: true); // note digit 13 becoming '7' and digit 17 moving into [89ab] range var_dump($uuid->toString()); // 01890986-fbb2-73d8-b424-b51ad7d67f0c var_dump($ulid->toRfc4122()); // 01890986-fbb2-b3d8-f424-b51ad7d67f0c var_dump($uuid->toBase32()); // 01H44RDYXJEFCB895N3BBXCZRC var_dump($ulid->toString()); // 01H44RDYXJPFCF895N3BBXCZRC
I'm continuing to publish useless nih junk on the Packagist:
arokettu/arithmetic-parser: A very configurable arithmetic parser and calculator. You can define your own set of functions and operators. You can even disable multiplication if you want to!
arokettu/clock: A set of PSR-20 clock implementations. Everyone has these implemented so why not me? :D
arokettu/system-clock: All these PSR-20 clock packages usually contain a ton of clocks for testing purposes but most of the production code needs only
new DateTimeImmutable('now')so I extracted SystemClock to a separate package that has only SystemClock.php and composer.json for the smallest possible package (if you don't count uglifying it js-like)
arokettu/kilo-mega: This one was actually released on February but I've forgot to write about it. It's a simple formatter for metric prefixes.
Also a new significant release:
arokettu/torrent-file: Torrent file class got file listing classes for v1 and v2 metadata in 5.0 release.
Just finished moving my old composer packages from
I tried to make the migration process as smooth as possible. I'm sorry for the inconvenience it might have caused.
While the original way is still valid, in Docker it's now easier to copy the Composer executable from its Docker image.
or for PHP < 7.2.5
Please note that without the installer, dependencies won't be checked, so you also need to install git and/or zip, and preferably optional dependencies like mbstring too.
I have recently found myself in a situation when 3 out of 4 libraries that I used to work with Excel files were abandoned:
akeneo-labs/spreadsheet-parser (streaming reader) had no commits in 4 years
mk-j/php_xlsxwriter (streaming writer) had no commits in 2 years
box/spout (streaming reader/writer) is formally abandoned
Luckily there exists a community fork of Spout called OpenSpout and it can replace them all. It seems pretty popular with 1 mln downloads and 229 stars but it's still less popular than the original and I managed to find it only by navigating the forks of Spout so I think it just needs more exposure.
A small step for the community may still be a huge leap for specific people, like Pierrick Charron and Sergey Panteleev who became this version release managers. I would like to congratulate them with a successful release.
This moon-in-reverse scale leap also happened to me: I got my first MR accepted to the PHP itself. It's the second C-based project that I contributed professionally, and the only huge one. The first one was my systemd-journal lib wrapper.
I have re-tested all my libraries for compatibility with PHP 8.2. Luckily due to small amount of changes and, well, me not using some bad practices, they are all compatible with the new release.
Only MonsterID had a new release to leverage the new Random Extension.
Unsigned is a fixed (but arbitrary) length unsigned integer arithmetic library for native PHP. It was created as a helper for the Random Extension Polyfill to remove hard dependency on the GMP. It may be useful for weird arithmetic with shifts and unsigned overflows that is used in RNGS, encryptors, hashes, etc. (But it won't be cryptographically secure! Time based attacks are quite possible because of some optimizations) Performance greatly depends on the PHP version, with PHP 8.0+ it performs quite nicely, only slightly slower than GMP.
Announcing my new library, a polyfill for the new sexy
ext-randomfrom PHP 8.2 that I mentioned a couple of posts ago. It requires PHP 7.1+ and the GMP extension.
There will be some limitations with the compatibility but it's already usable for most simple use cases. Grab it here: https://sandfox.dev/php/random-polyfill.html
Many thanks to Go Kudo for his work on the original extension.