n5s/local-bin

There is no license information available for the latest version (1.1.3) of this package.

Base class for providing the right binary depending of your platform.

1.1.3 2024-06-25 20:06 UTC

This package is auto-updated.

Last update: 2024-11-28 13:20:44 UTC


README

Base class for providing the right binary depending of your platform.

Install

composer require n5s/local-bin

Usage

Extend the base n5s\LocalBin\AbstractBinary class with your binary name:

use n5s\LocalBin\AbstractBinary;

class MyBinary extends AbstractBinary {
}

Set the class name to your binary name (e.g. JpegOptim -> jpegoptim) for less verbose code or override the getName static method.

Place the binary files for all supported platform inside the bin folder, at the root of your package, following this folder tree:

├── bin
│   ├── darwin
│   │   └── mybinary
│   ├── linux
│   │   ├── x64
│   │   │   └── mybinary
│   │   └── x86
│   │       └── mybinary
│   └── windows
│       ├── x64
│       │   └── mybinary.exe
│       └── x86
│           └── mybinary.exe

Get the path of your binary using:

$bin = MyBinary::getPath();