Skip to content
Allows you to launch a file or a resource with the your default OS application.
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
spec/drupol/launcher
src
tests/src
.editorconfig
.gitignore
.scrutinizer.yml
.travis.yml
LICENSE
README.md
appveyor.yml
composer.json
grumphp.yml.dist
infection.json.dist
phpspec.yml.dist

README.md

Latest Stable Version GitHub stars Total Downloads Build Status Build Status Scrutinizer code quality Code Coverage Mutation testing badge License Say Thanks! Donate!

OS Launcher

Description

Allows you to launch a file or a resource with the your default OS application.

Requirements

  • PHP >= 7.1

Installation

composer require drupol/launcher

Usage

<?php

declare(strict_types = 1);

include 'vendor/autoload.php';

use drupol\launcher\Launcher;

// Open the default browser.
Launcher::open('https://github.com/drupol/launcher');

// Open the default file manager.
Launcher::open('/tmp');

// Open the default file manager.
Launcher::open('C:\Windows');

// The parameter $resource is variadic.

// Open multiple resources.
Launcher::open('https://google.com', 'https://github.com');

Code quality, tests and benchmarks

Every time changes are introduced into the library, Travis CI run the tests and the benchmarks.

The library has tests written with PHPSpec. Feel free to check them out in the spec directory. Run composer phpspec to trigger the tests.

Before each commit some inspections are executed with GrumPHP, run ./vendor/bin/grumphp run to check manually.

PHPBench is used to benchmark the library, to run the benchmarks: composer bench

PHPInfection is used to ensure that your code is properly tested, run composer infection to test your code.

Contributing

Feel free to contribute to this library by sending Github pull requests. I'm quite reactive :-)

You can’t perform that action at this time.