2017 © Pedro Peláez
 

library netifaces

image

datasift/netifaces

  • Friday, August 9, 2013
  • by mheap
  • Repository
  • 52 Watchers
  • 0 Stars
  • 15,491 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 4 % Grown

The README.md

Netifaces

Installation

Add the following to your composer.json file, (*1)

{
    "requires": {
        "datasift/netifaces": "*"
    }
}

Usage

We currently support two methods, listAdapters() and getIpAddress()., (*2)

require __DIR__.'/../vendor/autoload.php';

// To get information about our network adapters, we need to know about two things
// 1. The OS that we're on
$os = Datasift\Os::getOs();
// 2. We need a parser for the ifconfig output
$parser = Datasift\IfconfigParser::fromDistributions($os->getPossibleClassNames());

// Next, we create a new netifaces instance, passing in our OS and Parser
$netifaces = new Datasift\netifaces($os, $parser);

// Then we can list the available adapters
var_dump($netifaces->listAdapters());

// Or get the IP address if a specific adapter
var_dump($netifaces->getIpAddress("eth0"));

The Versions

09/08 2013

dev-master

9999999-dev

  Sources   Download

The Requires

 

09/08 2013

dev-develop

dev-develop

  Sources   Download

The Requires

 

09/08 2013