Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/webapp/webservice/index.php

    racea570 r9be4f3f  
    1616    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1717*/
    18 
    19 xdebug_start_trace();
    2018
    2119require_once(__DIR__ ."/inc/Config.php");
    … …  
    6563        $lastTime = -1;
    6664        $keys = array_keys($data);
    67         $keyTimeframes = $keys[0];
    68         $itemCount = count($keys);
    69         if($itemCount < 0 ){
     65        if(count($keys) < 0 ){
    7066                error_log("No keys in fetched rrd data from ". $dbFile);
    7167                echo json_encode("");
    7268                exit;
    7369        }
    74         $timeframesCount = count($data[$keyTimeframes]);
    7570        if($debug > 0){
    76                 echo "<p>Variables: ". $itemCount ."; Timeframes: ". $timeframesCount ."</p>\n";
     71                echo "<p>Variables: ". count($keys) ."; Timeframes: ". count($data[$keys[0]]) ."</p>\n";
    7772        }
    78         $keysTimeframes = array_keys($data[$keyTimeframes]);
    79         for($i = 0; $i < $timeframesCount; $i++){
    80                 $time = $keysTimeframes[$i];
     73        for($i = 0; $i < count($data[$keys[0]]); $i++){
     74                $time = array_keys($data[$keys[0]])[$i];
    8175                $allValid = true;
    8276                $tmp = array();
    … …  
    181175}
    182176
    183 xdebug_stop_trace();
    184 
    185177?>
Note: See TracChangeset for help on using the changeset viewer.