Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/php-ffi/location
PHP library for determining the physical location of binaries
https://github.com/php-ffi/location
binary locator php resolver
Last synced: about 15 hours ago
JSON representation
PHP library for determining the physical location of binaries
- Host: GitHub
- URL: https://github.com/php-ffi/location
- Owner: php-ffi
- License: mit
- Created: 2021-08-07T20:21:57.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-01-01T14:01:10.000Z (almost 2 years ago)
- Last Synced: 2024-08-09T03:06:50.556Z (3 months ago)
- Topics: binary, locator, php, resolver
- Language: PHP
- Homepage:
- Size: 14.6 KB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Bin Locator
Library for searching binary files in the operating system.
## Requirements
- PHP >= 7.4
## Installation
Library is available as composer repository and can be installed using the
following command in a root of your project.```sh
$ composer require ffi/location
```## Usage
### Existence Check
Checking the library for existence.
```php
use FFI\Location\Locator;$exists = Locator::exists('libGL.so');
// Expected true in the case that the binary exists and false otherwise
```### Binary Pathname
Getting the full path to the library.
```php
use FFI\Location\Locator;$pathname = Locator::pathname('libGL.so');
// Expected "/usr/lib/x86_64-linux-gnu/libGL.so.1.7.0" or null
// in the case that the library cannot be found
```### Binary Resolving
Checking multiple names to find the most suitable library.
```php
use FFI\Location\Locator;$pathname = Locator::resolve('example.so', 'test.so', 'libvulkan.so');
// Expected "/usr/lib/x86_64-linux-gnu/libvulkan.so.1.2.131" or null
// in the case that the library cannot be found
```