Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

README

        

# Bin Locator


PHP 8.1+
Latest Stable Version
Latest Unstable Version
Total Downloads
License MIT




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
```