appstract/php-hostsfile

该软件包已被废弃且不再维护。未建议替代软件包。

使用 PHP 读取和写入 HostsFile 条目

1.0.0 2018-01-22 15:02 UTC

This package is auto-updated.

Last update: 2022-06-14 16:52:36 UTC


README

Latest Version on Packagist Total Downloads Software License

使用 PHP 读取和写入 HostsFile 条目。

安装

您可以通过 composer 安装此软件包

composer require appstract/php-hostsfile

用法

$host = new Appstract\HostsFile\Processor($path); // optional path to the file

$host->getLines(); // get all lines in the hostsfile
$host->addLine($ip, $domain, $aliases); // add a new line to the hostsfile
$host->set($ip, $domain, $aliases); // add a new line and overwrite any existing
$host->removeLine($domain); // remove a line from the hostsfile by domain
$host->save(); // save the changes to the hostsfile

贡献

欢迎贡献,感谢各位的贡献 :) 查看贡献者

关于 Appstract

Appstract 是来自荷兰的小团队。我们创建(开源)工具用于网页开发,并在 Medium 上撰写相关主题的文章。您可以在 Twitter 上关注我们,为我们买一杯啤酒,或在 Patreon 上支持我们

许可证

MIT 许可证(MIT)。有关更多信息,请参阅 许可证文件