itgalaxy / bin-wrapper
PHP library providing functionality to verify that user-agents are who they claim to be.
1.0.4
2017-03-29 09:32 UTC
Requires
- php: ^5.6 || ^7.0
- composer/semver: ^1.4.0
- guzzlehttp/guzzle: ^6.2.0
- itgalaxy/bin-version-check: ^2.0.0
- itgalaxy/os-filter: ^3.0.0
- mmoreram/extractor: ^1.2.0
- symfony/filesystem: ^2.7 | ^3.2
- webmozart/path-util: ^2.3.0
Requires (Dev)
- phpunit/php-code-coverage: ^4.0.0
- phpunit/phpunit: ^5.6.0
README
Binary wrapper that makes your programs seamlessly available as local dependencies
Install
The utility can be installed with Composer:
$ composer require bin-wrapper
Usage
<?php use Itgalaxy\BinWrapper\BinWrapper; $url = 'https://github.com/itgalaxy/pngquant-bin/raw/master/bin-vendor'; $platform = strtolower(PHP_OS); $binWrapper = new BinWrapper(); $binWrapper ->src($url . '/freebsd/x64/pngquant', 'darwin', 'x64') ->src($url . '/linux/x64/pngquant', 'linux', 'x64') ->src($url . '/linux/x86/pngquant', 'linux', 'x86') ->src($url . '/macos/pngquant', 'darwin') ->src($url . '/win/pngquant.exe', 'windowsnt') ->dest(__DIR__ . '/vendor-bin') ->using(substr($platform, 0, 3) === 'win' ? 'pngquant.exe' : 'pngquant') ->version('>=1.71'); $binWrapper->run(['--version']); // You can use `try {} catch {}` for catching exceptions
Get the path to your binary with $binWrapper->path()
:
<?php echo $binWrapper->path();
API
Coming soon
Related
- bin-wrapper - Thanks you for inspiration.
Contribution
Feel free to push your code if you agree with publishing under the MIT license.