public function getNet()
    {

        // Try getting it.
        try {
            $res = $this->exec->exec('ifconfig', '-a');
        } catch (Exception $e) {
            return [];
        }

        // Match up the entries
        if (preg_match_all('/^([^:]+)/m', $res, $net_matches, PREG_SET_ORDER) == 0) {
            return [];
        }

        // Store them here
        $nets = [];

        // Go through each
        foreach ($net_matches as $net) {

            // Save this one
            $nets[$net[1]] = array(
                'state' => '?',
                'type' => '?',
            );
        }

        // Give them
        return $nets;
    }
public function getNet()
    {

        // Try getting it.
        try {
            $res = $this->exec->exec('ifconfig', '-a');
        } catch (Exception $e) {
            return [];
        }

        // Match up the entries
        if (preg_match_all('/^([^:]+)/m', $res, $net_matches, PREG_SET_ORDER) == 0) {
            return [];
        }

        // Store them here
        $nets = [];

        // Go through each
        foreach ($net_matches as $net) {

            // Save this one
            $nets[$net[1]] = array(
                'state' => '?',
                'type' => '?',
            );
        }

        // Give them
        return $nets;
    }
public function getNet ( ) { // Try getting it. try { $ res = $ this -> exec -> exec ( 'ifconfig' , '-a' ) ; } catch ( Exception $ e ) { return [ ] ; } // Match up the entries if ( preg_match_all ( '/^([^:]+)/m' , $ res , $ net_matches , PREG_SET_ORDER ) == 0 ) { return [ ] ; } // Store them here $ nets = [ ] ; // Go through each foreach ( $ net_matches as $ net ) { // Save this one $ nets [ $ net [ 1 ] ] = array ( 'state' => '?' , 'type' => '?' , ) ; } // Give them return $ nets ; }
more than just name of interface
more than just name of interface