[go: up one dir, main page]

Skip to content

Open a file or a resource with the default OS application.

License

Notifications You must be signed in to change notification settings

loophp/launcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

OS Launcher

Description

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

Requirements

  • PHP >= 7.1

Installation

composer require loophp/launcher

Usage

<?php

declare(strict_types = 1);

include 'vendor/autoload.php';

use loophp\launcher\Launcher;

// Open the default browser.
Launcher::open('https://github.com/loophp/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, Github 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.

Contributing

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

About

Open a file or a resource with the default OS application.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages