public static function lspci($debug = PSI_DEBUG)
    {
        $arrResults = array();
        if (CommonFunctions::executeProgram("lspci", "", $strBuf, $debug)) {
            $arrLines = preg_split("/\n/", $strBuf, -1, PREG_SPLIT_NO_EMPTY);
            foreach ($arrLines as $strLine) {
                $arrParams = preg_split('/ /', trim($strLine), 2);
                if (count($arrParams) == 2)
                   $strName = $arrParams[1];
                else
                   $strName = "unknown";
                $strName = preg_replace('/\(.*\)/', '', $strName);
                $dev = new HWDevice();
                $dev->setName($strName);
                $arrResults[] = $dev;
            }
        }

        return $arrResults;
    }
public static function lspci($debug = PSI_DEBUG)
    {
        $arrResults = array();
        if (CommonFunctions::executeProgram("lspci", "", $strBuf, $debug)) {
            $arrLines = preg_split("/\n/", $strBuf, -1, PREG_SPLIT_NO_EMPTY);
            foreach ($arrLines as $strLine) {
                $arrParams = preg_split('/ /', trim($strLine), 2);
                if (count($arrParams) == 2)
                   $strName = $arrParams[1];
                else
                   $strName = "unknown";
                $strName = preg_replace('/\(.*\)/', '', $strName);
                $dev = new HWDevice();
                $dev->setName($strName);
                $arrResults[] = $dev;
            }
        }

        return $arrResults;
    }
public static function lspci ( $ debug = PSI_DEBUG ) { $ arrResults = array ( ) ; if ( CommonFunctions :: executeProgram ( "lspci" , "" , $ strBuf , $ debug ) ) { $ arrLines = preg_split ( "/\n/" , $ strBuf , - 1 , PREG_SPLIT_NO_EMPTY ) ; foreach ( $ arrLines as $ strLine ) { $ arrParams = preg_split ( '/ /' , trim ( $ strLine ) , 2 ) ; if ( count ( $ arrParams ) == 2 ) $ strName = $ arrParams [ 1 ] ; else $ strName = "unknown" ; $ strName = preg_replace ( '/\(.*\)/' , '' , $ strName ) ; $ dev = new HWDevice ( ) ; $ dev -> setName ( $ strName ) ; $ arrResults [ ] = $ dev ; } } return $ arrResults ; }
parsing the output of lspci command

@param  bool  $debug
@return array
parsing the output of lspci command