appstract / php-hostsfile
Read & Write Entries From the HostsFile with PHP
Installs: 826
Dependents: 1
Suggesters: 0
Security: 0
Stars: 12
Watchers: 5
Forks: 0
Open Issues: 0
pkg:composer/appstract/php-hostsfile
Requires
- php: >=5.5
- illuminate/support: ^5.4
Requires (Dev)
- phpunit/phpunit: ^5.7
README
Read & Write Entries From the HostsFile with PHP.
Installation
You can install the package via composer:
composer require appstract/php-hostsfile
Usage
$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
Contributing
Contributions are welcome, thanks to y'all :)
About Appstract
Appstract is a small team from The Netherlands. We create (open source) tools for webdevelopment and write about related subjects on Medium. You can follow us on Twitter, buy us a beer or support us on Patreon.
License
The MIT License (MIT). Please see License File for more information.