src/Provider/LinuxProvider.php
public function getCpuinfoByLsCpu()
    {
        if (!$this->cpuInfoByLsCpu) {
            $lscpu = shell_exec('lscpu');
            $lscpu = explode("\n", $lscpu);
            $values = [];
            foreach ($lscpu as $v) {
                $v = array_map('trim', explode(':', $v));
                if (isset($v[0], $v[1])) {
                    $values[$v[0]] = $v[1];
                }
            }
            $this->cpuInfoByLsCpu = $values;
        }
        return $this->cpuInfoByLsCpu;
    }
public function getCpuinfoByLsCpu()
    {
        if (!$this->cpuInfoByLsCpu) {
            $lscpu = shell_exec('lscpu');
            $lscpu = explode("\n", $lscpu);
            $values = [];
            foreach ($lscpu as $v) {
                $v = array_map('trim', explode(':', $v));
                if (isset($v[0], $v[1])) {
                    $values[$v[0]] = $v[1];
                }
            }
            $this->cpuInfoByLsCpu = $values;
        }
        return $this->cpuInfoByLsCpu;
    }
public function getCpuinfoByLsCpu ( ) { if ( ! $ this -> cpuInfoByLsCpu ) { $ lscpu = shell_exec ( 'lscpu' ) ; $ lscpu = explode ( "\n" , $ lscpu ) ; $ values = [ ] ; foreach ( $ lscpu as $ v ) { $ v = array_map ( 'trim' , explode ( ':' , $ v ) ) ; if ( isset ( $ v [ 0 ] , $ v [ 1 ] ) ) { $ values [ $ v [ 0 ] ] = $ v [ 1 ] ; } } $ this -> cpuInfoByLsCpu = $ values ; } return $ this -> cpuInfoByLsCpu ; }
Get information about CPU using lscpu untility
@return array
Get information about CPU using lscpu untility