src/RpkUtils/Sysinfo/Server.php
public static function cpuCoreInfo() 
    {
        $cores = array();
        if(false !== ($data = @file('/proc/stat'))){
            foreach($data as $line ) {
                if( preg_match('/^cpu[0-9]/', $line) ){
                    $info = explode(' ', $line);
                    $cores[]=array(
                        'user'      => $info[1],
                        'nice'      => $info[2],
                        'sys'       => $info[3],
                        'idle'      => $info[4],
                        'iowait'    => $info[5],
                        'irq'       => $info[6],
                        'softirq'   => $info[7]
                    );
                }
            }
        }
        
        return $cores;
        
    }
public static function cpuCoreInfo() 
    {
        $cores = array();
        if(false !== ($data = @file('/proc/stat'))){
            foreach($data as $line ) {
                if( preg_match('/^cpu[0-9]/', $line) ){
                    $info = explode(' ', $line);
                    $cores[]=array(
                        'user'      => $info[1],
                        'nice'      => $info[2],
                        'sys'       => $info[3],
                        'idle'      => $info[4],
                        'iowait'    => $info[5],
                        'irq'       => $info[6],
                        'softirq'   => $info[7]
                    );
                }
            }
        }
        
        return $cores;
        
    }
public static function cpuCoreInfo ( ) { $ cores = array ( ) ; if ( false !== ( $ data = @ file ( '/proc/stat' ) ) ) { foreach ( $ data as $ line ) { if ( preg_match ( '/^cpu[0-9]/' , $ line ) ) { $ info = explode ( ' ' , $ line ) ; $ cores [ ] = array ( 'user' => $ info [ 1 ] , 'nice' => $ info [ 2 ] , 'sys' => $ info [ 3 ] , 'idle' => $ info [ 4 ] , 'iowait' => $ info [ 5 ] , 'irq' => $ info [ 6 ] , 'softirq' => $ info [ 7 ] ) ; } } } return $ cores ; }
Server cpu cores information
@return array
Server cpu cores information