rosell-dk/locate-binaries
Composer 安装命令:
composer require rosell-dk/locate-binaries
包简介
Locate a binaries by means of exec() or similar
README 文档
README
Just a little class for locating binaries.
You need exec(), shell_exec() or similar enabled for it to work. Otherwise, it will throw.
Works on Linux, Windows and Mac.
Usage
To locate installed cwebp binaries (found on Linux with which -a, falling back to whereis -b; on Windows found using where):
use LocateBinaries\LocateBinaries;
$cwebBinariesFound = LocateBinaries::locateInstalledBinaries('cwebp');
Note that you get an array of matches - there may be several versions of a binary on a system.
The library also adds another method for locating binaries by peeking in common system paths, such as usr/bin and C:\Windows\System32
However, beware that these dirs could be subject to open_basedir restrictions which can lead to warning entries in the error log. The other method is therefore best.
Well warned, here it is the alternative, which you in some cases might want to fall back to after trying the first.
$imagickBinariesFound = LocateBinaries::locateInCommonSystemPaths('convert');
Installing
Install with composer:
composer require rosell-dk/locate-binaries
Notes
The library uses the exec-with-fallback library in order to be able to use alternatives to exec() when exec() is disabled.
Do you like what I do?
Perhaps you want to support my work, so I can continue doing it :)
Thanks!
rosell-dk/locate-binaries 适用场景与选型建议
rosell-dk/locate-binaries 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.72M 次下载、GitHub Stars 达 2, 最近一次更新时间为 2022 年 04 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「binary」 「which」 「locate」 「discover」 「whereis」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 rosell-dk/locate-binaries 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 rosell-dk/locate-binaries 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 rosell-dk/locate-binaries 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Locate - The users country, preferred language and other facts will be detected. Depending on configurable rules the user can be redirected to other languages or pages. Locate also provides geo blocking for configurable pages in configurable countries.
Find the instances of an executable in the system path. Like the `which` Linux command.
PHP wrapper Google Places API
A library for locating commands in a PATH.
A simple helper, helping to determine what color the text will look better over a monotonous color.
Harness the power of the Google Autocomplete API inside Craft. Adds an autocomplete search box to Craft entries.
统计信息
- 总下载量: 7.72M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 25
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-04-20