Skip to content

Commit

Permalink
removed update 0002 as it is now depreciated
Browse files Browse the repository at this point in the history
  • Loading branch information
glynhudson committed Mar 26, 2014
1 parent a0bdca2 commit 2b38bea
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 34 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ Modules/converttotimestore
Modules/mqtt
Modules/packetgen
Modules/openbem
Modules/scheduler
2 changes: 1 addition & 1 deletion Modules/admin/admin_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function admin_controller()

// In future versions we could check against db version number as to what updates should be applied
$updates[] = $update->u0001($applychanges);
$updates[] = $update->u0002($applychanges);
//$updates[] = $update->u0002($applychanges);
$updates[] = $update->u0003($applychanges);
$updates[] = $update->u0004($applychanges);

Expand Down
34 changes: 1 addition & 33 deletions Modules/admin/update_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,39 +58,7 @@ function u0001($apply)

function u0002($apply)
{
require "Modules/input/process_model.php";
$process = new Process(null,null,null);
$process_list = $process->get_process_list();

$operations = array();
$result = $this->mysqli->query("SELECT userid,id,processList,time,record FROM input");
while ($row = $result->fetch_object())
{
if ($row->processList)
{
$pairs = explode(",",$row->processList);
foreach ($pairs as $pair)
{
$inputprocess = explode(":", $pair);
$processid = $inputprocess[0];
$type = $process_list[$processid][1];

if (isset($inputprocess[1]) && $type == 1) { // type 1 = input
$inputid = $inputprocess[1];
$inputexists = $this->mysqli->query("SELECT record FROM input WHERE `id`='$inputid'");
$inputrow = $inputexists->fetch_object();
if (!$inputrow->record) $operations[] = "UPDATE input SET `record`='1' WHERE `id`='$inputid'";
if (!$inputrow->record && $apply) $this->mysqli->query("UPDATE input SET `record`='1' WHERE `id`='$inputid'");
}
}
}
}

return array(
'title'=>"Inputs are only recorded if used",
'description'=>"To improve performance inputs are only recorded if used as part of / x + - by input processes.",
'operations'=>$operations
);
// depreciated
}

function u0003($apply)
Expand Down

0 comments on commit 2b38bea

Please sign in to comment.