welsh-tidy-mouse / binary-providers
Binary providers
Requires
- php: ^8.3
- welsh-tidy-mouse/binary-fetcher: dev-main
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.50
- phpmd/phpmd: ^2.14
- phpstan/phpstan: ^1.11
This package is auto-updated.
Last update: 2025-05-28 14:54:11 UTC
README
This repository provides a set of binary providers for use with the Binary Fetcher library.
Each binary provider defines how to locate and download a specific binary from GitHub releases, tailored to the current platform (OS + architecture). These providers are used by Binary Fetcher to automate the installation of CLI tools across environments.
๐ฆ What Is This For?
The binary-fetcher
project is a PHP-based tool to download platform-specific binaries with zero configuration. It can be used both:
- Via CLI (
bin/binary-fetcher download
) - Via PHP (
BinaryFetcher::download()
)
This repository (binary-providers
) contains the list of supported binaries through reusable PHP provider classes.
๐งฉ Available Binary Providers
Provider Class | Binary | Source URL | Notes |
---|---|---|---|
\WelshTidyMouse\BinaryProvider\BunJsBinaryProvider |
bun |
oven-sh/bun | JavaScript runtime (Node.js alternative) |
\WelshTidyMouse\BinaryProvider\TailwindCssBinaryProvider |
tailwindcss |
tailwindlabs/tailwindcss | CSS utility framework CLI |
\WelshTidyMouse\BinaryProvider\SassBinaryProvider |
dart-sass |
sass/dart-sass | Sass compiler (standalone executable) |
๐ง Install
composer require welsh-tidy-mouse/binary-fetcher
๐ How to Use These Providers
Using Binary Fetcher, you can download any of these binaries based on your current OS and architecture.
From CLI
bin/binary-fetcher download "\WelshTidyMouse\BinaryProvider\BunJsBinaryProvider"
From PHP
use WelshTidyMouse\BinaryFetcher\BinaryFetcher; use WelshTidyMouse\BinaryProvider\BunJsBinaryProvider; $binaryPath = (new BinaryFetcher())->download(BunJsBinaryProvider::class);
The binary will be downloaded to a writable location and its path will be returned.
๐ ๏ธ Development & Contributions
You can add your own binary provider class implementing the interface:
namespace WelshTidyMouse\BinaryFetcher\Contract; use WelshTidyMouse\BinaryFetcher\Exception\BinaryProviderException; use WelshTidyMouse\BinaryFetcher\Type\OsType; use WelshTidyMouse\BinaryFetcher\Type\SystemArchType; interface BinaryProviderInterface { public function __construct(); public function getName(): string; public function getDownloadableAssetUrl(string $version, OsType $os, SystemArchType $arch): ?string; public function getBinaryFilenameFromDownloadedAsset(string $assetFileName, string $downloadDirPath): string; }
Pull requests for additional binary providers are welcome!
๐งช Quality
composer lint
to run PHPStancomposer cs
to fix files with Code Sniffercomposer md
to run PHPMDcomposer check
for all commands above
๐ Part of Welsh Tidy Mouse
This package is part of the Welsh Tidy Mouse ecosystem. Read more on the main repository: binary-fetcher