PHPackages                             appstract/php-hostsfile - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. appstract/php-hostsfile

AbandonedArchivedLibrary

appstract/php-hostsfile
=======================

Read &amp; Write Entries From the HostsFile with PHP

1.0.0(8y ago)131.0k1MITPHPPHP &gt;=5.5

Since Apr 18Pushed 8y ago4 watchersCompare

[ Source](https://github.com/appstract/php-hostsfile)[ Packagist](https://packagist.org/packages/appstract/php-hostsfile)[ Docs](https://github.com/appstract/php-hostsfile)[ RSS](/packages/appstract-php-hostsfile/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (9)Used By (1)

PHP HostsFile
=============

[](#php-hostsfile)

[![Latest Version on Packagist](https://camo.githubusercontent.com/74f1e519daa30c93b5f9c4010dba19a2435631f1b9b2e76b0a2b0c841d3a8681/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6170707374726163742f7068702d686f73747366696c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/appstract/php-hostsfile)[![Total Downloads](https://camo.githubusercontent.com/672f07767bbbb4c16e9ec9dcdd6c9f7bbf6431b618bf3b55ebfa2d19e482a651/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6170707374726163742f7068702d686f73747366696c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/appstract/php-hostsfile)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

Read &amp; Write Entries From the HostsFile with PHP.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require appstract/php-hostsfile
```

Usage
-----

[](#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
------------

[](#contributing)

Contributions are welcome, [thanks to y'all](https://github.com/appstract/php-hostsfile/graphs/contributors) :)

About Appstract
---------------

[](#about-appstract)

Appstract is a small team from The Netherlands. We create (open source) tools for webdevelopment and write about related subjects on [Medium](https://medium.com/appstract). You can [follow us on Twitter](https://twitter.com/teamappstract), [buy us a beer](https://www.paypal.me/teamappstract/10) or [support us on Patreon](https://www.patreon.com/appstract).

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 92.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~39 days

Recently: every ~65 days

Total

8

Last Release

3038d ago

Major Versions

0.3.0 → 1.0.02018-01-22

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1470623?v=4)[Gijs Jorissen](/maintainers/gizburdt)[@gizburdt](https://github.com/gizburdt)

![](https://avatars.githubusercontent.com/u/377001?v=4)[Ronald Krentz](/maintainers/Rokr)[@rokr](https://github.com/rokr)

![](https://avatars.githubusercontent.com/u/3015449?v=4)[Olav van Schie](/maintainers/ovanschie)[@ovanschie](https://github.com/ovanschie)

![](https://avatars.githubusercontent.com/u/17406280?v=4)[Teun de Kleijne](/maintainers/teuunn)[@teuunn](https://github.com/teuunn)

---

Top Contributors

[![ovanschie](https://avatars.githubusercontent.com/u/3015449?v=4)](https://github.com/ovanschie "ovanschie (26 commits)")[![gizburdt](https://avatars.githubusercontent.com/u/1470623?v=4)](https://github.com/gizburdt "gizburdt (2 commits)")

---

Tags

hostseditorhostsfilephpphpeditorhostsappstracthostsfile

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/appstract-php-hostsfile/health.svg)

```
[![Health](https://phpackages.com/badges/appstract-php-hostsfile/health.svg)](https://phpackages.com/packages/appstract-php-hostsfile)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[froala/wysiwyg-editor-php-sdk

PHP SDK for Froala WYSIWYG Editor

431.5M](/packages/froala-wysiwyg-editor-php-sdk)[sbsaga/toon

🧠 TOON for Laravel — a compact, human-readable, and token-efficient data format for AI prompts &amp; LLM contexts. Perfect for ChatGPT, Gemini, Claude, Mistral, and OpenAI integrations (JSON ⇄ TOON).

6115.6k](/packages/sbsaga-toon)[alexandrainst/php-xlsx-fast-editor

PHP library to make basic but fast read &amp; write operations on existing Excel workbooks

1311.4k](/packages/alexandrainst-php-xlsx-fast-editor)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
