droath/hostsfile-manager 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

droath/hostsfile-manager

Composer 安装命令:

composer require droath/hostsfile-manager

包简介

Manage hosts file on nix based systems.

README 文档

README

Build Status

Provides a class to add/remove lines from the hosts file. It has been tested to work on *nix based systems, otherwise you'll need to supply the path to the hosts file.

Getting Started

First, you'll need to download the hostsfile manager library using composer:

composer require droath/hostsfile-manager:^0.0.1

Examples

Add lines to the hosts file contents:

The below code appends two entries to the hosts file contents. If any of those lines already exists then nothing is appended.

<?php

    $hosts_file = (new \Droath\HostsFileManager\HostsFile())
        ->setLine('127.0.0.1', 'local.sickslap.com')
        ->setLine('127.0.0.2', 'local.hiphopsmack.com');

    (new \Droath\HostsFileManager\HostsFileWriter($hosts_file))
        ->add();

Remove a single line from hosts file:

The below code removes the one entry from the hosts file. All other lines within the hosts file remain untouched.

<?php

    $hosts_file = (new \Droath\HostsFileManager\HostsFile())
        ->setLine('127.0.0.2', 'local.hiphopsmack.com');

    (new \Droath\HostsFileManager\HostsFileWriter($hosts_file))
        ->remove();

统计信息

  • 总下载量: 6.43k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-03-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固