PHPackages                             tyurderi/hosts - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tyurderi/hosts

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tyurderi/hosts
==============

A very simple and minimalistic hosts file manager.

0.0.1(7y ago)224MITPHP

Since Jul 20Pushed 7y ago1 watchersCompare

[ Source](https://github.com/tyurderi/php-hosts)[ Packagist](https://packagist.org/packages/tyurderi/hosts)[ RSS](/packages/tyurderi-hosts/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (2)Used By (0)

PHP Hosts Manager
=================

[](#php-hosts-manager)

A very simple and minimalistic hosts file manager.

With this library you can create, edit and delete hosts in your `/etc/hosts` file.

### Documentation

[](#documentation)

See [GitHub Wiki](https://github.com/tyurderi/php-hosts/wiki).

### Requirements

[](#requirements)

- Linux, Windows or macOS
- PHP5.6

### Installation

[](#installation)

```
$ composer require tyurderi/hosts
```

### Basic Usage

[](#basic-usage)

```
require_once __DIR__ . '/vendor/autoload.php';

$editor = new tyurderi\Hosts\Editor();

// Create a new host entry
$host = $editor->push('127.0.0.1', 'example.com');

// Edit an existing host entry
$host = $editor->find('example.com');
echo $host->ip, PHP_EOL;      // => 127.0.0.1
echo $host->hosts, PHP_EOL;   // => example.com
echo $host->ignored, PHP_EOL; // => false
echo $host->empty, PHP_EOL;   // => false

$host->ip = '127.0.0.2';

$host->remove();

$editor->write();
```

License
-------

[](#license)

Copyright (c) 2018 tyurderi
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

2854d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/eb3e7b9f0c65f748fef3a590363e112526a8dcdd805a13098faa9cf6fa14180b?d=identicon)[tyurderi](/maintainers/tyurderi)

### Embed Badge

![Health badge](/badges/tyurderi-hosts/health.svg)

```
[![Health](https://phpackages.com/badges/tyurderi-hosts/health.svg)](https://phpackages.com/packages/tyurderi-hosts)
```

###  Alternatives

[bigbridge/product-import

Fast product import library for Magento 2

124117.0k](/packages/bigbridge-product-import)[aleksip/plugin-data-transform

Data Transform Plugin for Pattern Lab PHP

34897.4k3](/packages/aleksip-plugin-data-transform)[yoast/yoast-seo-for-neos

Yoast SEO for Neos CMS

24164.8k](/packages/yoast-yoast-seo-for-neos)[red-explosion/laravel-sqids

Easily generate Stripe/YouTube looking IDs for your Laravel models.

4530.8k](/packages/red-explosion-laravel-sqids)

PHPackages © 2026

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