Plugin Directory

Changeset 3250658


Ignore:
Timestamp:
03/04/2025 07:49:17 PM (12 months ago)
Author:
bitslip6
Message:

add check that cpuinfo exists

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bitfire/tags/4.5.0/src/api.php

    r3250646 r3250658  
    17001700   
    17011701    $cpu = 1;
    1702     $raw = file_get_contents('/proc/cpuinfo');
    1703     if (preg_match('/cpu cores\s+:\s+(\d+)/ims', $raw, $tmp)) {
    1704         $cpu = $tmp[1];
     1702    if (file_exists("/proc/cpuinfo") && is_readable("/proc/cpuinfo")) {
     1703        $raw = file_get_contents('/proc/cpuinfo');
     1704        if (preg_match('/cpu cores\s+:\s+(\d+)/ims', $raw, $tmp)) {
     1705            $cpu = $tmp[1];
     1706        }
    17051707    }
    17061708
Note: See TracChangeset for help on using the changeset viewer.