drupol / launcher
Open a file or a resource with the default OS application.
Fund package maintenance!
drupol
Installs: 1 367
Dependents: 2
Suggesters: 0
Security: 0
Stars: 11
Watchers: 3
Forks: 1
Open Issues: 1
Requires
- php: >= 7.1.3
- drupol/phposinfo: ^1.6
- symfony/process: ^4.3 || ^4.4 || ^5
Requires (Dev)
- drupol/php-conventions: ^2.0.2
- drupol/phpspec-annotation: ^1.2.0
- drupol/phpspec-requires: ^1.1
- friends-of-phpspec/phpspec-code-coverage: ^4.3.2
- friends-of-phpspec/phpspec-requires: ^1.1
- phpspec/phpspec: ^6.3
- phptaskman/changelog: ^1.0
This package is auto-updated.
Last update: 2024-12-06 08:01:27 UTC
README
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 :-)