welsh-tidy-mouse/binary-providers
Composer 安装命令:
composer require welsh-tidy-mouse/binary-providers
包简介
Binary providers
README 文档
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 lintto run PHPStancomposer csto fix files with Code Sniffercomposer mdto run PHPMDcomposer checkfor 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
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: WTFPL
- 更新时间: 2025-05-28