loophp/launcher

使用默认操作系统应用程序打开文件或资源。

资助包维护!
drupol

2.2.3 2020-11-11 19:21 UTC

This package is auto-updated.

Last update: 2024-09-21 12:51:18 UTC


README

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

操作系统启动器

描述

允许您使用默认操作系统应用程序启动文件或资源。

要求

  • PHP >= 7.1

安装

composer require loophp/launcher

使用方法

<?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');

代码质量、测试和基准

每次向库中引入更改时,Github CI 都会运行测试和基准测试。

该库使用 PHPSpec 编写了测试。您可以在 spec 目录中查看它们。运行 composer phpspec 以触发测试。

在每次提交之前,都会使用 GrumPHP 执行一些检查,运行 ./vendor/bin/grumphp run 以手动检查。

贡献

请随意通过发送 Github pull requests 为此库做出贡献。我反应很快 :-)