File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ public function getNumberOfCpuCores(): int
1515
1616 // from brianium/paratest
1717 $ cores = 2 ;
18- if (is_file ('/proc/cpuinfo ' )) {
18+ if (@ is_file ('/proc/cpuinfo ' )) {
1919 // Linux (and potentially Windows with linux sub systems)
2020 $ cpuinfo = @file_get_contents ('/proc/cpuinfo ' );
2121 if ($ cpuinfo !== false ) {
@@ -27,7 +27,7 @@ public function getNumberOfCpuCores(): int
2727 if (\DIRECTORY_SEPARATOR === '\\' ) {
2828 // Windows
2929 $ process = @popen ('wmic cpu get NumberOfLogicalProcessors ' , 'rb ' );
30- if ($ process !== false ) {
30+ if (is_resource ( $ process) ) {
3131 fgets ($ process );
3232 $ cores = (int ) fgets ($ process );
3333 pclose ($ process );
@@ -37,7 +37,7 @@ public function getNumberOfCpuCores(): int
3737 }
3838
3939 $ process = @\popen ('sysctl -n hw.ncpu ' , 'rb ' );
40- if ($ process !== false ) {
40+ if (is_resource ( $ process) ) {
4141 // *nix (Linux, BSD and Mac)
4242 $ cores = (int ) fgets ($ process );
4343 pclose ($ process );
You can’t perform that action at this time.
0 commit comments