protected function detectProcessorNumberByGrep() { if (Utils::findBin('grep') && file_exists('/proc/cpuinfo')) { $process = new Process('grep -c ^processor /proc/cpuinfo 2>/dev/null'); $process->run(); $this->processorNumber = intval($process->getOutput()); return $this->processorNumber; } return null; }
/** * @param string $package */ public static function getPkgConfigPrefix($package) { if (self::findBin('pkg-config')) { $cmd = 'pkg-config --variable=prefix ' . $package; $process = new Process($cmd); $code = $process->run(); if (intval($code) === 0) { $path = trim($process->getOutput()); if (file_exists($path)) { return $path; } } return false; } return false; }
public static function getPkgConfigPrefix($package) { $cmd = 'pkg-config --variable=prefix ' . $package; $process = new Process($cmd); $process->run(); return trim($process->getOutput()); }