Example #1
0
            $arr_subid = array(0, 0, 0, 0, 0, 0);
        }
        foreach ($arr_subid as $subid) {
            $new_id .= $subid;
        }
        if (NULL != self::$configVariables[$new_id]) {
            // delete from DB
            $query = "DELETE FROM `codev_config_table` WHERE config_id = '{$id}'";
            $cols = array("`user_id`", "`project_id`", "`team_id`", "`servicecontract_id`", "`commandset_id`", "`command_id`");
            if ($arr_subid != NULL && is_array($arr_subid)) {
                $i = 0;
                while ($i < count($cols)) {
                    $query .= " AND " . $cols[$i] . "='" . $arr_subid[$i] . "'";
                    $i++;
                }
            }
            $query .= ";";
            $result = SqlWrapper::getInstance()->sql_query($query);
            if (!$result) {
                echo "<span style='color:red'>ERROR: Query FAILED</span>";
                exit;
            }
            // remove from cache
            unset(self::$configVariables[$new_id]);
        } else {
            self::$logger->warn("DELETE variable <{$id}> not found in cache !");
        }
    }
}
Config::staticInit();