eloquent/liftoff

Open any file or URI using the default GUI application from within PHP.

Installs: 274

Dependents: 2

Stars: 9

Watchers: 2

Language: PHP

0.1.1 2014-02-13 11:25 UTC

README

Open any file or URI using the default GUI application from within PHP.

The most recent stable version is 0.1.1 Current build status image Current coverage status image

Installation and documentation

What is Liftoff?

Liftoff provides a simple interface to launch a file or URI in the host operating system's default application, in a cross-platform manner. Liftoff can be used, for example, to launch a HTML page in the operating system's default browser from within a command line PHP application.

Usage

Liftoff can be used as a library, to launch files and URIs from within a PHP application:

use Eloquent\Liftoff\Launcher;

$launcher = new Launcher;

$launcher->launch('/path/to/file.html');
$launcher->launch('/path/to/file.html', array('--with', '--arguments'));

$launcher->launch('http://example.org/');
$launcher->launch('http://example.org/', array('--with', '--arguments'));

Arguments provided as the second parameter will be forwarded on to the associated application.

Command line interface

Liftoff comes with a command line interface which can be used to launch files and URIs from the command line:

liftoff /path/to/file.html
liftoff /path/to/file.html --with --arguments

liftoff http://example.org/
liftoff http://example.org/ --with --arguments

Arguments after the path (or URI) will be forwarded on to the associated application.