From 3b138f421c6302a475c5075eb805dfb8267a2ecb Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Sun, 12 Aug 2018 22:53:42 -0400 Subject: [PATCH 01/24] Fixed issue #1 --- ajax.php | 4229 +++++++++++++++++++++++++++--------------------------- 1 file changed, 2116 insertions(+), 2113 deletions(-) diff --git a/ajax.php b/ajax.php index 5ec8272..10f2419 100644 --- a/ajax.php +++ b/ajax.php @@ -1,2113 +1,2116 @@ -" . update_finding_status() . ""; -} -elseif ($action == 'update_finding_ia_controls') { - print "" . update_finding_ia_controls() . ""; -} -elseif ($action == 'update_finding_notes') { - print "" . update_finding_notes() . ""; -} -elseif ($action == 'update_risk_status') { - print update_risk_status(); -} -elseif ($action == 'update_risk_analysis') { - print update_risk_analysis(); -} -elseif ($action == 'update_control_completion') { - print update_control_completion(); -} -elseif ($action == 'update_stig_control') { - print update_stig_control(); -} -elseif ($action == 'refresh_counts') { - print "" . refresh_counts() . ""; -} -elseif ($action == 'get_control_details') { - if ($_REQUEST['id'] == 'overall') { - print get_STE_details(); - } - else { - print get_control_details(); - } -} -elseif ($action == 'update_STE') { - print update_STE_details(); -} -elseif ($action == 'update_STE_risk') { - $conn->real_query( - "UPDATE `sagacity`.`ste` SET `risk_status`='" . - strtolower($conn->real_escape_string($_REQUEST['status'])) . - "' WHERE `id`=" . $conn->real_escape_string($ste)); -} -elseif ($action == 'get_hosts') { - $cat_id = filter_input(INPUT_POST, 'cat_id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); - if (is_numeric($cat_id)) { - print get_hosts($cat_id); - } - else { - print json_encode(['error' => 'Invalid category ID']); - } -} -elseif ($action == 'new-get-hosts') { - $cat_id = filter_input(INPUT_POST, 'cat-id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); - if (is_numeric($cat_id)) { - print new_get_hosts($cat_id); - } - else { - print json_encode(['error' => 'Invalid category ID']); - } -} -elseif ($action == 'get_target_data') { - print get_target_data($_REQUEST['type']); -} -elseif ($action == 'save_filter') { - print $db->save_Filter($_REQUEST['type'], $_REQUEST['name'], $_REQUEST['criteria']); -} -elseif ($action == 'target-filter') { - print header(JSON) . target_filter($ste, $_REQUEST['criteria']); -} -elseif ($action == 'scan-filter') { - print scan_filter($ste, $_REQUEST['criteria']); -} -elseif ($action == 'finding-filter') { - print finding_filter($ste, $_REQUEST['criteria']); -} -elseif ($action == 'reference-filter') { - print reference_filter($ste, $_REQUEST['criteria']); -} -elseif ($action == 'get-saved-filter') { - print get_saved_filter($_REQUEST['type'], $_REQUEST['name']); -} -elseif ($action == 'update-target-field') { - print update_target_field($_REQUEST['field'], $_REQUEST['data']); -} -elseif ($action == 'get_category_details') { - $cat_id = filter_input(INPUT_POST, 'cat_id', FILTER_VALIDATE_INT); - print header(JSON) . get_category_details($cat_id); -} -elseif ($action == 'add_scans') { - $import = new import(); - $import->scan_Result_Files(false); - - print header(JSON) . json_encode(array( - 'success' => 'Thread running' - )); -} -elseif ($action == 'auto-categorize') { - $db->auto_Catorgize_Targets($ste); - - print header(JSON) . json_encode([ - 'success' => 'Categorized Targets' - ]); -} -elseif ($action == 'delete-cat') { - $cat_id = filter_input(INPUT_POST, 'cat_id', FILTER_VALIDATE_INT); - if ($db->delete_Cat($cat_id)) { - print header(JSON) . json_encode([ - 'success' => 'Successfully deleted category' - ]); - } -} -elseif ($action == 'delete-file') { - $file = TMP . "/" . filter_input(INPUT_POST, 'filename', FILTER_SANITIZE_STRING); - if (file_exists($file)) { - if (unlink($file)) { - print header(JSON) . json_encode([ - 'success' => 'Deleted file' - ]); - } - else { - print header(JSON) . json_encode([ - 'error' => "Failed to delete $file" - ]); - } - } - else { - print header(JSON) . json_encode([ - 'error' => "$file does not exist" - ]); - } -} -elseif ($action == 'get-cat-data') { - $fname = filter_input(INPUT_POST, 'fname', FILTER_SANITIZE_STRING, FILTER_NULL_ON_FAILURE); - $checklist = $db->get_Checklist_By_File($fname); - - if (isset($checklist[0])) { - $checklist[0]->type = ucfirst($checklist[0]->type); - print header(JSON) . json_encode($checklist[0]); - } - else { - print header(JSON) . json_encode(array('error' => 'Error finding checklist')); - } -} -elseif ($action == 'checklist-remove-software') { - $chk_id = filter_input(INPUT_POST, 'chk_id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); - $sw_id = filter_input(INPUT_POST, 'sw_id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); - - $db->help->delete("sagacity.checklist_software_lookup", null, array( - array( - 'field' => 'chk_id', - 'op' => '=', - 'value' => $chk_id - ), - array( - 'field' => 'sw_id', - 'op' => '=', - 'value' => $sw_id, - 'sql_op' => 'AND' - ) - )); - - if ($db->help->execute()) { - print header(JSON) . json_encode(array('success' => 'Relationship deleted')); - } - else { - print header(JSON) . json_encode(array('error' => 'Failed to delete relationship')); - } -} -elseif ($action == 'checklist-add-software') { - $sw_id = filter_input(INPUT_POST, 'sw_id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); - $chk_id = filter_input(INPUT_POST, 'chk_id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); - - $db->help->insert("checklist_software_lookup", array( - 'sw_id' => $sw_id, - 'chk_id' => $chk_id - ), true); - - if (!$db->help->execute()) { - print header(JSON) . json_encode(array('status' => 'Error adding the software to the checklist')); - } - else { - print header(JSON) . json_encode(array('status' => 'Successfully added the software')); - } -} -elseif ($action == 'save-checklist') { - $rel_date = new DateTime(filter_input(INPUT_POST, 'rel-date', FILTER_SANITIZE_STRING)); - - $db->help->update("sagacity.checklist", [ - 'name' => filter_input(INPUT_POST, 'name', FILTER_SANITIZE_STRING), - 'description' => filter_input(INPUT_POST, 'desc', FILTER_SANITIZE_STRING), - 'icon' => filter_input(INPUT_POST, 'icon', FILTER_SANITIZE_STRING), - 'date' => (is_a($rel_date, 'DateTime') ? $rel_date->format(MYSQL_D_FORMAT) : (new DateTime())->format(MYSQL_D_FORMAT)) - ], [ - [ - 'field' => 'id', - 'op' => '=', - 'value' => filter_input(INPUT_POST, 'id', FILTER_VALIDATE_INT) - ] - ]); - - if($db->help->execute()) { - print json_encode(['success' => 'Successfully updated checklist']); - } - else { - print json_encode(['error' => 'Error updating checklist']); - } -} -elseif ($action == 'export-ckl') { - $cat_id = filter_input(INPUT_POST, 'cat', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); - $tgt_id = filter_input(INPUT_POST, 'tgt', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); - $script = null; - - if (!is_numeric($ste)) { - die; - } - - if ($cat_id && is_numeric($cat_id)) { - $script = (defined('PHP_BIN') ? realpath(PHP_BIN) : realpath(PHP)) . - " -c " . realpath(PHP_CONF) . - " -f " . realpath(DOC_ROOT . "/exec/export-ckl.php") . " --" . - " -s=$ste" . - " -c=$cat_id"; - } - elseif ($tgt_id && is_numeric($tgt_id)) { - $script = (defined('PHP_BIN') ? realpath(PHP_BIN) : realpath(PHP)) . - " -c " . realpath(PHP_CONF) . - " -f " . realpath(DOC_ROOT . "/exec/export-ckl.php") . " --" . - " -s=$ste" . - " -t=$tgt_id"; - } - - if (!is_null($script)) { - if (strtolower(substr(PHP_OS, 0, 3)) == "win") { - $shell = new COM("WScript.Shell"); - $shell->CurrentDirectory = DOC_ROOT . "/exec"; - $shell->run($script, 0, false); - } - elseif (strtolower(substr(PHP_OS, 0, 3)) == 'lin') { - exec("cd " . realpath(DOC_ROOT . "/exec") . " && {$script} > /dev/null &"); - } - } -} -elseif ($action == 'delete-host') { - $sel_tgts = json_decode(html_entity_decode(filter_input(INPUT_POST, 'selected_tgts', FILTER_SANITIZE_STRING))); - if (is_array($sel_tgts) && count($sel_tgts)) { - foreach ($sel_tgts as $tgt_id) { - if (!$db->delete_Target($tgt_id)) { - print header(JSON) . json_encode(array('error' => "Failed to delete target ID $tgt_id")); - break; - } - } - } - elseif (is_numeric($sel_tgts)) { - if (!$db->delete_Target($sel_tgts)) { - print header(JSON) . json_encode(array('error' => "Failed to delete target ID $sel_tgts")); - } - } - - print header(JSON) . json_encode(['success' => "Deleted all selected target(s)"]); -} -elseif ($action == 'get-target-notes') { - $tgt_id = filter_input(INPUT_POST, 'tgt-id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); - if (is_numeric($tgt_id) && $tgt_id > 0) { - $db->help->select("target", ['notes'], [ - [ - 'field' => 'id', - 'op' => '=', - 'value' => $tgt_id - ] - ]); - $row = $db->help->execute(); - if (is_array($row) && count($row) && isset($row['notes'])) { - print header(JSON) . json_encode(['notes' => $row['notes']]); - } - } -} -elseif ($action == 'save-target-notes') { - $tgt_id = filter_input(INPUT_POST, 'tgt-id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); - $notes = filter_input(INPUT_POST, 'notes', FILTER_SANITIZE_STRING, FILTER_NULL_ON_FAILURE); - if (is_numeric($tgt_id) && $tgt_id > 0) { - $db->help->update("target", [ - 'notes' => htmlentities($notes) - ], [ - [ - 'field' => 'id', - 'op' => '=', - 'value' => $tgt_id - ] - ]); - if ($db->help->execute()) { - print header(JSON) . json_encode(['success' => 'Updated target notes']); - } - else { - print header(JSON) . json_encode(['error' => $db->help->c->error]); - } - } -} -elseif ($action == 'get-load-status') { - $set = $db->get_Settings([ - 'cpe-count', 'cpe-dl-progress', 'cpe-progress', - 'cve-count', 'cve-dl-progress', 'cve-progress', - 'nvd-cve-count', 'nvd-cve-dl-progress', 'nvd-cve-progress', 'nvd-year', - 'stig-count', 'stig-dl-progress', 'stig-progress', - 'nasl-count', 'nasl-dl-progress', 'nasl-progress' - ]); - print json_encode($set); -} -elseif ($action == 'delete-scan') { - $scan_id = filter_input(INPUT_POST, 'scan-id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); - $del_tgts = (bool) filter_input(INPUT_POST, 'delete-targets', FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); - if ($scan_id) { - if ($db->delete_Scan($ste, $scan_id, $del_tgts)) { - print json_encode(['success' => 'Deleted Scan']); - } - else { - print json_encode(['error' => 'Error deleting scan']); - } - } -} - -function update_tgt_notes() -{ - global $db; - $notes = str_replace(" ", "", filter_input(INPUT_POST, 'notes', FILTER_SANITIZE_STRING)); - $tgt = filter_input(INPUT_POST, 'tgt', FILTER_VALIDATE_INT); - - $db->help->update("sagacity.target", array( - 'notes' => $notes - ), array( - array( - 'field' => 'id', - 'op' => '=', - 'value' => $tgt - ) - )); - - if (!$db->help->execute()) { - return "failure"; - } - else { - return "success"; - } -} - -function chk_filter() -{ - global $db; - $tgt_id = filter_input(INPUT_POST, 'tgt_id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); - $filter = filter_input(INPUT_POST, 'filter', FILTER_SANITIZE_STRING, FILTER_NULL_ON_FAILURE); - $hide_old = (boolean) filter_input(INPUT_POST, 'hide_old', FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); - - $ret = array(); - $db->help->create_table("c", true, $db->help->select("sagacity.checklist", null, array(), array( - 'order' => '`ver` DESC, CONVERT(`release`, DECIMAL(4,2)) DESC' - ))); - if (!$db->help->execute()) { - return $ret; - } - $where = array(); - $flags = array(); - - if (!empty($filter)) { - $where = array( - array( - 'field' => 'c.name', - 'op' => LIKE, - 'value' => "'%{$filter}%'" - ) - ); - } - - if (!empty($tgt_id)) { - $where[] = array( - 'field' => 'tc.chk_id', - 'op' => IS, - 'value' => null, - 'sql_op' => 'AND' - ); - $flags['table_joins'] = array( - "LEFT JOIN sagacity.target_checklist tc ON tc.chk_id = c.id AND tc.tgt_id = $tgt_id" - ); - $flags['order'] = 'c.name'; - } - if ($hide_old) { - $flags['group'] = 'c.name, c.type, c.id'; - } - - $db->help->select("c", array('c.id'), $where, $flags); - - $rows = $db->help->execute(); - if (is_array($rows) && count($rows) && isset($rows['id'])) { - $rows = array(0 => $rows); - } - - if (is_array($rows) && count($rows) && isset($rows[0])) { - foreach ($rows as $row) { - $chk = $db->get_Checklist($row['id']); - if (is_array($chk) && count($chk) && isset($chk[0]) && is_a($chk[0], 'checklist')) { - $ret[] = $chk[0]; - } - } - } - - return json_encode($ret); -} - -function sw_filter($is_os = false) -{ - global $db; - $ret = []; - $filter = "'%" . filter_input(INPUT_POST, 'filter', FILTER_SANITIZE_STRING, FILTER_NULL_ON_FAILURE) . "%'"; - $tgt_id = filter_input(INPUT_POST, 'tgt_id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); - - $db->help->select("sagacity.software s", ['s.id', 's.cpe', 's.sw_string'], [ - [ - 'field' => 's.cpe', - 'op' => LIKE, - 'value' => $filter, - 'open-paren' => true - ], - [ - 'field' => 's.sw_string', - 'op' => LIKE, - 'value' => $filter, - 'sql_op' => 'OR' - ], - [ - 'field' => 's.short_sw_string', - 'op' => LIKE, - 'value' => $filter, - 'sql_op' => 'OR', - 'close-paren' => true - ], - [ - 'field' => 'ts.sft_id', - 'op' => IS, - 'value' => null, - 'sql_op' => 'AND' - ], - [ - 'field' => 's.cpe', - 'op' => LIKE, - 'value' => ($is_os ? "'%/o%'" : "'%/a%'"), - 'sql_op' => 'AND' - ] - ], [ - 'table_joins' => [ - "LEFT JOIN `sagacity`.`target_software` ts ON ts.`sft_id` = s.`id`" . ($tgt_id ? " AND ts.`tgt_id` = $tgt_id" : "") - ], - 'order' => 's.cpe', - 'limit' => 25 - ]); - - $sw = $db->help->execute(); - - if (is_array($sw) && count($sw) && isset($sw['id'])) { - $sw = [0 => $sw]; - } - - if (is_array($sw) && count($sw) && isset($sw[0])) { - foreach ($sw as $row) { - $ret[] = [ - 'sw_id' => $row['id'], - 'cpe' => $row['cpe'], - 'sw_string' => $row['sw_string'] - ]; - } - } - - return header(JSON) . json_encode($ret); -} - -function update_proc_status() -{ - global $conn, $ste; - $control_id = str_replace("_", "-", substr(param('control'), 0, -7)); - if (preg_match("/[A-Z]{4}\-\d\-\d/", $control_id)) { - $proc_id = $control_id; - $sql = "SELECT `ctrl_id` " . - "FROM `sagacity`.`proc_findings` " . - "WHERE " . - "`ste_id`=" . $conn->real_escape_string($ste) . " AND " . - "`proc_id`='" . $conn->real_escape_string($control_id) . "'"; - if ($res = $conn->query($sql)) { - if ($res->num_rows) { - $row = $res->fetch_array(MYSQLI_ASSOC); - - $sql = "UPDATE `sagacity`.`proc_findings` " . - "SET `status`='" . $conn->real_escape_string($_REQUEST['status']) . " " . - "WHERE `ste_id`=" . $conn->real_escape_string($ste) . " AND " . - "`proc_id`='" . $conn->real_escape_string($row['ctrl_id']) . "'"; - } - else { - $sql = "INSERT INTO `sagacity`.`proc_findings` (`ste_id`,`ctrl_id`,`proc_id`,`status`) VALUES (" . - $_REQUEST['ste'] . "," . - "'" . $conn->real_escape_string(substr($proc_id, 0, 6)) . "'" . - "'" . $conn->real_escape_string($proc_id) . "'" . - "'" . $conn->real_escape_string($_REQUEST['status']) . "')"; - } - - if (!$conn->real_query($sql)) { - error_log($conn->error); - Sagacity_Error::sql_handler($sql); - } - } - } - else { - $sql = "SELECT `sub_control_id` FROM `sagacity`.`proc_ia_sub_controls` WHERE `parent_control_id`=?"; - - $sub_ctrls = db_helper::selectrow_array($conn, db_helper::mysql_escape_string($conn, $sql, $control_id)); - - foreach ($sub_ctrl as $proc_id) { - $sql = "SELECT COUNT(1) FROM `sagacity`.`proc_findings` WHERE `ste_id`=? AND `proc_id`=?"; - $sql = db_helper::mysql_escape_string($conn, $sql, $_REQUEST['ste'], $proc_id); - list($cnt) = db_helper::selectrow_array($conn, $sql); - if ($cnt) { - db_helper::run($conn, "UPDATE `sagacity`.`proc_findings` SET `status`=? WHERE `ste_id`=? AND `proc_id`=?", $_REQUEST['status'], $_REQUEST['ste'], $proc_id); - } - else { - db_helper::run($conn, "INSERT INTO `sagacity`.`proc_findings` (`ste_id`,`ctrl_id`,`proc_id`,`status`) VALUES (?,?,?,?)", $_REQUEST['ste'], $control_id, $proc_id, $_REQUEST['status']); - } - } - } -} - -function update_proc_notes() -{ - $control_id = $field = $_REQUEST['control']; - $match = array(); - if (preg_match("/([A-Z]{4}\_\d\_\d)/", $control_id, $match)) { - $control_id = str_replace("_", "-", $match[1]); - - $sql = "SELECT COUNT(1) FROM `sagacity`.`proc_findings` WHERE `ste_id`=? AND `proc_id`=?"; - - switch ($field) { - case (preg_match("/_test_result/", $field) ? true : false): - $field = "`test_results`"; - break; - case (preg_match("/_mit/", $field) ? true : false): - $field = "`mitigations`"; - break; - case (preg_match("/_milestone/", $field) ? true : false): - $field = "`milestones`"; - break; - case (preg_match("/_ref/", $field) ? true : false): - $field = "`ref`"; - break; - case (preg_match("/_notes/", $field) ? true : false): - $field = "`notes`"; - break; - default: - $field = ""; - } - - list($cnt) = db_helper::selectrow_array($conn, $sql, $_REQUEST['ste'], $control_id); - if ($cnt) { - $sql = "UPDATE `sagacity`.`proc_findings` SET=? WHERE `ste_id`=? AND `proc_id`=?"; - - db_helper::run($conn, $sql, $_REQUEST['notes'], $_REQUEST['ste'], $control_id); - } - else { - $sql = "INSERT INTO `sagacity`.`proc_findings` (`ste_id`,`ctrl_id`,`proc_id`,`status`,$field) VALUES (?,?,?,?,?)"; - - db_helper::run($conn, $sql, $_REQUEST['ste'], substr($control_id, 0, 6), $control_id, "Not Reviewed", $_REQUEST['notes']); - } - } - elseif (preg_match("/([A-Z]{4}\_\d)/", $control_id, $match)) { - $control_id = str_replace("_", "-", $match[1]); - - $sql = "SELECT COUNT(1) FROM `sagacity`.`control_findings` WHERE `ste_id`=? AND `control_id`=?"; - list($cnt) = db_helper::selectrow_array($conn, $sql, $_REQUEST['ste'], $control_id); - - switch ($field) { - case (preg_match("/_vul_desc/", $field) ? true : false): - $field = "`vul_desc`"; - break; - case (preg_match("/_mit/", $field) ? true : false): - $field = "`mitigations`"; - break; - case (preg_match("/_ref/", $field) ? true : false): - $field = "`ref`"; - break; - case (preg_match("/_notes/", $field) ? true : false): - $field = "`notes`"; - break; - default: - $field = ""; - } - - if ($cnt) { - $sql = "UPDATE `sagacity`.`control_findings` SET $field=? WHERE `ste_id`=? AND `control_id`=?"; - - db_helper::run($conn, $sql, $_REQUEST['notes'], $_REQUEST['ste'], $control_id); - } - else { - $sql = "INSERT INTO `sagacity`.`control_findings` (`control_id`,`ste_id`,$field,`risk_status`) " . - "VALUES (?,?,?,(SELECT LOWER(`impact`) FROM `sagacity`.`proc_ia_controls` WHERE `control_id`=?))"; - - db_helper::run($conn, $sql, $control_id, $_REQUEST['ste'], $_REQUEST['notes'], $control_id); - } - } - - return true; -} - -function refresh_counts() -{ - $ret = ''; - $sql = "SELECT `id`,`name` FROM `ste_cat` WHERE `ste_id`=?"; - - $cats = db_helper::selectrow_array($conn, $sql, $_REQUEST['ste_id']); - - foreach ($cats as $key => $cat) { - $sql2 = "SELECT (SELECT COUNT(1) " . - "FROM `sagacity`.`target` t " . - "LEFT JOIN `target_checklist` tc ON t.`id`=tc.`tgt_id` " . - "LEFT JOIN `pdi_checklist_lookup` pcl ON pcl.`checklist_id`=tc.`chk_id` " . - "LEFT JOIN `findings` f ON f.`pdi_id`=pcl.`pdi_id` AND t.`id` = f.`tgt_id` " . - "LEFT JOIN `findings_status` fs ON fs.`id`=f.`findings_status_id` " . - "WHERE t.`cat_id`=? AND " . - "fs.`status`='Open' AND " . - "f.`cat`=?) + " . - "(SELECT COUNT(1) AS 'total' " . - "FROM `checklist` c " . - "LEFT JOIN `pdi_checklist_lookup` pcl ON pcl.`checklist_id`=c.`id` " . - "LEFT JOIN `findings` f ON f.`pdi_id`=pcl.`pdi_id` " . - "LEFT JOIN `findings_status` fs ON f.`findings_status_id`=fs.`id` " . - "JOIN `target` t ON t.`id`=f.`tgt_id` " . - "WHERE t.`cat_id`=? AND " . - "c.`name`='Orphan' AND " . - "fs.`status`='Open' AND " . - "f.`cat`=?) AS 'sum_total'"; - - list($open_cat_1) = db_helper::selectrow_array($conn, $sql2, $row['id'], '1', $row['id'], '1'); - list($open_cat_2) = db_helper::selectrow_array($conn, $sql2, $row['id'], '2', $row['id'], '2'); - list($open_cat_3) = db_helper::selectrow_array($conn, $sql2, $row['id'], '3', $row['id'], '3'); - - $sql2 = "SELECT (SELECT COUNT(1) " . - "FROM `target` t " . - "LEFT JOIN `target_checklist` tc ON t.`id`=tc.`tgt_id` " . - "LEFT JOIN `pdi_checklist_lookup` pcl ON pcl.`checklist_id`=tc.`chk_id` " . - "LEFT JOIN `findings` f ON f.`pdi_id`=pcl.`pdi_id` AND t.`id` = f.`tgt_id` " . - "LEFT JOIN `findings_status` fs ON fs.`id`=f.`findings_status_id` " . - "WHERE t.`cat_id`=? AND " . - "(fs.`status`='Not Reviewed' OR fs.`status` IS NULL)) + " . - "(SELECT COUNT(1) AS 'total' " . - "FROM `checklist` c " . - "LEFT JOIN `pdi_checklist_lookup` pcl ON pcl.`checklist_id`=c.`id` " . - "LEFT JOIN `findings` f ON f.`pdi_id`=pcl.`pdi_id` " . - "LEFT JOIN `findings_status` fs ON f.`findings_status_id`=fs.`id` " . - "JOIN `target` t ON t.`id`=f.`tgt_id` " . - "WHERE t.`cat_id`=? AND " . - "c.`name`='Orphan' AND " . - "(fs.`status`='Not Reviewed' OR fs.`status` IS NULL)) AS 'sum_total'"; - - list($not_reviewed) = db_helper::selectrow_array($conn, $sql2, $row['id'], $row['id']); - - $sql2 = "SELECT (SELECT COUNT(1) " . - "FROM `target` t " . - "LEFT JOIN `target_checklist` tc ON t.`id`=tc.`tgt_id` " . - "LEFT JOIN `pdi_checklist_lookup` pcl ON pcl.`checklist_id`=tc.`chk_id` " . - "LEFT JOIN `findings` f ON f.`pdi_id`=pcl.`pdi_id` AND t.`id` = f.`tgt_id` " . - "LEFT JOIN `findings_status` fs ON fs.`id`=f.`findings_status_id` " . - "WHERE t.`cat_id`=? AND " . - "fs.`status`='Exception') + " . - "(SELECT COUNT(1) AS 'total' " . - "FROM `checklist` c " . - "LEFT JOIN `pdi_checklist_lookup` pcl ON pcl.`checklist_id`=c.`id` " . - "LEFT JOIN `findings` f ON f.`pdi_id`=pcl.`pdi_id` " . - "LEFT JOIN `findings_status` fs ON f.`findings_status_id`=fs.`id` " . - "JOIN `target` t ON t.`id`=f.`tgt_id` " . - "WHERE t.`cat_id`=? AND " . - "c.`name`='Orphan' AND " . - "fs.`status`='Exception') AS 'sum_total'"; - - list($exception) = db_helper::selectrow_array($conn, $sql2, $row['id'], $row['id']); - - $sql2 = "SELECT (SELECT COUNT(1) " . - "FROM `target` t " . - "LEFT JOIN `target_checklist` tc ON t.`id`=tc.`tgt_id` " . - "LEFT JOIN `pdi_checklist_lookup` pcl ON pcl.`checklist_id`=tc.`chk_id` " . - "LEFT JOIN `findings` f ON f.`pdi_id`=pcl.`pdi_id` AND t.`id` = f.`tgt_id` " . - "LEFT JOIN `findings_status` fs ON fs.`id`=f.`findings_status_id` " . - "WHERE t.`cat_id`=? AND " . - "fs.`status`='False Positive') + " . - "(SELECT COUNT(1) AS 'total' " . - "FROM `checklist` c " . - "LEFT JOIN `pdi_checklist_lookup` pcl ON pcl.`checklist_id`=c.`id` " . - "LEFT JOIN `findings` f ON f.`pdi_id`=pcl.`pdi_id` " . - "LEFT JOIN `findings_status` fs ON f.`findings_status_id`=fs.`id` " . - "JOIN `target` t ON t.`id`=f.`tgt_id` " . - "WHERE t.`cat_id`=? AND " . - "c.`name`='Orphan' AND " . - "fs.`status`='False Positive') AS 'sum_total'"; - - list($false_positive) = db_helper::selectrow_array($conn, $sql2, $row['id'], $row['id']); - - $row['name'] = str_replace(array(".", "-", " "), "", $row['name']); - - $ret .= ""; - } - - return $ret; -} - -function update_finding_status() -{ - global $conn; - $sql = "UPDATE `findings` SET " . - "`findings_status_id`=? " . - "WHERE " . - "`tgt_id`=? AND `pdi_id`=?"; - - db_helper::run($conn, $sql, $_REQUEST['status'], $_REQUEST['host_id'], $_REQUEST['pdi_id']); - - return true; -} - -function update_finding_ia_controls() -{ - $controls = explode(" ", $_REQUEST['ia_controls']); - $host_ids = explode(",", $_REQUEST['host_id']); - - return true; -} - -function update_finding_notes() -{ - global $conn; - $host_ids = explode(",", $_REQUEST['host_id']); - - $sql = "UPDATE `sagacity`.`findings` SET " . - "`notes`=? " . - "WHERE " . - "`tgt_id` IN (" . implode(",", $host_ids) . ") AND `pdi_id`=?"; - - db_helper::run($conn, $sql, $_REQUEST['notes'], $_REQUEST['pdi_id']); - - return true; -} - -/** - * Function to update the result script parsing status - * - * @global db $db - * @global int $ste - * - * @return array - */ -function update_script_status() -{ - global $db, $ste; - $ret = []; - - $type = filter_input(INPUT_POST, 'type', FILTER_SANITIZE_STRING, FILTER_NULL_ON_FAILURE); - $status = filter_input(INPUT_POST, 'status', FILTER_SANITIZE_STRING, FILTER_NULL_ON_FAILURE); - - if (!empty($type) && !empty($status)) { - $scans = $db->get_ScanData($ste, null, $status, $type); - } - elseif (!empty($type)) { - $scans = $db->get_ScanData($ste, null, null, $type); - } - elseif (!empty($status)) { - $scans = $db->get_ScanData($ste, null, $status); - } - else { - $scans = $db->get_ScanData($ste); - } - - foreach ($scans as $scan) { - $file_name = str_replace(["(", ")"], "", str_replace(" ", "_", $scan->get_File_Name())); - $diff = $scan->get_Last_Update()->diff($scan->get_Start_Time()); - - $ret[] = [ - "scan_id" => $scan->get_ID(), - "file_name" => $scan->get_File_Name(), - "id" => $file_name, - "file_date" => $scan->get_File_DateTime()->format("Y-m-d"), - "pid" => $scan->get_PID(), - "source" => $scan->get_Source()->get_Name(), - 'source_img' => $scan->get_Source()->get_Icon(), - "status" => $scan->get_Status(), - "perc_comp" => $scan->get_Percentage_Complete(), - "last_host" => $scan->get_Last_Host(), - "start_time" => $scan->get_Start_Time()->format("Y-m-d H:i:s"), - "update" => $scan->get_Last_Update()->format("Y-m-d H:i:s"), - "host_count" => $scan->get_Total_Host_Count(), - "error" => $scan->isScanError(), - "run_time" => $diff->format("%H:%I:%S") - ]; - } - - return json_encode(['success' => 1, 'results' => $ret]); -} - -/** - * - * @global mysqli $conn - * @global db $db - */ -function get_STE_details() -{ - global $conn, $db; - $ret = ''; - $open_high = $open_med = $open_low = $proc_na = $proc_c = $proc_total = $open_cat_1 = $open_cat_2 = $open_cat_3 = $tech_na = $tech_nf = $tech_total = 0; - - list($tech_total) = db_helper::selectrow_array($conn, "SELECT COUNT(1) FROM `sagacity`.`findings` f JOIN `sagacity`.`target` t ON t.`id`=f.`tgt_id` WHERE t.`ste_id`=?", $_REQUEST['ste_id']); - list($proc_total) = db_helper::selectrow_array($conn, "SELECT COUNT(1) FROM `sagacity`.`proc_findings` WHERE `ste_id`=?", $_REQUEST['ste_id']); - - $sql = "SELECT COUNT(1) " . - "FROM `sagacity`.`proc_findings` pf " . - "JOIN `sagacity`.`control_findings` cf ON pf.`ctrl_id`=cf.`control_id` " . - "WHERE pf.`ste_id`=? " . - "AND pf.`status`=? " . - "AND cf.`risk_status`=? " - ; - - list($open_high) = db_helper::selectrow_array($conn, $sql, $_REQUEST['ste_id'], 'Non-Compliant', 'high'); - list($open_med) = db_helper::selectrow_array($conn, $sql, $_REQUEST['ste_id'], 'Non-Compliant', 'medium'); - list($open_low) = db_helper::selectrow_array($conn, $sql, $_REQUEST['ste_id'], 'Non-Compliant', 'low'); - - $sql = "SELECT COUNT(1) " . - "FROM `sagacity`.`proc_findings` pf " . - "JOIN `sagacity`.`control_findings` cf ON pf.`ctrl_id`=cf.`control_id` " . - "WHERE pf.`ste_id`=? " . - "AND pf.`status`=? " - ; - - list($proc_na) = db_helper::selectrow_array($conn, $sql, $_REQUEST['ste_id'], 'Not Applicable'); - list($proc_c) = db_helper::selectrow_array($conn, $sql, $_REQUEST['ste_id'], 'Compliant'); - - $sql = "SELECT `ste`.`deviations`,`ste`.`recommendations`,`ste`.`residual_risk`," . - "`ste`.`conclusion`,`ste`.`risk_status`,sys.`mitigations`,sys.`executive_summary` " . - "FROM `sagacity`.`ste`,`sagacity`.`system` sys " . - "WHERE `ste`.`system_id`=sys.`id` AND " . - "`ste`.`id`=?"; - - list($dev, $rec, $res, $con, $status, $mit, $exec) = db_helper::selectrow_array($conn, $sql, $_REQUEST['ste_id']); - - $sql = "SELECT `id`,`name` FROM `sagacity`.`ste_cat` WHERE `ste_id`=?"; - - $cats = $db->get_STE_Cat_List($_REQUEST['ste_id']); - - foreach ($cats as $cat) { - $sql2 = "SELECT (SELECT COUNT(1) " . - "FROM `sagacity`.`target` t " . - "LEFT JOIN `sagacity`.`target_checklist` tc ON t.`id`=tc.`tgt_id` " . - "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=tc.`chk_id` " . - "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` AND t.`id` = f.`tgt_id` " . - "LEFT JOIN `sagacity`.`findings_status` fs ON fs.`id`=f.`findings_status_id` " . - "WHERE t.`cat_id`=? AND " . - "(fs.`status`='Open' OR fs.`status`='Exception') AND " . - "f.`cat`=?) + " . - "(SELECT COUNT(1) AS 'total' " . - "FROM `sagacity`.`checklist` c " . - "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=c.`id` " . - "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` " . - "LEFT JOIN `sagacity`.`findings_status` fs ON f.`findings_status_id`=fs.`id` " . - "JOIN `sagacity`.`target` t ON t.`id`=f.`tgt_id` " . - "WHERE t.`cat_id`=? AND " . - "c.`name`='Orphan' AND " . - "(fs.`status`='Open' OR fs.`status`='Exception') AND " . - "f.`cat`=?) AS 'sum_total'"; - - list($tmp) = db_helper::selectrow_array($conn, $sql2, $cat->get_ID(), '1', $cat->get_ID(), '1'); - $open_cat_1 += $tmp; - list($tmp) = db_helper::selectrow_array($conn, $sql2, $cat->get_ID(), '2', $cat->get_ID(), '2'); - $open_cat_2 += $tmp; - list($tmp) = db_helper::selectrow_array($conn, $sql2, $cat->get_ID(), '3', $cat->get_ID(), '3'); - $open_cat_3 += $tmp; - - $sql2 = "SELECT (SELECT COUNT(1) " . - "FROM `sagacity`.`target` t " . - "LEFT JOIN `sagacity`.`target_checklist` tc ON t.`id`=tc.`tgt_id` " . - "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=tc.`chk_id` " . - "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` AND t.`id` = f.`tgt_id` " . - "LEFT JOIN `sagacity`.`findings_status` fs ON fs.`id`=f.`findings_status_id` " . - "WHERE t.`cat_id`=? AND " . - "fs.`status`='Not Applicable') + " . - "(SELECT COUNT(1) AS 'total' " . - "FROM `sagacity`.`checklist` c " . - "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=c.`id` " . - "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` " . - "LEFT JOIN `sagacity`.`findings_status` fs ON f.`findings_status_id`=fs.`id` " . - "JOIN `sagacity`.`target` t ON t.`id`=f.`tgt_id` " . - "WHERE t.`cat_id`=? AND " . - "c.`name`='Orphan' AND " . - "fs.`status`='Not Applicable') AS 'sum_total'"; - - list($tmp) = db_helper::selectrow_array($conn, $sql2, $cat->get_ID(), $cat->get_ID()); - $tech_na += $tmp; - - $sql2 = "SELECT (SELECT COUNT(1) " . - "FROM `sagacity`.`target` t " . - "LEFT JOIN `sagacity`.`target_checklist` tc ON t.`id`=tc.`tgt_id` " . - "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=tc.`chk_id` " . - "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` AND t.`id` = f.`tgt_id` " . - "LEFT JOIN `sagacity`.`findings_status` fs ON fs.`id`=f.`findings_status_id` " . - "WHERE t.`cat_id`=? AND " . - "fs.`status`='Not a Finding') + " . - "(SELECT COUNT(1) AS 'total' " . - "FROM `sagacity`.`checklist` c " . - "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=c.`id` " . - "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` " . - "LEFT JOIN `sagacity`.`findings_status` fs ON f.`findings_status_id`=fs.`id` " . - "JOIN `sagacity`.`target` t ON t.`id`=f.`tgt_id` " . - "WHERE t.`cat_id`=? AND " . - "c.`name`='Orphan' AND " . - "fs.`status`='Not a Finding') AS 'sum_total'"; - - list($tmp) = db_helper::selectrow_array($conn, $sql2, $cat->get_ID(), $cat->get_ID()); - $tech_nf += $tmp; - } - -#'overall_mitigations,deviations,recommendations,residual_risk,conclusion,executive_summary' - $ret .= "
" . - "

Overall Mitigations

" . - "" . - "

Deviations

" . - "" . - "

Recommendations

" . - "" . - "Residual Risk Analysis  " . - "
" . - "" . - "

Conclusion

" . - "" . - "

Executive Summary

" . - "" . - "
" . - "
" . - "

Procedural ($proc_total)

" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "
HMLNAC
$open_high$open_med$open_low$proc_na$proc_c
" . sprintf("%i%%", ($open_high / $proc_total) * 100) . "" . sprintf("%i%%", ($open_med / $proc_total) * 100) . "" . sprintf("%i%%", ($open_low / $proc_total) * 100) . "" . sprintf("%i%%", ($proc_na / $proc_total) * 100) . "" . sprintf("%i%%", ($proc_c / $proc_total) * 100) . "
" . - "

Technical ($tech_total)

" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "
IIIIIINANF
$open_cat_1$open_cat_2$open_cat_3$tech_na$tech_nf
" . sprintf("%i%%", ($open_cat_1 / $tech_total) * 100) . "" . sprintf("%i%%", ($open_cat_2 / $tech_total) * 100) . "" . sprintf("%i%%", ($open_cat_3 / $tech_total) * 100) . "" . sprintf("%i%%", ($tech_na / $tech_total) * 100) . "" . sprintf("%i%%", ($tech_nf / $tech_total) * 100) . "
" . - "
"; -} - -function update_STE_details() -{ - global $conn; - if ($_REQUEST['id'] == 'deviations') { - $sql = "UPDATE `sagacity`.`ste` SET `deviations`=? WHERE `id`=?"; - } - elseif ($_REQUEST['id'] == 'recommendations') { - $sql = "UPDATE `sagacity`.`ste` SET `recommendations`=? WHERE `id`=?"; - } - elseif ($_REQUEST['id'] == 'residual_risk') { - $sql = "UPDATE `sagacity`.`ste` SET `residual_risk`=? WHERE `id`=?"; - } - elseif ($_REQUEST['id'] == 'conclusion') { - $sql = "UPDATE `sagacity`.`ste` SET `conclusion`=? WHERE `id`=?"; - } - elseif ($_REQUEST['id'] == 'overall_mitigations') { - $sql = "UPDATE `sagacity`.`system` JOIN `sagacity`.`ste` ON `ste`.`system_id`=`system`.`id` SET `mitigations`=? WHERE `ste`.`id`=?"; - } - elseif ($_REQUEST['id'] == 'executive_summary') { - $sql = "UPDATE `sagacity`.`system` JOIN `sagacity`.`ste` ON `ste`.`system_id`=`system`.`id` SET `executive_summary`=? WHERE `ste`.`id`=?"; - } - - db_helper::run($conn, $sql, $_REQUEST['text'], $_REQUEST['ste_id']); -} - -function get_control_details() -{ - global $conn, $db; - $ret = ''; - - $sql = "SELECT " . - "pc.`control_id`,pc.`name`,pc.`description`,pc.`impact`," . - "cf.`vul_desc`,cf.`mitigations`,cf.`risk_analysis`,cf.`risk_status`,cf.`done` " . - "FROM `sagacity`.`proc_ia_controls` pc " . - "LEFT JOIN `sagacity`.`control_findings` cf ON cf.`control_id`=pc.`control_id` " . - "WHERE pc.`control_id`=? AND cf.`ste_id`=?"; - - $ste = $db->get_STE($_REQUEST['ste'])[0]; - - $controls = $db->get_Proc_IA_Controls($ste, $_REQUEST['id'])[0]; - - $risk_analysis = $controls->finding->risk_analysis; - $ctrl_id = $controls->get_Control_ID(); - $impact = $controls->get_Impact(); - - $ret .= "
" . - $controls->get_Control_ID() . " - " . $controls->get_Name() . - "" . - "" . - " " . - "finding->done ? " checked" : "") . " id='done' value='1' onclick='javascript:toggle_control_completion();' />" . - "" . - "" . - ucfirst($controls->get_Worst_Status_String()) . - "" . - "" . - "
" . - "
" . $controls->get_Description() . "
" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" - ; - - $sql = "SELECT " . - "psc.`sub_control_id`,psc.`name`,pf.`test_results`,pf.`mitigations`,pf.`status` " . - "FROM `sagacity`.`proc_ia_sub_controls` psc " . - "LEFT JOIN `sagacity`.`proc_findings` pf ON psc.`sub_control_id`=pf.`proc_id` " . - "WHERE pf.`ste_id`=? AND " . - "psc.`parent_control_id`=? AND " . - "(pf.`status`='Non-Compliant' OR pf.`status`='Not Applicable')" - ; - - if ($res = $conn->query($sql)) { - while ($row = $res->fetch_array(MYSQLI_ASSOC)) { - $status = str_replace(" ", "_", $row['status']); - $ret .= "" . - "" . - "" . - "" . - "" - ; - } - } - - $ret .= "
Procedure /
Validation Step
FindingsMitigations
" . $controls->get_Control_ID() . "
" . $controls->get_Name() . "
" . $controls->finding->vul_desc . "" . $controls->finding->mitigations . "
" . $row['sub_control_id'] . "  " . $row['status'] . "
" . $row['name'] . "
" . $row['test_results'] . "" . $row['mitigations'] . "
" . - "
" . - "" . $controls->get_Control_ID() . " - Risk Analysis  " . - "" . - "" . - "" . - "
" . - "
" . - "$ctrl_id - Technical Findings" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - ""; - - $cat_1 = $db->get_Control_Finding_Count($controls, $_REQUEST['ste_id'], "Open", 1); - $cat_2 = $db->get_Control_Finding_Count($controls, $_REQUEST['ste_id'], "Open", 2); - $cat_3 = $db->get_Control_Finding_Count($controls, $_REQUEST['ste_id'], "Open", 3); - - /* - $sql = "SELECT ". - "IFNULL((SELECT COUNT(1) ". - "FROM `sagacity`.`target` t ". - "LEFT JOIN `sagacity`.`target_checklist` tc ON t.`id`=tc.`tgt_id` ". - "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=tc.`chk_id` ". - "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` AND t.`id` = f.`tgt_id` ". - "LEFT JOIN `sagacity`.`findings_status` fs ON fs.`id`=f.`findings_status_id` ". - "LEFT JOIN `sagacity`.`finding_controls` fc ON fc.`finding_id`=f.`id` ". - "WHERE ". - "(fs.`status`='Open' OR fs.`status`='Exception') AND ". - "f.`cat`=? AND ". - "fc.`ia_control`=? AND ". - "t.`ste_id`=? ". - "GROUP BY f.`pdi_id`". - "), 0)". - " + ". - "IFNULL((SELECT COUNT(1) ". - "FROM `sagacity`.`checklist` c ". - "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=c.`id` ". - "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` ". - "LEFT JOIN `sagacity`.`findings_status` fs ON f.`findings_status_id`=fs.`id` ". - "LEFT JOIN `sagacity`.`target` t ON t.`id`=f.`tgt_id` ". - "LEFT JOIN `sagacity`.`finding_controls` fc ON fc.`finding_id`=f.`id` ". - "WHERE ". - "c.`name`='Orphan' AND ". - "(fs.`status`='Open' OR fs.`status`='Exception') AND ". - "f.`cat`=? AND ". - "fc.`ia_control`=? AND ". - "t.`ste_id`=? ". - "GROUP BY f.`pdi_id`". - "), 0) AS 'sum_count'"; - - ($cat_1) = $dbh->selectrow_array($sql, undef, 1, param('id'), param('ste_id'), 1, param('id'), param('ste_id')); - ($cat_2) = $dbh->selectrow_array($sql, undef, 2, param('id'), param('ste_id'), 2, param('id'), param('ste_id')); - ($cat_3) = $dbh->selectrow_array($sql, undef, 3, param('id'), param('ste_id'), 3, param('id'), param('ste_id')); - */ - $sql = "SELECT " . - "IFNULL((SELECT COUNT(1) " . - "FROM `sagacity`.`target` t " . - "LEFT JOIN `sagacity`.`target_checklist` tc ON t.`id`=tc.`tgt_id` " . - "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=tc.`chk_id` " . - "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` AND t.`id` = f.`tgt_id` " . - "LEFT JOIN `sagacity`.`findings_status` fs ON fs.`id`=f.`findings_status_id` " . - "LEFT JOIN `sagacity`.`finding_controls` fc ON fc.`finding_id`=f.`id` " . - "WHERE " . - "(fs.`status`='Open' OR fs.`status`='Exception') AND " . - "fc.`ia_control`=? AND " . - "t.`ste_id`=? " . - "), 0)" . - " + " . - "IFNULL((SELECT COUNT(1) " . - "FROM `sagacity`.`checklist` c " . - "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=c.`id` " . - "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` " . - "LEFT JOIN `sagacity`.`findings_status` fs ON f.`findings_status_id`=fs.`id` " . - "LEFT JOIN `sagacity`.`target` t ON t.`id`=f.`tgt_id` " . - "LEFT JOIN `sagacity`.`finding_controls` fc ON fc.`finding_id`=f.`id` " . - "WHERE " . - "c.`name`='Orphan' AND " . - "(fs.`status`='Open' OR fs.`status`='Exception') AND " . - "fc.`ia_control`=? AND " . - "t.`ste_id`=? " . - "), 0) AS 'sum_count'"; - - $unique = db_helper::selectrow_array($conn, $sql, $controls->get_Control_ID(), $_REQUEST['ste_id'], $controls->get_Control_ID(), $_REQUEST['ste_id']); - /* - $sql = "SELECT ". - "IFNULL((SELECT COUNT(1) ". - "FROM `sagacity`.`target` t ". - "LEFT JOIN `sagacity`.`target_checklist` tc ON t.`id`=tc.`tgt_id` ". - "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=tc.`chk_id` ". - "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` AND t.`id` = f.`tgt_id` ". - "LEFT JOIN `sagacity`.`findings_status` fs ON fs.`id`=f.`findings_status_id` ". - "LEFT JOIN `sagacity`.`finding_controls` fc ON fc.`finding_id`=f.`id` ". - "WHERE ". - "fs.`status`=? AND ". - "fc.`ia_control`=? AND ". - "t.`ste_id`=? ". - "GROUP BY f.`pdi_id`". - "), 0)". - " + ". - "IFNULL((SELECT COUNT(1) ". - "FROM `sagacity`.`checklist` c ". - "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=c.`id` ". - "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` ". - "LEFT JOIN `sagacity`.`findings_status` fs ON f.`findings_status_id`=fs.`id` ". - "LEFT JOIN `sagacity`.`target` t ON t.`id`=f.`tgt_id` ". - "LEFT JOIN `sagacity`.`finding_controls` fc ON fc.`finding_id`=f.`id` ". - "WHERE ". - "c.`name`='Orphan' AND ". - "fs.`status`=? AND ". - "fc.`ia_control`=? AND ". - "t.`ste_id`=? ". - "GROUP BY f.`pdi_id`". - "), 0) AS 'sum_count'"; - - ($na) = $dbh->selectrow_array($sql, undef, "Not Applicable", param('id'), param('ste_id'), "Not Applicable", param('id'), param('ste_id')); - ($nf) = $dbh->selectrow_array($sql, undef, "Not a Finding", param('id'), param('ste_id'), "Not a Finding", param('id'), param('ste_id')); - */ - $na = $db->get_Control_Finding_Count($controls, $_REQUEST['ste_id'], "Not Applicable"); - $nf = $db->get_Control_Finding_Count($controls, $_REQUEST['ste_id'], "Not a Finding"); - - $sql = "SELECT " . - "IFNULL((SELECT COUNT(1) " . - "FROM `sagacity`.`target` t " . - "LEFT JOIN `sagacity`.`target_checklist` tc ON t.`id`=tc.`tgt_id` " . - "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=tc.`chk_id` " . - "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` AND t.`id` = f.`tgt_id` " . - "LEFT JOIN `sagacity`.`findings_status` fs ON fs.`id`=f.`findings_status_id` " . - "LEFT JOIN `sagacity`.`finding_controls` fc ON fc.`finding_id`=f.`id` " . - "WHERE " . - "(fs.`status`='Open' OR fs.`status`='Exception') AND " . - "fc.`ia_control`=? AND " . - "t.`ste_id`=? " . - "GROUP BY f.`tgt_id`" . - "), 0)" . - " + " . - "IFNULL((SELECT COUNT(1) " . - "FROM `sagacity`.`checklist` c " . - "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=c.`id` " . - "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` " . - "LEFT JOIN `sagacity`.`findings_status` fs ON f.`findings_status_id`=fs.`id` " . - "LEFT JOIN `sagacity`.`target` t ON t.`id`=f.`tgt_id` " . - "LEFT JOIN `sagacity`.`finding_controls` fc ON fc.`finding_id`=f.`id` " . - "WHERE " . - "c.`name`='Orphan' AND " . - "(fs.`status`='Open' OR fs.`status`='Exception') AND " . - "fc.`ia_control`=? AND " . - "t.`ste_id`=? " . - "GROUP BY f.`tgt_id`" . - "), 0) AS 'sum_count'"; - - $host_count = db_helper::selectrow_array($conn, $sql, $controls->get_Control_ID(), $_REQUEST['ste_id'], $controls->get_Control_ID(), $_REQUEST['ste_id']); - - $ret .= "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - "" . - ""; - - $ret .= "
IIIIIINANFUniqueHostsTotal
$cat_1$cat_2$cat_3$na$nf" . $unique['sum_count'] . "" . $host_count['sum_count'] . "" . ($cat_1 + $cat_2 + $cat_3) . "
" . - "
" . - "
" . - "" . - "" . - "" . - "" . - "" . - "" - ; - - $sql = "SELECT " . - "f.`pdi_id`,s.`stig_id`,f.`cat`,pdi.`short_title`," . - "(SELECT GROUP_CONCAT(fc.`ia_control` SEPARATOR ' ') " . - "FROM `sagacity`.`finding_controls` fc " . - "WHERE " . - "fc.`finding_id`=f.`id` " . - ") AS ia_controls " . - "FROM `sagacity`.`findings` f " . - "JOIN `sagacity`.`findings_status` fs ON fs.`id`=f.`findings_status_id` " . - "JOIN `sagacity`.`stigs` s ON s.`pdi_id`=f.`pdi_id` " . - "JOIN `sagacity`.`pdi_catalog` pdi ON pdi.`id`=f.`pdi_id` " . - "WHERE (fs.`status`='Open' OR fs.`status`='Exception') " . - "GROUP BY f.`pdi_id` " . - "HAVING ia_controls LIKE '%" . $_REQUEST['id'] . "%' " . - "ORDER BY s.`stig_id`" - ; - - if ($res = $conn->query($sql)) { - while ($row = $res->fetch_assoc()) { - $cat = str_repeat("I", $row['cat']); - $ias = explode(" ", $row['ia_controls']); - $ia_cnt = (is_array($ias) ? count($ias) : 0); - $stig = str_replace(".", "", $row['stig_id']); - - $sql2 = "SELECT " . - "GROUP_CONCAT(DISTINCT f.`id` SEPARATOR ',') AS 'finding_ids'," . - "GROUP_CONCAT(DISTINCT t.`name` SEPARATOR ', ') AS 'affected_hosts',f.`notes` " . - "FROM `sagacity`.`target` t " . - "JOIN `sagacity`.`findings` f ON f.`tgt_id`=t.`id` " . - "JOIN `sagacity`.`finding_controls` fc ON fc.`finding_id`=f.`id` " . - "WHERE t.`ste_id`=? AND f.`pdi_id`=?"; - - $row = db_helper::selectrow_array($conn, $sql2, $_REQUEST['ste_id'], $row['pdi_id'])[0]; - $ids = $row['finding_ids']; - $hosts = $row['affected_hosts']; - $notes = $row['notes']; - - $ret .= "" . - "" . - "" . - "" . - "" . - "" . - "" . - ""; - } - } - - - $ret .= "
STIG ID" . - "Cat" . - "M" . - "Vulnerability Title" . - "Affected Hosts" . - "Notes
(inc.)" . - "
" . $row['stig_id'] . "$cat" . - ($ia_cnt > 1 ? "" : "") . - "" . - "" . $row['short_title'] . "$hosts$notes
"; - - return $ret; -} - -function update_risk_status() -{ - global $conn; - $sql = "UPDATE `sagacity`.`control_findings` SET `risk_status`=? WHERE `ste_id`=? AND `control_id`=?"; - db_helper::run($conn, $sql, strtolower($_REQUEST['status']), $_REQUEST['ste_id'], $_REQUEST['ctrl_id']); -} - -function update_risk_analysis() -{ - global $conn; - $sql = "UPDATE `sagacity`.`control_findings` SET `risk_analysis`=? WHERE `control_id`=? AND `ste_id`=?"; - db_helper::run($conn, $sql, $_REQUEST['text'], $_REQUEST['ctrl_id'], $_REQUEST['ste_id']); -} - -function update_control_completion() -{ - global $conn; - $sql = "UPDATE `sagacity`.`control_findings` SET `done`=IF(`done`=1,0,1) WHERE `control_id`=? AND `ste_id`=?"; - db_helper::run($conn, $sql, $_REQUEST['ctrl_id'], $_REQUEST['ste_id']); -} - -function update_stig_control() -{ - global $conn; - $sql = "DELETE FROM `sagacity`.`finding_controls` WHERE `finding_id` IN (" . $_REQUEST['ids'] . ")"; - $conn->real_query($sql); - - $sql = "INSERT INTO `sagacity`.`finding_controls` (`finding_id`,`ia_control`) VALUES "; - $ids = explode(",", $_REQUEST['ids']); - for ($x = 0; $x < count($ids); $x++) { - $sql .= "(" . $ids[$x] . ",'" . $_REQUEST['ctrl_id'] . "'),"; - } - $sql = substr($sql, 0, -1); - $conn->real_query($sql); -} - -/** - * Function to get targets from the category - * - * @global db $db - * - * @param int $cat_id - * - * @return type - */ -function get_hosts($cat_id = null) -{ - global $db; - $ret = ['cat_id' => $cat_id]; - $ste_id = filter_input(INPUT_COOKIE, 'ste', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); - $tgts = []; - - if ($cat_id) { - $ste_cat = $db->get_Category($cat_id)[0]; - $tgts = $db->get_Target_By_Category($cat_id); - } - elseif (is_numeric($ste_id)) { - $tgts = $db->get_Unassigned_Targets($ste_id); - } - else { - return json_encode(['error' => "Invalid info"]); - } - - foreach ($tgts as $key => $tgt) { - $chks = $db->get_Target_Checklists($tgt->get_ID()); - if ($cat_id) { - $exp_scan_srcs = $db->get_Expected_Category_Sources($ste_cat); - } - else { - $exp_scan_srcs = null; - } - $scan_srcs = $db->get_Target_Scan_Sources($tgt, $exp_scan_srcs); - $icons = []; - $icon_str = ''; - $src_str = ''; - - foreach ($chks as $chk) { - if (!in_array($chk->get_Icon(), array_keys($icons))) { - $icons[$chk->get_Icon()]['icon'] = $chk->get_Icon(); - $icons[$chk->get_Icon()]['name'] = ''; - } - $icons[$chk->get_Icon()]['name'] .= "{$chk->get_Name()} V{$chk->get_Version()}R{$chk->get_Release()} ({$chk->get_type()})" . PHP_EOL; - } - - foreach ($icons as $icon => $data) { - $icon_str .= ""; - } - - foreach ($scan_srcs as $key => $src) { - $icon = $src['src']->get_Icon(); - if($src['scan_error']) { - $icon = strtolower($src['src']->get_Name()) . "-failed.png"; - } - - $src_str .= "get_Name()}"; - if (isset($src['count']) && $src['count']) { - $src_str .= " ({$src['count']})"; - } - $src_str .= "' class='checklist_image' />"; - } - - $ret['targets'][] = array_merge([ - 'id' => $tgt->get_ID(), - 'ste_id' => $tgt->get_STE_ID(), - 'name' => $tgt->get_Name(), - 'os' => $tgt->get_OS_String(), - 'location' => $tgt->get_Location(), - 'auto' => $tgt->get_Task_Status($tgt->get_Auto_Status_ID()), - 'man' => $tgt->get_Task_Status($tgt->get_Man_Status_ID()), - 'data' => $tgt->get_Task_Status($tgt->get_Data_Status_ID()), - 'fp' => $tgt->get_Task_Status($tgt->get_FP_Cat1_Status_ID()), - 'ip' => (count($tgt->interfaces) ? array_keys($tgt->interfaces)[0] : ''), - 'notes' => $tgt->getDisplayNotes(), - 'scans' => $src_str, - 'chk' => $icon_str, - 'nr' => $tgt->getNotReviewedCount(), - 'na' => $tgt->getNotApplicableCount(), - 'nf' => $tgt->getNotAFindingCount(), - 'cat_1' => $tgt->getCat1Count(), - 'cat_2' => $tgt->getCat2Count(), - 'cat_3' => $tgt->getCat3Count(), - 'comp' => $tgt->getCompliantPercent(), - 'assessed' => $tgt->getAssessedPercent() - ]); - } - - return json_encode($ret); -} - -function get_target_data() -{ - global $db; - - $tgt = $db->get_Target_Details($_REQUEST['ste_id'], $_REQUEST['tgt_id'])[0]; - - switch ($_REQUEST['type']) { - case 'netstat': - return $tgt->get_Netstat_Connections(); - case 'routes': - return $tgt->get_Routes(); - case 'firewall': - return $tgt->get_Firewall_Config(); - case 'shares': - return $tgt->get_Shares(); - case 'mounted': - return $tgt->get_Mounted(); - case 'process_list': - return $tgt->get_Process_List(); - case 'autorun': - return $tgt->get_Autorun(); - case 'services': - return $tgt->get_Services(); - case 'remote_registry': - return $tgt->get_Remote_Registry(); - case 'system': - return $tgt->get_System(); - case 'bios': - return $tgt->get_BIOS(); - case 'copyright': - return $tgt->get_Copyright(); - case 'missing_patches': - return $tgt->get_Missing_Patches(); - case 'user_list': - return $tgt->get_User_List(); - case 'disabled_accts': - return $tgt->get_Disabled_Accts(); - case 'stag_pwds': - return $tgt->get_Stag_Pwds(); - case 'never_logged_in': - return $tgt->get_Never_Logged_In(); - case 'pwds_never_expire': - return $tgt->get_Pwds_Never_Expire(); - } - - return null; -} - -function target_filter($ste_id, $criteria) -{ - global $db, $conn; - $where = array(); - $tgts = array(); - $idx = 0; - $like = false; - $ret = array(); - - $search = explode("\n", $criteria); - unset($search[count($search) - 1]); - - foreach ($search as $str) { - if (!$str) { - continue; - } - switch ($str) { - case (preg_match("/name /i", $str) ? true : false): - $where[] = "t.`name`"; - break; - case (preg_match("/sw /i", $str) ? true : false): - $where[] = "sw.`cpe`"; - break; - case (preg_match("/os /i", $str) ? true : false): - $where[] = "os.`cpe`"; - break; - case (preg_match("/auto status /i", $str) ? true : false): - $where[] = "`as`.`status`"; - break; - case (preg_match("/manual status /i", $str) ? true : false): - $where[] = "ms.`status`"; - break; - case (preg_match("/data gathering status /i", $str) ? true : false): - $where[] = "ds.`status`"; - break; - case (preg_match("/fp\/cat i status /i", $str) ? true : false): - $where[] = "fp.`status`"; - break; - case (preg_match("/category /i", $str) ? true : false): - $where[] = "t.`cat_id`"; - break; - case (preg_match("/open port /i", $str) ? true : false): - $where[] = "CONCAT(pps.`proto`,'/',pps.`port`)"; - break; - default: - continue 2; - } - - if (($pos = strpos($str, "!~")) !== false) { - $where[$idx] .= " NOT LIKE "; - $like = true; - } - elseif (($pos = strpos($str, "~=")) !== false) { - $where[$idx] .= " LIKE "; - $like = true; - } - elseif (($pos = strpos($str, "!=")) !== false) { - $where[$idx] .= " != "; - } - elseif (($pos = strpos($str, "=")) !== false) { - $where[$idx] .= " = "; - $pos--; - } - - $where[$idx] .= "'" . ($like ? "%" : "") . - $conn->real_escape_string(substr($str, $pos + 4, -1)) . - ($like ? "%" : "") . "'"; - - $idx++; - $like = false; - } - - $where_str = implode(" AND ", $where); - - $sql = "SELECT COUNT(DISTINCT(t.`id`)) as 'cnt' " . - "FROM `sagacity`.`target` t " . - "LEFT JOIN `sagacity`.`task_status` `as` ON t.`auto_status_id`=`as`.`id` " . - "LEFT JOIN `sagacity`.`task_status` ms ON t.`man_status_id`=ms.`id` " . - "LEFT JOIN `sagacity`.`task_status` ds ON t.`data_status_id`=ds.`id` " . - "LEFT JOIN `sagacity`.`task_status` fp ON t.`fp_cat1_status_id`=fp.`id` " . - "LEFT JOIN `sagacity`.`target_software` ts ON ts.`tgt_id`=t.`id` " . - "LEFT JOIN `sagacity`.`software` sw ON ts.`sft_id`=sw.`id` " . - "LEFT JOIN `sagacity`.`software` os ON t.`os_id`=os.`id` " . - "LEFT JOIN `sagacity`.`interfaces` i ON t.`id`=i.`tgt_id` " . - "LEFT JOIN `sagacity`.`pps_list` hp ON hp.`int_id`=i.`id` " . - "LEFT JOIN `sagacity`.`ports_proto_services` pps ON pps.`id`=hp.`pps_id` " . - "WHERE " . - $where_str - ; - $cnt = 0; - if ($res = $conn->query($sql)) { - $cnt = $res->fetch_array()[0]; - } - else { - error_log($conn->error); - Sagacity_Error::sql_handler($sql); - } - $ret['count'] = $cnt; - - $sql = "SELECT DISTINCT(t.`id`) " . - "FROM `sagacity`.`target` t " . - "LEFT JOIN `sagacity`.`task_status` `as` ON t.`auto_status_id`=`as`.`id` " . - "LEFT JOIN `sagacity`.`task_status` ms ON t.`man_status_id`=ms.`id` " . - "LEFT JOIN `sagacity`.`task_status` ds ON t.`data_status_id`=ds.`id` " . - "LEFT JOIN `sagacity`.`task_status` fp ON t.`fp_cat1_status_id`=fp.`id` " . - "LEFT JOIN `sagacity`.`target_software` ts ON ts.`tgt_id`=t.`id` " . - "LEFT JOIN `sagacity`.`software` sw ON ts.`sft_id`=sw.`id` " . - "LEFT JOIN `sagacity`.`software` os ON t.`os_id`=os.`id` " . - "LEFT JOIN `sagacity`.`interfaces` i ON t.`id`=i.`tgt_id` " . - "LEFT JOIN `sagacity`.`pps_list` hp ON hp.`int_id`=i.`id` " . - "LEFT JOIN `sagacity`.`ports_proto_services` pps ON pps.`id`=hp.`pps_id` " . - "WHERE " . - $where_str . " " . - ($_REQUEST['count'] != 'all' ? "LIMIT " . $_REQUEST['start_count'] . "," . $_REQUEST['count'] : "") - ; - - if ($res = $conn->query($sql)) { - while ($row = $res->fetch_assoc()) { - $tgts[] = $db->get_Target_Details($_REQUEST['ste'], $row['id'])[0]; - } - } - else { - error_log($conn->error); - Sagacity_Error::sql_handler($sql); - } - - foreach ($tgts as $tgt) { - $cat_id = $tgt->get_Cat_ID(); - $ste_cat = $db->get_Category($cat_id); - $chks = $db->get_Target_Checklists($tgt->get_ID()); - if (isset($cat_id)) { - $exp_scan_srcs = $db->get_Expected_Category_Sources($ste_cat); - } - else { - $exp_scan_srcs = null; - } - $scan_srcs = $db->get_Target_Scan_Sources($tgt, $exp_scan_srcs); - $icons = array(); - $icon_str = ''; - $src_str = ''; - - foreach ($chks as $chk) { - if (!in_array($chk->get_Icon(), array_keys($icons))) { - $icons[$chk->get_Icon()]['icon'] = $chk->get_Icon(); - $icons[$chk->get_Icon()]['name'] = ''; - } - $icons[$chk->get_Icon()]['name'] .= $chk->get_Name() . " V" . $chk->get_Version() . "R" . $chk->get_Release() . " (" . $chk->get_type() . ")" . PHP_EOL; - } - - foreach ($icons as $icon => $data) { - $icon_str .= ""; - } - - foreach ($scan_srcs as $src) { - $src_str .= "get_Icon() . "' title='" . $src['src']->get_Name(); - if (isset($src['count']) && $src['count']) { - $src_str .= " (" . $src['count'] . ")"; - } - $src_str .= "' class='checklist_image' />"; - } - - $ret['targets'][] = array_merge($tgt->get_JSON(), array( - 'scans' => $src_str, - 'chk' => $icon_str - )); - } - - if (isset($ret['targets']) && is_array($ret['targets']) && count($ret['targets'])) { - return json_encode($ret); - } - else { - return json_encode(array('count' => 0)); - } -} - -function reference_filter($criteria) -{ - global $db, $conn; - $where = array(); - $ref = array(); - $idx = 0; - $ret = ''; - $like = false; - $odd = true; - - $sql = "SELECT * FROM `sagacity`.`pdi_catalog` pdi "; - - $query = array( - 'cce' => array( - 'sql' => "LEFT JOIN `sagacity`.`cce` ON cce.`pdi_id`=pdi.`id` ", - 'added' => false - ), - 'cve' => array( - 'sql' => "LEFT JOIN `sagacity`.`cve` ON cve.`pdi_id`=pdi.`id` " . - "LEFT JOIN `sagacity`.`cve_db` ON cve_db.`cve_id`=cve.`cve_id` " . - "LEFT JOIN `sagacity`.`cve_references` ref ON ref.`cve_seq`=cve_db.`cve_id` " . - "LEFT JOIN `sagacity`.`cve_web` web ON web.`cve_id`=cve_db.`cve_id` ", - 'added' => false, - ), - 'vms' => array( - 'sql' => "LEFT JOIN `sagacity`.`golddisk` gd ON gd.`pdi_id`=pdi.`id` ", - 'added' => false, - ), - 'iavm' => array( - 'sql' => "LEFT JOIN `sagacity`.`iavm_notices` iavm ON iavm.`pdi_id`=pdi.`id` ", - 'added' => false, - ) - ); - - $xml = new DOMDocument(); - $xml->appendChild($root = xml_helper($xml, "root")); - - $search = explode("\n", $criteria); - unset($search[count($search) - 1]); - - foreach ($search as $str) { - switch ($str) { - case (preg_match("/cce /i", $str) ? true : false): - if (!$query['cce']['added']) { - $sql .= $query['cce']['sql']; - } - $query['cce']['added'] = true; - $where[] = ""; - break; - case (preg_match("/cpe /i", $str) ? true : false): - $where[] = ""; - break; - case (preg_match("/cve /i", $str) ? true : false): - if (!$query['cve']['added']) { - $sql .= $query['cve']['sql']; - } - $query['cve']['added'] = true; - $where[] = ""; - break; - case (preg_match("/ia control /i", $str) ? true : false): - $where[] = ""; - break; - case (preg_match("/iavm /i", $str) ? true : false): - if (!$query['iavm']['added']) { - $sql .= $query['iavm']['sql']; - } - $query['iavm']['added'] = true; - $where[] = ""; - break; - case (preg_match("/nessus plugin id /i", $str) ? true : false): - $where[] = ""; - break; - case (preg_match("/oval /i", $str) ? true : false): - $where[] = ""; - break; - case (preg_match("/reference /i", $str) ? true : false): - $where[] = ""; - break; - case (preg_match("/stig id /i", $str) ? true : false): - $where[] = ""; - break; - case (preg_match("/sv rule /i", $str) ? true : false): - $where[] = ""; - break; - case (preg_match("/vms id /i", $str) ? true : false): - if (!$query['vms']['added']) { - $sql .= $query['vms']['sql']; - } - $query['vms']['added'] = true; - $where[] = ""; - break; - case (preg_match("/vendor advisory /i", $str) ? true : false): - $where[] = ""; - break; - case (preg_match("/check contents /i", $str) ? true : false): - $where[] = ""; - break; - case (preg_match("/short title /i", $str) ? true : false): - $where[] = ""; - break; - case (preg_match("/description /i", $str) ? true : false): - $where[] = ""; - break; - default: - continue 2; - } - - if (($pos = strpos($str, "!~")) !== false) { - $where[$idx] .= " NOT LIKE "; - $like = true; - } - elseif (($pos = strpos($str, "~=")) !== false) { - $where[$idx] .= " LIKE "; - $like = true; - } - elseif (($pos = strpos($str, "!=")) !== false) { - $where[$idx] .= " != "; - } - elseif (($pos = strpos($str, "=")) !== false) { - $where[$idx] .= " = "; - $pos--; - } - - $where[$idx] .= "'" . ($like ? "%" : "") . - $conn->real_escape_string(substr($str, $pos + 4, -1)) . - ($like ? "%" : "") . "'"; - - $idx++; - $like = false; - } - - $where_str = implode(" AND ", $where); - - $sql = "SELECT COUNT(t.`id`) as 'cnt' " . - "WHERE " . - $where_str; - - $cnt = 0; - if ($res = $conn->query($sql)) { - $cnt = $res->fetch_array()[0]; - } - else { - error_log($conn->error); - Sagacity_Error::sql_handler($sql); - } - $root->setAttribute('count', $cnt); - - $sql = "SELECT t.`id` " . - " " . - "WHERE " . - $where_str . " " . - ($_REQUEST['count'] != 'all' ? "LIMIT " . $_REQUEST['start_count'] . "," . $_REQUEST['count'] : "") - ; - - if ($res = $conn->query($sql)) { - while ($row = $res->fetch_assoc()) { - - } - } - else { - error_log($conn->error); - Sagacity_Error::sql_handler($sql); - } - - return $xml->saveXML(); -} - -function scan_filter($ste_id, $criteria) -{ - -} - -function finding_filter($ste_id, $criteria) -{ - -} - -function get_saved_filter($type, $filter_name) -{ - global $db; - $filter = $db->get_Filters($type, $filter_name); - $ret = array(); - - if (is_array($filter) && count($filter)) { - $filter = $filter[0]; - foreach (explode("\n", $filter['criteria']) as $cri) { - if ($cri) - $ret[] = $cri; - } - } - - return json_encode($ret); -} - -function update_target_field($field, $data) -{ - global $db, $conn; - - $sql = "UPDATE `sagacity`.`target` t " . - "LEFT JOIN `sagacity`.`target_software` ts ON t.`id`=ts.`tgt_id` " . - "LEFT JOIN `sagacity`.`target_checklist` tc ON t.`id`=tc.`tgt_id` " . - "LEFT JOIN `sagacity`.`target_net_meta` tnm ON t.`id`=tnm.`tgt_id` " . - "LEFT JOIN `sagacity`.`target_sys_meta` tsm ON t.`id`=tsm.`tgt_id` " . - "LEFT JOIN `sagacity`.`target_user_meta` tum ON t.`id`=tum.`tgt_id` " . - "SET "; - - switch ($field) { - case 'name': - $sql .= "t.`name`='" . $conn->real_escape_string($data) . "'"; - break; - case 'location': - $sql .= "t.`location`='" . $conn->real_escape_string($data) . "'"; - break; - case 'wmi_pid': - $sql .= "tsm.`wmi_listening_pid`='" . $conn->real_escape_string($data) . "'"; - break; - case 'last_login': - $sql .= "tum.`last_login`='" . $conn->real_escape_string($data) . "'"; - break; - case 'login': - $sql .= "tum.`login`='" . $conn->real_escape_string($data) . "'"; - break; - case 'notes': - $sql .= "t.`notes`='" . $conn->real_escape_string($data) . "'"; - break; - case 'auto_status': - $sql .= "t.`auto_status_id`='" . $conn->real_escape_string($data) . "'"; - break; - case 'man_status': - $sql .= "t.`man_status_id`='" . $conn->real_escape_string($data) . "'"; - break; - case 'data_status': - $sql .= "t.`data_status_id`='" . $conn->real_escape_string($data) . "'"; - break; - case 'fp-cat1_status': - $sql .= "t.`fp_cat1_status_id`='" . $conn->real_escape_string($data) . "'"; - break; - case 'vm': - $sql .= "tsm.`is_vm`='" . $conn->real_escape_string($data) . "'"; - break; - case 'pp_on': - $sql .= "t.`pp_off`=" . ($data == '1' ? '0' : '1'); - break; - case 'netstat_data': - $sql .= "tnm.`netstat_connections`='" . $conn->real_escape_string($data) . "'"; - break; - case 'routes_data': - $sql .= "tnm.`routes`='" . $conn->real_escape_string($data) . "'"; - break; - case 'shares_data': - $sql .= "tnm.`shares`='" . $conn->real_escape_string($data) . "'"; - break; - case 'firewall_data': - $sql .= "tnm.`firewall_config`='" . $conn->real_escape_string($data) . "'"; - break; - case 'mounted_data': - $sql .= "tsm.`mounted`='" . $conn->real_escape_string($data) . "'"; - break; - case 'process_list_data': - $sql .= "tsm.`process_list`='" . $conn->real_escape_string($data) . "'"; - break; - case 'autorun_data': - $sql .= "tsm.`autorun`='" . $conn->real_escape_string($data) . "'"; - break; - case 'services_data': - $sql .= "tsm.`services`='" . $conn->real_escape_string($data) . "'"; - break; - case 'remote_registry_data': - $sql .= "tsm.`remote_registry`='" . $conn->real_escape_string($data) . "'"; - break; - case 'copyright_data': - $sql .= "tsm.`copyrighted`='" . $conn->real_escape_string($data) . "'"; - break; - case 'system_data': - $sql .= "tsm.`system`='" . $conn->real_escape_string($data) . "'"; - break; - case 'bios_data': - $sql .= "tsm.`bios`='" . $conn->real_escape_string($data) . "'"; - break; - case 'missing_patches_data': - $sql .= "t.`missing_patches`='" . $conn->real_escape_string($data) . "'"; - break; - case 'user_list_data': - $sql .= "tum.`user_list`='" . $conn->real_escape_string($data) . "'"; - break; - case 'disabled_accts_data': - $sql .= "tum.`disabled_accts`='" . $conn->real_escape_string($data) . "'"; - break; - case 'stag_pwds_data': - $sql .= "tum.`stag_pwds`='" . $conn->real_escape_string($data) . "'"; - break; - case 'never_logged_in_data': - $sql .= "tum.`never_logged_in`='" . $conn->real_escape_string($data) . "'"; - break; - case 'pwds_never_expire_data': - $sql .= "tum.`pwd_never_expires`='" . $conn->real_escape_string($data) . "'"; - break; - case '': - $sql .= "='" . $conn->real_escape_string($data) . "'"; - break; - } - - $sql .= " WHERE t.`id`=" . $conn->real_escape_string($_REQUEST['tgt_id']); - - if (!$conn->real_query($sql)) { - error_log($conn->error); - Sagacity_Error::sql_handler($sql); - - return 'false'; - } - - return 'true'; -} - -function get_category_details($cat_id) -{ - global $db; - $cat = $db->get_Category($cat_id); - if (is_array($cat) && count($cat) && isset($cat[0]) && is_a($cat[0], 'ste_cat')) { - $cat = $cat[0]; - } - else { - return 'no category found'; - } - - return json_encode([ - 'id' => $cat->get_ID(), - 'name' => $cat->get_Name(), - 'analyst' => $cat->get_Analyst(), - 'sources' => $cat->get_Sources() - ]); -} +" . update_finding_status() . ""; +} +elseif ($action == 'update_finding_ia_controls') { + print "" . update_finding_ia_controls() . ""; +} +elseif ($action == 'update_finding_notes') { + print "" . update_finding_notes() . ""; +} +elseif ($action == 'update_risk_status') { + print update_risk_status(); +} +elseif ($action == 'update_risk_analysis') { + print update_risk_analysis(); +} +elseif ($action == 'update_control_completion') { + print update_control_completion(); +} +elseif ($action == 'update_stig_control') { + print update_stig_control(); +} +elseif ($action == 'refresh_counts') { + print "" . refresh_counts() . ""; +} +elseif ($action == 'get_control_details') { + if ($_REQUEST['id'] == 'overall') { + print get_STE_details(); + } + else { + print get_control_details(); + } +} +elseif ($action == 'update_STE') { + print update_STE_details(); +} +elseif ($action == 'update_STE_risk') { + $conn->real_query( + "UPDATE `sagacity`.`ste` SET `risk_status`='" . + strtolower($conn->real_escape_string($_REQUEST['status'])) . + "' WHERE `id`=" . $conn->real_escape_string($ste)); +} +elseif ($action == 'get_hosts') { + $cat_id = filter_input(INPUT_POST, 'cat_id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); + if (is_numeric($cat_id)) { + print get_hosts($cat_id); + } + else { + print json_encode(['error' => 'Invalid category ID']); + } +} +elseif ($action == 'new-get-hosts') { + $cat_id = filter_input(INPUT_POST, 'cat-id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); + if (is_numeric($cat_id)) { + print new_get_hosts($cat_id); + } + else { + print json_encode(['error' => 'Invalid category ID']); + } +} +elseif ($action == 'get_target_data') { + print get_target_data($_REQUEST['type']); +} +elseif ($action == 'save_filter') { + print $db->save_Filter($_REQUEST['type'], $_REQUEST['name'], $_REQUEST['criteria']); +} +elseif ($action == 'target-filter') { + print header(JSON) . target_filter($ste, $_REQUEST['criteria']); +} +elseif ($action == 'scan-filter') { + print scan_filter($ste, $_REQUEST['criteria']); +} +elseif ($action == 'finding-filter') { + print finding_filter($ste, $_REQUEST['criteria']); +} +elseif ($action == 'reference-filter') { + print reference_filter($ste, $_REQUEST['criteria']); +} +elseif ($action == 'get-saved-filter') { + print get_saved_filter($_REQUEST['type'], $_REQUEST['name']); +} +elseif ($action == 'update-target-field') { + print update_target_field($_REQUEST['field'], $_REQUEST['data']); +} +elseif ($action == 'get_category_details') { + $cat_id = filter_input(INPUT_POST, 'cat_id', FILTER_VALIDATE_INT); + print header(JSON) . get_category_details($cat_id); +} +elseif ($action == 'add_scans') { + $import = new import(); + $import->scan_Result_Files(false); + + print header(JSON) . json_encode(array( + 'success' => 'Thread running' + )); +} +elseif ($action == 'auto-categorize') { + $db->auto_Catorgize_Targets($ste); + + print header(JSON) . json_encode([ + 'success' => 'Categorized Targets' + ]); +} +elseif ($action == 'delete-cat') { + $cat_id = filter_input(INPUT_POST, 'cat_id', FILTER_VALIDATE_INT); + if ($db->delete_Cat($cat_id)) { + print header(JSON) . json_encode([ + 'success' => 'Successfully deleted category' + ]); + } +} +elseif ($action == 'delete-file') { + $file = filter_input(INPUT_POST, 'filename', FILTER_SANITIZE_STRING); + $file = realpath($file); + + if ($file && preg_match("/^" . preg_quote(TMP, '/') . "/", $file)) { + if (unlink($file)) { + print header(JSON) . json_encode([ + 'success' => 'Deleted file' + ]); + } + else { + print header(JSON) . json_encode([ + 'error' => "Failed to delete $file" + ]); + } + } + else { + $file = filter_input(INPUT_POST, 'filename', FILTER_SANITIZE_STRING); + print header(JSON) . json_encode([ + 'error' => "$file does not exist" + ]); + } +} +elseif ($action == 'get-cat-data') { + $fname = filter_input(INPUT_POST, 'fname', FILTER_SANITIZE_STRING, FILTER_NULL_ON_FAILURE); + $checklist = $db->get_Checklist_By_File($fname); + + if (isset($checklist[0])) { + $checklist[0]->type = ucfirst($checklist[0]->type); + print header(JSON) . json_encode($checklist[0]); + } + else { + print header(JSON) . json_encode(array('error' => 'Error finding checklist')); + } +} +elseif ($action == 'checklist-remove-software') { + $chk_id = filter_input(INPUT_POST, 'chk_id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); + $sw_id = filter_input(INPUT_POST, 'sw_id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); + + $db->help->delete("sagacity.checklist_software_lookup", null, array( + array( + 'field' => 'chk_id', + 'op' => '=', + 'value' => $chk_id + ), + array( + 'field' => 'sw_id', + 'op' => '=', + 'value' => $sw_id, + 'sql_op' => 'AND' + ) + )); + + if ($db->help->execute()) { + print header(JSON) . json_encode(array('success' => 'Relationship deleted')); + } + else { + print header(JSON) . json_encode(array('error' => 'Failed to delete relationship')); + } +} +elseif ($action == 'checklist-add-software') { + $sw_id = filter_input(INPUT_POST, 'sw_id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); + $chk_id = filter_input(INPUT_POST, 'chk_id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); + + $db->help->insert("checklist_software_lookup", array( + 'sw_id' => $sw_id, + 'chk_id' => $chk_id + ), true); + + if (!$db->help->execute()) { + print header(JSON) . json_encode(array('status' => 'Error adding the software to the checklist')); + } + else { + print header(JSON) . json_encode(array('status' => 'Successfully added the software')); + } +} +elseif ($action == 'save-checklist') { + $rel_date = new DateTime(filter_input(INPUT_POST, 'rel-date', FILTER_SANITIZE_STRING)); + + $db->help->update("sagacity.checklist", [ + 'name' => filter_input(INPUT_POST, 'name', FILTER_SANITIZE_STRING), + 'description' => filter_input(INPUT_POST, 'desc', FILTER_SANITIZE_STRING), + 'icon' => filter_input(INPUT_POST, 'icon', FILTER_SANITIZE_STRING), + 'date' => (is_a($rel_date, 'DateTime') ? $rel_date->format(MYSQL_D_FORMAT) : (new DateTime())->format(MYSQL_D_FORMAT)) + ], [ + [ + 'field' => 'id', + 'op' => '=', + 'value' => filter_input(INPUT_POST, 'id', FILTER_VALIDATE_INT) + ] + ]); + + if($db->help->execute()) { + print json_encode(['success' => 'Successfully updated checklist']); + } + else { + print json_encode(['error' => 'Error updating checklist']); + } +} +elseif ($action == 'export-ckl') { + $cat_id = filter_input(INPUT_POST, 'cat', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); + $tgt_id = filter_input(INPUT_POST, 'tgt', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); + $script = null; + + if (!is_numeric($ste)) { + die; + } + + if ($cat_id && is_numeric($cat_id)) { + $script = (defined('PHP_BIN') ? realpath(PHP_BIN) : realpath(PHP)) . + " -c " . realpath(PHP_CONF) . + " -f " . realpath(DOC_ROOT . "/exec/export-ckl.php") . " --" . + " -s=$ste" . + " -c=$cat_id"; + } + elseif ($tgt_id && is_numeric($tgt_id)) { + $script = (defined('PHP_BIN') ? realpath(PHP_BIN) : realpath(PHP)) . + " -c " . realpath(PHP_CONF) . + " -f " . realpath(DOC_ROOT . "/exec/export-ckl.php") . " --" . + " -s=$ste" . + " -t=$tgt_id"; + } + + if (!is_null($script)) { + if (strtolower(substr(PHP_OS, 0, 3)) == "win") { + $shell = new COM("WScript.Shell"); + $shell->CurrentDirectory = DOC_ROOT . "/exec"; + $shell->run($script, 0, false); + } + elseif (strtolower(substr(PHP_OS, 0, 3)) == 'lin') { + exec("cd " . realpath(DOC_ROOT . "/exec") . " && {$script} > /dev/null &"); + } + } +} +elseif ($action == 'delete-host') { + $sel_tgts = json_decode(html_entity_decode(filter_input(INPUT_POST, 'selected_tgts', FILTER_SANITIZE_STRING))); + if (is_array($sel_tgts) && count($sel_tgts)) { + foreach ($sel_tgts as $tgt_id) { + if (!$db->delete_Target($tgt_id)) { + print header(JSON) . json_encode(array('error' => "Failed to delete target ID $tgt_id")); + break; + } + } + } + elseif (is_numeric($sel_tgts)) { + if (!$db->delete_Target($sel_tgts)) { + print header(JSON) . json_encode(array('error' => "Failed to delete target ID $sel_tgts")); + } + } + + print header(JSON) . json_encode(['success' => "Deleted all selected target(s)"]); +} +elseif ($action == 'get-target-notes') { + $tgt_id = filter_input(INPUT_POST, 'tgt-id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); + if (is_numeric($tgt_id) && $tgt_id > 0) { + $db->help->select("target", ['notes'], [ + [ + 'field' => 'id', + 'op' => '=', + 'value' => $tgt_id + ] + ]); + $row = $db->help->execute(); + if (is_array($row) && count($row) && isset($row['notes'])) { + print header(JSON) . json_encode(['notes' => $row['notes']]); + } + } +} +elseif ($action == 'save-target-notes') { + $tgt_id = filter_input(INPUT_POST, 'tgt-id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); + $notes = filter_input(INPUT_POST, 'notes', FILTER_SANITIZE_STRING, FILTER_NULL_ON_FAILURE); + if (is_numeric($tgt_id) && $tgt_id > 0) { + $db->help->update("target", [ + 'notes' => htmlentities($notes) + ], [ + [ + 'field' => 'id', + 'op' => '=', + 'value' => $tgt_id + ] + ]); + if ($db->help->execute()) { + print header(JSON) . json_encode(['success' => 'Updated target notes']); + } + else { + print header(JSON) . json_encode(['error' => $db->help->c->error]); + } + } +} +elseif ($action == 'get-load-status') { + $set = $db->get_Settings([ + 'cpe-count', 'cpe-dl-progress', 'cpe-progress', + 'cve-count', 'cve-dl-progress', 'cve-progress', + 'nvd-cve-count', 'nvd-cve-dl-progress', 'nvd-cve-progress', 'nvd-year', + 'stig-count', 'stig-dl-progress', 'stig-progress', + 'nasl-count', 'nasl-dl-progress', 'nasl-progress' + ]); + print json_encode($set); +} +elseif ($action == 'delete-scan') { + $scan_id = filter_input(INPUT_POST, 'scan-id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); + $del_tgts = (bool) filter_input(INPUT_POST, 'delete-targets', FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); + if ($scan_id) { + if ($db->delete_Scan($ste, $scan_id, $del_tgts)) { + print json_encode(['success' => 'Deleted Scan']); + } + else { + print json_encode(['error' => 'Error deleting scan']); + } + } +} + +function update_tgt_notes() +{ + global $db; + $notes = str_replace(" ", "", filter_input(INPUT_POST, 'notes', FILTER_SANITIZE_STRING)); + $tgt = filter_input(INPUT_POST, 'tgt', FILTER_VALIDATE_INT); + + $db->help->update("sagacity.target", array( + 'notes' => $notes + ), array( + array( + 'field' => 'id', + 'op' => '=', + 'value' => $tgt + ) + )); + + if (!$db->help->execute()) { + return "failure"; + } + else { + return "success"; + } +} + +function chk_filter() +{ + global $db; + $tgt_id = filter_input(INPUT_POST, 'tgt_id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); + $filter = filter_input(INPUT_POST, 'filter', FILTER_SANITIZE_STRING, FILTER_NULL_ON_FAILURE); + $hide_old = (boolean) filter_input(INPUT_POST, 'hide_old', FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); + + $ret = array(); + $db->help->create_table("c", true, $db->help->select("sagacity.checklist", null, array(), array( + 'order' => '`ver` DESC, CONVERT(`release`, DECIMAL(4,2)) DESC' + ))); + if (!$db->help->execute()) { + return $ret; + } + $where = array(); + $flags = array(); + + if (!empty($filter)) { + $where = array( + array( + 'field' => 'c.name', + 'op' => LIKE, + 'value' => "'%{$filter}%'" + ) + ); + } + + if (!empty($tgt_id)) { + $where[] = array( + 'field' => 'tc.chk_id', + 'op' => IS, + 'value' => null, + 'sql_op' => 'AND' + ); + $flags['table_joins'] = array( + "LEFT JOIN sagacity.target_checklist tc ON tc.chk_id = c.id AND tc.tgt_id = $tgt_id" + ); + $flags['order'] = 'c.name'; + } + if ($hide_old) { + $flags['group'] = 'c.name, c.type, c.id'; + } + + $db->help->select("c", array('c.id'), $where, $flags); + + $rows = $db->help->execute(); + if (is_array($rows) && count($rows) && isset($rows['id'])) { + $rows = array(0 => $rows); + } + + if (is_array($rows) && count($rows) && isset($rows[0])) { + foreach ($rows as $row) { + $chk = $db->get_Checklist($row['id']); + if (is_array($chk) && count($chk) && isset($chk[0]) && is_a($chk[0], 'checklist')) { + $ret[] = $chk[0]; + } + } + } + + return json_encode($ret); +} + +function sw_filter($is_os = false) +{ + global $db; + $ret = []; + $filter = "'%" . filter_input(INPUT_POST, 'filter', FILTER_SANITIZE_STRING, FILTER_NULL_ON_FAILURE) . "%'"; + $tgt_id = filter_input(INPUT_POST, 'tgt_id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); + + $db->help->select("sagacity.software s", ['s.id', 's.cpe', 's.sw_string'], [ + [ + 'field' => 's.cpe', + 'op' => LIKE, + 'value' => $filter, + 'open-paren' => true + ], + [ + 'field' => 's.sw_string', + 'op' => LIKE, + 'value' => $filter, + 'sql_op' => 'OR' + ], + [ + 'field' => 's.short_sw_string', + 'op' => LIKE, + 'value' => $filter, + 'sql_op' => 'OR', + 'close-paren' => true + ], + [ + 'field' => 'ts.sft_id', + 'op' => IS, + 'value' => null, + 'sql_op' => 'AND' + ], + [ + 'field' => 's.cpe', + 'op' => LIKE, + 'value' => ($is_os ? "'%/o%'" : "'%/a%'"), + 'sql_op' => 'AND' + ] + ], [ + 'table_joins' => [ + "LEFT JOIN `sagacity`.`target_software` ts ON ts.`sft_id` = s.`id`" . ($tgt_id ? " AND ts.`tgt_id` = $tgt_id" : "") + ], + 'order' => 's.cpe', + 'limit' => 25 + ]); + + $sw = $db->help->execute(); + + if (is_array($sw) && count($sw) && isset($sw['id'])) { + $sw = [0 => $sw]; + } + + if (is_array($sw) && count($sw) && isset($sw[0])) { + foreach ($sw as $row) { + $ret[] = [ + 'sw_id' => $row['id'], + 'cpe' => $row['cpe'], + 'sw_string' => $row['sw_string'] + ]; + } + } + + return header(JSON) . json_encode($ret); +} + +function update_proc_status() +{ + global $conn, $ste; + $control_id = str_replace("_", "-", substr(param('control'), 0, -7)); + if (preg_match("/[A-Z]{4}\-\d\-\d/", $control_id)) { + $proc_id = $control_id; + $sql = "SELECT `ctrl_id` " . + "FROM `sagacity`.`proc_findings` " . + "WHERE " . + "`ste_id`=" . $conn->real_escape_string($ste) . " AND " . + "`proc_id`='" . $conn->real_escape_string($control_id) . "'"; + if ($res = $conn->query($sql)) { + if ($res->num_rows) { + $row = $res->fetch_array(MYSQLI_ASSOC); + + $sql = "UPDATE `sagacity`.`proc_findings` " . + "SET `status`='" . $conn->real_escape_string($_REQUEST['status']) . " " . + "WHERE `ste_id`=" . $conn->real_escape_string($ste) . " AND " . + "`proc_id`='" . $conn->real_escape_string($row['ctrl_id']) . "'"; + } + else { + $sql = "INSERT INTO `sagacity`.`proc_findings` (`ste_id`,`ctrl_id`,`proc_id`,`status`) VALUES (" . + $_REQUEST['ste'] . "," . + "'" . $conn->real_escape_string(substr($proc_id, 0, 6)) . "'" . + "'" . $conn->real_escape_string($proc_id) . "'" . + "'" . $conn->real_escape_string($_REQUEST['status']) . "')"; + } + + if (!$conn->real_query($sql)) { + error_log($conn->error); + Sagacity_Error::sql_handler($sql); + } + } + } + else { + $sql = "SELECT `sub_control_id` FROM `sagacity`.`proc_ia_sub_controls` WHERE `parent_control_id`=?"; + + $sub_ctrls = db_helper::selectrow_array($conn, db_helper::mysql_escape_string($conn, $sql, $control_id)); + + foreach ($sub_ctrl as $proc_id) { + $sql = "SELECT COUNT(1) FROM `sagacity`.`proc_findings` WHERE `ste_id`=? AND `proc_id`=?"; + $sql = db_helper::mysql_escape_string($conn, $sql, $_REQUEST['ste'], $proc_id); + list($cnt) = db_helper::selectrow_array($conn, $sql); + if ($cnt) { + db_helper::run($conn, "UPDATE `sagacity`.`proc_findings` SET `status`=? WHERE `ste_id`=? AND `proc_id`=?", $_REQUEST['status'], $_REQUEST['ste'], $proc_id); + } + else { + db_helper::run($conn, "INSERT INTO `sagacity`.`proc_findings` (`ste_id`,`ctrl_id`,`proc_id`,`status`) VALUES (?,?,?,?)", $_REQUEST['ste'], $control_id, $proc_id, $_REQUEST['status']); + } + } + } +} + +function update_proc_notes() +{ + $control_id = $field = $_REQUEST['control']; + $match = array(); + if (preg_match("/([A-Z]{4}\_\d\_\d)/", $control_id, $match)) { + $control_id = str_replace("_", "-", $match[1]); + + $sql = "SELECT COUNT(1) FROM `sagacity`.`proc_findings` WHERE `ste_id`=? AND `proc_id`=?"; + + switch ($field) { + case (preg_match("/_test_result/", $field) ? true : false): + $field = "`test_results`"; + break; + case (preg_match("/_mit/", $field) ? true : false): + $field = "`mitigations`"; + break; + case (preg_match("/_milestone/", $field) ? true : false): + $field = "`milestones`"; + break; + case (preg_match("/_ref/", $field) ? true : false): + $field = "`ref`"; + break; + case (preg_match("/_notes/", $field) ? true : false): + $field = "`notes`"; + break; + default: + $field = ""; + } + + list($cnt) = db_helper::selectrow_array($conn, $sql, $_REQUEST['ste'], $control_id); + if ($cnt) { + $sql = "UPDATE `sagacity`.`proc_findings` SET=? WHERE `ste_id`=? AND `proc_id`=?"; + + db_helper::run($conn, $sql, $_REQUEST['notes'], $_REQUEST['ste'], $control_id); + } + else { + $sql = "INSERT INTO `sagacity`.`proc_findings` (`ste_id`,`ctrl_id`,`proc_id`,`status`,$field) VALUES (?,?,?,?,?)"; + + db_helper::run($conn, $sql, $_REQUEST['ste'], substr($control_id, 0, 6), $control_id, "Not Reviewed", $_REQUEST['notes']); + } + } + elseif (preg_match("/([A-Z]{4}\_\d)/", $control_id, $match)) { + $control_id = str_replace("_", "-", $match[1]); + + $sql = "SELECT COUNT(1) FROM `sagacity`.`control_findings` WHERE `ste_id`=? AND `control_id`=?"; + list($cnt) = db_helper::selectrow_array($conn, $sql, $_REQUEST['ste'], $control_id); + + switch ($field) { + case (preg_match("/_vul_desc/", $field) ? true : false): + $field = "`vul_desc`"; + break; + case (preg_match("/_mit/", $field) ? true : false): + $field = "`mitigations`"; + break; + case (preg_match("/_ref/", $field) ? true : false): + $field = "`ref`"; + break; + case (preg_match("/_notes/", $field) ? true : false): + $field = "`notes`"; + break; + default: + $field = ""; + } + + if ($cnt) { + $sql = "UPDATE `sagacity`.`control_findings` SET $field=? WHERE `ste_id`=? AND `control_id`=?"; + + db_helper::run($conn, $sql, $_REQUEST['notes'], $_REQUEST['ste'], $control_id); + } + else { + $sql = "INSERT INTO `sagacity`.`control_findings` (`control_id`,`ste_id`,$field,`risk_status`) " . + "VALUES (?,?,?,(SELECT LOWER(`impact`) FROM `sagacity`.`proc_ia_controls` WHERE `control_id`=?))"; + + db_helper::run($conn, $sql, $control_id, $_REQUEST['ste'], $_REQUEST['notes'], $control_id); + } + } + + return true; +} + +function refresh_counts() +{ + $ret = ''; + $sql = "SELECT `id`,`name` FROM `ste_cat` WHERE `ste_id`=?"; + + $cats = db_helper::selectrow_array($conn, $sql, $_REQUEST['ste_id']); + + foreach ($cats as $key => $cat) { + $sql2 = "SELECT (SELECT COUNT(1) " . + "FROM `sagacity`.`target` t " . + "LEFT JOIN `target_checklist` tc ON t.`id`=tc.`tgt_id` " . + "LEFT JOIN `pdi_checklist_lookup` pcl ON pcl.`checklist_id`=tc.`chk_id` " . + "LEFT JOIN `findings` f ON f.`pdi_id`=pcl.`pdi_id` AND t.`id` = f.`tgt_id` " . + "LEFT JOIN `findings_status` fs ON fs.`id`=f.`findings_status_id` " . + "WHERE t.`cat_id`=? AND " . + "fs.`status`='Open' AND " . + "f.`cat`=?) + " . + "(SELECT COUNT(1) AS 'total' " . + "FROM `checklist` c " . + "LEFT JOIN `pdi_checklist_lookup` pcl ON pcl.`checklist_id`=c.`id` " . + "LEFT JOIN `findings` f ON f.`pdi_id`=pcl.`pdi_id` " . + "LEFT JOIN `findings_status` fs ON f.`findings_status_id`=fs.`id` " . + "JOIN `target` t ON t.`id`=f.`tgt_id` " . + "WHERE t.`cat_id`=? AND " . + "c.`name`='Orphan' AND " . + "fs.`status`='Open' AND " . + "f.`cat`=?) AS 'sum_total'"; + + list($open_cat_1) = db_helper::selectrow_array($conn, $sql2, $row['id'], '1', $row['id'], '1'); + list($open_cat_2) = db_helper::selectrow_array($conn, $sql2, $row['id'], '2', $row['id'], '2'); + list($open_cat_3) = db_helper::selectrow_array($conn, $sql2, $row['id'], '3', $row['id'], '3'); + + $sql2 = "SELECT (SELECT COUNT(1) " . + "FROM `target` t " . + "LEFT JOIN `target_checklist` tc ON t.`id`=tc.`tgt_id` " . + "LEFT JOIN `pdi_checklist_lookup` pcl ON pcl.`checklist_id`=tc.`chk_id` " . + "LEFT JOIN `findings` f ON f.`pdi_id`=pcl.`pdi_id` AND t.`id` = f.`tgt_id` " . + "LEFT JOIN `findings_status` fs ON fs.`id`=f.`findings_status_id` " . + "WHERE t.`cat_id`=? AND " . + "(fs.`status`='Not Reviewed' OR fs.`status` IS NULL)) + " . + "(SELECT COUNT(1) AS 'total' " . + "FROM `checklist` c " . + "LEFT JOIN `pdi_checklist_lookup` pcl ON pcl.`checklist_id`=c.`id` " . + "LEFT JOIN `findings` f ON f.`pdi_id`=pcl.`pdi_id` " . + "LEFT JOIN `findings_status` fs ON f.`findings_status_id`=fs.`id` " . + "JOIN `target` t ON t.`id`=f.`tgt_id` " . + "WHERE t.`cat_id`=? AND " . + "c.`name`='Orphan' AND " . + "(fs.`status`='Not Reviewed' OR fs.`status` IS NULL)) AS 'sum_total'"; + + list($not_reviewed) = db_helper::selectrow_array($conn, $sql2, $row['id'], $row['id']); + + $sql2 = "SELECT (SELECT COUNT(1) " . + "FROM `target` t " . + "LEFT JOIN `target_checklist` tc ON t.`id`=tc.`tgt_id` " . + "LEFT JOIN `pdi_checklist_lookup` pcl ON pcl.`checklist_id`=tc.`chk_id` " . + "LEFT JOIN `findings` f ON f.`pdi_id`=pcl.`pdi_id` AND t.`id` = f.`tgt_id` " . + "LEFT JOIN `findings_status` fs ON fs.`id`=f.`findings_status_id` " . + "WHERE t.`cat_id`=? AND " . + "fs.`status`='Exception') + " . + "(SELECT COUNT(1) AS 'total' " . + "FROM `checklist` c " . + "LEFT JOIN `pdi_checklist_lookup` pcl ON pcl.`checklist_id`=c.`id` " . + "LEFT JOIN `findings` f ON f.`pdi_id`=pcl.`pdi_id` " . + "LEFT JOIN `findings_status` fs ON f.`findings_status_id`=fs.`id` " . + "JOIN `target` t ON t.`id`=f.`tgt_id` " . + "WHERE t.`cat_id`=? AND " . + "c.`name`='Orphan' AND " . + "fs.`status`='Exception') AS 'sum_total'"; + + list($exception) = db_helper::selectrow_array($conn, $sql2, $row['id'], $row['id']); + + $sql2 = "SELECT (SELECT COUNT(1) " . + "FROM `target` t " . + "LEFT JOIN `target_checklist` tc ON t.`id`=tc.`tgt_id` " . + "LEFT JOIN `pdi_checklist_lookup` pcl ON pcl.`checklist_id`=tc.`chk_id` " . + "LEFT JOIN `findings` f ON f.`pdi_id`=pcl.`pdi_id` AND t.`id` = f.`tgt_id` " . + "LEFT JOIN `findings_status` fs ON fs.`id`=f.`findings_status_id` " . + "WHERE t.`cat_id`=? AND " . + "fs.`status`='False Positive') + " . + "(SELECT COUNT(1) AS 'total' " . + "FROM `checklist` c " . + "LEFT JOIN `pdi_checklist_lookup` pcl ON pcl.`checklist_id`=c.`id` " . + "LEFT JOIN `findings` f ON f.`pdi_id`=pcl.`pdi_id` " . + "LEFT JOIN `findings_status` fs ON f.`findings_status_id`=fs.`id` " . + "JOIN `target` t ON t.`id`=f.`tgt_id` " . + "WHERE t.`cat_id`=? AND " . + "c.`name`='Orphan' AND " . + "fs.`status`='False Positive') AS 'sum_total'"; + + list($false_positive) = db_helper::selectrow_array($conn, $sql2, $row['id'], $row['id']); + + $row['name'] = str_replace(array(".", "-", " "), "", $row['name']); + + $ret .= ""; + } + + return $ret; +} + +function update_finding_status() +{ + global $conn; + $sql = "UPDATE `findings` SET " . + "`findings_status_id`=? " . + "WHERE " . + "`tgt_id`=? AND `pdi_id`=?"; + + db_helper::run($conn, $sql, $_REQUEST['status'], $_REQUEST['host_id'], $_REQUEST['pdi_id']); + + return true; +} + +function update_finding_ia_controls() +{ + $controls = explode(" ", $_REQUEST['ia_controls']); + $host_ids = explode(",", $_REQUEST['host_id']); + + return true; +} + +function update_finding_notes() +{ + global $conn; + $host_ids = explode(",", $_REQUEST['host_id']); + + $sql = "UPDATE `sagacity`.`findings` SET " . + "`notes`=? " . + "WHERE " . + "`tgt_id` IN (" . implode(",", $host_ids) . ") AND `pdi_id`=?"; + + db_helper::run($conn, $sql, $_REQUEST['notes'], $_REQUEST['pdi_id']); + + return true; +} + +/** + * Function to update the result script parsing status + * + * @global db $db + * @global int $ste + * + * @return array + */ +function update_script_status() +{ + global $db, $ste; + $ret = []; + + $type = filter_input(INPUT_POST, 'type', FILTER_SANITIZE_STRING, FILTER_NULL_ON_FAILURE); + $status = filter_input(INPUT_POST, 'status', FILTER_SANITIZE_STRING, FILTER_NULL_ON_FAILURE); + + if (!empty($type) && !empty($status)) { + $scans = $db->get_ScanData($ste, null, $status, $type); + } + elseif (!empty($type)) { + $scans = $db->get_ScanData($ste, null, null, $type); + } + elseif (!empty($status)) { + $scans = $db->get_ScanData($ste, null, $status); + } + else { + $scans = $db->get_ScanData($ste); + } + + foreach ($scans as $scan) { + $file_name = str_replace(["(", ")"], "", str_replace(" ", "_", $scan->get_File_Name())); + $diff = $scan->get_Last_Update()->diff($scan->get_Start_Time()); + + $ret[] = [ + "scan_id" => $scan->get_ID(), + "file_name" => $scan->get_File_Name(), + "id" => $file_name, + "file_date" => $scan->get_File_DateTime()->format("Y-m-d"), + "pid" => $scan->get_PID(), + "source" => $scan->get_Source()->get_Name(), + 'source_img' => $scan->get_Source()->get_Icon(), + "status" => $scan->get_Status(), + "perc_comp" => $scan->get_Percentage_Complete(), + "last_host" => $scan->get_Last_Host(), + "start_time" => $scan->get_Start_Time()->format("Y-m-d H:i:s"), + "update" => $scan->get_Last_Update()->format("Y-m-d H:i:s"), + "host_count" => $scan->get_Total_Host_Count(), + "error" => $scan->isScanError(), + "run_time" => $diff->format("%H:%I:%S") + ]; + } + + return json_encode(['success' => 1, 'results' => $ret]); +} + +/** + * + * @global mysqli $conn + * @global db $db + */ +function get_STE_details() +{ + global $conn, $db; + $ret = ''; + $open_high = $open_med = $open_low = $proc_na = $proc_c = $proc_total = $open_cat_1 = $open_cat_2 = $open_cat_3 = $tech_na = $tech_nf = $tech_total = 0; + + list($tech_total) = db_helper::selectrow_array($conn, "SELECT COUNT(1) FROM `sagacity`.`findings` f JOIN `sagacity`.`target` t ON t.`id`=f.`tgt_id` WHERE t.`ste_id`=?", $_REQUEST['ste_id']); + list($proc_total) = db_helper::selectrow_array($conn, "SELECT COUNT(1) FROM `sagacity`.`proc_findings` WHERE `ste_id`=?", $_REQUEST['ste_id']); + + $sql = "SELECT COUNT(1) " . + "FROM `sagacity`.`proc_findings` pf " . + "JOIN `sagacity`.`control_findings` cf ON pf.`ctrl_id`=cf.`control_id` " . + "WHERE pf.`ste_id`=? " . + "AND pf.`status`=? " . + "AND cf.`risk_status`=? " + ; + + list($open_high) = db_helper::selectrow_array($conn, $sql, $_REQUEST['ste_id'], 'Non-Compliant', 'high'); + list($open_med) = db_helper::selectrow_array($conn, $sql, $_REQUEST['ste_id'], 'Non-Compliant', 'medium'); + list($open_low) = db_helper::selectrow_array($conn, $sql, $_REQUEST['ste_id'], 'Non-Compliant', 'low'); + + $sql = "SELECT COUNT(1) " . + "FROM `sagacity`.`proc_findings` pf " . + "JOIN `sagacity`.`control_findings` cf ON pf.`ctrl_id`=cf.`control_id` " . + "WHERE pf.`ste_id`=? " . + "AND pf.`status`=? " + ; + + list($proc_na) = db_helper::selectrow_array($conn, $sql, $_REQUEST['ste_id'], 'Not Applicable'); + list($proc_c) = db_helper::selectrow_array($conn, $sql, $_REQUEST['ste_id'], 'Compliant'); + + $sql = "SELECT `ste`.`deviations`,`ste`.`recommendations`,`ste`.`residual_risk`," . + "`ste`.`conclusion`,`ste`.`risk_status`,sys.`mitigations`,sys.`executive_summary` " . + "FROM `sagacity`.`ste`,`sagacity`.`system` sys " . + "WHERE `ste`.`system_id`=sys.`id` AND " . + "`ste`.`id`=?"; + + list($dev, $rec, $res, $con, $status, $mit, $exec) = db_helper::selectrow_array($conn, $sql, $_REQUEST['ste_id']); + + $sql = "SELECT `id`,`name` FROM `sagacity`.`ste_cat` WHERE `ste_id`=?"; + + $cats = $db->get_STE_Cat_List($_REQUEST['ste_id']); + + foreach ($cats as $cat) { + $sql2 = "SELECT (SELECT COUNT(1) " . + "FROM `sagacity`.`target` t " . + "LEFT JOIN `sagacity`.`target_checklist` tc ON t.`id`=tc.`tgt_id` " . + "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=tc.`chk_id` " . + "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` AND t.`id` = f.`tgt_id` " . + "LEFT JOIN `sagacity`.`findings_status` fs ON fs.`id`=f.`findings_status_id` " . + "WHERE t.`cat_id`=? AND " . + "(fs.`status`='Open' OR fs.`status`='Exception') AND " . + "f.`cat`=?) + " . + "(SELECT COUNT(1) AS 'total' " . + "FROM `sagacity`.`checklist` c " . + "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=c.`id` " . + "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` " . + "LEFT JOIN `sagacity`.`findings_status` fs ON f.`findings_status_id`=fs.`id` " . + "JOIN `sagacity`.`target` t ON t.`id`=f.`tgt_id` " . + "WHERE t.`cat_id`=? AND " . + "c.`name`='Orphan' AND " . + "(fs.`status`='Open' OR fs.`status`='Exception') AND " . + "f.`cat`=?) AS 'sum_total'"; + + list($tmp) = db_helper::selectrow_array($conn, $sql2, $cat->get_ID(), '1', $cat->get_ID(), '1'); + $open_cat_1 += $tmp; + list($tmp) = db_helper::selectrow_array($conn, $sql2, $cat->get_ID(), '2', $cat->get_ID(), '2'); + $open_cat_2 += $tmp; + list($tmp) = db_helper::selectrow_array($conn, $sql2, $cat->get_ID(), '3', $cat->get_ID(), '3'); + $open_cat_3 += $tmp; + + $sql2 = "SELECT (SELECT COUNT(1) " . + "FROM `sagacity`.`target` t " . + "LEFT JOIN `sagacity`.`target_checklist` tc ON t.`id`=tc.`tgt_id` " . + "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=tc.`chk_id` " . + "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` AND t.`id` = f.`tgt_id` " . + "LEFT JOIN `sagacity`.`findings_status` fs ON fs.`id`=f.`findings_status_id` " . + "WHERE t.`cat_id`=? AND " . + "fs.`status`='Not Applicable') + " . + "(SELECT COUNT(1) AS 'total' " . + "FROM `sagacity`.`checklist` c " . + "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=c.`id` " . + "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` " . + "LEFT JOIN `sagacity`.`findings_status` fs ON f.`findings_status_id`=fs.`id` " . + "JOIN `sagacity`.`target` t ON t.`id`=f.`tgt_id` " . + "WHERE t.`cat_id`=? AND " . + "c.`name`='Orphan' AND " . + "fs.`status`='Not Applicable') AS 'sum_total'"; + + list($tmp) = db_helper::selectrow_array($conn, $sql2, $cat->get_ID(), $cat->get_ID()); + $tech_na += $tmp; + + $sql2 = "SELECT (SELECT COUNT(1) " . + "FROM `sagacity`.`target` t " . + "LEFT JOIN `sagacity`.`target_checklist` tc ON t.`id`=tc.`tgt_id` " . + "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=tc.`chk_id` " . + "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` AND t.`id` = f.`tgt_id` " . + "LEFT JOIN `sagacity`.`findings_status` fs ON fs.`id`=f.`findings_status_id` " . + "WHERE t.`cat_id`=? AND " . + "fs.`status`='Not a Finding') + " . + "(SELECT COUNT(1) AS 'total' " . + "FROM `sagacity`.`checklist` c " . + "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=c.`id` " . + "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` " . + "LEFT JOIN `sagacity`.`findings_status` fs ON f.`findings_status_id`=fs.`id` " . + "JOIN `sagacity`.`target` t ON t.`id`=f.`tgt_id` " . + "WHERE t.`cat_id`=? AND " . + "c.`name`='Orphan' AND " . + "fs.`status`='Not a Finding') AS 'sum_total'"; + + list($tmp) = db_helper::selectrow_array($conn, $sql2, $cat->get_ID(), $cat->get_ID()); + $tech_nf += $tmp; + } + +#'overall_mitigations,deviations,recommendations,residual_risk,conclusion,executive_summary' + $ret .= "
" . + "

Overall Mitigations

" . + "" . + "

Deviations

" . + "" . + "

Recommendations

" . + "" . + "Residual Risk Analysis  " . + "
" . + "" . + "

Conclusion

" . + "" . + "

Executive Summary

" . + "" . + "
" . + "
" . + "

Procedural ($proc_total)

" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "
HMLNAC
$open_high$open_med$open_low$proc_na$proc_c
" . sprintf("%i%%", ($open_high / $proc_total) * 100) . "" . sprintf("%i%%", ($open_med / $proc_total) * 100) . "" . sprintf("%i%%", ($open_low / $proc_total) * 100) . "" . sprintf("%i%%", ($proc_na / $proc_total) * 100) . "" . sprintf("%i%%", ($proc_c / $proc_total) * 100) . "
" . + "

Technical ($tech_total)

" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "
IIIIIINANF
$open_cat_1$open_cat_2$open_cat_3$tech_na$tech_nf
" . sprintf("%i%%", ($open_cat_1 / $tech_total) * 100) . "" . sprintf("%i%%", ($open_cat_2 / $tech_total) * 100) . "" . sprintf("%i%%", ($open_cat_3 / $tech_total) * 100) . "" . sprintf("%i%%", ($tech_na / $tech_total) * 100) . "" . sprintf("%i%%", ($tech_nf / $tech_total) * 100) . "
" . + "
"; +} + +function update_STE_details() +{ + global $conn; + if ($_REQUEST['id'] == 'deviations') { + $sql = "UPDATE `sagacity`.`ste` SET `deviations`=? WHERE `id`=?"; + } + elseif ($_REQUEST['id'] == 'recommendations') { + $sql = "UPDATE `sagacity`.`ste` SET `recommendations`=? WHERE `id`=?"; + } + elseif ($_REQUEST['id'] == 'residual_risk') { + $sql = "UPDATE `sagacity`.`ste` SET `residual_risk`=? WHERE `id`=?"; + } + elseif ($_REQUEST['id'] == 'conclusion') { + $sql = "UPDATE `sagacity`.`ste` SET `conclusion`=? WHERE `id`=?"; + } + elseif ($_REQUEST['id'] == 'overall_mitigations') { + $sql = "UPDATE `sagacity`.`system` JOIN `sagacity`.`ste` ON `ste`.`system_id`=`system`.`id` SET `mitigations`=? WHERE `ste`.`id`=?"; + } + elseif ($_REQUEST['id'] == 'executive_summary') { + $sql = "UPDATE `sagacity`.`system` JOIN `sagacity`.`ste` ON `ste`.`system_id`=`system`.`id` SET `executive_summary`=? WHERE `ste`.`id`=?"; + } + + db_helper::run($conn, $sql, $_REQUEST['text'], $_REQUEST['ste_id']); +} + +function get_control_details() +{ + global $conn, $db; + $ret = ''; + + $sql = "SELECT " . + "pc.`control_id`,pc.`name`,pc.`description`,pc.`impact`," . + "cf.`vul_desc`,cf.`mitigations`,cf.`risk_analysis`,cf.`risk_status`,cf.`done` " . + "FROM `sagacity`.`proc_ia_controls` pc " . + "LEFT JOIN `sagacity`.`control_findings` cf ON cf.`control_id`=pc.`control_id` " . + "WHERE pc.`control_id`=? AND cf.`ste_id`=?"; + + $ste = $db->get_STE($_REQUEST['ste'])[0]; + + $controls = $db->get_Proc_IA_Controls($ste, $_REQUEST['id'])[0]; + + $risk_analysis = $controls->finding->risk_analysis; + $ctrl_id = $controls->get_Control_ID(); + $impact = $controls->get_Impact(); + + $ret .= "
" . + $controls->get_Control_ID() . " - " . $controls->get_Name() . + "" . + "" . + " " . + "finding->done ? " checked" : "") . " id='done' value='1' onclick='javascript:toggle_control_completion();' />" . + "" . + "" . + ucfirst($controls->get_Worst_Status_String()) . + "" . + "" . + "
" . + "
" . $controls->get_Description() . "
" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" + ; + + $sql = "SELECT " . + "psc.`sub_control_id`,psc.`name`,pf.`test_results`,pf.`mitigations`,pf.`status` " . + "FROM `sagacity`.`proc_ia_sub_controls` psc " . + "LEFT JOIN `sagacity`.`proc_findings` pf ON psc.`sub_control_id`=pf.`proc_id` " . + "WHERE pf.`ste_id`=? AND " . + "psc.`parent_control_id`=? AND " . + "(pf.`status`='Non-Compliant' OR pf.`status`='Not Applicable')" + ; + + if ($res = $conn->query($sql)) { + while ($row = $res->fetch_array(MYSQLI_ASSOC)) { + $status = str_replace(" ", "_", $row['status']); + $ret .= "" . + "" . + "" . + "" . + "" + ; + } + } + + $ret .= "
Procedure /
Validation Step
FindingsMitigations
" . $controls->get_Control_ID() . "
" . $controls->get_Name() . "
" . $controls->finding->vul_desc . "" . $controls->finding->mitigations . "
" . $row['sub_control_id'] . "  " . $row['status'] . "
" . $row['name'] . "
" . $row['test_results'] . "" . $row['mitigations'] . "
" . + "
" . + "" . $controls->get_Control_ID() . " - Risk Analysis  " . + "" . + "" . + "" . + "
" . + "
" . + "$ctrl_id - Technical Findings" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + ""; + + $cat_1 = $db->get_Control_Finding_Count($controls, $_REQUEST['ste_id'], "Open", 1); + $cat_2 = $db->get_Control_Finding_Count($controls, $_REQUEST['ste_id'], "Open", 2); + $cat_3 = $db->get_Control_Finding_Count($controls, $_REQUEST['ste_id'], "Open", 3); + + /* + $sql = "SELECT ". + "IFNULL((SELECT COUNT(1) ". + "FROM `sagacity`.`target` t ". + "LEFT JOIN `sagacity`.`target_checklist` tc ON t.`id`=tc.`tgt_id` ". + "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=tc.`chk_id` ". + "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` AND t.`id` = f.`tgt_id` ". + "LEFT JOIN `sagacity`.`findings_status` fs ON fs.`id`=f.`findings_status_id` ". + "LEFT JOIN `sagacity`.`finding_controls` fc ON fc.`finding_id`=f.`id` ". + "WHERE ". + "(fs.`status`='Open' OR fs.`status`='Exception') AND ". + "f.`cat`=? AND ". + "fc.`ia_control`=? AND ". + "t.`ste_id`=? ". + "GROUP BY f.`pdi_id`". + "), 0)". + " + ". + "IFNULL((SELECT COUNT(1) ". + "FROM `sagacity`.`checklist` c ". + "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=c.`id` ". + "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` ". + "LEFT JOIN `sagacity`.`findings_status` fs ON f.`findings_status_id`=fs.`id` ". + "LEFT JOIN `sagacity`.`target` t ON t.`id`=f.`tgt_id` ". + "LEFT JOIN `sagacity`.`finding_controls` fc ON fc.`finding_id`=f.`id` ". + "WHERE ". + "c.`name`='Orphan' AND ". + "(fs.`status`='Open' OR fs.`status`='Exception') AND ". + "f.`cat`=? AND ". + "fc.`ia_control`=? AND ". + "t.`ste_id`=? ". + "GROUP BY f.`pdi_id`". + "), 0) AS 'sum_count'"; + + ($cat_1) = $dbh->selectrow_array($sql, undef, 1, param('id'), param('ste_id'), 1, param('id'), param('ste_id')); + ($cat_2) = $dbh->selectrow_array($sql, undef, 2, param('id'), param('ste_id'), 2, param('id'), param('ste_id')); + ($cat_3) = $dbh->selectrow_array($sql, undef, 3, param('id'), param('ste_id'), 3, param('id'), param('ste_id')); + */ + $sql = "SELECT " . + "IFNULL((SELECT COUNT(1) " . + "FROM `sagacity`.`target` t " . + "LEFT JOIN `sagacity`.`target_checklist` tc ON t.`id`=tc.`tgt_id` " . + "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=tc.`chk_id` " . + "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` AND t.`id` = f.`tgt_id` " . + "LEFT JOIN `sagacity`.`findings_status` fs ON fs.`id`=f.`findings_status_id` " . + "LEFT JOIN `sagacity`.`finding_controls` fc ON fc.`finding_id`=f.`id` " . + "WHERE " . + "(fs.`status`='Open' OR fs.`status`='Exception') AND " . + "fc.`ia_control`=? AND " . + "t.`ste_id`=? " . + "), 0)" . + " + " . + "IFNULL((SELECT COUNT(1) " . + "FROM `sagacity`.`checklist` c " . + "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=c.`id` " . + "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` " . + "LEFT JOIN `sagacity`.`findings_status` fs ON f.`findings_status_id`=fs.`id` " . + "LEFT JOIN `sagacity`.`target` t ON t.`id`=f.`tgt_id` " . + "LEFT JOIN `sagacity`.`finding_controls` fc ON fc.`finding_id`=f.`id` " . + "WHERE " . + "c.`name`='Orphan' AND " . + "(fs.`status`='Open' OR fs.`status`='Exception') AND " . + "fc.`ia_control`=? AND " . + "t.`ste_id`=? " . + "), 0) AS 'sum_count'"; + + $unique = db_helper::selectrow_array($conn, $sql, $controls->get_Control_ID(), $_REQUEST['ste_id'], $controls->get_Control_ID(), $_REQUEST['ste_id']); + /* + $sql = "SELECT ". + "IFNULL((SELECT COUNT(1) ". + "FROM `sagacity`.`target` t ". + "LEFT JOIN `sagacity`.`target_checklist` tc ON t.`id`=tc.`tgt_id` ". + "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=tc.`chk_id` ". + "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` AND t.`id` = f.`tgt_id` ". + "LEFT JOIN `sagacity`.`findings_status` fs ON fs.`id`=f.`findings_status_id` ". + "LEFT JOIN `sagacity`.`finding_controls` fc ON fc.`finding_id`=f.`id` ". + "WHERE ". + "fs.`status`=? AND ". + "fc.`ia_control`=? AND ". + "t.`ste_id`=? ". + "GROUP BY f.`pdi_id`". + "), 0)". + " + ". + "IFNULL((SELECT COUNT(1) ". + "FROM `sagacity`.`checklist` c ". + "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=c.`id` ". + "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` ". + "LEFT JOIN `sagacity`.`findings_status` fs ON f.`findings_status_id`=fs.`id` ". + "LEFT JOIN `sagacity`.`target` t ON t.`id`=f.`tgt_id` ". + "LEFT JOIN `sagacity`.`finding_controls` fc ON fc.`finding_id`=f.`id` ". + "WHERE ". + "c.`name`='Orphan' AND ". + "fs.`status`=? AND ". + "fc.`ia_control`=? AND ". + "t.`ste_id`=? ". + "GROUP BY f.`pdi_id`". + "), 0) AS 'sum_count'"; + + ($na) = $dbh->selectrow_array($sql, undef, "Not Applicable", param('id'), param('ste_id'), "Not Applicable", param('id'), param('ste_id')); + ($nf) = $dbh->selectrow_array($sql, undef, "Not a Finding", param('id'), param('ste_id'), "Not a Finding", param('id'), param('ste_id')); + */ + $na = $db->get_Control_Finding_Count($controls, $_REQUEST['ste_id'], "Not Applicable"); + $nf = $db->get_Control_Finding_Count($controls, $_REQUEST['ste_id'], "Not a Finding"); + + $sql = "SELECT " . + "IFNULL((SELECT COUNT(1) " . + "FROM `sagacity`.`target` t " . + "LEFT JOIN `sagacity`.`target_checklist` tc ON t.`id`=tc.`tgt_id` " . + "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=tc.`chk_id` " . + "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` AND t.`id` = f.`tgt_id` " . + "LEFT JOIN `sagacity`.`findings_status` fs ON fs.`id`=f.`findings_status_id` " . + "LEFT JOIN `sagacity`.`finding_controls` fc ON fc.`finding_id`=f.`id` " . + "WHERE " . + "(fs.`status`='Open' OR fs.`status`='Exception') AND " . + "fc.`ia_control`=? AND " . + "t.`ste_id`=? " . + "GROUP BY f.`tgt_id`" . + "), 0)" . + " + " . + "IFNULL((SELECT COUNT(1) " . + "FROM `sagacity`.`checklist` c " . + "LEFT JOIN `sagacity`.`pdi_checklist_lookup` pcl ON pcl.`checklist_id`=c.`id` " . + "LEFT JOIN `sagacity`.`findings` f ON f.`pdi_id`=pcl.`pdi_id` " . + "LEFT JOIN `sagacity`.`findings_status` fs ON f.`findings_status_id`=fs.`id` " . + "LEFT JOIN `sagacity`.`target` t ON t.`id`=f.`tgt_id` " . + "LEFT JOIN `sagacity`.`finding_controls` fc ON fc.`finding_id`=f.`id` " . + "WHERE " . + "c.`name`='Orphan' AND " . + "(fs.`status`='Open' OR fs.`status`='Exception') AND " . + "fc.`ia_control`=? AND " . + "t.`ste_id`=? " . + "GROUP BY f.`tgt_id`" . + "), 0) AS 'sum_count'"; + + $host_count = db_helper::selectrow_array($conn, $sql, $controls->get_Control_ID(), $_REQUEST['ste_id'], $controls->get_Control_ID(), $_REQUEST['ste_id']); + + $ret .= "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + ""; + + $ret .= "
IIIIIINANFUniqueHostsTotal
$cat_1$cat_2$cat_3$na$nf" . $unique['sum_count'] . "" . $host_count['sum_count'] . "" . ($cat_1 + $cat_2 + $cat_3) . "
" . + "
" . + "
" . + "" . + "" . + "" . + "" . + "" . + "" + ; + + $sql = "SELECT " . + "f.`pdi_id`,s.`stig_id`,f.`cat`,pdi.`short_title`," . + "(SELECT GROUP_CONCAT(fc.`ia_control` SEPARATOR ' ') " . + "FROM `sagacity`.`finding_controls` fc " . + "WHERE " . + "fc.`finding_id`=f.`id` " . + ") AS ia_controls " . + "FROM `sagacity`.`findings` f " . + "JOIN `sagacity`.`findings_status` fs ON fs.`id`=f.`findings_status_id` " . + "JOIN `sagacity`.`stigs` s ON s.`pdi_id`=f.`pdi_id` " . + "JOIN `sagacity`.`pdi_catalog` pdi ON pdi.`id`=f.`pdi_id` " . + "WHERE (fs.`status`='Open' OR fs.`status`='Exception') " . + "GROUP BY f.`pdi_id` " . + "HAVING ia_controls LIKE '%" . $_REQUEST['id'] . "%' " . + "ORDER BY s.`stig_id`" + ; + + if ($res = $conn->query($sql)) { + while ($row = $res->fetch_assoc()) { + $cat = str_repeat("I", $row['cat']); + $ias = explode(" ", $row['ia_controls']); + $ia_cnt = (is_array($ias) ? count($ias) : 0); + $stig = str_replace(".", "", $row['stig_id']); + + $sql2 = "SELECT " . + "GROUP_CONCAT(DISTINCT f.`id` SEPARATOR ',') AS 'finding_ids'," . + "GROUP_CONCAT(DISTINCT t.`name` SEPARATOR ', ') AS 'affected_hosts',f.`notes` " . + "FROM `sagacity`.`target` t " . + "JOIN `sagacity`.`findings` f ON f.`tgt_id`=t.`id` " . + "JOIN `sagacity`.`finding_controls` fc ON fc.`finding_id`=f.`id` " . + "WHERE t.`ste_id`=? AND f.`pdi_id`=?"; + + $row = db_helper::selectrow_array($conn, $sql2, $_REQUEST['ste_id'], $row['pdi_id'])[0]; + $ids = $row['finding_ids']; + $hosts = $row['affected_hosts']; + $notes = $row['notes']; + + $ret .= "" . + "" . + "" . + "" . + "" . + "" . + "" . + ""; + } + } + + + $ret .= "
STIG ID" . + "Cat" . + "M" . + "Vulnerability Title" . + "Affected Hosts" . + "Notes
(inc.)" . + "
" . $row['stig_id'] . "$cat" . + ($ia_cnt > 1 ? "" : "") . + "" . + "" . $row['short_title'] . "$hosts$notes
"; + + return $ret; +} + +function update_risk_status() +{ + global $conn; + $sql = "UPDATE `sagacity`.`control_findings` SET `risk_status`=? WHERE `ste_id`=? AND `control_id`=?"; + db_helper::run($conn, $sql, strtolower($_REQUEST['status']), $_REQUEST['ste_id'], $_REQUEST['ctrl_id']); +} + +function update_risk_analysis() +{ + global $conn; + $sql = "UPDATE `sagacity`.`control_findings` SET `risk_analysis`=? WHERE `control_id`=? AND `ste_id`=?"; + db_helper::run($conn, $sql, $_REQUEST['text'], $_REQUEST['ctrl_id'], $_REQUEST['ste_id']); +} + +function update_control_completion() +{ + global $conn; + $sql = "UPDATE `sagacity`.`control_findings` SET `done`=IF(`done`=1,0,1) WHERE `control_id`=? AND `ste_id`=?"; + db_helper::run($conn, $sql, $_REQUEST['ctrl_id'], $_REQUEST['ste_id']); +} + +function update_stig_control() +{ + global $conn; + $sql = "DELETE FROM `sagacity`.`finding_controls` WHERE `finding_id` IN (" . $_REQUEST['ids'] . ")"; + $conn->real_query($sql); + + $sql = "INSERT INTO `sagacity`.`finding_controls` (`finding_id`,`ia_control`) VALUES "; + $ids = explode(",", $_REQUEST['ids']); + for ($x = 0; $x < count($ids); $x++) { + $sql .= "(" . $ids[$x] . ",'" . $_REQUEST['ctrl_id'] . "'),"; + } + $sql = substr($sql, 0, -1); + $conn->real_query($sql); +} + +/** + * Function to get targets from the category + * + * @global db $db + * + * @param int $cat_id + * + * @return mixed + */ +function get_hosts($cat_id = null) +{ + global $db; + $ret = ['cat_id' => $cat_id]; + $ste_id = filter_input(INPUT_COOKIE, 'ste', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE); + $tgts = []; + + if ($cat_id) { + $ste_cat = $db->get_Category($cat_id)[0]; + $tgts = $db->get_Target_By_Category($cat_id); + } + elseif (is_numeric($ste_id)) { + $tgts = $db->get_Unassigned_Targets($ste_id); + } + else { + return json_encode(['error' => "Invalid info"]); + } + + foreach ($tgts as $key => $tgt) { + $chks = $db->get_Target_Checklists($tgt->get_ID()); + if ($cat_id) { + $exp_scan_srcs = $db->get_Expected_Category_Sources($ste_cat); + } + else { + $exp_scan_srcs = null; + } + $scan_srcs = $db->get_Target_Scan_Sources($tgt, $exp_scan_srcs); + $icons = []; + $icon_str = ''; + $src_str = ''; + + foreach ($chks as $chk) { + if (!in_array($chk->get_Icon(), array_keys($icons))) { + $icons[$chk->get_Icon()]['icon'] = $chk->get_Icon(); + $icons[$chk->get_Icon()]['name'] = ''; + } + $icons[$chk->get_Icon()]['name'] .= "{$chk->get_Name()} V{$chk->get_Version()}R{$chk->get_Release()} ({$chk->get_type()})" . PHP_EOL; + } + + foreach ($icons as $icon => $data) { + $icon_str .= ""; + } + + foreach ($scan_srcs as $key => $src) { + $icon = $src['src']->get_Icon(); + if($src['scan_error']) { + $icon = strtolower($src['src']->get_Name()) . "-failed.png"; + } + + $src_str .= "get_Name()}"; + if (isset($src['count']) && $src['count']) { + $src_str .= " ({$src['count']})"; + } + $src_str .= "' class='checklist_image' />"; + } + + $ret['targets'][] = array_merge([ + 'id' => $tgt->get_ID(), + 'ste_id' => $tgt->get_STE_ID(), + 'name' => $tgt->get_Name(), + 'os' => $tgt->get_OS_String(), + 'location' => $tgt->get_Location(), + 'auto' => $tgt->get_Task_Status($tgt->get_Auto_Status_ID()), + 'man' => $tgt->get_Task_Status($tgt->get_Man_Status_ID()), + 'data' => $tgt->get_Task_Status($tgt->get_Data_Status_ID()), + 'fp' => $tgt->get_Task_Status($tgt->get_FP_Cat1_Status_ID()), + 'ip' => (count($tgt->interfaces) ? array_keys($tgt->interfaces)[0] : ''), + 'notes' => $tgt->getDisplayNotes(), + 'scans' => $src_str, + 'chk' => $icon_str, + 'nr' => $tgt->getNotReviewedCount(), + 'na' => $tgt->getNotApplicableCount(), + 'nf' => $tgt->getNotAFindingCount(), + 'cat_1' => $tgt->getCat1Count(), + 'cat_2' => $tgt->getCat2Count(), + 'cat_3' => $tgt->getCat3Count(), + 'comp' => $tgt->getCompliantPercent(), + 'assessed' => $tgt->getAssessedPercent() + ]); + } + + return json_encode($ret); +} + +function get_target_data() +{ + global $db; + + $tgt = $db->get_Target_Details($_REQUEST['ste_id'], $_REQUEST['tgt_id'])[0]; + + switch ($_REQUEST['type']) { + case 'netstat': + return $tgt->get_Netstat_Connections(); + case 'routes': + return $tgt->get_Routes(); + case 'firewall': + return $tgt->get_Firewall_Config(); + case 'shares': + return $tgt->get_Shares(); + case 'mounted': + return $tgt->get_Mounted(); + case 'process_list': + return $tgt->get_Process_List(); + case 'autorun': + return $tgt->get_Autorun(); + case 'services': + return $tgt->get_Services(); + case 'remote_registry': + return $tgt->get_Remote_Registry(); + case 'system': + return $tgt->get_System(); + case 'bios': + return $tgt->get_BIOS(); + case 'copyright': + return $tgt->get_Copyright(); + case 'missing_patches': + return $tgt->get_Missing_Patches(); + case 'user_list': + return $tgt->get_User_List(); + case 'disabled_accts': + return $tgt->get_Disabled_Accts(); + case 'stag_pwds': + return $tgt->get_Stag_Pwds(); + case 'never_logged_in': + return $tgt->get_Never_Logged_In(); + case 'pwds_never_expire': + return $tgt->get_Pwds_Never_Expire(); + } + + return null; +} + +function target_filter($ste_id, $criteria) +{ + global $db, $conn; + $where = array(); + $tgts = array(); + $idx = 0; + $like = false; + $ret = array(); + + $search = explode("\n", $criteria); + unset($search[count($search) - 1]); + + foreach ($search as $str) { + if (!$str) { + continue; + } + switch ($str) { + case (preg_match("/name /i", $str) ? true : false): + $where[] = "t.`name`"; + break; + case (preg_match("/sw /i", $str) ? true : false): + $where[] = "sw.`cpe`"; + break; + case (preg_match("/os /i", $str) ? true : false): + $where[] = "os.`cpe`"; + break; + case (preg_match("/auto status /i", $str) ? true : false): + $where[] = "`as`.`status`"; + break; + case (preg_match("/manual status /i", $str) ? true : false): + $where[] = "ms.`status`"; + break; + case (preg_match("/data gathering status /i", $str) ? true : false): + $where[] = "ds.`status`"; + break; + case (preg_match("/fp\/cat i status /i", $str) ? true : false): + $where[] = "fp.`status`"; + break; + case (preg_match("/category /i", $str) ? true : false): + $where[] = "t.`cat_id`"; + break; + case (preg_match("/open port /i", $str) ? true : false): + $where[] = "CONCAT(pps.`proto`,'/',pps.`port`)"; + break; + default: + continue 2; + } + + if (($pos = strpos($str, "!~")) !== false) { + $where[$idx] .= " NOT LIKE "; + $like = true; + } + elseif (($pos = strpos($str, "~=")) !== false) { + $where[$idx] .= " LIKE "; + $like = true; + } + elseif (($pos = strpos($str, "!=")) !== false) { + $where[$idx] .= " != "; + } + elseif (($pos = strpos($str, "=")) !== false) { + $where[$idx] .= " = "; + $pos--; + } + + $where[$idx] .= "'" . ($like ? "%" : "") . + $conn->real_escape_string(substr($str, $pos + 4, -1)) . + ($like ? "%" : "") . "'"; + + $idx++; + $like = false; + } + + $where_str = implode(" AND ", $where); + + $sql = "SELECT COUNT(DISTINCT(t.`id`)) as 'cnt' " . + "FROM `sagacity`.`target` t " . + "LEFT JOIN `sagacity`.`task_status` `as` ON t.`auto_status_id`=`as`.`id` " . + "LEFT JOIN `sagacity`.`task_status` ms ON t.`man_status_id`=ms.`id` " . + "LEFT JOIN `sagacity`.`task_status` ds ON t.`data_status_id`=ds.`id` " . + "LEFT JOIN `sagacity`.`task_status` fp ON t.`fp_cat1_status_id`=fp.`id` " . + "LEFT JOIN `sagacity`.`target_software` ts ON ts.`tgt_id`=t.`id` " . + "LEFT JOIN `sagacity`.`software` sw ON ts.`sft_id`=sw.`id` " . + "LEFT JOIN `sagacity`.`software` os ON t.`os_id`=os.`id` " . + "LEFT JOIN `sagacity`.`interfaces` i ON t.`id`=i.`tgt_id` " . + "LEFT JOIN `sagacity`.`pps_list` hp ON hp.`int_id`=i.`id` " . + "LEFT JOIN `sagacity`.`ports_proto_services` pps ON pps.`id`=hp.`pps_id` " . + "WHERE " . + $where_str + ; + $cnt = 0; + if ($res = $conn->query($sql)) { + $cnt = $res->fetch_array()[0]; + } + else { + error_log($conn->error); + Sagacity_Error::sql_handler($sql); + } + $ret['count'] = $cnt; + + $sql = "SELECT DISTINCT(t.`id`) " . + "FROM `sagacity`.`target` t " . + "LEFT JOIN `sagacity`.`task_status` `as` ON t.`auto_status_id`=`as`.`id` " . + "LEFT JOIN `sagacity`.`task_status` ms ON t.`man_status_id`=ms.`id` " . + "LEFT JOIN `sagacity`.`task_status` ds ON t.`data_status_id`=ds.`id` " . + "LEFT JOIN `sagacity`.`task_status` fp ON t.`fp_cat1_status_id`=fp.`id` " . + "LEFT JOIN `sagacity`.`target_software` ts ON ts.`tgt_id`=t.`id` " . + "LEFT JOIN `sagacity`.`software` sw ON ts.`sft_id`=sw.`id` " . + "LEFT JOIN `sagacity`.`software` os ON t.`os_id`=os.`id` " . + "LEFT JOIN `sagacity`.`interfaces` i ON t.`id`=i.`tgt_id` " . + "LEFT JOIN `sagacity`.`pps_list` hp ON hp.`int_id`=i.`id` " . + "LEFT JOIN `sagacity`.`ports_proto_services` pps ON pps.`id`=hp.`pps_id` " . + "WHERE " . + $where_str . " " . + ($_REQUEST['count'] != 'all' ? "LIMIT " . $_REQUEST['start_count'] . "," . $_REQUEST['count'] : "") + ; + + if ($res = $conn->query($sql)) { + while ($row = $res->fetch_assoc()) { + $tgts[] = $db->get_Target_Details($_REQUEST['ste'], $row['id'])[0]; + } + } + else { + error_log($conn->error); + Sagacity_Error::sql_handler($sql); + } + + foreach ($tgts as $tgt) { + $cat_id = $tgt->get_Cat_ID(); + $ste_cat = $db->get_Category($cat_id); + $chks = $db->get_Target_Checklists($tgt->get_ID()); + if (isset($cat_id)) { + $exp_scan_srcs = $db->get_Expected_Category_Sources($ste_cat); + } + else { + $exp_scan_srcs = null; + } + $scan_srcs = $db->get_Target_Scan_Sources($tgt, $exp_scan_srcs); + $icons = array(); + $icon_str = ''; + $src_str = ''; + + foreach ($chks as $chk) { + if (!in_array($chk->get_Icon(), array_keys($icons))) { + $icons[$chk->get_Icon()]['icon'] = $chk->get_Icon(); + $icons[$chk->get_Icon()]['name'] = ''; + } + $icons[$chk->get_Icon()]['name'] .= $chk->get_Name() . " V" . $chk->get_Version() . "R" . $chk->get_Release() . " (" . $chk->get_type() . ")" . PHP_EOL; + } + + foreach ($icons as $icon => $data) { + $icon_str .= ""; + } + + foreach ($scan_srcs as $src) { + $src_str .= "get_Icon() . "' title='" . $src['src']->get_Name(); + if (isset($src['count']) && $src['count']) { + $src_str .= " (" . $src['count'] . ")"; + } + $src_str .= "' class='checklist_image' />"; + } + + $ret['targets'][] = array_merge($tgt->get_JSON(), array( + 'scans' => $src_str, + 'chk' => $icon_str + )); + } + + if (isset($ret['targets']) && is_array($ret['targets']) && count($ret['targets'])) { + return json_encode($ret); + } + else { + return json_encode(array('count' => 0)); + } +} + +function reference_filter($criteria) +{ + global $db, $conn; + $where = array(); + $ref = array(); + $idx = 0; + $ret = ''; + $like = false; + $odd = true; + + $sql = "SELECT * FROM `sagacity`.`pdi_catalog` pdi "; + + $query = array( + 'cce' => array( + 'sql' => "LEFT JOIN `sagacity`.`cce` ON cce.`pdi_id`=pdi.`id` ", + 'added' => false + ), + 'cve' => array( + 'sql' => "LEFT JOIN `sagacity`.`cve` ON cve.`pdi_id`=pdi.`id` " . + "LEFT JOIN `sagacity`.`cve_db` ON cve_db.`cve_id`=cve.`cve_id` " . + "LEFT JOIN `sagacity`.`cve_references` ref ON ref.`cve_seq`=cve_db.`cve_id` " . + "LEFT JOIN `sagacity`.`cve_web` web ON web.`cve_id`=cve_db.`cve_id` ", + 'added' => false, + ), + 'vms' => array( + 'sql' => "LEFT JOIN `sagacity`.`golddisk` gd ON gd.`pdi_id`=pdi.`id` ", + 'added' => false, + ), + 'iavm' => array( + 'sql' => "LEFT JOIN `sagacity`.`iavm_notices` iavm ON iavm.`pdi_id`=pdi.`id` ", + 'added' => false, + ) + ); + + $xml = new DOMDocument(); + $xml->appendChild($root = xml_helper($xml, "root")); + + $search = explode("\n", $criteria); + unset($search[count($search) - 1]); + + foreach ($search as $str) { + switch ($str) { + case (preg_match("/cce /i", $str) ? true : false): + if (!$query['cce']['added']) { + $sql .= $query['cce']['sql']; + } + $query['cce']['added'] = true; + $where[] = ""; + break; + case (preg_match("/cpe /i", $str) ? true : false): + $where[] = ""; + break; + case (preg_match("/cve /i", $str) ? true : false): + if (!$query['cve']['added']) { + $sql .= $query['cve']['sql']; + } + $query['cve']['added'] = true; + $where[] = ""; + break; + case (preg_match("/ia control /i", $str) ? true : false): + $where[] = ""; + break; + case (preg_match("/iavm /i", $str) ? true : false): + if (!$query['iavm']['added']) { + $sql .= $query['iavm']['sql']; + } + $query['iavm']['added'] = true; + $where[] = ""; + break; + case (preg_match("/nessus plugin id /i", $str) ? true : false): + $where[] = ""; + break; + case (preg_match("/oval /i", $str) ? true : false): + $where[] = ""; + break; + case (preg_match("/reference /i", $str) ? true : false): + $where[] = ""; + break; + case (preg_match("/stig id /i", $str) ? true : false): + $where[] = ""; + break; + case (preg_match("/sv rule /i", $str) ? true : false): + $where[] = ""; + break; + case (preg_match("/vms id /i", $str) ? true : false): + if (!$query['vms']['added']) { + $sql .= $query['vms']['sql']; + } + $query['vms']['added'] = true; + $where[] = ""; + break; + case (preg_match("/vendor advisory /i", $str) ? true : false): + $where[] = ""; + break; + case (preg_match("/check contents /i", $str) ? true : false): + $where[] = ""; + break; + case (preg_match("/short title /i", $str) ? true : false): + $where[] = ""; + break; + case (preg_match("/description /i", $str) ? true : false): + $where[] = ""; + break; + default: + continue 2; + } + + if (($pos = strpos($str, "!~")) !== false) { + $where[$idx] .= " NOT LIKE "; + $like = true; + } + elseif (($pos = strpos($str, "~=")) !== false) { + $where[$idx] .= " LIKE "; + $like = true; + } + elseif (($pos = strpos($str, "!=")) !== false) { + $where[$idx] .= " != "; + } + elseif (($pos = strpos($str, "=")) !== false) { + $where[$idx] .= " = "; + $pos--; + } + + $where[$idx] .= "'" . ($like ? "%" : "") . + $conn->real_escape_string(substr($str, $pos + 4, -1)) . + ($like ? "%" : "") . "'"; + + $idx++; + $like = false; + } + + $where_str = implode(" AND ", $where); + + $sql = "SELECT COUNT(t.`id`) as 'cnt' " . + "WHERE " . + $where_str; + + $cnt = 0; + if ($res = $conn->query($sql)) { + $cnt = $res->fetch_array()[0]; + } + else { + error_log($conn->error); + Sagacity_Error::sql_handler($sql); + } + $root->setAttribute('count', $cnt); + + $sql = "SELECT t.`id` " . + " " . + "WHERE " . + $where_str . " " . + ($_REQUEST['count'] != 'all' ? "LIMIT " . $_REQUEST['start_count'] . "," . $_REQUEST['count'] : "") + ; + + if ($res = $conn->query($sql)) { + while ($row = $res->fetch_assoc()) { + + } + } + else { + error_log($conn->error); + Sagacity_Error::sql_handler($sql); + } + + return $xml->saveXML(); +} + +function scan_filter($ste_id, $criteria) +{ + +} + +function finding_filter($ste_id, $criteria) +{ + +} + +function get_saved_filter($type, $filter_name) +{ + global $db; + $filter = $db->get_Filters($type, $filter_name); + $ret = array(); + + if (is_array($filter) && count($filter)) { + $filter = $filter[0]; + foreach (explode("\n", $filter['criteria']) as $cri) { + if ($cri) + $ret[] = $cri; + } + } + + return json_encode($ret); +} + +function update_target_field($field, $data) +{ + global $db, $conn; + + $sql = "UPDATE `sagacity`.`target` t " . + "LEFT JOIN `sagacity`.`target_software` ts ON t.`id`=ts.`tgt_id` " . + "LEFT JOIN `sagacity`.`target_checklist` tc ON t.`id`=tc.`tgt_id` " . + "LEFT JOIN `sagacity`.`target_net_meta` tnm ON t.`id`=tnm.`tgt_id` " . + "LEFT JOIN `sagacity`.`target_sys_meta` tsm ON t.`id`=tsm.`tgt_id` " . + "LEFT JOIN `sagacity`.`target_user_meta` tum ON t.`id`=tum.`tgt_id` " . + "SET "; + + switch ($field) { + case 'name': + $sql .= "t.`name`='" . $conn->real_escape_string($data) . "'"; + break; + case 'location': + $sql .= "t.`location`='" . $conn->real_escape_string($data) . "'"; + break; + case 'wmi_pid': + $sql .= "tsm.`wmi_listening_pid`='" . $conn->real_escape_string($data) . "'"; + break; + case 'last_login': + $sql .= "tum.`last_login`='" . $conn->real_escape_string($data) . "'"; + break; + case 'login': + $sql .= "tum.`login`='" . $conn->real_escape_string($data) . "'"; + break; + case 'notes': + $sql .= "t.`notes`='" . $conn->real_escape_string($data) . "'"; + break; + case 'auto_status': + $sql .= "t.`auto_status_id`='" . $conn->real_escape_string($data) . "'"; + break; + case 'man_status': + $sql .= "t.`man_status_id`='" . $conn->real_escape_string($data) . "'"; + break; + case 'data_status': + $sql .= "t.`data_status_id`='" . $conn->real_escape_string($data) . "'"; + break; + case 'fp-cat1_status': + $sql .= "t.`fp_cat1_status_id`='" . $conn->real_escape_string($data) . "'"; + break; + case 'vm': + $sql .= "tsm.`is_vm`='" . $conn->real_escape_string($data) . "'"; + break; + case 'pp_on': + $sql .= "t.`pp_off`=" . ($data == '1' ? '0' : '1'); + break; + case 'netstat_data': + $sql .= "tnm.`netstat_connections`='" . $conn->real_escape_string($data) . "'"; + break; + case 'routes_data': + $sql .= "tnm.`routes`='" . $conn->real_escape_string($data) . "'"; + break; + case 'shares_data': + $sql .= "tnm.`shares`='" . $conn->real_escape_string($data) . "'"; + break; + case 'firewall_data': + $sql .= "tnm.`firewall_config`='" . $conn->real_escape_string($data) . "'"; + break; + case 'mounted_data': + $sql .= "tsm.`mounted`='" . $conn->real_escape_string($data) . "'"; + break; + case 'process_list_data': + $sql .= "tsm.`process_list`='" . $conn->real_escape_string($data) . "'"; + break; + case 'autorun_data': + $sql .= "tsm.`autorun`='" . $conn->real_escape_string($data) . "'"; + break; + case 'services_data': + $sql .= "tsm.`services`='" . $conn->real_escape_string($data) . "'"; + break; + case 'remote_registry_data': + $sql .= "tsm.`remote_registry`='" . $conn->real_escape_string($data) . "'"; + break; + case 'copyright_data': + $sql .= "tsm.`copyrighted`='" . $conn->real_escape_string($data) . "'"; + break; + case 'system_data': + $sql .= "tsm.`system`='" . $conn->real_escape_string($data) . "'"; + break; + case 'bios_data': + $sql .= "tsm.`bios`='" . $conn->real_escape_string($data) . "'"; + break; + case 'missing_patches_data': + $sql .= "t.`missing_patches`='" . $conn->real_escape_string($data) . "'"; + break; + case 'user_list_data': + $sql .= "tum.`user_list`='" . $conn->real_escape_string($data) . "'"; + break; + case 'disabled_accts_data': + $sql .= "tum.`disabled_accts`='" . $conn->real_escape_string($data) . "'"; + break; + case 'stag_pwds_data': + $sql .= "tum.`stag_pwds`='" . $conn->real_escape_string($data) . "'"; + break; + case 'never_logged_in_data': + $sql .= "tum.`never_logged_in`='" . $conn->real_escape_string($data) . "'"; + break; + case 'pwds_never_expire_data': + $sql .= "tum.`pwd_never_expires`='" . $conn->real_escape_string($data) . "'"; + break; + case '': + $sql .= "='" . $conn->real_escape_string($data) . "'"; + break; + } + + $sql .= " WHERE t.`id`=" . $conn->real_escape_string($_REQUEST['tgt_id']); + + if (!$conn->real_query($sql)) { + error_log($conn->error); + Sagacity_Error::sql_handler($sql); + + return 'false'; + } + + return 'true'; +} + +function get_category_details($cat_id) +{ + global $db; + $cat = $db->get_Category($cat_id); + if (is_array($cat) && count($cat) && isset($cat[0]) && is_a($cat[0], 'ste_cat')) { + $cat = $cat[0]; + } + else { + return 'no category found'; + } + + return json_encode([ + 'id' => $cat->get_ID(), + 'name' => $cat->get_Name(), + 'analyst' => $cat->get_Analyst(), + 'sources' => $cat->get_Sources() + ]); +} From d6b6fe159d1b400b40a1e3b789e2af1ca1b8d062 Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Tue, 21 Aug 2018 17:29:25 -0400 Subject: [PATCH 02/24] Fix to #4 --- exec/parse_excel_echecklist.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/exec/parse_excel_echecklist.php b/exec/parse_excel_echecklist.php index ed7c614..fe04da3 100644 --- a/exec/parse_excel_echecklist.php +++ b/exec/parse_excel_echecklist.php @@ -268,6 +268,7 @@ foreach ($objSS->getWorksheetIterator() as $wksht) { $new_findings = []; $updated_findings = []; + $row_count = 0; foreach ($wksht->getRowIterator(11) as $row) { $stig_id = $wksht->getCell("{$stig_col}{$row->getRowIndex()}")->getValue(); @@ -327,12 +328,21 @@ foreach ($objSS->getWorksheetIterator() as $wksht) { $x++; } + $row_count++; + + if($row_count % 100 == 0) { + if(!$db->add_Findings_By_Target($updated_findings, $new_findings)) { + die(print_r(debug_backtrace(), true)); + } else { + $updated_findings = []; + $new_findings = []; + } + } + + $db->update_Running_Scan($base_name, ['name' => 'perc_comp', 'value' => (($row->getRowIndex() - 10) / $row_count) * 100]); if (PHP_SAPI == 'cli') { print "\r" . sprintf("%.2f%%", (($row->getRowIndex() - 10) / $row_count) * 100); } - else { - $db->update_Running_Scan($base_name, ['name' => 'perc_comp', 'value' => (($row->getRowIndex() - 10) / $row_count) * 100]); - } } if (!$db->add_Findings_By_Target($updated_findings, $new_findings)) { From 9edd6c1c353b3f0cfda383089b861da658acf630 Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Tue, 28 Aug 2018 20:46:48 -0400 Subject: [PATCH 03/24] Fixes to bug #5 --- exec/background_stigs.php | 2 +- exec/installer.php | 10 ++++++++++ setup.php | 12 ++++++++++-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/exec/background_stigs.php b/exec/background_stigs.php index 03c3637..7d01cdb 100644 --- a/exec/background_stigs.php +++ b/exec/background_stigs.php @@ -155,7 +155,7 @@ foreach ($xml_files as $key => $file) { continue; } elseif(!empty(STIG_EXCLUSIONS) && preg_match("/" . STIG_EXCLUSIONS . "/i", $file)) { - unlink($file); + unlink(TMP . "/stigs/xml/$file"); $log->debug("Skipping $file due to matching STIG exclusion"); continue; } diff --git a/exec/installer.php b/exec/installer.php index 7e00965..22937ce 100644 --- a/exec/installer.php +++ b/exec/installer.php @@ -101,16 +101,26 @@ function save_Database($params) $php = null; $mysql = null; if (strtolower(substr(PHP_OS, 0, 3)) == 'lin') { + $res = []; + exec("which php", $res); if (file_exists('/bin/php')) { $php = realpath("/bin/php"); } + elseif (is_array($res) && isset($res[0]) && file_exists($res[0])) { + $php = realpath($res[0]); + } else { die(json_encode(['error' => 'Cannot find the PHP executable'])); } + $res = []; + exec("which mysql", $res); if (file_exists('/bin/mysql')) { $mysql = realpath('/bin/mysql'); } + elseif (is_array($res) && isset($res[0]) && file_exists($res[0])) { + $mysql = realpath($res[0]); + } else { die(json_encode(['error' => 'Cannot find the MySQL executable'])); } diff --git a/setup.php b/setup.php index febbbf6..e9a7a96 100644 --- a/setup.php +++ b/setup.php @@ -51,6 +51,14 @@ if (!is_writable(dirname(__FILE__) . "/config.inc")) { die("Sagacity needs write access to the config.inc file in the document root"); } +if(!is_writable(dirname(__FILE__) . "/inc")) { + die("Sagacity needs write access to the /inc directory to create the encrypted password file"); +} + +if(!file_exists(dirname(__FILE__) . "/logs")) { + mkdir(dirname(__FILE__) . "/logs"); +} + if (!function_exists('openssl_encrypt')) { print << @@ -596,14 +604,14 @@ EOL;
-
+
From d52454d1bb7acdb41bd7f1c85e469bddd5fd9098 Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Tue, 28 Aug 2018 21:27:13 -0400 Subject: [PATCH 04/24] Updates to 3rd party libraries Add Dockerfile and specific docker-php.ini --- .gitignore | 3 + CHANGELOG.md | 2 + Dockerfile | 6 + conf/docker-php.ini | 14 + config.inc | 5 +- inc/.gitignore | 1 + inc/composer.json | 41 +- inc/composer.lock | 452 ++- .../src/BackgroundProcess.php | 2 +- inc/vendor/composer/autoload_files.php | 43 +- inc/vendor/composer/autoload_psr4.php | 3 + inc/vendor/composer/autoload_real.php | 18 + inc/vendor/composer/autoload_static.php | 63 + inc/vendor/composer/installed.json | 201 +- inc/vendor/godsgood33/php-db/.gitattributes | 17 + inc/vendor/godsgood33/php-db/.gitignore | 4 + inc/vendor/godsgood33/php-db/.scrutinizer.yml | 26 + inc/vendor/godsgood33/php-db/LICENSE | 201 ++ inc/vendor/godsgood33/php-db/README.md | Bin 0 -> 7252 bytes inc/vendor/godsgood33/php-db/composer.json | 37 + inc/vendor/godsgood33/php-db/composer.lock | 1549 +++++++++ .../php-db/examples/create_table_json.json | 136 + inc/vendor/godsgood33/php-db/phpunit.xml | 16 + inc/vendor/godsgood33/php-db/src/DBConfig.php | 50 + inc/vendor/godsgood33/php-db/src/Database.php | 1896 ++++++++++ .../godsgood33/php-db/tests/DatabaseTest.php | 794 +++++ .../godsgood33/php-db/tests/TestClass.php | 24 + .../godsgood33/php-db/tests/TestClass2.php | 5 + .../godsgood33/php-db/tests/bootstrap.php | 3 + inc/vendor/markbaker/complex/README.md | 155 + .../markbaker/complex/classes/Autoloader.php | 53 + .../markbaker/complex/classes/Bootstrap.php | 38 + .../markbaker/complex/classes/src/Complex.php | 387 +++ .../complex/classes/src/Exception.php | 13 + .../complex/classes/src/functions/abs.php | 29 + .../complex/classes/src/functions/acos.php | 38 + .../complex/classes/src/functions/acosh.php | 34 + .../complex/classes/src/functions/acot.php | 25 + .../complex/classes/src/functions/acoth.php | 25 + .../complex/classes/src/functions/acsc.php | 29 + .../complex/classes/src/functions/acsch.php | 29 + .../classes/src/functions/argument.php | 28 + .../complex/classes/src/functions/asec.php | 29 + .../complex/classes/src/functions/asech.php | 29 + .../complex/classes/src/functions/asin.php | 37 + .../complex/classes/src/functions/asinh.php | 33 + .../complex/classes/src/functions/atan.php | 45 + .../complex/classes/src/functions/atanh.php | 38 + .../classes/src/functions/conjugate.php | 28 + .../complex/classes/src/functions/cos.php | 34 + .../complex/classes/src/functions/cosh.php | 32 + .../complex/classes/src/functions/cot.php | 29 + .../complex/classes/src/functions/coth.php | 24 + .../complex/classes/src/functions/csc.php | 29 + .../complex/classes/src/functions/csch.php | 29 + .../complex/classes/src/functions/exp.php | 34 + .../complex/classes/src/functions/inverse.php | 29 + .../complex/classes/src/functions/ln.php | 33 + .../complex/classes/src/functions/log10.php | 32 + .../complex/classes/src/functions/log2.php | 32 + .../classes/src/functions/negative.php | 31 + .../complex/classes/src/functions/pow.php | 40 + .../complex/classes/src/functions/rho.php | 28 + .../complex/classes/src/functions/sec.php | 25 + .../complex/classes/src/functions/sech.php | 25 + .../complex/classes/src/functions/sin.php | 32 + .../complex/classes/src/functions/sinh.php | 32 + .../complex/classes/src/functions/sqrt.php | 29 + .../complex/classes/src/functions/tan.php | 40 + .../complex/classes/src/functions/tanh.php | 35 + .../complex/classes/src/functions/theta.php | 38 + .../complex/classes/src/operations/add.php | 46 + .../classes/src/operations/divideby.php | 56 + .../classes/src/operations/divideinto.php | 56 + .../classes/src/operations/multiply.php | 48 + .../classes/src/operations/subtract.php | 46 + inc/vendor/markbaker/complex/composer.json | 77 + .../complex/examples/complexTest.php | 154 + .../complex/examples/testFunctions.php | 52 + .../complex/examples/testOperations.php | 34 + inc/vendor/markbaker/complex/license.md | 25 + inc/vendor/pacificsec/cpe/.gitignore | 5 + inc/vendor/pacificsec/cpe/README.md | 42 + inc/vendor/pacificsec/cpe/composer.json | 26 + .../cpe/src/Common/LogicalValue.php | 44 + .../pacificsec/cpe/src/Common/Utilities.php | 166 + .../cpe/src/Common/WellFormedName.php | 210 ++ .../cpe/src/Matching/CPENameMatcher.php | 287 ++ .../CPE => src}/Matching/Relation.php | 0 .../CPE => src}/Naming/CPENameBinder.php | 357 +- .../cpe/src/Naming/CPENameUnbinder.php | 466 +++ .../PacificSec/CPE/Common/LogicalValue.php | 42 - .../PacificSec/CPE/Common/Utilities.php | 167 - .../PacificSec/CPE/Common/WellFormedName.php | 210 -- .../CPE/Matching/CPENameMatcher.php | 287 -- .../PacificSec/CPE/Naming/CPENameUnbinder.php | 466 --- inc/vendor/phpoffice/phpspreadsheet/.sami.php | 24 + .../phpoffice/phpspreadsheet/.travis.yml | 21 +- .../phpoffice/phpspreadsheet/CHANGELOG.md | 89 + inc/vendor/phpoffice/phpspreadsheet/README.md | 4 +- .../phpoffice/phpspreadsheet/composer.json | 9 +- .../phpoffice/phpspreadsheet/composer.lock | 146 +- .../phpspreadsheet/docs/extra/extra.js | 57 - .../phpoffice/phpspreadsheet/docs/index.md | 2 + .../references/features-cross-reference.md | 18 + .../references/function-list-by-category.md | 46 +- .../docs/references/function-list-by-name.md | 47 +- .../docs/topics/accessing-cells.md | 6 +- .../phpspreadsheet/docs/topics/autofilters.md | 4 +- .../topics/reading-and-writing-to-file.md | 16 +- .../phpspreadsheet/docs/topics/recipes.md | 8 +- .../phpspreadsheet/docs/topics/worksheets.md | 4 +- .../phpoffice/phpspreadsheet/mkdocs.yml | 4 - .../Autofilter/10_Autofilter_selection_1.php | 2 +- .../Autofilter/10_Autofilter_selection_2.php | 2 +- .../10_Autofilter_selection_display.php | 2 +- .../Basic/08_Conditional_formatting.php | 2 +- .../Basic/08_Conditional_formatting_2.php | 2 +- .../Chart/32_Chart_read_write_HTML.php | 2 +- .../samples/Chart/32_Chart_read_write_PDF.php | 2 +- .../samples/Chart/33_Chart_create_area.php | 62 +- .../Chart/33_Chart_create_bar_stacked.php | 66 +- .../samples/Chart/33_Chart_create_column.php | 66 +- .../Chart/33_Chart_create_column_2.php | 66 +- .../Chart/33_Chart_create_composite.php | 98 +- .../samples/Chart/33_Chart_create_line.php | 62 +- .../Chart/33_Chart_create_multiple_charts.php | 128 +- .../samples/Chart/33_Chart_create_pie.php | 122 +- .../samples/Chart/33_Chart_create_radar.php | 66 +- .../samples/Chart/33_Chart_create_scatter.php | 50 +- .../samples/Chart/33_Chart_create_stock.php | 56 +- ...a_configurable_read_filter_(version_1).php | 2 +- ...a_configurable_read_filter_(version_2).php | 2 +- .../20_Reader_worksheet_hyperlink_image.php | 54 + .../Custom_properties.php | 10 +- .../samples/bootstrap/js/bootstrap.min.js | 12 +- .../samples/bootstrap/js/jquery.min.js | 8 +- .../samples/templates/chartSpreadsheet.php | 66 +- .../Calculation/Calculation.php | 187 +- .../PhpSpreadsheet/Calculation/DateTime.php | 57 +- .../Calculation/Engineering.php | 694 ++-- .../PhpSpreadsheet/Calculation/Financial.php | 108 +- .../PhpSpreadsheet/Calculation/Functions.php | 19 +- .../PhpSpreadsheet/Calculation/Logical.php | 149 +- .../PhpSpreadsheet/Calculation/LookupRef.php | 29 + .../PhpSpreadsheet/Calculation/MathTrig.php | 205 +- .../PhpSpreadsheet/Calculation/TextData.php | 92 + .../Calculation/functionlist.txt | 34 + .../src/PhpSpreadsheet/Cell/Coordinate.php | 126 +- .../src/PhpSpreadsheet/Cell/Hyperlink.php | 8 + .../src/PhpSpreadsheet/Chart/DataSeries.php | 2 +- .../src/PhpSpreadsheet/Helper/Html.php | 11 +- .../src/PhpSpreadsheet/Helper/Migrator.php | 54 +- .../src/PhpSpreadsheet/Reader/Csv.php | 41 +- .../src/PhpSpreadsheet/Reader/Html.php | 1 + .../src/PhpSpreadsheet/Reader/IReadFilter.php | 6 +- .../src/PhpSpreadsheet/Reader/Xlsx.php | 534 ++- .../src/PhpSpreadsheet/Reader/Xml.php | 2 +- .../src/PhpSpreadsheet/Shared/Date.php | 2 +- .../src/PhpSpreadsheet/Shared/JAMA/Matrix.php | 4 +- .../PhpSpreadsheet/Shared/Trend/BestFit.php | 48 +- .../Shared/Trend/PolynomialBestFit.php | 2 +- .../src/PhpSpreadsheet/Spreadsheet.php | 305 ++ .../src/PhpSpreadsheet/Style/NumberFormat.php | 2 +- .../src/PhpSpreadsheet/Style/Style.php | 3 + .../PhpSpreadsheet/Worksheet/AutoFilter.php | 2 +- .../PhpSpreadsheet/Worksheet/BaseDrawing.php | 28 +- .../PhpSpreadsheet/Worksheet/Worksheet.php | 28 +- .../PhpSpreadsheet/Writer/Xls/Worksheet.php | 2 +- .../src/PhpSpreadsheet/Writer/Xlsx.php | 32 +- .../Writer/Xlsx/ContentTypes.php | 21 +- .../PhpSpreadsheet/Writer/Xlsx/Drawing.php | 38 +- .../src/PhpSpreadsheet/Writer/Xlsx/Rels.php | 75 +- .../PhpSpreadsheet/Writer/Xlsx/Workbook.php | 17 +- .../PhpSpreadsheet/Writer/Xlsx/Worksheet.php | 54 +- .../Calculation/CalculationTest.php | 120 + .../Calculation/DateTimeTest.php | 487 +++ .../Calculation/EngineeringTest.php | 1009 ++++++ .../Calculation/FinancialTest.php | 613 ++++ .../Calculation/FunctionsTest.php | 385 ++ .../Calculation/LogicalTest.php | 123 + .../Calculation/LookupRefTest.php | 172 + .../Calculation/MathTrigTest.php | 881 +++++ .../Calculation/TextDataTest.php | 431 +++ .../Cell/AdvancedValueBinderTest.php | 79 + .../Cell/CoordinateTest.php | 367 ++ .../PhpSpreadsheetTests/Cell/DataTypeTest.php | 17 + .../Cell/DataValidationTest.php | 19 + .../Cell/DataValidatorTest.php | 73 + .../Cell/DefaultValueBinderTest.php | 86 + .../Cell/HyperlinkTest.php | 81 + .../Chart/DataSeriesValuesTest.php | 62 + .../PhpSpreadsheetTests/Chart/LayoutTest.php | 30 + .../PhpSpreadsheetTests/Chart/LegendTest.php | 127 + .../Collection/CellsTest.php | 117 + .../Custom/ComplexAssert.php | 82 + .../Functional/AbstractFunctional.php | 39 + .../Functional/ColumnWidthTest.php | 43 + .../Functional/CommentsTest.php | 44 + .../Functional/ConditionalStopIfTrueTest.php | 72 + .../Functional/DrawingImageHyperlinkTest.php | 42 + .../Functional/EnclosureTest.php | 37 + .../Functional/FreezePaneTest.php | 75 + .../Functional/HtmlCommentsTest.php | 63 + .../Functional/MergedCellsTest.php | 42 + .../Functional/PrintAreaTest.php | 44 + .../Functional/ReadFilterTest.php | 124 + .../TypeAttributePreservationTest.php | 51 + .../Functional/WorkbookViewAttributesTest.php | 80 + .../PhpSpreadsheetTests/Helper/HtmlTest.php | 33 + .../Helper/MigratorTest.php | 88 + .../PhpSpreadsheetTests/Helper/SampleTest.php | 62 + .../PhpSpreadsheetTests/IOFactoryTest.php | 147 + .../PhpSpreadsheetTests/Reader/CsvTest.php | 109 + .../PhpSpreadsheetTests/Reader/HtmlTest.php | 46 + .../PhpSpreadsheetTests/Reader/OdsTest.php | 225 ++ .../PhpSpreadsheetTests/Reader/XlsxTest.php | 19 + .../PhpSpreadsheetTests/Reader/XmlTest.php | 105 + .../ReferenceHelperTest.php | 56 + .../PhpSpreadsheetTests/SettingsTest.php | 40 + .../Shared/CodePageTest.php | 54 + .../PhpSpreadsheetTests/Shared/DateTest.php | 171 + .../PhpSpreadsheetTests/Shared/FileTest.php | 32 + .../PhpSpreadsheetTests/Shared/FontTest.php | 86 + .../Shared/PasswordHasherTest.php | 25 + .../Shared/StringHelperTest.php | 100 + .../Shared/TimeZoneTest.php | 32 + .../Style/BorderRangeTest.php | 73 + .../PhpSpreadsheetTests/Style/BorderTest.php | 26 + .../PhpSpreadsheetTests/Style/ColorTest.php | 73 + .../Style/NumberFormatTest.php | 48 + .../Worksheet/AutoFilter/Column/RuleTest.php | 103 + .../Worksheet/AutoFilter/ColumnTest.php | 176 + .../Worksheet/AutoFilterTest.php | 336 ++ .../Worksheet/ColumnCellIteratorTest.php | 86 + .../Worksheet/ColumnIteratorTest.php | 85 + .../Worksheet/ColumnTest.php | 48 + .../Worksheet/DrawingTest.php | 40 + .../Worksheet/RowCellIteratorTest.php | 88 + .../Worksheet/RowIteratorTest.php | 83 + .../PhpSpreadsheetTests/Worksheet/RowTest.php | 48 + .../Worksheet/WorksheetTest.php | 133 + .../Writer/Ods/ContentTest.php | 98 + .../Writer/Xls/WorkbookTest.php | 143 + .../Writer/Xlsx/UnparsedDataTest.php | 103 + .../phpspreadsheet/tests/bootstrap.php | 13 + .../tests/data/Calculation/DateTime/DATE.php | 489 +++ .../data/Calculation/DateTime/DATEDIF.php | 616 ++++ .../data/Calculation/DateTime/DATEVALUE.php | 297 ++ .../tests/data/Calculation/DateTime/DAY.php | 56 + .../data/Calculation/DateTime/DAYS360.php | 208 ++ .../tests/data/Calculation/DateTime/EDATE.php | 79 + .../data/Calculation/DateTime/EOMONTH.php | 89 + .../tests/data/Calculation/DateTime/HOUR.php | 52 + .../data/Calculation/DateTime/ISOWEEKNUM.php | 36 + .../data/Calculation/DateTime/MINUTE.php | 52 + .../tests/data/Calculation/DateTime/MONTH.php | 52 + .../data/Calculation/DateTime/NETWORKDAYS.php | 103 + .../data/Calculation/DateTime/SECOND.php | 52 + .../tests/data/Calculation/DateTime/TIME.php | 136 + .../data/Calculation/DateTime/TIMEVALUE.php | 56 + .../data/Calculation/DateTime/WEEKDAY.php | 130 + .../data/Calculation/DateTime/WEEKNUM.php | 77 + .../data/Calculation/DateTime/WORKDAY.php | 92 + .../tests/data/Calculation/DateTime/YEAR.php | 48 + .../data/Calculation/DateTime/YEARFRAC.php | 388 +++ .../data/Calculation/Engineering/BESSELI.php | 279 ++ .../data/Calculation/Engineering/BESSELJ.php | 169 + .../data/Calculation/Engineering/BESSELK.php | 194 ++ .../data/Calculation/Engineering/BESSELY.php | 119 + .../data/Calculation/Engineering/BIN2DEC.php | 49 + .../data/Calculation/Engineering/BIN2HEX.php | 73 + .../data/Calculation/Engineering/BIN2OCT.php | 77 + .../data/Calculation/Engineering/BITAND.php | 20 + .../Calculation/Engineering/BITLSHIFT.php | 20 + .../data/Calculation/Engineering/BITOR.php | 24 + .../Calculation/Engineering/BITRSHIFT.php | 16 + .../data/Calculation/Engineering/BITXOR.php | 24 + .../data/Calculation/Engineering/COMPLEX.php | 3085 +++++++++++++++++ .../Calculation/Engineering/CONVERTUOM.php | 148 + .../data/Calculation/Engineering/DEC2BIN.php | 91 + .../data/Calculation/Engineering/DEC2HEX.php | 75 + .../data/Calculation/Engineering/DEC2OCT.php | 57 + .../data/Calculation/Engineering/DELTA.php | 129 + .../data/Calculation/Engineering/ERF.php | 581 ++++ .../data/Calculation/Engineering/ERFC.php | 166 + .../Calculation/Engineering/ERFPRECISE.php | 22 + .../data/Calculation/Engineering/GESTEP.php | 409 +++ .../data/Calculation/Engineering/HEX2BIN.php | 71 + .../data/Calculation/Engineering/HEX2DEC.php | 67 + .../data/Calculation/Engineering/HEX2OCT.php | 58 + .../data/Calculation/Engineering/IMABS.php | 112 + .../Calculation/Engineering/IMAGINARY.php | 124 + .../Calculation/Engineering/IMARGUMENT.php | 108 + .../Calculation/Engineering/IMCONJUGATE.php | 108 + .../data/Calculation/Engineering/IMCOS.php | 112 + .../data/Calculation/Engineering/IMCOSH.php | 112 + .../data/Calculation/Engineering/IMCOT.php | 112 + .../data/Calculation/Engineering/IMCSC.php | 112 + .../data/Calculation/Engineering/IMCSCH.php | 112 + .../data/Calculation/Engineering/IMDIV.php | 89 + .../data/Calculation/Engineering/IMEXP.php | 112 + .../data/Calculation/Engineering/IMLN.php | 112 + .../data/Calculation/Engineering/IMLOG10.php | 112 + .../data/Calculation/Engineering/IMLOG2.php | 112 + .../data/Calculation/Engineering/IMPOWER.php | 94 + .../Calculation/Engineering/IMPRODUCT.php | 80 + .../data/Calculation/Engineering/IMREAL.php | 124 + .../data/Calculation/Engineering/IMSEC.php | 112 + .../data/Calculation/Engineering/IMSECH.php | 112 + .../data/Calculation/Engineering/IMSIN.php | 112 + .../data/Calculation/Engineering/IMSINH.php | 112 + .../data/Calculation/Engineering/IMSQRT.php | 116 + .../data/Calculation/Engineering/IMSUB.php | 40 + .../data/Calculation/Engineering/IMSUM.php | 56 + .../data/Calculation/Engineering/IMTAN.php | 112 + .../data/Calculation/Engineering/OCT2BIN.php | 61 + .../data/Calculation/Engineering/OCT2DEC.php | 41 + .../data/Calculation/Engineering/OCT2HEX.php | 42 + .../data/Calculation/Financial/ACCRINT.php | 75 + .../data/Calculation/Financial/ACCRINTM.php | 45 + .../data/Calculation/Financial/AMORDEGRC.php | 26 + .../data/Calculation/Financial/AMORLINC.php | 26 + .../data/Calculation/Financial/COUPDAYBS.php | 40 + .../data/Calculation/Financial/COUPDAYS.php | 61 + .../data/Calculation/Financial/COUPDAYSNC.php | 40 + .../data/Calculation/Financial/COUPNCD.php | 40 + .../data/Calculation/Financial/COUPNUM.php | 48 + .../data/Calculation/Financial/COUPPCD.php | 40 + .../data/Calculation/Financial/CUMIPMT.php | 87 + .../data/Calculation/Financial/CUMPRINC.php | 87 + .../tests/data/Calculation/Financial/DB.php | 134 + .../tests/data/Calculation/Financial/DDB.php | 115 + .../tests/data/Calculation/Financial/DISC.php | 43 + .../data/Calculation/Financial/DOLLARDE.php | 51 + .../data/Calculation/Financial/DOLLARFR.php | 51 + .../data/Calculation/Financial/EFFECT.php | 31 + .../tests/data/Calculation/Financial/FV.php | 65 + .../data/Calculation/Financial/FVSCHEDULE.php | 39 + .../data/Calculation/Financial/INTRATE.php | 45 + .../tests/data/Calculation/Financial/IPMT.php | 70 + .../tests/data/Calculation/Financial/IRR.php | 61 + .../data/Calculation/Financial/ISPMT.php | 34 + .../tests/data/Calculation/Financial/MIRR.php | 77 + .../data/Calculation/Financial/NOMINAL.php | 31 + .../tests/data/Calculation/Financial/NPER.php | 73 + .../tests/data/Calculation/Financial/NPV.php | 42 + .../data/Calculation/Financial/PDURATION.php | 36 + .../data/Calculation/Financial/PRICE.php | 96 + .../data/Calculation/Financial/PRICEDISC.php | 12 + .../tests/data/Calculation/Financial/PV.php | 24 + .../tests/data/Calculation/Financial/RATE.php | 72 + .../tests/data/Calculation/Financial/RRI.php | 28 + .../tests/data/Calculation/Financial/SLN.php | 40 + .../tests/data/Calculation/Financial/SYD.php | 44 + .../tests/data/Calculation/Financial/XIRR.php | 71 + .../data/Calculation/Functions/ERROR_TYPE.php | 59 + .../Calculation/Functions/IF_CONDITION.php | 36 + .../data/Calculation/Functions/ISFORMULA.php | 84 + .../data/Calculation/Functions/IS_BLANK.php | 67 + .../data/Calculation/Functions/IS_ERR.php | 67 + .../data/Calculation/Functions/IS_ERROR.php | 67 + .../data/Calculation/Functions/IS_EVEN.php | 83 + .../data/Calculation/Functions/IS_LOGICAL.php | 67 + .../data/Calculation/Functions/IS_NA.php | 67 + .../data/Calculation/Functions/IS_NONTEXT.php | 67 + .../data/Calculation/Functions/IS_NUMBER.php | 67 + .../data/Calculation/Functions/IS_ODD.php | 83 + .../data/Calculation/Functions/IS_TEXT.php | 67 + .../tests/data/Calculation/Functions/N.php | 138 + .../tests/data/Calculation/Functions/TYPE.php | 100 + .../tests/data/Calculation/Logical/AND.php | 124 + .../tests/data/Calculation/Logical/IF.php | 37 + .../data/Calculation/Logical/IFERROR.php | 44 + .../tests/data/Calculation/Logical/NOT.php | 83 + .../tests/data/Calculation/Logical/OR.php | 119 + .../tests/data/Calculation/Logical/XOR.php | 52 + .../data/Calculation/LookupRef/COLUMNS.php | 36 + .../Calculation/LookupRef/FORMULATEXT.php | 34 + .../data/Calculation/LookupRef/HLOOKUP.php | 278 ++ .../data/Calculation/LookupRef/INDEX.php | 90 + .../data/Calculation/LookupRef/MATCH.php | 99 + .../tests/data/Calculation/LookupRef/ROWS.php | 36 + .../data/Calculation/LookupRef/VLOOKUP.php | 294 ++ .../tests/data/Calculation/MathTrig/ACOT.php | 60 + .../tests/data/Calculation/MathTrig/ACOTH.php | 60 + .../tests/data/Calculation/MathTrig/ATAN2.php | 86 + .../data/Calculation/MathTrig/CEILING.php | 104 + .../data/Calculation/MathTrig/COMBIN.php | 126 + .../tests/data/Calculation/MathTrig/COT.php | 44 + .../tests/data/Calculation/MathTrig/COTH.php | 60 + .../tests/data/Calculation/MathTrig/CSC.php | 44 + .../tests/data/Calculation/MathTrig/CSCH.php | 60 + .../tests/data/Calculation/MathTrig/EVEN.php | 72 + .../tests/data/Calculation/MathTrig/FACT.php | 44 + .../data/Calculation/MathTrig/FACTDOUBLE.php | 36 + .../tests/data/Calculation/MathTrig/FLOOR.php | 57 + .../tests/data/Calculation/MathTrig/GCD.php | 132 + .../tests/data/Calculation/MathTrig/INT.php | 80 + .../tests/data/Calculation/MathTrig/LCM.php | 68 + .../tests/data/Calculation/MathTrig/LOG.php | 344 ++ .../data/Calculation/MathTrig/MDETERM.php | 262 ++ .../data/Calculation/MathTrig/MINVERSE.php | 411 +++ .../tests/data/Calculation/MathTrig/MMULT.php | 305 ++ .../tests/data/Calculation/MathTrig/MOD.php | 54 + .../data/Calculation/MathTrig/MROUND.php | 59 + .../data/Calculation/MathTrig/MULTINOMIAL.php | 17 + .../tests/data/Calculation/MathTrig/ODD.php | 56 + .../tests/data/Calculation/MathTrig/POWER.php | 409 +++ .../data/Calculation/MathTrig/PRODUCT.php | 51 + .../data/Calculation/MathTrig/QUOTIENT.php | 34 + .../tests/data/Calculation/MathTrig/ROMAN.php | 28 + .../data/Calculation/MathTrig/ROUNDDOWN.php | 74 + .../data/Calculation/MathTrig/ROUNDUP.php | 74 + .../tests/data/Calculation/MathTrig/SEC.php | 60 + .../tests/data/Calculation/MathTrig/SECH.php | 60 + .../data/Calculation/MathTrig/SERIESSUM.php | 34 + .../tests/data/Calculation/MathTrig/SIGN.php | 56 + .../data/Calculation/MathTrig/SQRTPI.php | 64 + .../data/Calculation/MathTrig/SUBTOTAL.php | 74 + .../Calculation/MathTrig/SUBTOTALHIDDEN.php | 74 + .../Calculation/MathTrig/SUBTOTALNESTED.php | 18 + .../tests/data/Calculation/MathTrig/SUMIF.php | 61 + .../data/Calculation/MathTrig/SUMPRODUCT.php | 19 + .../tests/data/Calculation/MathTrig/SUMSQ.php | 47 + .../data/Calculation/MathTrig/SUMX2MY2.php | 19 + .../data/Calculation/MathTrig/SUMX2PY2.php | 19 + .../data/Calculation/MathTrig/SUMXMY2.php | 19 + .../tests/data/Calculation/MathTrig/TRUNC.php | 99 + .../tests/data/Calculation/TextData/CHAR.php | 48 + .../tests/data/Calculation/TextData/CLEAN.php | 24 + .../tests/data/Calculation/TextData/CODE.php | 72 + .../data/Calculation/TextData/CONCATENATE.php | 21 + .../data/Calculation/TextData/DOLLAR.php | 34 + .../tests/data/Calculation/TextData/EXACT.php | 39 + .../tests/data/Calculation/TextData/FIND.php | 74 + .../tests/data/Calculation/TextData/FIXED.php | 34 + .../tests/data/Calculation/TextData/LEFT.php | 34 + .../tests/data/Calculation/TextData/LEN.php | 28 + .../tests/data/Calculation/TextData/LOWER.php | 20 + .../tests/data/Calculation/TextData/MID.php | 57 + .../data/Calculation/TextData/NUMBERVALUE.php | 52 + .../data/Calculation/TextData/PROPER.php | 16 + .../data/Calculation/TextData/REPLACE.php | 32 + .../tests/data/Calculation/TextData/RIGHT.php | 34 + .../data/Calculation/TextData/SEARCH.php | 62 + .../data/Calculation/TextData/SUBSTITUTE.php | 42 + .../tests/data/Calculation/TextData/T.php | 24 + .../tests/data/Calculation/TextData/TEXT.php | 69 + .../data/Calculation/TextData/TEXTJOIN.php | 28 + .../tests/data/Calculation/TextData/TRIM.php | 32 + .../tests/data/Calculation/TextData/UPPER.php | 20 + .../tests/data/Calculation/TextData/VALUE.php | 44 + .../CalculationBinaryComparisonOperation.php | 267 ++ .../tests/data/Cell/DefaultValueBinder.php | 76 + .../tests/data/CellAbsoluteCoordinate.php | 52 + .../tests/data/CellAbsoluteReference.php | 68 + .../tests/data/CellBuildRange.php | 26 + .../tests/data/CellCoordinates.php | 46 + .../CellExtractAllCellReferencesInRange.php | 152 + .../tests/data/CellGetRangeBoundaries.php | 30 + .../data/CellMergeRangesInCollection.php | 70 + .../tests/data/CellRangeBoundaries.php | 30 + .../tests/data/CellRangeDimension.php | 18 + .../tests/data/CellSplitRange.php | 32 + .../phpspreadsheet/tests/data/ColumnIndex.php | 52 + .../tests/data/ColumnString.php | 52 + .../tests/data/CoordinateIsRange.php | 24 + .../TypeAttributePreservation/Formula.php | 40 + .../tests/data/Reader/CSV/backslash.csv | 2 + .../tests/data/Reader/CSV/contains_html.csv | 1 + .../data/Reader/CSV/csv_without_extension | 3 + .../tests/data/Reader/CSV/empty.csv | 0 .../tests/data/Reader/CSV/enclosure.csv | 4 + .../data/Reader/CSV/semicolon_separated.csv | 3 + .../Reader/HTML/csv_with_angle_bracket.csv | 1 + .../tests/data/Reader/Ods/data.ods | Bin 0 -> 11764 bytes .../Reader/XLSX/without_cell_reference.xlsx | Bin 0 -> 6384 bytes .../tests/data/Reader/Xml/WithoutStyle.xml | 47 + .../Reader/Xml/XEETestInvalidSimpleXML.xml | 8 + .../data/Reader/Xml/XEETestInvalidUTF-16.xml | Bin 0 -> 276 bytes .../Reader/Xml/XEETestInvalidUTF-16BE.xml | Bin 0 -> 278 bytes .../Reader/Xml/XEETestInvalidUTF-16LE.xml | Bin 0 -> 278 bytes .../data/Reader/Xml/XEETestInvalidUTF-8.xml | 8 + .../data/Reader/Xml/XEETestValidUTF-16.xml | Bin 0 -> 176 bytes .../data/Reader/Xml/XEETestValidUTF-16BE.xml | Bin 0 -> 178 bytes .../data/Reader/Xml/XEETestValidUTF-16LE.xml | Bin 0 -> 178 bytes .../data/Reader/Xml/XEETestValidUTF-8.xml | 4 + .../data/Shared/CentimeterSizeToPixels.php | 24 + .../tests/data/Shared/CodePage.php | 219 ++ .../data/Shared/Date/DateTimeToExcel.php | 72 + .../data/Shared/Date/ExcelToTimestamp1900.php | 75 + .../Date/ExcelToTimestamp1900Timezone.php | 137 + .../data/Shared/Date/ExcelToTimestamp1904.php | 45 + .../tests/data/Shared/Date/FormatCodes.php | 149 + .../Shared/Date/FormattedPHPToExcel1900.php | 89 + .../data/Shared/Date/TimestampToExcel1900.php | 61 + .../data/Shared/Date/TimestampToExcel1904.php | 29 + .../tests/data/Shared/FontSizeToPixels.php | 68 + .../tests/data/Shared/InchSizeToPixels.php | 24 + .../tests/data/Shared/PasswordHashes.php | 28 + .../data/Style/ColorChangeBrightness.php | 77 + .../tests/data/Style/ColorGetBlue.php | 35 + .../tests/data/Style/ColorGetGreen.php | 35 + .../tests/data/Style/ColorGetRed.php | 35 + .../tests/data/Style/NumberFormat.php | 189 + .../tests/data/Style/NumberFormatDates.php | 65 + .../tests/data/Writer/Ods/content-empty.xml | 25 + .../data/Writer/Ods/content-with-data.xml | 105 + .../data/Writer/XLSX/form_pass_print.xlsm | Bin 0 -> 17469 bytes reference/stigs/.gitignore | 2 + 511 files changed, 45960 insertions(+), 2739 deletions(-) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 conf/docker-php.ini create mode 100644 inc/.gitignore create mode 100644 inc/vendor/godsgood33/php-db/.gitattributes create mode 100644 inc/vendor/godsgood33/php-db/.gitignore create mode 100644 inc/vendor/godsgood33/php-db/.scrutinizer.yml create mode 100644 inc/vendor/godsgood33/php-db/LICENSE create mode 100644 inc/vendor/godsgood33/php-db/README.md create mode 100644 inc/vendor/godsgood33/php-db/composer.json create mode 100644 inc/vendor/godsgood33/php-db/composer.lock create mode 100644 inc/vendor/godsgood33/php-db/examples/create_table_json.json create mode 100644 inc/vendor/godsgood33/php-db/phpunit.xml create mode 100644 inc/vendor/godsgood33/php-db/src/DBConfig.php create mode 100644 inc/vendor/godsgood33/php-db/src/Database.php create mode 100644 inc/vendor/godsgood33/php-db/tests/DatabaseTest.php create mode 100644 inc/vendor/godsgood33/php-db/tests/TestClass.php create mode 100644 inc/vendor/godsgood33/php-db/tests/TestClass2.php create mode 100644 inc/vendor/godsgood33/php-db/tests/bootstrap.php create mode 100644 inc/vendor/markbaker/complex/README.md create mode 100644 inc/vendor/markbaker/complex/classes/Autoloader.php create mode 100644 inc/vendor/markbaker/complex/classes/Bootstrap.php create mode 100644 inc/vendor/markbaker/complex/classes/src/Complex.php create mode 100644 inc/vendor/markbaker/complex/classes/src/Exception.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/abs.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/acos.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/acosh.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/acot.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/acoth.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/acsc.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/acsch.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/argument.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/asec.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/asech.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/asin.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/asinh.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/atan.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/atanh.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/conjugate.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/cos.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/cosh.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/cot.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/coth.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/csc.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/csch.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/exp.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/inverse.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/ln.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/log10.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/log2.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/negative.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/pow.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/rho.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/sec.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/sech.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/sin.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/sinh.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/sqrt.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/tan.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/tanh.php create mode 100644 inc/vendor/markbaker/complex/classes/src/functions/theta.php create mode 100644 inc/vendor/markbaker/complex/classes/src/operations/add.php create mode 100644 inc/vendor/markbaker/complex/classes/src/operations/divideby.php create mode 100644 inc/vendor/markbaker/complex/classes/src/operations/divideinto.php create mode 100644 inc/vendor/markbaker/complex/classes/src/operations/multiply.php create mode 100644 inc/vendor/markbaker/complex/classes/src/operations/subtract.php create mode 100644 inc/vendor/markbaker/complex/composer.json create mode 100644 inc/vendor/markbaker/complex/examples/complexTest.php create mode 100644 inc/vendor/markbaker/complex/examples/testFunctions.php create mode 100644 inc/vendor/markbaker/complex/examples/testOperations.php create mode 100644 inc/vendor/markbaker/complex/license.md create mode 100644 inc/vendor/pacificsec/cpe/.gitignore create mode 100644 inc/vendor/pacificsec/cpe/composer.json create mode 100644 inc/vendor/pacificsec/cpe/src/Common/LogicalValue.php create mode 100644 inc/vendor/pacificsec/cpe/src/Common/Utilities.php create mode 100644 inc/vendor/pacificsec/cpe/src/Common/WellFormedName.php create mode 100644 inc/vendor/pacificsec/cpe/src/Matching/CPENameMatcher.php rename inc/vendor/pacificsec/cpe/{vendor/PacificSec/CPE => src}/Matching/Relation.php (100%) rename inc/vendor/pacificsec/cpe/{vendor/PacificSec/CPE => src}/Naming/CPENameBinder.php (53%) create mode 100644 inc/vendor/pacificsec/cpe/src/Naming/CPENameUnbinder.php delete mode 100644 inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Common/LogicalValue.php delete mode 100644 inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Common/Utilities.php delete mode 100644 inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Common/WellFormedName.php delete mode 100644 inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Matching/CPENameMatcher.php delete mode 100644 inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Naming/CPENameUnbinder.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/.sami.php delete mode 100644 inc/vendor/phpoffice/phpspreadsheet/docs/extra/extra.js create mode 100644 inc/vendor/phpoffice/phpspreadsheet/samples/Reader/20_Reader_worksheet_hyperlink_image.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Calculation/CalculationTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Calculation/DateTimeTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Calculation/FinancialTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Calculation/FunctionsTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Calculation/LogicalTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Calculation/LookupRefTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Calculation/MathTrigTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Calculation/TextDataTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Cell/AdvancedValueBinderTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Cell/CoordinateTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Cell/DataTypeTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Cell/DataValidationTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Cell/DataValidatorTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Cell/DefaultValueBinderTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Cell/HyperlinkTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Chart/DataSeriesValuesTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Chart/LayoutTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Chart/LegendTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Collection/CellsTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Functional/AbstractFunctional.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Functional/ColumnWidthTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Functional/CommentsTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Functional/ConditionalStopIfTrueTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Functional/DrawingImageHyperlinkTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Functional/EnclosureTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Functional/FreezePaneTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Functional/HtmlCommentsTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Functional/MergedCellsTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Functional/PrintAreaTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Functional/ReadFilterTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Functional/TypeAttributePreservationTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Functional/WorkbookViewAttributesTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Helper/HtmlTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Helper/MigratorTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Helper/SampleTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/IOFactoryTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Reader/CsvTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Reader/HtmlTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Reader/OdsTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Reader/XlsxTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Reader/XmlTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/ReferenceHelperTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/SettingsTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Shared/CodePageTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Shared/DateTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Shared/FileTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Shared/FontTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Shared/PasswordHasherTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Shared/StringHelperTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Shared/TimeZoneTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Style/BorderRangeTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Style/BorderTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Style/ColorTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Style/NumberFormatTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Worksheet/AutoFilter/Column/RuleTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Worksheet/AutoFilter/ColumnTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Worksheet/AutoFilterTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Worksheet/ColumnCellIteratorTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Worksheet/ColumnIteratorTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Worksheet/ColumnTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Worksheet/DrawingTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Worksheet/RowCellIteratorTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Worksheet/RowIteratorTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Worksheet/RowTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Worksheet/WorksheetTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Writer/Ods/ContentTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Writer/Xls/WorkbookTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/PhpSpreadsheetTests/Writer/Xlsx/UnparsedDataTest.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/bootstrap.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/DateTime/DATE.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/DateTime/DATEDIF.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/DateTime/DATEVALUE.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/DateTime/DAY.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/DateTime/DAYS360.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/DateTime/EDATE.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/DateTime/EOMONTH.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/DateTime/HOUR.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/DateTime/ISOWEEKNUM.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/DateTime/MINUTE.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/DateTime/MONTH.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/DateTime/NETWORKDAYS.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/DateTime/SECOND.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/DateTime/TIME.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/DateTime/TIMEVALUE.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/DateTime/WEEKDAY.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/DateTime/WEEKNUM.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/DateTime/WORKDAY.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/DateTime/YEAR.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/DateTime/YEARFRAC.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/BESSELI.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/BESSELJ.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/BESSELK.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/BESSELY.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/BIN2DEC.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/BIN2HEX.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/BIN2OCT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/BITAND.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/BITLSHIFT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/BITOR.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/BITRSHIFT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/BITXOR.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/COMPLEX.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/CONVERTUOM.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/DEC2BIN.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/DEC2HEX.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/DEC2OCT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/DELTA.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/ERF.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/ERFC.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/ERFPRECISE.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/GESTEP.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/HEX2BIN.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/HEX2DEC.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/HEX2OCT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMABS.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMAGINARY.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMARGUMENT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMCONJUGATE.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMCOS.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMCOSH.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMCOT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMCSC.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMCSCH.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMDIV.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMEXP.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMLN.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMLOG10.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMLOG2.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMPOWER.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMPRODUCT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMREAL.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMSEC.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMSECH.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMSIN.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMSINH.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMSQRT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMSUB.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMSUM.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/IMTAN.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/OCT2BIN.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/OCT2DEC.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Engineering/OCT2HEX.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/ACCRINT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/ACCRINTM.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/AMORDEGRC.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/AMORLINC.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/COUPDAYBS.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/COUPDAYS.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/COUPDAYSNC.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/COUPNCD.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/COUPNUM.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/COUPPCD.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/CUMIPMT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/CUMPRINC.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/DB.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/DDB.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/DISC.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/DOLLARDE.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/DOLLARFR.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/EFFECT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/FV.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/FVSCHEDULE.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/INTRATE.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/IPMT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/IRR.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/ISPMT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/MIRR.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/NOMINAL.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/NPER.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/NPV.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/PDURATION.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/PRICE.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/PRICEDISC.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/PV.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/RATE.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/RRI.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/SLN.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/SYD.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Financial/XIRR.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Functions/ERROR_TYPE.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Functions/IF_CONDITION.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Functions/ISFORMULA.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Functions/IS_BLANK.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Functions/IS_ERR.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Functions/IS_ERROR.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Functions/IS_EVEN.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Functions/IS_LOGICAL.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Functions/IS_NA.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Functions/IS_NONTEXT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Functions/IS_NUMBER.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Functions/IS_ODD.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Functions/IS_TEXT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Functions/N.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Functions/TYPE.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Logical/AND.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Logical/IF.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Logical/IFERROR.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Logical/NOT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Logical/OR.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/Logical/XOR.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/LookupRef/COLUMNS.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/LookupRef/FORMULATEXT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/LookupRef/HLOOKUP.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/LookupRef/INDEX.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/LookupRef/MATCH.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/LookupRef/ROWS.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/LookupRef/VLOOKUP.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/ACOT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/ACOTH.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/ATAN2.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/CEILING.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/COMBIN.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/COT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/COTH.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/CSC.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/CSCH.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/EVEN.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/FACT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/FACTDOUBLE.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/FLOOR.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/GCD.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/INT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/LCM.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/LOG.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/MDETERM.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/MINVERSE.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/MMULT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/MOD.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/MROUND.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/MULTINOMIAL.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/ODD.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/POWER.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/PRODUCT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/QUOTIENT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/ROMAN.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/ROUNDDOWN.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/ROUNDUP.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/SEC.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/SECH.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/SERIESSUM.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/SIGN.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/SQRTPI.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/SUBTOTAL.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/SUBTOTALHIDDEN.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/SUBTOTALNESTED.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/SUMIF.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/SUMPRODUCT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/SUMSQ.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/SUMX2MY2.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/SUMX2PY2.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/SUMXMY2.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/MathTrig/TRUNC.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/CHAR.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/CLEAN.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/CODE.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/CONCATENATE.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/DOLLAR.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/EXACT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/FIND.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/FIXED.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/LEFT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/LEN.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/LOWER.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/MID.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/NUMBERVALUE.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/PROPER.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/REPLACE.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/RIGHT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/SEARCH.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/SUBSTITUTE.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/T.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/TEXT.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/TEXTJOIN.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/TRIM.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/UPPER.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Calculation/TextData/VALUE.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/CalculationBinaryComparisonOperation.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Cell/DefaultValueBinder.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/CellAbsoluteCoordinate.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/CellAbsoluteReference.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/CellBuildRange.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/CellCoordinates.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/CellExtractAllCellReferencesInRange.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/CellGetRangeBoundaries.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/CellMergeRangesInCollection.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/CellRangeBoundaries.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/CellRangeDimension.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/CellSplitRange.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/ColumnIndex.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/ColumnString.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/CoordinateIsRange.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Functional/TypeAttributePreservation/Formula.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Reader/CSV/backslash.csv create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Reader/CSV/contains_html.csv create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Reader/CSV/csv_without_extension create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Reader/CSV/empty.csv create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Reader/CSV/enclosure.csv create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Reader/CSV/semicolon_separated.csv create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Reader/HTML/csv_with_angle_bracket.csv create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Reader/Ods/data.ods create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Reader/XLSX/without_cell_reference.xlsx create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Reader/Xml/WithoutStyle.xml create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Reader/Xml/XEETestInvalidSimpleXML.xml create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Reader/Xml/XEETestInvalidUTF-16.xml create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Reader/Xml/XEETestInvalidUTF-16BE.xml create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Reader/Xml/XEETestInvalidUTF-16LE.xml create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Reader/Xml/XEETestInvalidUTF-8.xml create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Reader/Xml/XEETestValidUTF-16.xml create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Reader/Xml/XEETestValidUTF-16BE.xml create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Reader/Xml/XEETestValidUTF-16LE.xml create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Reader/Xml/XEETestValidUTF-8.xml create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Shared/CentimeterSizeToPixels.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Shared/CodePage.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Shared/Date/DateTimeToExcel.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Shared/Date/ExcelToTimestamp1900.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Shared/Date/ExcelToTimestamp1900Timezone.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Shared/Date/ExcelToTimestamp1904.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Shared/Date/FormatCodes.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Shared/Date/FormattedPHPToExcel1900.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Shared/Date/TimestampToExcel1900.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Shared/Date/TimestampToExcel1904.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Shared/FontSizeToPixels.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Shared/InchSizeToPixels.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Shared/PasswordHashes.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Style/ColorChangeBrightness.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Style/ColorGetBlue.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Style/ColorGetGreen.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Style/ColorGetRed.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Style/NumberFormat.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Style/NumberFormatDates.php create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Writer/Ods/content-empty.xml create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Writer/Ods/content-with-data.xml create mode 100644 inc/vendor/phpoffice/phpspreadsheet/tests/data/Writer/XLSX/form_pass_print.xlsm create mode 100644 reference/stigs/.gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c2d640e --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/.buildpath +/.project +/.settings/ \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 110b393..d240acb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## v1.3.3 + ## v1.3.2 - Initial GitHub load - Previous versions loaded on [SourceForge](https://sourceforge.net/projects/sagacity/) \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b395466 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM php:7.2.8-apache-stretch +COPY conf/docker-php.ini /usr/local/etc/php/php.ini +RUN apt update && apt -y install zlib1g-dev mysql-client +RUN docker-php-ext-install mysqli zip +RUN mkdir /var/log/sagacity && chown www-data:www-data /var/log/sagacity +EXPOSE 80 diff --git a/conf/docker-php.ini b/conf/docker-php.ini new file mode 100644 index 0000000..490b557 --- /dev/null +++ b/conf/docker-php.ini @@ -0,0 +1,14 @@ +memory_limit=1024M +error_reporting=E_ALL +display_errors=On +display_startup_errors=On +html_errors=On +variables_order="GPCS" +request_order="GPCS" +post_max_size=1G +include_path="./:/var/www/html:/var/www/html/classes:/var/www/html/inc" +file_uploads=On +upload_max_filesize=1G +allow_url_fopen=On +allow_url_include=Off +date.timezone=America/Indiana/Indianapolis \ No newline at end of file diff --git a/config.inc b/config.inc index 3df1759..a35954b 100644 --- a/config.inc +++ b/config.inc @@ -15,6 +15,7 @@ * - Nov 14, 2017 - File created * - May 24, 2018 - Updated constants for 1.3.2 release * - Jun 2, 2018 - Added new STIG_EXCLUSIONS constant to permanently exclude STIGs + * - Aug 28, 2018 - Updated constants for 1.3.3 release */ // @new /** @@ -29,8 +30,8 @@ define('E_DEBUG', 65535); define('DOC_ROOT', '{DOC_ROOT}'); define('PWD_FILE', '{PWD_FILE}'); define('TMP', '{TMP_PATH}'); -define('VER', '1.3.2'); -define('REL_DATE', '2018-05-31'); +define('VER', '1.3.3'); +define('REL_DATE', '2018-08-31'); define('LOG_LEVEL', '{E_ERROR}'); define('LOG_PATH', '{LOG_PATH}'); define('SALT', '{SALT}'); diff --git a/inc/.gitignore b/inc/.gitignore new file mode 100644 index 0000000..80875bd --- /dev/null +++ b/inc/.gitignore @@ -0,0 +1 @@ +/passwd \ No newline at end of file diff --git a/inc/composer.json b/inc/composer.json index 6f2de3b..acd3ccc 100644 --- a/inc/composer.json +++ b/inc/composer.json @@ -1,12 +1,31 @@ { - "require" : { - "phpoffice/phpspreadsheet" : "^1.0", - "cocur/background-process" : "^0.7.0", - "tecnickcom/tcpdf" : "^6.2", - "pacificsec/cpe" : "^1.0", - "monolog/monolog": "^1.23" - }, - "require-dev" : { - "phpunit/phpunit" : "^6.2" - } -} + "require" : { + "phpoffice/phpspreadsheet" : "~1.4", + "cocur/background-process" : "~0.7", + "tecnickcom/tcpdf" : "~6.2", + "pacificsec/cpe" : "1.0.1", + "godsgood33/php-db" : "~1.3" + }, + "require-dev" : { + "phpunit/phpunit" : "~7.3" + }, + "type" : "project", + "homepage" : "https://cyberperspectives.com", + "license" : "Apache-2.0", + "authors" : [{ + "name" : "Ryan Prather", + "email" : "ryan.prather@cyberperspectives.com", + "role" : "Braun" + }, { + "name" : "Jeff Odegard", + "email" : "jeff.odegard@cyberperspectives.com", + "role" : "Brains" + } + ], + "keywords" : [ + "security", + "disa", + "rmf" + ], + "name" : "cyberperspectives\\sagacity" +} \ No newline at end of file diff --git a/inc/composer.lock b/inc/composer.lock index 398686e..8eaaff6 100644 --- a/inc/composer.lock +++ b/inc/composer.lock @@ -1,10 +1,10 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "92ac4709f5221f74a1c7f00e59df8ad7", + "content-hash": "184b710525eca347d52d3a2062cdf1c7", "packages": [ { "name": "cocur/background-process", @@ -44,6 +44,148 @@ ], "time": "2017-02-11T12:41:41+00:00" }, + { + "name": "godsgood33/php-db", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/godsgood33/php-db.git", + "reference": "cdf01f123c16dcb0b294b3b9013557e2d472f1c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/godsgood33/php-db/zipball/cdf01f123c16dcb0b294b3b9013557e2d472f1c9", + "reference": "cdf01f123c16dcb0b294b3b9013557e2d472f1c9", + "shasum": "" + }, + "require": { + "monolog/monolog": "~1.23" + }, + "require-dev": { + "phpunit/phpunit": "~7.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Godsgood33\\Php_Db\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Ryan Prather", + "email": "godsgood33@gmail.com", + "role": "Developer" + } + ], + "description": "PHP Database Library", + "homepage": "https://github.com/godsgood33/php-db", + "keywords": [ + "database", + "library", + "mysql", + "mysqli" + ], + "time": "2018-06-07T18:30:13+00:00" + }, + { + "name": "markbaker/complex", + "version": "1.4.6", + "source": { + "type": "git", + "url": "https://github.com/MarkBaker/PHPComplex.git", + "reference": "a78d82ae4e682c3809fc3023d1b0ce654f6ab12b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/a78d82ae4e682c3809fc3023d1b0ce654f6ab12b", + "reference": "a78d82ae4e682c3809fc3023d1b0ce654f6ab12b", + "shasum": "" + }, + "require": { + "php": "^5.6.0|^7.0.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3", + "phpcompatibility/php-compatibility": "^8.0", + "phpdocumentor/phpdocumentor": "2.*", + "phploc/phploc": "2.*", + "phpmd/phpmd": "2.*", + "phpunit/phpunit": "^4.8.35|^5.4.0", + "sebastian/phpcpd": "2.*", + "squizlabs/php_codesniffer": "^3.3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Complex\\": "classes/src/" + }, + "files": [ + "classes/src/functions/abs.php", + "classes/src/functions/acos.php", + "classes/src/functions/acosh.php", + "classes/src/functions/acot.php", + "classes/src/functions/acoth.php", + "classes/src/functions/acsc.php", + "classes/src/functions/acsch.php", + "classes/src/functions/argument.php", + "classes/src/functions/asec.php", + "classes/src/functions/asech.php", + "classes/src/functions/asin.php", + "classes/src/functions/asinh.php", + "classes/src/functions/atan.php", + "classes/src/functions/atanh.php", + "classes/src/functions/conjugate.php", + "classes/src/functions/cos.php", + "classes/src/functions/cosh.php", + "classes/src/functions/cot.php", + "classes/src/functions/coth.php", + "classes/src/functions/csc.php", + "classes/src/functions/csch.php", + "classes/src/functions/exp.php", + "classes/src/functions/inverse.php", + "classes/src/functions/ln.php", + "classes/src/functions/log2.php", + "classes/src/functions/log10.php", + "classes/src/functions/negative.php", + "classes/src/functions/pow.php", + "classes/src/functions/rho.php", + "classes/src/functions/sec.php", + "classes/src/functions/sech.php", + "classes/src/functions/sin.php", + "classes/src/functions/sinh.php", + "classes/src/functions/sqrt.php", + "classes/src/functions/tan.php", + "classes/src/functions/tanh.php", + "classes/src/functions/theta.php", + "classes/src/operations/add.php", + "classes/src/operations/subtract.php", + "classes/src/operations/multiply.php", + "classes/src/operations/divideby.php", + "classes/src/operations/divideinto.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Baker", + "email": "mark@lange.demon.co.uk" + } + ], + "description": "PHP Class for working with complex numbers", + "homepage": "https://github.com/MarkBaker/PHPComplex", + "keywords": [ + "complex", + "mathematics" + ], + "time": "2018-07-31T08:38:40+00:00" + }, { "name": "monolog/monolog", "version": "1.23.0", @@ -124,33 +266,59 @@ }, { "name": "pacificsec/cpe", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/pacificsec/cpe.git", - "reference": "3d78d66fc4ea249b6f353a7c48f426835a792d11" + "reference": "52cc49e04388ba00493be634287f6ce3efb30afc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pacificsec/cpe/zipball/3d78d66fc4ea249b6f353a7c48f426835a792d11", - "reference": "3d78d66fc4ea249b6f353a7c48f426835a792d11", + "url": "https://api.github.com/repos/pacificsec/cpe/zipball/52cc49e04388ba00493be634287f6ce3efb30afc", + "reference": "52cc49e04388ba00493be634287f6ce3efb30afc", "shasum": "" }, + "require": { + "php": ">=5.3.0" + }, "type": "library", - "notification-url": "https://packagist.org/downloads/" + "autoload": { + "psr-4": { + "PacificSec\\CPE\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Antonio Franco", + "email": "antonio.franco@pacificsec.com" + } + ], + "description": "CPE: Common Platform Enumeration for PHP", + "homepage": "https://github.com/pacificsec/cpe", + "keywords": [ + "cpe", + "cve", + "pacificsec", + "security" + ], + "time": "2018-08-22T17:55:09+00:00" }, { "name": "phpoffice/phpspreadsheet", - "version": "1.2.1", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/PHPOffice/PhpSpreadsheet.git", - "reference": "36acc372875c4d894dc093825ce4f62209db5a76" + "reference": "125f462a718956f37d81305ca0df4f17cef0f3b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/36acc372875c4d894dc093825ce4f62209db5a76", - "reference": "36acc372875c4d894dc093825ce4f62209db5a76", + "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/125f462a718956f37d81305ca0df4f17cef0f3b9", + "reference": "125f462a718956f37d81305ca0df4f17cef0f3b9", "shasum": "" }, "require": { @@ -166,6 +334,7 @@ "ext-xmlwriter": "*", "ext-zip": "*", "ext-zlib": "*", + "markbaker/complex": "^1.4.1", "php": "^5.6|^7.0", "psr/simple-cache": "^1.0" }, @@ -175,7 +344,7 @@ "jpgraph/jpgraph": "^4.0", "mpdf/mpdf": "^7.0.0", "phpunit/phpunit": "^5.7", - "squizlabs/php_codesniffer": "^2.7", + "squizlabs/php_codesniffer": "^3.3", "tecnickcom/tcpdf": "^6.2" }, "suggest": { @@ -223,7 +392,7 @@ "xls", "xlsx" ], - "time": "2018-04-10T03:53:16+00:00" + "time": "2018-08-06T02:58:06+00:00" }, { "name": "psr/log", @@ -440,16 +609,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.8.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "478465659fd987669df0bd8a9bf22a8710e5f1b6" + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/478465659fd987669df0bd8a9bf22a8710e5f1b6", - "reference": "478465659fd987669df0bd8a9bf22a8710e5f1b6", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", "shasum": "" }, "require": { @@ -484,26 +653,26 @@ "object", "object graph" ], - "time": "2018-05-29T17:25:09+00:00" + "time": "2018-06-11T23:09:50+00:00" }, { "name": "phar-io/manifest", - "version": "1.0.1", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", "shasum": "" }, "require": { "ext-dom": "*", "ext-phar": "*", - "phar-io/version": "^1.0.1", + "phar-io/version": "^2.0", "php": "^5.6 || ^7.0" }, "type": "library", @@ -539,20 +708,20 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-03-05T18:14:27+00:00" + "time": "2018-07-08T19:23:20+00:00" }, { "name": "phar-io/version", - "version": "1.0.1", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", "shasum": "" }, "require": { @@ -586,7 +755,7 @@ } ], "description": "Library for handling version information and constraints", - "time": "2017-03-05T17:38:23+00:00" + "time": "2018-07-08T19:19:57+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -742,16 +911,16 @@ }, { "name": "phpspec/prophecy", - "version": "1.7.6", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712" + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712", - "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", "shasum": "" }, "require": { @@ -763,12 +932,12 @@ }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "1.8.x-dev" } }, "autoload": { @@ -801,44 +970,44 @@ "spy", "stub" ], - "time": "2018-04-18T13:57:24+00:00" + "time": "2018-08-05T17:53:17+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "5.3.2", + "version": "6.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac" + "reference": "865662550c384bc1db7e51d29aeda1c2c161d69a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/865662550c384bc1db7e51d29aeda1c2c161d69a", + "reference": "865662550c384bc1db7e51d29aeda1c2c161d69a", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^7.0", - "phpunit/php-file-iterator": "^1.4.2", + "php": "^7.1", + "phpunit/php-file-iterator": "^2.0", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^2.0.1", + "phpunit/php-token-stream": "^3.0", "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.0", + "sebastian/environment": "^3.1", "sebastian/version": "^2.0.1", "theseer/tokenizer": "^1.1" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^7.0" }, "suggest": { - "ext-xdebug": "^2.5.5" + "ext-xdebug": "^2.6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.3.x-dev" + "dev-master": "6.0-dev" } }, "autoload": { @@ -864,29 +1033,29 @@ "testing", "xunit" ], - "time": "2018-04-06T15:36:58+00:00" + "time": "2018-06-01T07:51:50+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "reference": "cecbc684605bb0cc288828eb5d65d93d5c676d3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cecbc684605bb0cc288828eb5d65d93d5c676d3c", + "reference": "cecbc684605bb0cc288828eb5d65d93d5c676d3c", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -901,7 +1070,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -911,7 +1080,7 @@ "filesystem", "iterator" ], - "time": "2017-11-27T13:52:08+00:00" + "time": "2018-06-11T11:44:00+00:00" }, { "name": "phpunit/php-text-template", @@ -956,28 +1125,28 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.9", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/8b8454ea6958c3dee38453d3bd571e023108c91f", + "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -992,7 +1161,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -1001,33 +1170,33 @@ "keywords": [ "timer" ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2018-02-01T13:07:23+00:00" }, { "name": "phpunit/php-token-stream", - "version": "2.0.2", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "791198a2c6254db10131eecfe8c06670700904db" + "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", - "reference": "791198a2c6254db10131eecfe8c06670700904db", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/21ad88bbba7c3d93530d93994e0a33cd45f02ace", + "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.2.4" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1050,40 +1219,40 @@ "keywords": [ "tokenizer" ], - "time": "2017-11-27T05:48:46+00:00" + "time": "2018-02-01T13:16:43+00:00" }, { "name": "phpunit/phpunit", - "version": "6.5.8", + "version": "7.3.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "4f21a3c6b97c42952fd5c2837bb354ec0199b97b" + "reference": "34705f81bddc3f505b9599a2ef96e2b4315ba9b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4f21a3c6b97c42952fd5c2837bb354ec0199b97b", - "reference": "4f21a3c6b97c42952fd5c2837bb354ec0199b97b", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/34705f81bddc3f505b9599a2ef96e2b4315ba9b8", + "reference": "34705f81bddc3f505b9599a2ef96e2b4315ba9b8", "shasum": "" }, "require": { + "doctrine/instantiator": "^1.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "^1.6.1", - "phar-io/manifest": "^1.0.1", - "phar-io/version": "^1.0", - "php": "^7.0", + "myclabs/deep-copy": "^1.7", + "phar-io/manifest": "^1.0.2", + "phar-io/version": "^2.0", + "php": "^7.1", "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^5.3", - "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-code-coverage": "^6.0.7", + "phpunit/php-file-iterator": "^2.0.1", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^1.0.9", - "phpunit/phpunit-mock-objects": "^5.0.5", - "sebastian/comparator": "^2.1", - "sebastian/diff": "^2.0", + "phpunit/php-timer": "^2.0", + "sebastian/comparator": "^3.0", + "sebastian/diff": "^3.0", "sebastian/environment": "^3.1", "sebastian/exporter": "^3.1", "sebastian/global-state": "^2.0", @@ -1092,15 +1261,15 @@ "sebastian/version": "^2.0.1" }, "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2", - "phpunit/dbunit": "<3.0" + "phpunit/phpunit-mock-objects": "*" }, "require-dev": { "ext-pdo": "*" }, "suggest": { + "ext-soap": "*", "ext-xdebug": "*", - "phpunit/php-invoker": "^1.1" + "phpunit/php-invoker": "^2.0" }, "bin": [ "phpunit" @@ -1108,7 +1277,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.5.x-dev" + "dev-master": "7.3-dev" } }, "autoload": { @@ -1134,66 +1303,7 @@ "testing", "xunit" ], - "time": "2018-04-10T11:38:34+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "5.0.7", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "3eaf040f20154d27d6da59ca2c6e28ac8fd56dce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/3eaf040f20154d27d6da59ca2c6e28ac8fd56dce", - "reference": "3eaf040f20154d27d6da59ca2c6e28ac8fd56dce", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.5", - "php": "^7.0", - "phpunit/php-text-template": "^1.2.1", - "sebastian/exporter": "^3.1" - }, - "conflict": { - "phpunit/phpunit": "<6.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.5" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2018-05-29T13:50:43+00:00" + "time": "2018-08-22T06:39:21+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -1242,30 +1352,30 @@ }, { "name": "sebastian/comparator", - "version": "2.1.3", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/diff": "^2.0 || ^3.0", + "php": "^7.1", + "sebastian/diff": "^3.0", "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "^6.4" + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1302,32 +1412,33 @@ "compare", "equality" ], - "time": "2018-02-01T13:46:46+00:00" + "time": "2018-07-12T15:12:46+00:00" }, { "name": "sebastian/diff", - "version": "2.0.1", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" + "reference": "366541b989927187c4ca70490a35615d3fef2dce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/366541b989927187c4ca70490a35615d3fef2dce", + "reference": "366541b989927187c4ca70490a35615d3fef2dce", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.2" + "phpunit/phpunit": "^7.0", + "symfony/process": "^2 || ^3.3 || ^4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1352,9 +1463,12 @@ "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "diff" + "diff", + "udiff", + "unidiff", + "unified diff" ], - "time": "2017-08-03T08:09:46+00:00" + "time": "2018-06-10T07:54:39+00:00" }, { "name": "sebastian/environment", diff --git a/inc/vendor/cocur/background-process/src/BackgroundProcess.php b/inc/vendor/cocur/background-process/src/BackgroundProcess.php index 938b633..2cc354f 100644 --- a/inc/vendor/cocur/background-process/src/BackgroundProcess.php +++ b/inc/vendor/cocur/background-process/src/BackgroundProcess.php @@ -186,7 +186,7 @@ class BackgroundProcess { /** * @param int $pid PID of process to resume * - * @return Cocur\BackgroundProcess\BackgroundProcess + * @return BackgroundProcess */ static public function createFromPID($pid) { $process = new self(); diff --git a/inc/vendor/composer/autoload_files.php b/inc/vendor/composer/autoload_files.php index d931b8f..23129e8 100644 --- a/inc/vendor/composer/autoload_files.php +++ b/inc/vendor/composer/autoload_files.php @@ -6,5 +6,46 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( - '6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', + 'abede361264e2ae69ec1eee813a101af' => $vendorDir . '/markbaker/complex/classes/src/functions/abs.php', + '21a5860fbef5be28db5ddfbc3cca67c4' => $vendorDir . '/markbaker/complex/classes/src/functions/acos.php', + '1546e3f9d127f2a9bb2d1b6c31c26ef1' => $vendorDir . '/markbaker/complex/classes/src/functions/acosh.php', + 'd2516f7f4fba5ea5905f494b4a8262e0' => $vendorDir . '/markbaker/complex/classes/src/functions/acot.php', + '4511163d560956219b96882c0980b65e' => $vendorDir . '/markbaker/complex/classes/src/functions/acoth.php', + 'c361f5616dc2a8da4fa3e137077cd4ea' => $vendorDir . '/markbaker/complex/classes/src/functions/acsc.php', + '02d68920fc98da71991ce569c91df0f6' => $vendorDir . '/markbaker/complex/classes/src/functions/acsch.php', + '88e19525eae308b4a6aa3419364875d3' => $vendorDir . '/markbaker/complex/classes/src/functions/argument.php', + '60e8e2d0827b58bfc904f13957e51849' => $vendorDir . '/markbaker/complex/classes/src/functions/asec.php', + '13d2f040713999eab66c359b4d79871d' => $vendorDir . '/markbaker/complex/classes/src/functions/asech.php', + '838ab38beb32c68a79d3cd2c007d5a04' => $vendorDir . '/markbaker/complex/classes/src/functions/asin.php', + 'bb28eccd0f8f008333a1b3c163d604ac' => $vendorDir . '/markbaker/complex/classes/src/functions/asinh.php', + '9e483de83558c98f7d3feaa402c78cb3' => $vendorDir . '/markbaker/complex/classes/src/functions/atan.php', + '36b74b5b765ded91ee58c8ee3c0e85e3' => $vendorDir . '/markbaker/complex/classes/src/functions/atanh.php', + '05c15ee9510da7fd6bf6136f436500c0' => $vendorDir . '/markbaker/complex/classes/src/functions/conjugate.php', + 'd3208dfbce2505e370788f9f22f6785f' => $vendorDir . '/markbaker/complex/classes/src/functions/cos.php', + '141cf1fb3a3046f8b64534b0ebab33ca' => $vendorDir . '/markbaker/complex/classes/src/functions/cosh.php', + 'be660df75fd0dbe7fa7c03b7434b3294' => $vendorDir . '/markbaker/complex/classes/src/functions/cot.php', + '01e31ea298a51bc9e91517e3ce6b9e76' => $vendorDir . '/markbaker/complex/classes/src/functions/coth.php', + '803ddd97f7b1da68982a7b087c3476f6' => $vendorDir . '/markbaker/complex/classes/src/functions/csc.php', + '3001cdfd101ec3c32da34ee43c2e149b' => $vendorDir . '/markbaker/complex/classes/src/functions/csch.php', + '77b2d7629ef2a93fabb8c56754a91051' => $vendorDir . '/markbaker/complex/classes/src/functions/exp.php', + '4a4471296dec796c21d4f4b6552396a9' => $vendorDir . '/markbaker/complex/classes/src/functions/inverse.php', + 'c3e9897e1744b88deb56fcdc39d34d85' => $vendorDir . '/markbaker/complex/classes/src/functions/ln.php', + 'a83cacf2de942cff288de15a83afd26d' => $vendorDir . '/markbaker/complex/classes/src/functions/log2.php', + '6a861dacc9ee2f3061241d4c7772fa21' => $vendorDir . '/markbaker/complex/classes/src/functions/log10.php', + '4d2522d968c8ba78d6c13548a1b4200e' => $vendorDir . '/markbaker/complex/classes/src/functions/negative.php', + 'fd587ca933fc0447fa5ab4843bdd97f7' => $vendorDir . '/markbaker/complex/classes/src/functions/pow.php', + '383ef01c62028fc78cd4388082fce3c2' => $vendorDir . '/markbaker/complex/classes/src/functions/rho.php', + '150fbd1b95029dc47292da97ecab9375' => $vendorDir . '/markbaker/complex/classes/src/functions/sec.php', + '549abd9bae174286d660bdaa07407c68' => $vendorDir . '/markbaker/complex/classes/src/functions/sech.php', + '6bfbf5eaea6b17a0ed85cb21ba80370c' => $vendorDir . '/markbaker/complex/classes/src/functions/sin.php', + '22efe13f1a497b8e199540ae2d9dc59c' => $vendorDir . '/markbaker/complex/classes/src/functions/sinh.php', + 'e90135ab8e787795a509ed7147de207d' => $vendorDir . '/markbaker/complex/classes/src/functions/sqrt.php', + 'bb0a7923ffc6a90919cd64ec54ff06bc' => $vendorDir . '/markbaker/complex/classes/src/functions/tan.php', + '2d302f32ce0fd4e433dd91c5bb404a28' => $vendorDir . '/markbaker/complex/classes/src/functions/tanh.php', + '24dd4658a952171a4ee79218c4f9fd06' => $vendorDir . '/markbaker/complex/classes/src/functions/theta.php', + 'e49b7876281d6f5bc39536dde96d1f4a' => $vendorDir . '/markbaker/complex/classes/src/operations/add.php', + '47596e02b43cd6da7700134fd08f88cf' => $vendorDir . '/markbaker/complex/classes/src/operations/subtract.php', + '883af48563631547925fa4c3b48ead07' => $vendorDir . '/markbaker/complex/classes/src/operations/multiply.php', + 'f190e3308e6ca23234a2875edc985c03' => $vendorDir . '/markbaker/complex/classes/src/operations/divideby.php', + 'ac9e33ce6841aa5bf5d16d465a2f03a7' => $vendorDir . '/markbaker/complex/classes/src/operations/divideinto.php', ); diff --git a/inc/vendor/composer/autoload_psr4.php b/inc/vendor/composer/autoload_psr4.php index 111fd3c..076955b 100644 --- a/inc/vendor/composer/autoload_psr4.php +++ b/inc/vendor/composer/autoload_psr4.php @@ -9,6 +9,9 @@ return array( 'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'), 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), 'PhpOffice\\PhpSpreadsheet\\' => array($vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet'), + 'PacificSec\\CPE\\' => array($vendorDir . '/pacificsec/cpe/src'), 'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'), + 'Godsgood33\\Php_Db\\' => array($vendorDir . '/godsgood33/php-db/src'), + 'Complex\\' => array($vendorDir . '/markbaker/complex/classes/src'), 'Cocur\\BackgroundProcess\\' => array($vendorDir . '/cocur/background-process/src'), ); diff --git a/inc/vendor/composer/autoload_real.php b/inc/vendor/composer/autoload_real.php index 38c051b..73421f3 100644 --- a/inc/vendor/composer/autoload_real.php +++ b/inc/vendor/composer/autoload_real.php @@ -47,6 +47,24 @@ class ComposerAutoloaderInit69a0c53551ee5f4e61c53efb549e5e72 $loader->register(true); + if ($useStaticLoader) { + $includeFiles = Composer\Autoload\ComposerStaticInit69a0c53551ee5f4e61c53efb549e5e72::$files; + } else { + $includeFiles = require __DIR__ . '/autoload_files.php'; + } + foreach ($includeFiles as $fileIdentifier => $file) { + composerRequire69a0c53551ee5f4e61c53efb549e5e72($fileIdentifier, $file); + } + return $loader; } } + +function composerRequire69a0c53551ee5f4e61c53efb549e5e72($fileIdentifier, $file) +{ + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + require $file; + + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + } +} diff --git a/inc/vendor/composer/autoload_static.php b/inc/vendor/composer/autoload_static.php index 7f8651d..42ceafc 100644 --- a/inc/vendor/composer/autoload_static.php +++ b/inc/vendor/composer/autoload_static.php @@ -6,19 +6,70 @@ namespace Composer\Autoload; class ComposerStaticInit69a0c53551ee5f4e61c53efb549e5e72 { + public static $files = array ( + 'abede361264e2ae69ec1eee813a101af' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/abs.php', + '21a5860fbef5be28db5ddfbc3cca67c4' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acos.php', + '1546e3f9d127f2a9bb2d1b6c31c26ef1' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acosh.php', + 'd2516f7f4fba5ea5905f494b4a8262e0' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acot.php', + '4511163d560956219b96882c0980b65e' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acoth.php', + 'c361f5616dc2a8da4fa3e137077cd4ea' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acsc.php', + '02d68920fc98da71991ce569c91df0f6' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acsch.php', + '88e19525eae308b4a6aa3419364875d3' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/argument.php', + '60e8e2d0827b58bfc904f13957e51849' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/asec.php', + '13d2f040713999eab66c359b4d79871d' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/asech.php', + '838ab38beb32c68a79d3cd2c007d5a04' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/asin.php', + 'bb28eccd0f8f008333a1b3c163d604ac' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/asinh.php', + '9e483de83558c98f7d3feaa402c78cb3' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/atan.php', + '36b74b5b765ded91ee58c8ee3c0e85e3' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/atanh.php', + '05c15ee9510da7fd6bf6136f436500c0' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/conjugate.php', + 'd3208dfbce2505e370788f9f22f6785f' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/cos.php', + '141cf1fb3a3046f8b64534b0ebab33ca' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/cosh.php', + 'be660df75fd0dbe7fa7c03b7434b3294' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/cot.php', + '01e31ea298a51bc9e91517e3ce6b9e76' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/coth.php', + '803ddd97f7b1da68982a7b087c3476f6' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/csc.php', + '3001cdfd101ec3c32da34ee43c2e149b' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/csch.php', + '77b2d7629ef2a93fabb8c56754a91051' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/exp.php', + '4a4471296dec796c21d4f4b6552396a9' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/inverse.php', + 'c3e9897e1744b88deb56fcdc39d34d85' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/ln.php', + 'a83cacf2de942cff288de15a83afd26d' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/log2.php', + '6a861dacc9ee2f3061241d4c7772fa21' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/log10.php', + '4d2522d968c8ba78d6c13548a1b4200e' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/negative.php', + 'fd587ca933fc0447fa5ab4843bdd97f7' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/pow.php', + '383ef01c62028fc78cd4388082fce3c2' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/rho.php', + '150fbd1b95029dc47292da97ecab9375' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/sec.php', + '549abd9bae174286d660bdaa07407c68' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/sech.php', + '6bfbf5eaea6b17a0ed85cb21ba80370c' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/sin.php', + '22efe13f1a497b8e199540ae2d9dc59c' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/sinh.php', + 'e90135ab8e787795a509ed7147de207d' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/sqrt.php', + 'bb0a7923ffc6a90919cd64ec54ff06bc' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/tan.php', + '2d302f32ce0fd4e433dd91c5bb404a28' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/tanh.php', + '24dd4658a952171a4ee79218c4f9fd06' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/theta.php', + 'e49b7876281d6f5bc39536dde96d1f4a' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/add.php', + '47596e02b43cd6da7700134fd08f88cf' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/subtract.php', + '883af48563631547925fa4c3b48ead07' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/multiply.php', + 'f190e3308e6ca23234a2875edc985c03' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/divideby.php', + 'ac9e33ce6841aa5bf5d16d465a2f03a7' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/divideinto.php', + ); + public static $prefixLengthsPsr4 = array ( 'P' => array ( 'Psr\\SimpleCache\\' => 16, 'Psr\\Log\\' => 8, 'PhpOffice\\PhpSpreadsheet\\' => 25, + 'PacificSec\\CPE\\' => 15, ), 'M' => array ( 'Monolog\\' => 8, ), + 'G' => + array ( + 'Godsgood33\\Php_Db\\' => 18, + ), 'C' => array ( + 'Complex\\' => 8, 'Cocur\\BackgroundProcess\\' => 24, ), ); @@ -36,10 +87,22 @@ class ComposerStaticInit69a0c53551ee5f4e61c53efb549e5e72 array ( 0 => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet', ), + 'PacificSec\\CPE\\' => + array ( + 0 => __DIR__ . '/..' . '/pacificsec/cpe/src', + ), 'Monolog\\' => array ( 0 => __DIR__ . '/..' . '/monolog/monolog/src/Monolog', ), + 'Godsgood33\\Php_Db\\' => + array ( + 0 => __DIR__ . '/..' . '/godsgood33/php-db/src', + ), + 'Complex\\' => + array ( + 0 => __DIR__ . '/..' . '/markbaker/complex/classes/src', + ), 'Cocur\\BackgroundProcess\\' => array ( 0 => __DIR__ . '/..' . '/cocur/background-process/src', diff --git a/inc/vendor/composer/installed.json b/inc/vendor/composer/installed.json index bc55cf8..ddbe219 100644 --- a/inc/vendor/composer/installed.json +++ b/inc/vendor/composer/installed.json @@ -39,6 +39,152 @@ "unix" ] }, + { + "name": "godsgood33/php-db", + "version": "1.3.1", + "version_normalized": "1.3.1.0", + "source": { + "type": "git", + "url": "https://github.com/godsgood33/php-db.git", + "reference": "cdf01f123c16dcb0b294b3b9013557e2d472f1c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/godsgood33/php-db/zipball/cdf01f123c16dcb0b294b3b9013557e2d472f1c9", + "reference": "cdf01f123c16dcb0b294b3b9013557e2d472f1c9", + "shasum": "" + }, + "require": { + "monolog/monolog": "~1.23" + }, + "require-dev": { + "phpunit/phpunit": "~7.2" + }, + "time": "2018-06-07T18:30:13+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Godsgood33\\Php_Db\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Ryan Prather", + "email": "godsgood33@gmail.com", + "role": "Developer" + } + ], + "description": "PHP Database Library", + "homepage": "https://github.com/godsgood33/php-db", + "keywords": [ + "database", + "library", + "mysql", + "mysqli" + ] + }, + { + "name": "markbaker/complex", + "version": "1.4.6", + "version_normalized": "1.4.6.0", + "source": { + "type": "git", + "url": "https://github.com/MarkBaker/PHPComplex.git", + "reference": "a78d82ae4e682c3809fc3023d1b0ce654f6ab12b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/a78d82ae4e682c3809fc3023d1b0ce654f6ab12b", + "reference": "a78d82ae4e682c3809fc3023d1b0ce654f6ab12b", + "shasum": "" + }, + "require": { + "php": "^5.6.0|^7.0.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3", + "phpcompatibility/php-compatibility": "^8.0", + "phpdocumentor/phpdocumentor": "2.*", + "phploc/phploc": "2.*", + "phpmd/phpmd": "2.*", + "phpunit/phpunit": "^4.8.35|^5.4.0", + "sebastian/phpcpd": "2.*", + "squizlabs/php_codesniffer": "^3.3.0" + }, + "time": "2018-07-31T08:38:40+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Complex\\": "classes/src/" + }, + "files": [ + "classes/src/functions/abs.php", + "classes/src/functions/acos.php", + "classes/src/functions/acosh.php", + "classes/src/functions/acot.php", + "classes/src/functions/acoth.php", + "classes/src/functions/acsc.php", + "classes/src/functions/acsch.php", + "classes/src/functions/argument.php", + "classes/src/functions/asec.php", + "classes/src/functions/asech.php", + "classes/src/functions/asin.php", + "classes/src/functions/asinh.php", + "classes/src/functions/atan.php", + "classes/src/functions/atanh.php", + "classes/src/functions/conjugate.php", + "classes/src/functions/cos.php", + "classes/src/functions/cosh.php", + "classes/src/functions/cot.php", + "classes/src/functions/coth.php", + "classes/src/functions/csc.php", + "classes/src/functions/csch.php", + "classes/src/functions/exp.php", + "classes/src/functions/inverse.php", + "classes/src/functions/ln.php", + "classes/src/functions/log2.php", + "classes/src/functions/log10.php", + "classes/src/functions/negative.php", + "classes/src/functions/pow.php", + "classes/src/functions/rho.php", + "classes/src/functions/sec.php", + "classes/src/functions/sech.php", + "classes/src/functions/sin.php", + "classes/src/functions/sinh.php", + "classes/src/functions/sqrt.php", + "classes/src/functions/tan.php", + "classes/src/functions/tanh.php", + "classes/src/functions/theta.php", + "classes/src/operations/add.php", + "classes/src/operations/subtract.php", + "classes/src/operations/multiply.php", + "classes/src/operations/divideby.php", + "classes/src/operations/divideinto.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Baker", + "email": "mark@lange.demon.co.uk" + } + ], + "description": "PHP Class for working with complex numbers", + "homepage": "https://github.com/MarkBaker/PHPComplex", + "keywords": [ + "complex", + "mathematics" + ] + }, { "name": "monolog/monolog", "version": "1.23.0", @@ -121,36 +267,62 @@ }, { "name": "pacificsec/cpe", - "version": "1.0.0", - "version_normalized": "1.0.0.0", + "version": "1.0.1", + "version_normalized": "1.0.1.0", "source": { "type": "git", "url": "https://github.com/pacificsec/cpe.git", - "reference": "3d78d66fc4ea249b6f353a7c48f426835a792d11" + "reference": "52cc49e04388ba00493be634287f6ce3efb30afc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pacificsec/cpe/zipball/3d78d66fc4ea249b6f353a7c48f426835a792d11", - "reference": "3d78d66fc4ea249b6f353a7c48f426835a792d11", + "url": "https://api.github.com/repos/pacificsec/cpe/zipball/52cc49e04388ba00493be634287f6ce3efb30afc", + "reference": "52cc49e04388ba00493be634287f6ce3efb30afc", "shasum": "" }, + "require": { + "php": ">=5.3.0" + }, + "time": "2018-08-22T17:55:09+00:00", "type": "library", - "installation-source": "dist", - "notification-url": "https://packagist.org/downloads/" + "installation-source": "source", + "autoload": { + "psr-4": { + "PacificSec\\CPE\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Antonio Franco", + "email": "antonio.franco@pacificsec.com" + } + ], + "description": "CPE: Common Platform Enumeration for PHP", + "homepage": "https://github.com/pacificsec/cpe", + "keywords": [ + "cpe", + "cve", + "pacificsec", + "security" + ] }, { "name": "phpoffice/phpspreadsheet", - "version": "1.2.1", - "version_normalized": "1.2.1.0", + "version": "1.4.0", + "version_normalized": "1.4.0.0", "source": { "type": "git", "url": "https://github.com/PHPOffice/PhpSpreadsheet.git", - "reference": "36acc372875c4d894dc093825ce4f62209db5a76" + "reference": "125f462a718956f37d81305ca0df4f17cef0f3b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/36acc372875c4d894dc093825ce4f62209db5a76", - "reference": "36acc372875c4d894dc093825ce4f62209db5a76", + "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/125f462a718956f37d81305ca0df4f17cef0f3b9", + "reference": "125f462a718956f37d81305ca0df4f17cef0f3b9", "shasum": "" }, "require": { @@ -166,6 +338,7 @@ "ext-xmlwriter": "*", "ext-zip": "*", "ext-zlib": "*", + "markbaker/complex": "^1.4.1", "php": "^5.6|^7.0", "psr/simple-cache": "^1.0" }, @@ -175,7 +348,7 @@ "jpgraph/jpgraph": "^4.0", "mpdf/mpdf": "^7.0.0", "phpunit/phpunit": "^5.7", - "squizlabs/php_codesniffer": "^2.7", + "squizlabs/php_codesniffer": "^3.3", "tecnickcom/tcpdf": "^6.2" }, "suggest": { @@ -184,7 +357,7 @@ "mpdf/mpdf": "Option for rendering PDF with PDF Writer", "tecnick.com/tcpdf": "Option for rendering PDF with PDF Writer" }, - "time": "2018-04-10T03:53:16+00:00", + "time": "2018-08-06T02:58:06+00:00", "type": "library", "installation-source": "source", "autoload": { diff --git a/inc/vendor/godsgood33/php-db/.gitattributes b/inc/vendor/godsgood33/php-db/.gitattributes new file mode 100644 index 0000000..bdb0cab --- /dev/null +++ b/inc/vendor/godsgood33/php-db/.gitattributes @@ -0,0 +1,17 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/inc/vendor/godsgood33/php-db/.gitignore b/inc/vendor/godsgood33/php-db/.gitignore new file mode 100644 index 0000000..b0fbc01 --- /dev/null +++ b/inc/vendor/godsgood33/php-db/.gitignore @@ -0,0 +1,4 @@ +.settings/ +.buildpath +code-coverage/ +/vendor/ diff --git a/inc/vendor/godsgood33/php-db/.scrutinizer.yml b/inc/vendor/godsgood33/php-db/.scrutinizer.yml new file mode 100644 index 0000000..5653d85 --- /dev/null +++ b/inc/vendor/godsgood33/php-db/.scrutinizer.yml @@ -0,0 +1,26 @@ +checks: + php: true + +filter: + paths: ["src/*"] + +tools: + external_code_coverage: + timeout: 600 + php_sim: true + php_pdepend: true + php_analyzer: true + php_cs_fixer: true + +build: + nodes: + analysis: + tests: + override: + - php-scrutinizer-run + +build_failure_conditions: + - 'elements.rating(<= C).new.exists' # No new classes/methods with a rating of C or worse allowed + - 'issues.severity(>= MAJOR).new.exists' # New issues of major or higher severity + - 'project.metric_change("scrutinizer.test_coverage", < 0)' # Code Coverage decreased from previous inspection + - 'patches.label("Unused Use Statements").new.exists' # No new unused imports patches allowed \ No newline at end of file diff --git a/inc/vendor/godsgood33/php-db/LICENSE b/inc/vendor/godsgood33/php-db/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/inc/vendor/godsgood33/php-db/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/inc/vendor/godsgood33/php-db/README.md b/inc/vendor/godsgood33/php-db/README.md new file mode 100644 index 0000000000000000000000000000000000000000..80e791204cb6fc02f457c91e01c796f20ea9ab2c GIT binary patch literal 7252 zcmc(kYj0ac5Qg__koXUWv>(!nB&02O71RrYqC%jgst`fQiJiu+W2eVXLqPm>;C*&H zo;|)LBvp}hnseEm%R4jg>~8=0`&z2f59u3SReG52r+3pk>6i4LuKVdEbyF|3_2s8D zN-bR{X_$UZYw1w;qjapN&(fxT!?d4jeI02=U)LY0qvv(K?WPU=J4ihric5G-&U+=%vyStLu()Ur;bmOg9<#w!Ry^hD` zlqG@SgY02P_;L3-TiVKgy=@GMK&k)#MUwc{ie6utaX1r6@Z;Lix2}+`#{af-*VDbt zt<#yFM;b#Ms`N+~_jp-pOh>*nLgw-foBMi06_}>3M)vb;{vw%~ZDn+=QOMoU+i5>K z>359)srFc7csz}Tjl#2bW3>4Vj?8$OtwS!>g$dM$P*Ytx&IvR@v-mUA+Jz;1#Vc#HI?~xj4oJDa}dTPaBGe?7J z>T6zC@g$Ssj@608r+Nzei1xAc+|dPw%N|a$#auAlgG4ZWL3qQ!p z6U}tQ(2K{8BofUJyv0lY5?ib$e)evl$i2|B)dW^qZuhdJQ$2fCuB7YIx2NxSb%Erm z{(dc;)2zO$+95K(DQ0_VSN}F^WKDj3K9PGfZKo&c=H!`L;CEd%5hW}yH6G=dypnxg zp-z4T&Z`;8)d|-Ad@Nhr8Vf4S2!vNBwuIg{*# zXzb;fc*N}Oz4U$hSz}8qN{%!(?Mo(^=~|~VmhO($PLZ`;)lJN3YWLiKsQ7Iw=2%PR zpu_o*EQ7Bt^M?A~&rzV(tmg35c-ux%Z&ZaWRkJ|NIzpg ztH?4EhEmD*hHlB39uL@o_sp@i4;^N<8_Y*6bQt&Fmn^E(IKp~Juv0hJk6Q{NhMCtq zOo0tZ;0t*BeZ&sV0af^p@6pxFM)a|gg9)s+5xZbZD&APaP>Fant9uq#@So1L*V)z+ z$@KoWlUa{y_n6~xiT7+jc7}`Y6aF5^7kDx_+A$$du^zk29Hi&eOp5jRcPXj&;eY3K8pklYhiSI;#kNrJNL$Zhjd5Kuw!TPalTB7tRxOoyj+&spz>hp-mT?|v zksqGzNMMBRc)D3%nLVzFy^ryXahzulRoPN>e9aR%>y>Tez3Q4+dM@&IC`)XOv8KD| zCLr7rzp;A5QoOR&f3V?IvL$k*X(-2{2SST1F>tu& zKepVX=2+j0vg?i9pUtB{^pm-WKDmMg^YosNDqen?ZDHL2o4}gOeJ@8g{aq6ig1xV( zeQo+eZ>-wNSkMuyW7-NdS%Hyb zv2KqHG|shifPI~f1uOcwoaF;-K9J2Y1X;(LgtKjI*w3@v7ONKPNnxR%eM}>K5$lYF zu*`MD4%4(*hluYF@*WC*ruF&WpEFP65YKp6&ZHUpM>Z`(H;@A%XVelqP7h1$Lau2u zeh=GcBgiROFC)%w8+%y=lSSS$W3|^riM^R>`EPncj_;y<*WT1> zY=5.3.0", + "psr/log": "~1.0" + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "graylog2/gelf-php": "~1.0", + "jakub-onderka/php-parallel-lint": "0.9", + "php-amqplib/php-amqplib": "~2.4", + "php-console/php-console": "^3.1.3", + "phpunit/phpunit": "~4.5", + "phpunit/phpunit-mock-objects": "2.3.0", + "ruflin/elastica": ">=0.90 <3.0", + "sentry/sentry": "^0.13", + "swiftmailer/swiftmailer": "^5.3|^6.0" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mongo": "Allow sending log messages to a MongoDB server", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "sentry/sentry": "Allow sending log messages to a Sentry server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "http://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "time": "2017-06-19T01:22:40+00:00" + }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10T12:19:37+00:00" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2017-07-22T11:58:36+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "478465659fd987669df0bd8a9bf22a8710e5f1b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/478465659fd987669df0bd8a9bf22a8710e5f1b6", + "reference": "478465659fd987669df0bd8a9bf22a8710e5f1b6", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2018-05-29T17:25:09+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2017-03-05T18:14:27+00:00" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2017-03-05T17:38:23+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-30T07:14:17+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.7.6", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712", + "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2018-04-18T13:57:24+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "6.0.7", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "865662550c384bc1db7e51d29aeda1c2c161d69a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/865662550c384bc1db7e51d29aeda1c2c161d69a", + "reference": "865662550c384bc1db7e51d29aeda1c2c161d69a", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.1", + "phpunit/php-file-iterator": "^2.0", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^3.0", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.1", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "suggest": { + "ext-xdebug": "^2.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2018-06-01T07:51:50+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "e20525b0c2945c7c317fff95660698cb3d2a53bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/e20525b0c2945c7c317fff95660698cb3d2a53bc", + "reference": "e20525b0c2945c7c317fff95660698cb3d2a53bc", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2018-05-28T12:13:49+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/8b8454ea6958c3dee38453d3bd571e023108c91f", + "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2018-02-01T13:07:23+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/21ad88bbba7c3d93530d93994e0a33cd45f02ace", + "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2018-02-01T13:16:43+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "7.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "00bc0b93f0ff4f557e9ea766557fde96da9a03dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/00bc0b93f0ff4f557e9ea766557fde96da9a03dd", + "reference": "00bc0b93f0ff4f557e9ea766557fde96da9a03dd", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "^1.7", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.1", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^6.0.7", + "phpunit/php-file-iterator": "^2.0", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^2.0", + "sebastian/comparator": "^3.0", + "sebastian/diff": "^3.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0.1" + }, + "conflict": { + "phpunit/phpunit-mock-objects": "*" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*", + "phpunit/php-invoker": "^2.0" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2018-06-05T03:40:05+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "ed5fd2281113729f1ebcc64d101ad66028aeb3d5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/ed5fd2281113729f1ebcc64d101ad66028aeb3d5", + "reference": "ed5fd2281113729f1ebcc64d101ad66028aeb3d5", + "shasum": "" + }, + "require": { + "php": "^7.1", + "sebastian/diff": "^3.0", + "sebastian/exporter": "^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2018-04-18T13:33:00+00:00" + }, + { + "name": "sebastian/diff", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "e09160918c66281713f1c324c1f4c4c3037ba1e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/e09160918c66281713f1c324c1f4c4c3037ba1e8", + "reference": "e09160918c66281713f1c324c1f4c4c3037ba1e8", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0", + "symfony/process": "^2 || ^3.3 || ^4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "time": "2018-02-01T13:45:15+00:00" + }, + { + "name": "sebastian/environment", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2017-07-01T08:51:00+00:00" + }, + { + "name": "sebastian/exporter", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2017-04-03T13:19:02+00:00" + }, + { + "name": "sebastian/global-state", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2017-04-27T15:39:26+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2017-03-03T06:23:57+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2017-04-07T12:08:54+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-01-29T19:49:41+00:00" + } + ], + "aliases": [], + "minimum-stability": "beta", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/inc/vendor/godsgood33/php-db/examples/create_table_json.json b/inc/vendor/godsgood33/php-db/examples/create_table_json.json new file mode 100644 index 0000000..08cc67a --- /dev/null +++ b/inc/vendor/godsgood33/php-db/examples/create_table_json.json @@ -0,0 +1,136 @@ +{ + "tables": [ + { + "schema": "db", + "name": "settings", + "primary_key": [ + "id" + ], + "unique": [ + "meta_key" + ], + "fields": [ + { + "name": "id", + "dataType": "int(11)", + "type": 3, + "length": 11, + "values": [], + "ai": true, + "nn": true, + "default": "" + }, + { + "name": "meta_key", + "dataType": "varchar(100)", + "type": 253, + "length": 100, + "values": [], + "ai": false, + "nn": true, + "default": "" + }, + { + "name": "meta_value", + "dataType": "mediumtext", + "type": 250, + "length": null, + "values": [], + "ai": false, + "nn": false, + "default": null + } + ] + }, + { + "schema": "db", + "name": "test", + "primary_key": [ + "id", + "fk" + ], + "fields": [ + { + "name": "id", + "dataType": "int(11)", + "type": 3, + "length": 11, + "values": [], + "ai": true, + "nn": true, + "default": "" + }, + { + "name": "fk", + "dataType": "int(11)", + "type": 3, + "length": 11, + "values": [], + "ai": false, + "nn": true, + "default": "" + }, + { + "name": "default", + "dataType": "tinyint(1)", + "type": 1, + "length": 1, + "values": [], + "ai": false, + "nn": false, + "default": "0" + }, + { + "name": "enum", + "dataType": "enum", + "type": 247, + "length": null, + "values": [ + "1", + "2" + ], + "ai": false, + "nn": false, + "default": "1" + } + ], + "constraints": [ + { + "id": "con_1", + "local": "fk", + "schema": "db", + "table": "test", + "field": "id", + "update": null, + "delete": null + } + ], + "index": [ + { + "id": "default_idx", + "type": "index", + "ref": "default" + } + ] + }, + { + "schema": "db", + "name": "test2", + "primary_key": [ + "id" + ], + "fields": [ + { + "name": "id", + "dataType": "int(11)", + "type": 3, + "length": 11, + "values": [], + "ai": true, + "nn": true, + "default": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/inc/vendor/godsgood33/php-db/phpunit.xml b/inc/vendor/godsgood33/php-db/phpunit.xml new file mode 100644 index 0000000..4ff2356 --- /dev/null +++ b/inc/vendor/godsgood33/php-db/phpunit.xml @@ -0,0 +1,16 @@ + + + + + tests/ + + + + + src/ + + + \ No newline at end of file diff --git a/inc/vendor/godsgood33/php-db/src/DBConfig.php b/inc/vendor/godsgood33/php-db/src/DBConfig.php new file mode 100644 index 0000000..002d7bc --- /dev/null +++ b/inc/vendor/godsgood33/php-db/src/DBConfig.php @@ -0,0 +1,50 @@ +_c = $dbh; + } else { + if (PHP_DB_SERVER == '{IP|hostname}' || PHP_DB_USER == '{username}' || PHP_DB_PWD == '{password}' || PHP_DB_SCHEMA == '{schema}') { + throw new Error("Need to update DBConfig.php", E_ERROR); + } + $this->_c = new mysqli(PHP_DB_SERVER, PHP_DB_USER, PHP_DB_PWD, PHP_DB_SCHEMA); + } + + if ($this->_c->connect_errno) { + throw new Error("Could not create database class due to error {$this->_c->error}", E_ERROR); + } + + $this->_logPath = $strLogPath; + touch($this->_logPath . "/db.log"); + + $this->_logger = new Logger('db', [ + new StreamHandler(realpath($this->_logPath . "/db.log"), $this->_logLevel) + ]); + + if (PHP_SAPI == 'cli') { + $stream = new StreamHandler("php://output", $this->_logLevel); + $stream->setFormatter(new LineFormatter("%datetime% %level_name% %message%" . PHP_EOL, "H:i:s.u")); + $this->_logger->pushHandler($stream); + } + + $this->_logger->info("Database connected"); + $this->_logger->debug("Connection details:", [ + 'Server' => PHP_DB_SERVER, + 'User' => PHP_DB_USER, + 'Schema' => PHP_DB_SCHEMA + ]); + + $this->setVar("time_zone", "+00:00"); + $this->setVar("sql_mode", ""); + } + + /** + * Function to make sure that the database is connected + * + * @return boolean + */ + public function isConnected() + { + $this->_logger->debug("Pinging server"); + return $this->_c->ping(); + } + + /** + * Setter function for _logger + * + * @param Logger $log + */ + public function setLogger(Logger $log) + { + $this->_logger->debug("Setting logger"); + $this->_logger = $log; + } + + /** + * Getter function for _logger + * + * @return string + */ + public function getLogLevel() + { + $this->_logger->debug("Getting log level ({$this->_logLevel})"); + return $this->_logLevel; + } + + /** + * Function to set the log level just in case there needs to be a change to the default log level + * + * @param string $strLevel + */ + public function setLogLevel($strLevel) + { + $this->_logger->debug("Setting log level to {$strLevel}"); + $this->_logLevel = $strLevel; + + $handles = []; + + foreach ($this->_logger->getHandlers() as $h) { + $h->/** @scrutinizer ignore-call */ + setLevel($strLevel); + $handles[] = $h; + } + + $this->_logger->setHandlers($handles); + } + + /** + * Getter function for _queryType + * + * @return int + */ + public function getQueryType() + { + return $this->_queryType; + } + + /** + * Setter function for _queryType + * + * @param int $qt + */ + public function setQueryType($qt) + { + $this->_queryType = $qt; + } + + /** + * Getter function for _sql + * + * @return string + */ + public function getSql() + { + return $this->_sql; + } + + /** + * Function to return the currently selected database schema + * + * @return string + */ + public function getSchema() + { + if ($res = $this->_c->query("SELECT DATABASE()")) { + $row = $res->fetch_row(); + + $this->_logger->debug("Getting schema {$row[0]}"); + return $row[0]; + } + return null; + } + + /** + * Function to set schema + * + * @param string $strSchema + */ + public function setSchema($strSchema) + { + $this->_logger->debug("Setting schema to {$strSchema}"); + if (! $this->_c->select_db($strSchema)) { + $this->_logger->emergency("Unknown schema {$strSchema}"); + return false; + } + return true; + } + + /** + * Method to set a MYSQL variable + * + * @param string $strName + * @param string $strVal + * + * @return boolean + */ + public function setVar($strName, $strVal) + { + if (! $strName || ! $strVal) { + $this->_logger->debug("name or value are blank", [ + 'name' => $strName, + 'value' => $strVal + ]); + return false; + } + + $this->_logger->debug("Setting {$strName} = '{$strVal}'"); + + if ($this->_c->real_query("SET $strName = {$this->_escape($strVal)}")) { + return true; + } else { + $this->_logger->error("Failed to set variable {$this->_c->error}"); + return false; + } + } + + /** + * Function to execute the statement + * + * @param mixed $return + * [optional] + * MYSQLI constant to control what is returned from the mysqli_result object + * @param string $class + * [optional] + * Class to use when returning object + * @param string $strSql + * [optional] + * Optional SQL query + * + * @throws \Exception + * @throws \InvalidArgumentException + * + * @return mixed + */ + public function execute($return = MYSQLI_ASSOC, $class = null, $strSql = null) + { + if (! is_null($strSql)) { + $this->_sql = $strSql; + } + + $query = 'SELECT'; + switch ($this->_queryType) { + case self::SELECT_COUNT: + $query = 'SELECT COUNT'; + break; + case self::INSERT: + case self::EXTENDED_INSERT: + $query = 'INSERT'; + break; + case self::UPDATE: + case self::EXTENDED_UPDATE: + $query = 'UPDATE'; + break; + case self::REPLACE: + case self::EXTENDED_REPLACE: + $query = 'REPLACE'; + break; + case self::DROP: + $query = 'DROP'; + break; + case self::DELETE: + $query = 'DELETE'; + break; + case self::CREATE_TABLE: + $query = 'CREATE TABLE'; + break; + case self::TRUNCATE: + $query = 'TRUNCATE'; + break; + } + + if (is_a($this->_c, 'mysqli')) { + if (! $this->_c->ping()) { + require_once 'DBConfig.php'; + $this->_c = null; + $this->_c = new mysqli(PHP_DB_SERVER, PHP_DB_USER, PHP_DB_PWD, PHP_DB_SCHEMA); + } + } else { + throw new \Error('Database was not connected', E_ERROR); + } + + $this->_logger->info("Executing {$query} query"); + $this->_logger->debug($this->_sql); + + try { + if (in_array($this->_queryType, [ + self::SELECT, + self::SELECT_COUNT + ])) { + $this->_result = $this->_c->query($this->_sql); + if ($this->_c->error) { + $this->_logger->error("There is an error {$this->_c->error}"); + $this->_logger->debug("Errored on query", [$this->_sql]); + throw new Exception("There was an error {$this->_c->error}", E_ERROR); + } + } else { + $this->_result = $this->_c->real_query($this->_sql); + if ($this->_c->errno) { + $this->_logger->error("There was an error {$this->_c->error}"); + $this->_logger->debug("Errored on query", [$this->_sql]); + throw new Exception("There was an error {$this->_c->error}", E_ERROR); + } + } + + if ($return == MYSQLI_OBJECT && ! is_null($class) && class_exists(/** @scrutinizer ignore-type */$class)) { + $this->_logger->debug("Checking results for query", [ + 'class' => get_class($class) + ]); + $this->_result = $this->checkResults($return, $class); + } elseif ($return == MYSQLI_OBJECT && is_null($class)) { + $this->_logger->debug("Checking results for query", [ + 'class' => 'stdClass' + ]); + $this->_result = $this->checkResults($return, 'stdClass'); + } else { + $this->_logger->debug("Checking results for query and returning associative array"); + $this->_result = $this->checkResults(MYSQLI_ASSOC); + } + } catch (Exception $e) {} + + return $this->_result; + } + + /** + * Function to check the results and return what is expected + * + * @param mixed $returnType + * [optional] + * Optional return mysqli_result return type + * @param mixed $class + * + * @return mixed + */ + public function checkResults($returnType = MYSQLI_ASSOC, $class = null) + { + $res = null; + + switch ($this->_queryType) { + case self::SELECT_COUNT: + if (! is_a($this->_result, 'mysqli_result')) { + $this->_logger->error("Error with return on query"); + return; + } + + if ($this->_result->num_rows == 1) { + $row = $this->_result->fetch_assoc(); + if (isset($row['count'])) { + $this->_logger->debug("Returning SELECT_COUNT query", [ + 'count' => $row['count'] + ]); + $res = $row['count']; + } + } elseif ($this->_result->num_rows > 1) { + $this->_logger->debug("Returning SELECT_COUNT query", [ + 'count' => $this->_result->num_rows + ]); + $res = $this->_result->num_rows; + } + + mysqli_free_result($this->_result); + + return $res; + case self::SELECT: + if (! is_a($this->_result, 'mysqli_result')) { + $this->_logger->error("Error with return on query"); + return; + } + + if ($returnType == MYSQLI_OBJECT && ! is_null($class) && class_exists($class)) { + if ($this->_result->num_rows == 1) { + $this->_logger->debug("Returning object from SELECT query", [ + 'type' => get_class($class) + ]); + $res = $this->_result->fetch_object($class); + } elseif ($this->_result->num_rows > 1) { + $this->_logger->debug("Returning object array from SELECT query", [ + 'type' => get_class($class) + ]); + while ($row = $this->_result->fetch_object($class)) { + $res[] = $row; + } + } + } else { + if ($this->_result->num_rows == 1) { + $this->_logger->debug("Fetching results"); + $res = $this->_result->fetch_array($returnType); + } elseif ($this->_result->num_rows > 1) { + $this->_logger->debug("Fetching results array"); + $res = $this->fetchAll($returnType); + } + } + + mysqli_free_result($this->_result); + + return $res; + case self::INSERT: + if ($this->_c->error) { + $this->_logger->error("Database Error {$this->_c->error}"); + return 0; + } + + if ($this->_c->insert_id) { + $this->_logger->debug("Insert successful returning insert_id", [ + 'id' => $this->_c->insert_id + ]); + return $this->_c->insert_id; + } elseif ($this->_c->affected_rows) { + $this->_logger->debug("Insert successful return affected row count", [ + 'count' => $this->_c->affected_rows + ]); + return $this->_c->affected_rows; + } + + $this->_logger->debug("Insert successful, but no ID so returning 1 for success"); + + return 1; + // intentional fall through + case self::EXTENDED_INSERT: + // intentional fall through + case self::EXTENDED_REPLACE: + // intentional fall through + case self::EXTENDED_UPDATE: + // intentional fall through + case self::REPLACE: + // intentional fall through + case self::UPDATE: + // intentional fall through + case self::DELETE: + // intentional fall through + case self::ALTER_TABLE: + if ($this->_c->error) { + $this->_logger->error("Database Error {$this->_c->error}"); + return false; + } elseif ($this->_c->affected_rows) { + $this->_logger->debug("Returning affected row count for {$this->_queryType}", [ + 'count' => $this->_c->affected_rows + ]); + return $this->_c->affected_rows; + } else { + return true; + } + break; + case self::CREATE_TABLE: + // intentional fall through + case self::DROP: + // intentional fall through + case self::TRUNCATE: + $this->_logger->debug("Returning from {$this->_queryType}"); + return true; + } + } + + /** + * Function to pass through calling the query function (used for backwards compatibility and for more complex queries that aren't currently supported) + * Nothing is escaped + * + * @param string $strSql + * [optional] + * Optional query to pass in and execute + * + * @return \mysqli_result|boolean + */ + public function query($strSql = null) + { + if (is_null($strSql)) { + return $this->_c->query($this->_sql); + } else { + return $this->_c->query($strSql); + } + } + + /** + * A function to build a select query + * + * @param string $strTableName + * The table to query + * @param array|string $fields + * [optional] + * Optional array of fields to return (defaults to '*') + * @param array $arrWhere + * [optional] + * Optional 2-dimensional array to build where clause from + * @param array $arrFlags + * [optional] + * Optional 2-dimensional array to allow other flags + * + * @see Database::where() + * @see Database::flags() + * + * @throws \InvalidArgumentException + * + * @return mixed + */ + public function select($strTableName, $fields = null, $arrWhere = [], $arrFlags = []) + { + $this->_sql = null; + $this->_queryType = self::SELECT; + + if (! is_null($strTableName)) { + $this->_logger->debug("Starting SELECT query of {$strTableName}", [ + 'fields' => $this->fields($fields) + ]); + $this->_sql = "SELECT " . $this->fields($fields) . " FROM $strTableName"; + } else { + $this->_logger->emergency("Table name is invalid or wrong type"); + throw new Error("Table name is invalid"); + } + + if (isset($arrFlags['joins']) && is_array($arrFlags['joins']) && count($arrFlags['joins'])) { + $this->_logger->debug("Adding joins", [ + 'joins' => implode(' ', $arrFlags['joins']) + ]); + $this->_sql .= " " . implode(" ", $arrFlags['joins']); + } else { + $this->_logger->debug("No joins"); + } + + if (! is_null($arrWhere) && is_array($arrWhere) && count($arrWhere)) { + $where_str = " WHERE"; + $this->_logger->debug("Parsing where clause and adding to query"); + foreach ($arrWhere as $x => $w) { + $where_str .= $this->parseClause($w, $x); + } + if (strlen($where_str) > strlen(" WHERE")) { + $this->_sql .= $where_str; + } + } + + if (is_array($arrFlags) && count($arrFlags)) { + $this->_logger->debug("Parsing flags and adding to query", $arrFlags); + $this->_sql .= $this->flags($arrFlags); + } + + if (self::$autorun) { + return $this->execute(MYSQLI_BOTH); + } + + return $this->_sql; + } + + /** + * Function to build a query to check the number of rows in a table + * + * @param string $strTableName + * The table to query + * @param array $arrWhere + * [optional] + * Optional 2-dimensional array to build where clause + * @param array $arrFlags + * [optional] + * Optional 2-dimensional array to add flags + * + * @see Database::where() + * @see Database::flags() + * + * @return string|NULL + */ + public function selectCount($strTableName, $arrWhere = [], $arrFlags = []) + { + $this->_sql = null; + $this->_queryType = self::SELECT_COUNT; + + if (! is_null($strTableName)) { + $this->_sql = "SELECT COUNT(1) AS 'count' FROM $strTableName"; + } else { + $this->_logger->emergency("Table name is invalid or wrong type"); + throw new Error("Table name is invalid"); + } + + if (isset($arrFlags['joins']) && is_array($arrFlags['joins'])) { + $this->_sql .= " " . implode(" ", $arrFlags['joins']); + } + + if (! is_null($arrWhere) && is_array($arrWhere) && count($arrWhere)) { + $where_str = " WHERE"; + foreach ($arrWhere as $x => $w) { + $where_str .= $this->parseClause($w, $x); + } + if (strlen($where_str) > strlen(" WHERE")) { + $this->_sql .= $where_str; + } + } + + if (is_array($arrFlags) && count($arrFlags)) { + $this->_sql .= $this->flags($arrFlags); + } + + if (self::$autorun) { + return $this->execute(MYSQLI_BOTH); + } + + return $this->_sql; + } + + /** + * Function to build an insert query statement + * + * @param string $strTableName + * @param array|string $arrParams + * @param boolean $blnToIgnore + * + * @return string|NULL + */ + public function insert($strTableName, $arrParams = null, $blnToIgnore = false) + { + $this->_sql = null; + $this->_queryType = self::INSERT; + + if (! is_null($strTableName)) { + $this->_sql = "INSERT" . ($blnToIgnore ? " IGNORE" : "") . " INTO $strTableName" . (is_array($arrParams) && count($arrParams) ? " (`" . implode("`,`", array_keys($arrParams)) . "`)" : null); + } else { + throw new Error("Table name is invalid"); + } + + if (is_array($arrParams) && count($arrParams)) { + $this->_sql .= " VALUES (" . implode(",", array_map([ + $this, + '_escape' + ], array_values($arrParams))) . ")"; + } elseif (is_string($arrParams) && stripos($arrParams, 'SELECT') !== false) { + $this->_sql .= " {$arrParams}"; + } else { + throw new Error("Invalid type passed to insert " . gettype($arrParams)); + } + + if (self::$autorun) { + return $this->execute(MYSQLI_BOTH); + } + + return $this->_sql; + } + + /** + * Function to create an extended insert query statement + * + * @param string $strTableName + * The table name that the data is going to be inserted on + * @param array $arrFields + * An array of field names that each value represents + * @param array|string $params + * An array of array of values or a string with a SELECT statement to populate the insert with + * @param boolean $blnToIgnore + * [optional] + * Boolean to decide if we need to use the INSERT IGNORE INTO syntax + * + * @return NULL|string Returns the SQL if self::$autorun is set to false, else it returns the output from running. + */ + public function extendedInsert($strTableName, $arrFields, $params, $blnToIgnore = false) + { + $this->_sql = null; + $this->_queryType = self::EXTENDED_INSERT; + + if (! is_null($strTableName) && is_string($strTableName)) { + $this->_sql = "INSERT " . ($blnToIgnore ? "IGNORE " : "") . "INTO $strTableName " . "(`" . implode("`,`", $arrFields) . "`)"; + } else { + throw new Error("Table name is invalid"); + } + + if (is_array($params) && count($params)) { + $this->_sql .= " VALUES "; + if (isset($params[0]) && is_array($params[0])) { + foreach ($params as $p) { + if (count($p) != count($arrFields)) { + $this->_logger->emergency("Inconsistent number of fields to values in extended_insert", [ + $p + ]); + throw new Error("Inconsistent number of fields in fields and values in extended_insert " . print_r($p, true)); + } + $this->sql .= "(" . implode(",", array_map([$this, '_escape'], array_values($p))) . ")"; + + if ($p != end($params)) { + $this->_sql .= ","; + } + } + } else { + $this->sql .= "(" . implode("),(", array_map([$this, '_escape'], array_values($params))) . ")"; + } + } + + if (self::$autorun) { + return $this->execute(MYSQLI_BOTH); + } + + return $this->_sql; + } + + /** + * Build a statement to update a table + * + * @param string $strTableName + * The table name to update + * @param array $arrParams + * Name/value pairs of the field name and value + * @param array $arrWhere + * [optional] + * Two-dimensional array to create where clause + * @param array $arrFlags + * [optional] + * Two-dimensional array to create other flag options (joins, order, and group) + * + * @see Database::where() + * @see Database::flags() + * + * @return NULL|string + */ + public function update($strTableName, $arrParams, $arrWhere = [], $arrFlags = []) + { + $this->_sql = "UPDATE "; + $this->_queryType = self::UPDATE; + + if (! is_null($strTableName) && is_string($strTableName)) { + $this->_sql .= $strTableName; + + if (isset($arrFlags['joins']) && is_array($arrFlags['joins'])) { + $this->_sql .= " " . implode(" ", $arrFlags['joins']); + unset($arrFlags['joins']); + } + + $this->_sql .= " SET "; + } else { + throw new Error("Table name is invalid"); + } + + if (is_array($arrParams) && count($arrParams)) { + foreach ($arrParams as $f => $p) { + if ((strpos($f, "`") === false) && (strpos($f, ".") === false) && (strpos($f, "*") === false) && (stripos($f, " as ") === false)) { + $f = "`{$f}`"; + } + + if (! is_null($p)) { + $this->_sql .= "$f={$this->_escape($p)},"; + } else { + $this->_sql .= "$f=NULL,"; + } + } + } else { + throw new Error("No fields to update"); + } + + $this->_sql = substr($this->_sql, 0, - 1); + + if (! is_null($arrWhere) && is_array($arrWhere) && count($arrWhere)) { + $where_str = " WHERE"; + foreach ($arrWhere as $x => $w) { + $where_str .= $this->parseClause($w, $x); + } + if (strlen($where_str) > strlen(" WHERE")) { + $this->_sql .= $where_str; + } + } + + if (! is_null($arrFlags) && is_array($arrFlags) && count($arrFlags)) { + $this->_sql .= $this->flags($arrFlags); + } + + if (self::$autorun) { + return $this->execute(MYSQLI_BOTH); + } + + return $this->_sql; + } + + /** + * Function to offer an extended updated functionality by using two different tables. + * + * @param string $strTableToUpdate + * The table that you want to update (alias 'tbu' is automatically added) + * @param string $strOriginalTable + * The table with the data you want to overwrite to_be_updated table (alias 'o' is automatically added) + * @param string $strLinkField + * The common index value between them that will join the fields + * @param array|string $arrParams + * If string only a single field is updated (tbu.$params = o.$params) + * If array each element in the array is a field to be updated (tbu.$param = o.$param) + * + * @return mixed + */ + public function extendedUpdate($strTableToUpdate, $strOriginalTable, $strLinkField, $arrParams) + { + $this->_sql = "UPDATE "; + $this->_queryType = self::EXTENDED_UPDATE; + + if (! is_null($strTableToUpdate) && ! is_null($strOriginalTable) && ! is_null($strLinkField)) { + $this->_sql .= "$strTableToUpdate tbu INNER JOIN $strOriginalTable o USING ($strLinkField) SET "; + } else { + throw new Error("Missing necessary fields"); + } + + if (is_array($arrParams) && count($arrParams)) { + foreach ($arrParams as $param) { + if ($param != $strLinkField) { + $this->_sql .= "tbu.`$param` = o.`$param`,"; + } + } + $this->_sql = substr($this->_sql, 0, - 1); + } elseif (is_string($arrParams)) { + $this->_sql .= "tbu.`$arrParams` = o.`$arrParams`"; + } else { + throw new Exception("Do not understand datatype " . gettype($arrParams), E_ERROR); + } + + if (self::$autorun) { + return $this->execute(MYSQLI_BOTH); + } + + return $this->_sql; + } + + /** + * Function to build a replace query + * + * @param string $strTableName + * The table to update + * @param array $arrParams + * Name/value pair to insert + * + * @return NULL|string + */ + public function replace($strTableName, $arrParams) + { + $this->_sql = null; + $this->_queryType = self::REPLACE; + + if (! is_null($strTableName) && is_string($strTableName)) { + $this->_sql = "REPLACE INTO $strTableName " . "(`" . implode("`,`", array_keys($arrParams)) . "`)"; + } else { + throw new Error("Table name is invalid"); + } + + $this->_sql .= " VALUES (" . implode(",", array_map([ + $this, + '_escape' + ], array_values($arrParams))) . ")"; + + if (self::$autorun) { + return $this->execute(MYSQLI_BOTH); + } + + return $this->_sql; + } + + /** + * Function to build an extended replace statement + * + * @param string $strTableName + * Table name to update + * @param array $arrFields + * Array of fields + * @param array $arrParams + * Two-dimensional array of values + * + * @return NULL|string + */ + public function extendedReplace($strTableName, $arrFields, $arrParams) + { + $this->_sql = null; + $this->_queryType = self::EXTENDED_REPLACE; + + if (! is_array($arrFields) || ! count($arrFields)) { + throw new Exception("Error with the field type"); + } + + if (! is_null($strTableName) && is_string($strTableName)) { + $this->_sql = "REPLACE INTO $strTableName " . "(`" . implode("`,`", $arrFields) . "`)"; + } else { + throw new Error("Table name is invalid"); + } + + if (is_array($arrParams) && count($arrParams)) { + $this->_sql .= " VALUES "; + foreach ($arrParams as $p) { + $this->_sql .= "(" . implode(",", array_map([ + $this, + '_escape' + ], array_values($p))) . ")"; + + if ($p != end($arrParams)) { + $this->_sql .= ","; + } + } + } + + if (self::$autorun) { + return $this->execute(MYSQLI_BOTH); + } + + return $this->_sql; + } + + /** + * Function to build a delete statement + * + * @param string $strTableName + * Table name to act on + * @param array $arrFields + * [optional] + * Optional list of fields to delete (used when including multiple tables) + * @param array $arrWhere + * [optional] + * Optional 2-dimensional array to build where clause from + * @param array $arrJoins + * [optional] + * Optional 2-dimensional array to add other flags + * + * @see Database::where() + * @see Database::flags() + * + * @return string|NULL + */ + public function delete($strTableName, $arrFields = [], $arrWhere = [], $arrJoins = []) + { + $this->_sql = "DELETE"; + $this->_queryType = self::DELETE; + + $this->_logger->debug("Deleting table data"); + + if (! is_null($arrFields) && is_array($arrFields) && count($arrFields)) { + $this->_sql .= " " . implode(",", $arrFields); + } + + if (! is_null($strTableName) && is_string($strTableName)) { + $this->_sql .= " FROM $strTableName"; + } else { + throw new Error("Table name is invalid"); + } + + if (! is_null($arrJoins) && is_array($arrJoins) && count($arrJoins)) { + $this->_sql .= " " . implode(" ", $arrJoins); + } + + if (! is_null($arrWhere) && is_array($arrWhere) && count($arrWhere)) { + $where_str = " WHERE"; + foreach ($arrWhere as $x => $w) { + $where_str .= $this->parseClause($w, $x); + } + if (strlen($where_str) > strlen(" WHERE")) { + $this->_sql .= $where_str; + } + } + + if (self::$autorun) { + return $this->execute(MYSQLI_BOTH); + } + + return $this->_sql; + } + + /** + * Function to build a drop table statement (automatically executes) + * + * @param string $strTableName + * Table to drop + * @param string $strType + * [optional] + * Type of item to drop ('table', 'view') (defaulted to 'table') + * @param boolean $blnIsTemp + * [optional] + * Optional boolean if this is a temporary table + * + * @return string|NULL + */ + public function drop($strTableName, $strType = 'table', $blnIsTemp = false) + { + $this->_sql = null; + $this->_queryType = self::DROP; + + switch ($strType) { + case 'table': + $strType = 'TABLE'; + break; + case 'view': + $strType = 'VIEW'; + break; + default: + throw new Error("Invalid type " . gettype($strType), E_ERROR); + } + + if (! is_null($strTableName) && is_string($strTableName)) { + $this->_sql = "DROP" . ($blnIsTemp ? " TEMPORARY" : "") . " $strType IF EXISTS `{$strTableName}`"; + } else { + throw new Error("Table name is invalid"); + } + + if (self::$autorun) { + return $this->execute(MYSQLI_BOTH); + } + + return $this->_sql; + } + + /** + * Function to build a truncate table statement (automatically executes) + * + * @param string $strTableName + * Table to truncate + * + * @throws \Error + * + * @return string|NULL + */ + public function truncate($strTableName) + { + $this->_sql = null; + $this->_queryType = self::TRUNCATE; + + if (! is_null($strTableName) && is_string($strTableName)) { + $this->_sql = "TRUNCATE TABLE $strTableName"; + } else { + throw new Error("Table name is invalid"); + } + + if (self::$autorun) { + return $this->execute(MYSQLI_BOTH); + } + + return $this->_sql; + } + + /** + * Function to build a create temporary table statement + * + * @param string $strTableName + * Name to give the table when creating + * @param boolean $blnIsTemp + * [optional] + * Optional boolean to make the table a temporary table + * @param mixed $strSelect + * [optional] + * Optional parameter if null uses last built statement + * If string, will be made the SQL statement executed to create the table + * If array, 2-dimensional array with "field", "datatype" values to build table fields + * + * @return NULL|string + */ + public function createTable($strTableName, $blnIsTemp = false, $strSelect = null) + { + $this->_queryType = self::CREATE_TABLE; + + if (is_null($strSelect) && ! is_null($this->_sql) && substr($this->_sql, 0, 6) == 'SELECT') { + $this->_sql = "CREATE" . ($blnIsTemp ? " TEMPORARY" : "") . " TABLE IF NOT EXISTS $strTableName AS ($this->_sql)"; + } elseif (! is_null($strTableName) && is_string($strTableName) && is_string($strSelect)) { + $this->_sql = "CREATE" . ($blnIsTemp ? " TEMPORARY" : "") . " TABLE IF NOT EXISTS $strTableName AS ($strSelect)"; + } elseif (! is_null($strTableName) && is_string($strTableName) && is_array($strSelect)) { + $this->_sql = "CREATE" . ($blnIsTemp ? " TEMPORARY" : "") . " TABLE IF NOT EXISTS $strTableName ("; + + foreach ($strSelect as $field) { + $default = null; + if (isset($field['default'])) { + $default = (is_null($field['default']) ? "" : " DEFAULT '{$field['default']}'"); + } + $this->_sql .= "`{$field['field']}` {$field['datatype']}" . $default . (isset($field['option']) ? " {$field['option']}" : '') . ","; + } + $this->_sql = substr($this->_sql, 0, - 1) . ")"; + } + + if (self::$autorun) { + return $this->execute(); + } + + return $this->_sql; + } + + /** + * Function to create a table using a stdClass object derived from JSON + * + * @param \stdClass $json + * + * @example /examples/create_table_json.json + * + */ + public function createTableJson($json) + { + $this->_queryType = self::CREATE_TABLE; + $this->_c->select_db($json->schema); + + $this->_sql = "CREATE TABLE IF NOT EXISTS `{$json->name}` ("; + foreach ($json->fields as $field) { + $this->_sql .= "`{$field->name}` {$field->dataType}"; + + if ($field->dataType == 'enum') { + $this->_sql .= "('" . implode("','", $field->values) . "')"; + } + + if ($field->ai) { + $this->_sql .= " AUTO_INCREMENT"; + } + + if ($field->nn) { + $this->_sql .= " NOT NULL"; + } else { + if ($field->default === null) { + $this->_sql .= " DEFAULT NULL"; + } elseif (strlen($field->default)) { + $this->_sql .= " DEFAULT '{$field->default}'"; + } + } + + if ($field != end($json->fields)) { + $this->_sql .= ","; + } + } + + if (isset($json->index) && count($json->index)) { + foreach ($json->index as $ind) { + $this->_sql .= ", " . strtoupper($ind->type) . " `{$ind->id}` (`{$ind->ref}`)"; + } + } + + if (isset($json->constraints) && count($json->constraints)) { + foreach ($json->constraints as $con) { + $this->_sql .= ", CONSTRAINT `{$con->id}` " . "FOREIGN KEY (`{$con->local}`) " . "REFERENCES `{$con->schema}`.`{$con->table}` (`{$con->field}`) " . "ON DELETE " . (is_null($con->delete) ? "NO ACTION" : strtoupper($con->delete)) . " " . "ON UPDATE " . (is_null($con->update) ? "NO ACTION" : strtoupper($con->update)); + } + } + + if (isset($json->unique) && count($json->unique)) { + $this->_sql .= ", UNIQUE(`" . implode("`,`", $json->unique) . "`)"; + } + + if (isset($json->primary_key) && count($json->primary_key)) { + $this->_sql .= ", PRIMARY KEY(`" . implode("`,`", $json->primary_key) . "`))"; + } else { + if (substr($this->_sql, - 1) == ',') { + $this->_sql = substr($this->_sql, 0, - 1); + } + + $this->_sql .= ")"; + } + + $this->execute(MYSQLI_BOTH); + } + + /** + * Function to alter a existing table + * + * @param string $strTableName + * Table to alter + * @param int $intAction + * What action should be taken ('add-column', 'drop-column', 'modify-column') + * @param mixed $arrParams + * For add column this is a stdClass object that has the same elements as the example json + * + * @return mixed + */ + public function alterTable($strTableName, $intAction, $arrParams) + { + $this->_queryType = self::ALTER_TABLE; + $this->_sql = "ALTER TABLE $strTableName"; + if ($intAction == self::ADD_COLUMN) { + $nn = ($arrParams->nn ? " NOT NULL" : ""); + $default = null; + if ($arrParams->default === null) { + $default = " DEFAULT NULL"; + } elseif (strlen($arrParams->default)) { + $default = " DEFAULT {$this->_escape($arrParams->default)}"; + } + $this->_sql .= " ADD COLUMN `{$arrParams->name}` {$arrParams->dataType}" . $nn . $default; + } elseif ($intAction == self::DROP_COLUMN) { + $this->_sql .= " DROP COLUMN "; + foreach ($arrParams as $col) { + $this->_sql .= "`{$col->name}`"; + + if ($col != end($arrParams)) { + $this->_sql .= ","; + } + } + } elseif ($intAction == self::MODIFY_COLUMN) { + $this->_sql .= " MODIFY COLUMN"; + $nn = ($arrParams->nn ? " NOT NULL" : ""); + $default = null; + if ($arrParams->default === null) { + $default = " DEFAULT NULL"; + } elseif (strlen($arrParams->default)) { + $default = " DEFAULT {$this->_escape($arrParams->default)}"; + } + $this->_sql .= " `{$arrParams->name}` `{$arrParams->new_name}` {$arrParams->dataType}" . $nn . $default; + } + + if (self::$autorun) { + return $this->execute(); + } + + return $this->_sql; + } + + /** + * Check to see if a field in a table exists + * + * @param string $strTableName + * Table to check + * @param string $strFieldName + * Field name to find + * + * @return boolean Returns TRUE if field is found in that schema and table, otherwise FALSE + */ + public function fieldExists($strTableName, $strFieldName) + { + $fdata = $this->fieldData($strTableName); + + if (is_array($fdata) && count($fdata)) { + foreach ($fdata as $field) { + if ($field->name == $strFieldName) { + return true; + } + } + } + + return false; + } + + /** + * Function to get the column data (datatype, flags, defaults, etc) + * + * @param string $strTableName + * Table to query + * @param mixed $field + * [optional] + * Optional field to retrieve data (if null, returns data from all fields) + * + * @return array + */ + public function fieldData($strTableName, $field = null) + { + if (is_null($field)) { + $res = $this->_c->query("SELECT * FROM $strTableName LIMIT 1"); + } elseif (is_array($field)) { + $res = $this->_c->query("SELECT `" . implode("`,`", $field) . "` FROM $strTableName LIMIT 1"); + } elseif (is_string($field)) { + $res = $this->_c->query("SELECT $field FROM $strTableName LIMIT 1"); + } else { + return null; + } + + $fields = null; + if (is_a($res, 'mysqli_result')) { + $fields = $res->fetch_fields(); + foreach ($fields as $i => $f) { + $fields["{$f->name}"] = $f; + unset($fields[$i]); + } + } + + return $fields; + } + + /** + * Function to check that all field parameters are set correctly + * + * @param object $field_data + * @param object $check + * @param array $pks + * @param object $index + * + * @return array|string + */ + public function fieldCheck($field_data, $check, $pks, $index) + { + $default = null; + $ret = null; + + $nn = ($check->nn ? " NOT NULL" : null); + if ($check->default === null) { + $default = " DEFAULT NULL"; + } elseif (strlen($check->default)) { + $default = " DEFAULT '{$check->default}'"; + } + + if ($field_data->type != $check->type && $check->type != MYSQLI_TYPE_ENUM) { + $this->_logger->notice("Wrong datatype", [ + 'name' => $field_data->name, + 'datatype' => $check->dataType + ]); + $ret = " CHANGE COLUMN `{$field_data->name}` `{$check->name}` {$check->dataType}" . "{$nn}{$default}"; + } elseif (! is_null($check->length) && $field_data->length != $check->length) { + $this->_logger->notice("Incorrect size", [ + 'name' => $field_data->name, + 'current' => $field_data->length, + 'new_size' => $check->length + ]); + $ret = " CHANGE COLUMN `{$field_data->name}` `{$check->name}` {$check->dataType}" . "{$nn}{$default}"; + } elseif ($check->type == MYSQLI_TYPE_ENUM && ! ($field_data->flags & MYSQLI_ENUM_FLAG)) { + $this->_logger->notice("Setting ENUM type", [ + 'name' => $field_data->name, + 'values' => implode(",", $check->values) + ]); + $ret = " CHANGE COLUMN `{$field_data->name}` `{$check->name}` {$check->dataType}('" . implode("','", $check->values) . "')" . "{$nn}{$default}"; + } + + if (! is_null($index) && count($index)) { + foreach ($index as $ind) { + if ($check->name == $ind->ref && ! ($field_data->flags & MYSQLI_MULTIPLE_KEY_FLAG)) { + $this->_logger->debug("Missing index", [ + 'name' => $field_data->name + ]); + $ret .= ($ret ? "," : "") . " ADD INDEX `{$ind->id}` (`{$ind->ref}` ASC)"; + } + } + } + + if (in_array($check->name, $pks) && ! ($field_data->flags & MYSQLI_PRI_KEY_FLAG)) { + $this->_logger->debug("Setting PKs", [ + 'keys' => implode(',', $pks) + ]); + $ret .= ($ret ? "," : "") . " DROP PRIMARY KEY, ADD PRIMARY KEY(`" . implode("`,`", $pks) . "`)"; + } + + return $ret; + } + + /** + * Function to check for the existence of a table within a schema + * + * @param string $strSchema + * The schema to search in + * @param string $strTableName + * Table to search for + * + * @return integer|boolean Returns number of tables that match if table is found in that schema, otherwise FALSE + */ + public function tableExists($strSchema, $strTableName) + { + if (! $this->_c->select_db($strSchema)) { + fwrite("php://stdout", $this->_c->error . PHP_EOL); + } + $sql = "SHOW TABLES LIKE '{$strTableName}'"; + + if ($res = $this->_c->query($sql)) { + if (gettype($res) == 'object' && is_a($res, 'mysqli_result') && $res->num_rows) { + return $res->num_rows; + } + } else { + if ($this->_c->errno) { + fwrite("php://stdout", $this->_c->error . PHP_EOL); + } + } + + return false; + } + + /** + * Function to detect if string is a JSON object or not + * + * @param string $strVal + * + * @return boolean + */ + public function isJson($strVal) + { + json_decode($strVal); + return (json_last_error() == JSON_ERROR_NONE); + } + + /** + * Function to escape SQL characters to prevent SQL injection + * + * @param mixed $val + * Value to escape + * @param boolean $blnEscape + * Decide if we should escape or not + * + * @return string Escaped value + */ + public function _escape($val, $blnEscape = true) + { + if (is_null($val) || (is_string($val) && strtolower($val) == 'null')) { + return 'NULL'; + } elseif (is_numeric($val) || is_string($val)) { + if (stripos($val, "IF(") !== false) { + return $val; + } + elseif ($blnEscape) { + return "'{$this->_c->real_escape_string($val)}'"; + } + return $val; + } elseif (is_a($val, 'DateTime')) { + return "'{$val->format(MYSQL_DATETIME)}'"; + } elseif (is_bool($val)) { + return $val ? "'1'" : "'0'"; + } elseif (gettype($val) == 'object' && method_exists($val, '_escape')) { + $ret = call_user_func([ + $val, + '_escape' + ]); + if ($ret !== false) { + return $ret; + } else { + throw new Exception("Error in return from _escape method in " . get_class($val), E_ERROR); + } + } elseif (gettype($val) == 'object') { + $this->_logger->error("Unknown object to escape " . get_class($val) . " in SQL string {$this->_sql}"); + return; + } + + throw new Exception("Unknown datatype to escape in SQL string {$this->_sql} " . gettype($val), E_ERROR); + } + + /** + * Function to retrieve all results + * + * @param int $intResultType + * + * @return mixed + */ + public function fetchAll($intResultType = MYSQLI_ASSOC) + { + $res = []; + if (method_exists('mysqli_result', 'fetch_all')) { // Compatibility layer with PHP < 5.3 + $res = $this->_result->fetch_all($intResultType); + } else { + while ($tmp = $this->_result->fetch_array($intResultType)) { + $res[] = $tmp; + } + } + + return $res; + } + + /** + * Function to populate the fields for the SQL + * + * @param array|string $fields + * [optional] + * Optional array of fields to string together to create a field list + * + * @return string + */ + public function fields($fields = null) + { + $ret = null; + + if (is_array($fields) && count($fields) && isset($fields[0]) && is_string($fields[0])) { + foreach ($fields as $field) { + if ((strpos($field, '`') === false) && (strpos($field, '.') === false) && (strpos($field, '*') === false) && (strpos($field, 'JSON_') === false) && (stripos($field, ' as ') === false)) { + $ret .= "`$field`,"; + } else { + $ret .= "$field,"; + } + } + $ret = substr($ret, - 1) == ',' ? substr($ret, 0, - 1) : $ret; + } elseif (is_string($fields)) { + $ret = $fields; + } elseif (is_null($fields)) { + $ret = "*"; + } else { + throw new \InvalidArgumentException("Invalid field type"); + } + + return $ret; + } + + /** + * Function to parse the flags + * + * @param array $flags + * Two-dimensional array to added flags + * + * + * [ + *   'joins' => [ + *     "JOIN table2 t2 ON t2.id=t1.id" + *   ], + *   'group' => 'field', + *   'having' => 'field', + *   'order' => 'field', + *   'start' => 0, + *   'limit' => 0 + * ] + * + * + * @see Database::groups() + * @see Database::having() + * @see Database::order() + * + * @return string + */ + public function flags($arrFlags) + { + $ret = ''; + + if (isset($arrFlags['group'])) { + $ret .= $this->groups($arrFlags['group']); + } + + if (isset($arrFlags['having']) && is_array($arrFlags['having'])) { + $having = " HAVING"; + foreach ($arrFlags['having'] as $x => $h) { + $having .= $this->parseClause($h, $x); + } + if (strlen($having) > strlen(" HAVING")) { + $ret .= $having; + } + } + + if (isset($arrFlags['order'])) { + $ret .= $this->order($arrFlags['order']); + } + + if (isset($arrFlags['limit']) && (is_string($arrFlags['limit']) || is_numeric($arrFlags['limit']))) { + $ret .= " LIMIT "; + if (isset($arrFlags['start']) && (is_string($arrFlags['start']) || is_numeric($arrFlags['start']))) { + $ret .= "{$arrFlags['start']},"; + } + $ret .= "{$arrFlags['limit']}"; + } + + return $ret; + } + + /** + * Function to parse SQL GROUP BY statements + * + * @param mixed $groups + * + * @return string + */ + public function groups($groups) + { + $ret = ''; + if (is_array($groups) && count($groups)) { + $ret .= " GROUP BY"; + + foreach ($groups as $grp) { + $ret .= " $grp"; + + if ($grp != end($groups)) { + $ret .= ","; + } + } + } elseif (is_string($groups)) { + $ret .= " GROUP BY {$groups}"; + } else { + throw (new Exception("Error in datatype for groups " . gettype($groups), E_ERROR)); + } + + return $ret; + } + + /** + * Function to parse SQL ORDER BY statements + * + * @param mixed $order + * + * @return string + */ + public function order($order) + { + $ret = ''; + if (is_array($order)) { + $ret .= " ORDER BY"; + + foreach ($order as $ord) { + $ret .= " {$ord['field']} {$ord['sort']}"; + + if ($ord != end($order)) { + $ret .= ","; + } + } + } elseif (is_string($order)) { + $ret .= " ORDER BY {$order}"; + } + + return $ret; + } + + /** + * Function to see if a constraint exists + * + * @param string $strConstraintId + * + * @return boolean + */ + public function isConstraint($strConstraintId) + { + $res = $this->_c->query("SELECT * FROM information_schema.TABLE_CONSTRAINTS WHERE CONSTRAINT_NAME = '{$strConstraintId}'"); + + if ($res->num_rows) { + return true; + } + + return false; + } + + /** + * Function to parse where and having clauses + * + * @param array $arrClause + * @param int $intIndex + */ + public function parseClause($arrClause, $intIndex) + { + $ret = null; + + $this->_logger->debug("Parsing clause", $arrClause); + + if (! isset($arrClause['field']) && isset($arrClause['close-paren']) && $arrClause['close-paren']) { + $ret .= ")"; + return $ret; + } elseif ($intIndex > 0 && ! isset($arrClause['sql_op'])) { + $this->_logger->warning("Missing sql_op field to identify how current and previous WHERE clause statements should be linked ('AND', 'OR', 'XOR', etc), skipped", [ + 'clause' => implode(",", $arrClause) + ]); + return; + } + + $op = '='; + if (isset($arrClause['op'])) { + $op = $arrClause['op']; + } + + switch ($op) { + case self::BETWEEN: + if (! isset($arrClause['field']) || ! isset($arrClause['low']) || ! isset($arrClause['high'])) { + $this->_logger->warning("Missing field, low, or high for BETWEEN where clause, skipping"); + return; + } + break; + default: + if (! isset($arrClause['field']) || ! isset($arrClause['value'])) { + $this->_logger->warning("Missing field or value for WHERE clause, skipping", $arrClause); + return; + } + } + + if ($intIndex > 0) { + $ret .= " {$arrClause['sql_op']}"; + } + + if (isset($arrClause['open-paren']) && $arrClause['open-paren']) { + $ret .= " ("; + } + + if (isset($arrClause['backticks']) && ! $arrClause['backticks']) { + $field = $arrClause['field']; + } else { + $field = "`{$arrClause['field']}`"; + } + + if ($op == self::IN || $op == self::NOT_IN) { + if (is_string($arrClause['value'])) { + $ret .= " {$field} {$op} " . (strpos($arrClause['value'], '(') !== false ? $arrClause['value'] : "({$arrClause['value']})"); + } elseif (is_array($arrClause['value'])) { + $ret .= " {$field} {$op} (" . implode(",", array_map([ + $this, + '_escape' + ], $arrClause['value'])) . ")"; + } else { + $this->_logger->error("Invalid datatype for IN WHERE clause, only string and array allowed " . gettype($arrClause['value']), $arrClause); + throw new Exception("Invalid datatype for IN WHERE clause", E_ERROR); + } + } elseif ($op == self::BETWEEN) { + $ret .= " {$field} BETWEEN {$this->_escape($arrClause['low'])} AND {$this->_escape($arrClause['high'])}"; + } else { + if (isset($arrClause['escape']) && ! $arrClause['escape']) { + $value = $arrClause['value']; + } else { + $value = $this->_escape($arrClause['value']); + } + + if (isset($arrClause['case_insensitive']) && $arrClause['case_insensitive']) { + $ret .= " LOWER({$field}) {$op} LOWER({$this->_escape($arrClause['value'])})"; + } elseif (preg_match("/\(SELECT/", $arrClause['value'])) { + $ret .= " {$field} {$op} {$arrClause['value']}"; + } else { + $ret .= " {$field} {$op} {$value}"; + } + } + + if (isset($arrClause['close-paren']) && $arrClause['close-paren']) { + $ret .= ")"; + } + + return $ret; + } +} diff --git a/inc/vendor/godsgood33/php-db/tests/DatabaseTest.php b/inc/vendor/godsgood33/php-db/tests/DatabaseTest.php new file mode 100644 index 0000000..366efad --- /dev/null +++ b/inc/vendor/godsgood33/php-db/tests/DatabaseTest.php @@ -0,0 +1,794 @@ +db = new Database(realpath(__DIR__)); + // Database::$autorun = true; + } + + public function testCanCreateDatabaseInstance() + { + $this->assertInstanceOf("Godsgood33\Php_Db\Database", $this->db); + } + + public function testGetSchema() + { + $schema = $this->db->getSchema(); + $this->assertEquals("db", $schema); + } + + public function testSetSchemaWithNonExistentSchema() + { + $ret = $this->db->setSchema("george"); + $this->assertFalse($ret); + } + + public function testDatabaseConnection() + { + $this->assertTrue($this->db->isConnected()); + } + + public function testPassInMysqliConnection() + { + $conn = new mysqli(PHP_DB_SERVER, PHP_DB_USER, PHP_DB_PWD, PHP_DB_SCHEMA); + if ($conn->connect_errno) { + fwrite(STDOUT, $conn->connect_error); + } + + $this->db = new Database(realpath(__DIR__), $conn); + + $this->assertInstanceOf("Godsgood33\Php_Db\Database", $this->db); + } + + public function testSetLogLevel() + { + $this->db->setLogLevel(Logger::DEBUG); + $this->assertEquals(Logger::DEBUG, $this->db->getLogLevel()); + } + + /** + * @expectedException TypeError + */ + public function testSelectWithInvalidTableName() + { + $this->db->select(new stdClass()); + } + + public function testSelectWithNoParameters() + { + // query table with NO parameters + $this->db->select("test"); + $this->assertEquals("SELECT * FROM test", $this->db->getSql()); + } + + public function testSelectWithNullFieldParameter() + { + // query table with null fields parameter + $this->db->select("test", null); + $this->assertEquals("SELECT * FROM test", $this->db->getSql()); + } + + public function testSelectWithOneArrayParameter() + { + // query table with one parameter + $this->db->select("test", [ + 'id' + ]); + $this->assertEquals("SELECT `id` FROM test", $this->db->getSql()); + } + + public function testSelectWithTwoArrayParameters() + { + // query table with 2 parameters + $this->db->select("test", [ + 'id', + 'name' + ]); + $this->assertEquals("SELECT `id`,`name` FROM test", $this->db->getSql()); + } + + public function testSelectWithOneStringParameter() + { + // query table with string parameter + $this->db->select("test", 'id'); + $this->assertEquals("SELECT id FROM test", $this->db->getSql()); + } + + /** + * @expectedException InvalidArgumentException + */ + public function testSelectWithStdClassParameter() + { + // query table with object parameter + $this->db->select("test", new stdClass()); + $this->assertEquals("SELECT FROM test", $this->db->getSql()); + } + + /** + * @expectedException TypeError + */ + public function testSelectWithNullWhereParameter() + { + // query table with null where parameter + $this->db->select("test", 'id', null); + $this->assertEquals("SELECT id FROM test", $this->db->getSql()); + } + + public function testSelectWithEmptyArrayWhereParameter() + { + // query table with empty array where paramter + $this->db->select("test", 'id', []); + $this->assertEquals("SELECT id FROM test", $this->db->getSql()); + } + + public function testSelectWithImcompleteWhereArrayParameter() + { + // query with incomplete WHERE clause + $this->db->select("test", 'id', [ + [ + 'field' => 'id' + ] + ]); + $this->assertEquals("SELECT id FROM test", $this->db->getSql()); + } + + public function testGroupWithString() + { + // $this->markTestIncomplete(); + + // query with single group by string + $sql = $this->db->groups('name'); + $this->assertEquals(" GROUP BY name", $sql); + } + + public function testGroupWithArray() + { + // query with array group by string + $sql = $this->db->groups([ + 'name', + 'id' + ]); + $this->assertEquals(" GROUP BY name, id", $sql); + } + + /** + * @expectedException Exception + */ + public function testGroupWrongUnknownDataType() + { + // $this->markTestIncomplete(); + + // query group with invalid datatype (stdClass) should throw Exception + $this->db->groups(new stdClass()); + } + + public function testOrderWithString() + { + // $this->markTestIncomplete(); + + // query with single name order parameter + $sql = $this->db->order("name"); + $this->assertEquals(" ORDER BY name", $sql); + } + + public function testOrderWithArray() + { + // query with order array + $sql = $this->db->order([ + [ + 'field' => 'id', + 'sort' => 'ASC' + ], + [ + 'field' => 'name', + 'sort' => 'DESC' + ] + ]); + $this->assertEquals(" ORDER BY id ASC, name DESC", $sql); + } + + public function testOrderWithObject() + { + // query with invalid datatype (stdClass) will return empty string + $sql = $this->db->order(new stdClass()); + $this->assertEquals("", $sql); + } + + public function testFlags() + { + // $this->markTestIncomplete(); + + // query flags with all parameters + $sql = $this->db->flags([ + 'group' => 'name', + 'order' => 'name', + 'having' => [ + [ + 'field' => 'id', + 'op' => '=', + 'value' => 1 + ] + ], + 'limit' => '10', + 'start' => '5' + ]); + $this->assertEquals(" GROUP BY name HAVING `id` = '1' ORDER BY name LIMIT 5,10", $sql); + } + + public function testCreateTemporaryTable() + { + $this->db->select("test"); + $this->db->createTable('test2', true); + $this->assertEquals("CREATE TEMPORARY TABLE IF NOT EXISTS test2 AS (SELECT * FROM test)", $this->db->getSql()); + } + + public function testCreateTable() + { + // Database::$autorun = false; + $this->db->createTable('test', false, $this->db->select("test")); + $this->assertEquals("CREATE TABLE IF NOT EXISTS test AS (SELECT * FROM test)", $this->db->getSql()); + // Database::$autorun = true; + } + + public function testCreateTableWithArrayParameter() + { + $this->db->createTable("test", true, [ + [ + 'field' => 'id', + 'datatype' => 'int(11)', + 'option' => 'PRIMARY KEY' + ], + [ + 'field' => 'name', + 'datatype' => 'varchar(100)', + 'default' => null + ], + [ + 'field' => 'email', + 'datatype' => 'varchar(100)', + 'default' => '' + ] + ]); + $this->assertEquals("CREATE TEMPORARY TABLE IF NOT EXISTS test (`id` int(11) PRIMARY KEY,`name` varchar(100),`email` varchar(100) DEFAULT '')", $this->db->getSql()); + } + + public function testCreateTableJson() + { + $json = json_decode(file_get_contents(dirname(dirname(__FILE__)) . "/examples/create_table_json.json")); + + $this->db->createTableJson($json->tables[0]); + $this->assertEquals("CREATE TABLE IF NOT EXISTS `settings` (`id` int(11) AUTO_INCREMENT NOT NULL,`meta_key` varchar(100) NOT NULL,`meta_value` mediumtext DEFAULT NULL, UNIQUE(`meta_key`), PRIMARY KEY(`id`))", $this->db->getSql()); + } + + public function testCreateTableJson2() + { + $json = json_decode(file_get_contents(dirname(dirname(__FILE__)) . "/examples/create_table_json.json")); + + $this->db->createTableJson($json->tables[1]); + $this->assertEquals("CREATE TABLE IF NOT EXISTS `test` (`id` int(11) AUTO_INCREMENT NOT NULL,`fk` int(11) NOT NULL,`default` tinyint(1) DEFAULT '0',`enum` enum('1','2') DEFAULT '1', INDEX `default_idx` (`default`), CONSTRAINT `con_1` FOREIGN KEY (`fk`) REFERENCES `db`.`test` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, PRIMARY KEY(`id`,`fk`))", $this->db->getSql()); + } + + public function testCreateTableJson3() + { + $json = json_decode(file_get_contents(dirname(dirname(__FILE__)) . "/examples/create_table_json.json")); + + $this->db->createTableJson($json->tables[2]); + $this->assertEquals("CREATE TABLE IF NOT EXISTS `test2` (`id` int(11) AUTO_INCREMENT NOT NULL, PRIMARY KEY(`id`))", $this->db->getSql()); + } + + public function testTableExists() + { + $tbl_count = $this->db->tableExists('db', 'settings'); + $this->assertEquals(1, $tbl_count); + } + + public function testMultipleTableExists() + { + $tbl_count = $this->db->tableExists('db', 'test%'); + $this->assertEquals(2, $tbl_count); + } + + public function testTableNotPresent() + { + $tbl_not_present = $this->db->tableExists('db', "users"); + $this->assertFalse($tbl_not_present); + } + + public function testAlterTableAddColumn() + { + $new = new stdClass(); + $new->name = 'newCol'; + $new->dataType = 'tinyint(1)'; + $new->nn = false; + $new->default = null; + + $this->db->alterTable('test', Database::ADD_COLUMN, $new); + $this->assertEquals("ALTER TABLE test ADD COLUMN `newCol` tinyint(1) DEFAULT NULL", $this->db->getSql()); + } + + public function testAlterTableModifyColumn() + { + $mod = new stdClass(); + $mod->name = 'default'; + $mod->new_name = 'default2'; + $mod->dataType = 'int(1)'; + $mod->nn = true; + $mod->default = 1; + + $this->db->alterTable("test", Database::MODIFY_COLUMN, $mod); + $this->assertEquals("ALTER TABLE test MODIFY COLUMN `default` `default2` int(1) NOT NULL DEFAULT '1'", $this->db->getSql()); + } + + public function testAlterTableDropColumn() + { + $drop = new stdClass(); + $drop->name = 'newCol'; + + $this->db->alterTable("test", Database::DROP_COLUMN, [ + $drop + ]); + $this->assertEquals("ALTER TABLE test DROP COLUMN `newCol`", $this->db->getSql()); + } + + public function testSelectCountWithNoParameters() + { + $this->db->selectCount("test"); + $this->assertEquals("SELECT COUNT(1) AS 'count' FROM test", $this->db->getSql()); + } + + /** + * @expectedException TypeError + */ + public function testSelectCountWithStdClassParameterForTable() + { + $this->db->selectCount(new stdClass()); + } + + public function testSelectCountWithArrayWhereParameter() + { + $this->db->selectCount("test", [ + [ + 'field' => 'name', + 'value' => 'Ed' + ] + ], [ + 'joins' => [ + "JOIN settings s ON s.id = test.id" + ] + ]); + $this->assertEquals("SELECT COUNT(1) AS 'count' FROM test JOIN settings s ON s.id = test.id WHERE `name` = 'Ed'", $this->db->getSql()); + } + + public function testInsertWithOneElementArrayParameter() + { + // query with one parameter + $this->db->insert("test", [ + 'id' => 1 + ]); + $this->assertEquals("INSERT INTO test (`id`) VALUES ('1')", $this->db->getSql()); + } + + public function testInsertWithTwoElementArrayParameter() + { + // query with 2 parameters + $this->db->insert("test", [ + 'id' => 1, + 'name' => 'Ed' + ], true); + $this->assertEquals("INSERT IGNORE INTO test (`id`,`name`) VALUES ('1','Ed')", $this->db->getSql()); + } + + public function testInsertWithSelectStatement() + { + // insert query using SELECT statement + $this->db->insert("test", "SELECT id FROM settings"); + $this->assertEquals("INSERT INTO test SELECT id FROM settings", $this->db->getSql()); + } + + /** + * @expectedException TypeError + */ + public function testInsertInvalidTableNameDataType() + { + $this->db->insert(new stdClass()); + } + + /** + * @expectedException Error + */ + public function testInsertInvalidParameterDataType() + { + $this->db->insert("test", new stdClass()); + } + + public function testEInsert() + { + // extended insert query with fields and 2 items + $this->db->extendedInsert("test", [ + 'id', + 'name' + ], [ + [ + 1, + 'Ed' + ], + [ + 2, + 'Frank' + ] + ]); + $this->assertEquals("INSERT INTO test (`id`,`name`) VALUES ('1','Ed'),('2','Frank')", $this->db->getSql()); + } + + /** + * @expectedException TypeError + */ + public function testEInsertInvalidTableNameDatatype() + { + $this->db->extendedInsert(new stdClass(), [], []); + } + + /** + * @expectedException Error + */ + public function testEInsertDifferentFieldValuePairs() + { + $this->db->extendedInsert('test', [ + 'id', + 'name' + ], [ + [ + 1 + ], + [ + 2 + ] + ]); + } + + /** + * @expectedException Error + */ + public function testEInsertDifferentFieldValuePairs2() + { + $this->db->extendedInsert('test', [ + 'id', + 'name' + ], [ + [ + 1, + 'Ed' + ], + [ + 2 + ] + ]); + } + + public function testUpdateWithOneElementArrayParameter() + { + $this->db->update('test', [ + 'name' => 'Frank' + ]); + $this->assertEquals("UPDATE test SET `name`='Frank'", $this->db->getSql()); + } + + public function testUpdateWithOneElementAndWhereArray() + { + $this->db->update('test', [ + 'name' => 'Frank' + ], [ + [ + 'field' => 'id', + 'value' => 1 + ] + ]); + $this->assertEquals("UPDATE test SET `name`='Frank' WHERE `id` = '1'", $this->db->getSql()); + } + + public function testUpdateWithOneElementAndJoinClause() + { + $this->db->update('test t', [ + 't.name' => 'Frank' + ], [], [ + 'joins' => [ + "JOIN settings s ON s.id=t.id" + ] + ]); + $this->assertEquals("UPDATE test t JOIN settings s ON s.id=t.id SET t.name='Frank'", $this->db->getSql()); + } + + public function testUpdateWithOneElementAndLimitClause() + { + $this->db->update('test', [ + 'name' => 'Frank' + ], [], [ + 'limit' => 1 + ]); + $this->assertEquals("UPDATE test SET `name`='Frank' LIMIT 1", $this->db->getSql()); + } + + /** + * @expectedException TypeError + */ + public function testUpdateInvalidTableNameDatatype() + { + $this->db->update(new stdClass(), []); + } + + public function testEUpdateWithArrayList() + { + $this->db->extendedUpdate("test", "settings", "id", [ + 'name' + ]); + $this->assertEquals("UPDATE test tbu INNER JOIN settings o USING (id) SET tbu.`name` = o.`name`", $this->db->getSql()); + } + + public function testEUpdateWithStringList() + { + $this->db->extendedUpdate("test", "settings", "id", "name"); + $this->assertEquals("UPDATE test tbu INNER JOIN settings o USING (id) SET tbu.`name` = o.`name`", $this->db->getSql()); + } + + /** + * @expectedException Exception + */ + public function testEUpdateInvalidParamDatatype() + { + $this->db->extendedUpdate('test', 'settings', 'id', new stdClass()); + } + + public function testReplace() + { + $this->db->replace("test", [ + 'id' => 1 + ]); + $this->assertEquals("REPLACE INTO test (`id`) VALUES ('1')", $this->db->getSql()); + } + + /** + * @expectedException TypeError + */ + public function testReplaceInvalidTableNameDatatype() + { + $this->db->replace(new stdClass(), []); + } + + public function testEReplace() + { + $this->db->extendedReplace("test", [ + 'id', + 'name' + ], [ + [ + 1, + 'Ed' + ], + [ + 2, + 'Frank' + ] + ]); + $this->assertEquals("REPLACE INTO test (`id`,`name`) VALUES ('1','Ed'),('2','Frank')", $this->db->getSql()); + } + + /** + * @expectedException TypeError + */ + public function testEReplaceInvalidTableNameDatatype() + { + $this->db->extendedReplace(new stdClass(), [], []); + } + + public function testFieldExists() + { + $id_exists = $this->db->fieldExists('test', 'id'); + $this->assertTrue($id_exists); + } + + public function testFieldDoesNotExist() + { + $phone_not_exists = $this->db->fieldExists('test', 'phone'); + $this->assertFalse($phone_not_exists); + } + + public function testFieldData() + { + $id = new stdClass(); + $id->name = 'id'; + $id->orgname = 'id'; + $id->table = 'test2'; + $id->orgtable = 'test2'; + $id->def = null; + $id->db = 'db'; + $id->catalog = 'def'; + $id->max_length = 0; + $id->length = 11; + $id->charsetnr = 63; + $id->flags = 49667; + $id->type = 3; + $id->decimals = 0; + + // query all fields in table + $fd = $this->db->fieldData("test2"); + $this->assertEquals([ + 'id' => $id + ], $fd); + + // query single field in table + $fd = $this->db->fieldData('test2', 'id'); + $this->assertEquals([ + 'id' => $id + ], $fd); + + // query array of fields in table + $fd = $this->db->fieldData('test2', [ + 'id' + ]); + $this->assertEquals([ + 'id' => $id + ], $fd); + + // invalid datatype for field name + $fd = $this->db->fieldData('test2', new stdClass()); + $this->assertEquals(null, $fd); + } + + public function testEscapeDontEscapeNow() + { + // $this->markTestIncomplete(); + $ret = $this->db->_escape('NOW()', false); + $this->assertEquals("NOW()", $ret); + } + + public function testEscapeDontEscapeBackticks() + { + $ret = $this->db->_escape("t.`id`", false); + $this->assertEquals("t.`id`", $ret); + } + + public function testEscapeEscapeDateTime() + { + $dt = new DateTime("2017-01-01 00:00:00"); + $ret = $this->db->_escape($dt); + $this->assertEquals("'2017-01-01 00:00:00'", $ret); + } + + public function testEscapeBoolean() + { + $ret = $this->db->_escape(true); + $this->assertEquals("'1'", $ret); + } + + public function testEscapeClassWithEscapeMethod() + { + $tc = new TestClass(); + $tc->var = "test's"; + $ret = $this->db->_escape($tc); + $this->assertEquals("test\'s", $ret); + } + + public function testEscapeUnknownClassToEscape() + { + // $this->markTestIncomplete(); + $tc2 = new TestClass2(); + $tc2->var = "test"; + $ret = $this->db->_escape($tc2); + + $this->assertEquals("", $ret); + } + + public function testDeleteBasic() + { + $this->db->delete("test"); + $this->assertEquals("DELETE FROM test", $this->db->getSql()); + } + + public function testDeleteWithWhereClause() + { + $this->db->delete('test', [ + 'id' + ], [ + [ + 'field' => 'id', + 'op' => '=', + 'value' => 1 + ] + ]); + $this->assertEquals("DELETE id FROM test WHERE `id` = '1'", $this->db->getSql()); + } + + public function testDeleteWithJoin() + { + $this->db->delete('test t', [], [], [ + 'joins' => "JOIN settings s ON s.id=t.id" + ]); + $this->assertEquals("DELETE FROM test t JOIN settings s ON s.id=t.id", $this->db->getSql()); + } + + /** + * @expectedException TypeError + */ + public function testDeleteInvalidTableNameDatatype() + { + $this->db->delete(new stdClass()); + } + + public function testTruncate() + { + $this->db->truncate('test'); + $this->assertEquals("TRUNCATE TABLE test", $this->db->getSql()); + } + + /** + * @expectedException TypeError + */ + public function testTruncateInvalidTableNameDatatype() + { + $this->db->truncate(new stdClass()); + } + + public function testDropSettingsTable() + { + // Database::$autorun = false; + $sql = $this->db->drop("settings"); + $this->assertEquals("DROP TABLE IF EXISTS `settings`", $sql); + // Database::$autorun = true; + } + + public function testDropTestTable() + { + // Database::$autorun = false; + $sql = $this->db->drop("test"); + $this->assertEquals("DROP TABLE IF EXISTS `test`", $sql); + // Database::$autorun = true; + } + + public function testDropView() + { + // Database::$autorun = false; + $sql = $this->db->drop("test", "view"); + $this->assertEquals("DROP VIEW IF EXISTS `test`", $sql); + // Database::$autorun = true; + } + + /** + * @expectedException TypeError + */ + public function testDropInvalidTableNameDatatype() + { + $this->db->drop(new stdClass()); + } + + /** + * @expectedException TypeError + */ + public function testDropInvalidTypeDatatype() + { + $this->db->drop('test', new stdClass()); + } + + public function testSetSchema() + { + // set the schema and validate that it is what we set it to + $this->db->setSchema("test"); + $row = $this->db->query("SELECT DATABASE()"); + $this->assertEquals("test", $row->fetch_array()[0]); + } +} \ No newline at end of file diff --git a/inc/vendor/godsgood33/php-db/tests/TestClass.php b/inc/vendor/godsgood33/php-db/tests/TestClass.php new file mode 100644 index 0000000..836a54c --- /dev/null +++ b/inc/vendor/godsgood33/php-db/tests/TestClass.php @@ -0,0 +1,24 @@ +var); + } +} \ No newline at end of file diff --git a/inc/vendor/godsgood33/php-db/tests/TestClass2.php b/inc/vendor/godsgood33/php-db/tests/TestClass2.php new file mode 100644 index 0000000..4d01a9e --- /dev/null +++ b/inc/vendor/godsgood33/php-db/tests/TestClass2.php @@ -0,0 +1,5 @@ +add($complexString2); +``` +or pass all values to the appropriate function +``` +$complexString1 = '1.23-4.56i'; +$complexString2 = '2.34+5.67i'; + +echo Complex\add($complexString1, $complexString2); +``` +If you want to perform the same operation against multiple values (e.g. to add three or more complex numbers), then you can pass multiple arguments to any of the operations. + +You can pass these arguments as Complex objects, or as an array or string that will parse to a complex object. + +## Using functions + +When calling any of the available functions for a complex value, you can either call the relevant method for the Complex object +``` +$complexString = '1.23-4.56i'; + +$complexObject = new Complex\Complex($complexString); +echo $complexObject->sinh(); +``` +or you can call the function as you would in procedural code, passing the Complex object as an argument +``` +$complexString = '1.23-4.56i'; + +$complexObject = new Complex\Complex($complexString); +echo Complex\sinh($complexObject); +``` +When called procedurally using the function, you can pass in the argument as a Complex object, or as an array or string that will parse to a complex object. +``` +$complexString = '1.23-4.56i'; + +echo Complex\sinh($complexString); +``` + +In the case of the `pow()` function (the only implemented function that requires an additional argument) you need to pass both arguments when calling the function procedurally + +``` +$complexString = '1.23-4.56i'; + +$complexObject = new Complex\Complex($complexString); +echo Complex\pow($complexObject, 2); +``` +or pass the additional argument when calling the method +``` +$complexString = '1.23-4.56i'; + +$complexObject = new Complex\Complex($complexString); +echo $complexObject->pow(2); +``` diff --git a/inc/vendor/markbaker/complex/classes/Autoloader.php b/inc/vendor/markbaker/complex/classes/Autoloader.php new file mode 100644 index 0000000..9a8fcc1 --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/Autoloader.php @@ -0,0 +1,53 @@ +regex = $regex; + parent::__construct($it, $regex); + } +} + +class FilenameFilter extends FilesystemRegexFilter +{ + // Filter files against the regex + public function accept() + { + return (!$this->isFile() || preg_match($this->regex, $this->getFilename())); + } +} + + +$srcFolder = __DIR__ . DIRECTORY_SEPARATOR . 'src'; +$srcDirectory = new RecursiveDirectoryIterator($srcFolder); + +$filteredFileList = new FilenameFilter($srcDirectory, '/(?:php)$/i'); +$filteredFileList = new FilenameFilter($filteredFileList, '/^(?!.*(Complex|Exception)\.php).*$/i'); + +foreach (new RecursiveIteratorIterator($filteredFileList) as $file) { + if ($file->isFile()) { + include_once $file; + } +} diff --git a/inc/vendor/markbaker/complex/classes/src/Complex.php b/inc/vendor/markbaker/complex/classes/src/Complex.php new file mode 100644 index 0000000..5671eb2 --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/Complex.php @@ -0,0 +1,387 @@ + 0.0 && empty($suffix)) { + $suffix = 'i'; + } + + // Set parsed values in our properties + $this->realPart = (float) $realPart; + $this->imaginaryPart = (float) $imaginaryPart; + $this->suffix = strtolower($suffix); + } + + /** + * Gets the real part of this complex number + * + * @return Float + */ + public function getReal() + { + return $this->realPart; + } + + /** + * Gets the imaginary part of this complex number + * + * @return Float + */ + public function getImaginary() + { + return $this->imaginaryPart; + } + + /** + * Gets the suffix of this complex number + * + * @return String + */ + public function getSuffix() + { + return $this->suffix; + } + + /** + * Returns true if this is a real value, false if a complex value + * + * @return Bool + */ + public function isReal() + { + return $this->imaginaryPart == 0.0; + } + + /** + * Returns true if this is a complex value, false if a real value + * + * @return Bool + */ + public function isComplex() + { + return !$this->isReal(); + } + + public function format() + { + $str = ""; + if ($this->imaginaryPart != 0.0) { + if (\abs($this->imaginaryPart) != 1.0) { + $str .= $this->imaginaryPart . $this->suffix; + } else { + $str .= (($this->imaginaryPart < 0.0) ? '-' : '') . $this->suffix; + } + } + if ($this->realPart != 0.0) { + if (($str) && ($this->imaginaryPart > 0.0)) { + $str = "+" . $str; + } + $str = $this->realPart . $str; + } + if (!$str) { + $str = "0.0"; + } + + return $str; + } + + public function __toString() + { + return $this->format(); + } + + /** + * Validates whether the argument is a valid complex number, converting scalar or array values if possible + * + * @param mixed $complex The value to validate + * @return Complex + * @throws Exception If the argument isn't a Complex number or cannot be converted to one + */ + public static function validateComplexArgument($complex) + { + if (is_scalar($complex) || is_array($complex)) { + $complex = new Complex($complex); + } elseif (!is_object($complex) || !($complex instanceof Complex)) { + throw new Exception('Value is not a valid complex number'); + } + + return $complex; + } + + /** + * Returns the reverse of this complex number + * + * @return Complex + */ + public function reverse() + { + return new Complex( + $this->imaginaryPart, + $this->realPart, + ($this->realPart == 0.0) ? null : $this->suffix + ); + } + + public function invertImaginary() + { + return new Complex( + $this->realPart, + $this->imaginaryPart * -1, + ($this->imaginaryPart == 0.0) ? null : $this->suffix + ); + } + + public function invertReal() + { + return new Complex( + $this->realPart * -1, + $this->imaginaryPart, + ($this->imaginaryPart == 0.0) ? null : $this->suffix + ); + } + + protected static $functions = [ + 'abs', + 'acos', + 'acosh', + 'acot', + 'acoth', + 'acsc', + 'acsch', + 'argument', + 'asec', + 'asech', + 'asin', + 'asinh', + 'atan', + 'atanh', + 'conjugate', + 'cos', + 'cosh', + 'cot', + 'coth', + 'csc', + 'csch', + 'exp', + 'inverse', + 'ln', + 'log2', + 'log10', + 'negative', + 'pow', + 'rho', + 'sec', + 'sech', + 'sin', + 'sinh', + 'sqrt', + 'tan', + 'tanh', + 'theta', + ]; + + protected static $operations = [ + 'add', + 'subtract', + 'multiply', + 'divideby', + 'divideinto', + ]; + + /** + * Returns the result of the function call or operation + * + * @return Complex|float + * @throws Exception|\InvalidArgumentException + */ + public function __call($functionName, $arguments) + { + $functionName = strtolower(str_replace('_', '', $functionName)); + + // Test for function calls + if (in_array($functionName, self::$functions)) { + $functionName = "\\" . __NAMESPACE__ . "\\{$functionName}"; + return $functionName($this, ...$arguments); + } + // Test for operation calls + if (in_array($functionName, self::$operations)) { + $functionName = "\\" . __NAMESPACE__ . "\\{$functionName}"; + return $functionName($this, ...$arguments); + } + throw new Exception('Function or Operation does not exist'); + } +} diff --git a/inc/vendor/markbaker/complex/classes/src/Exception.php b/inc/vendor/markbaker/complex/classes/src/Exception.php new file mode 100644 index 0000000..a2beb73 --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/Exception.php @@ -0,0 +1,13 @@ +getReal() - $invsqrt->getImaginary(), + $complex->getImaginary() + $invsqrt->getReal() + ); + $log = ln($adjust); + + return new Complex( + $log->getImaginary(), + -1 * $log->getReal() + ); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/acosh.php b/inc/vendor/markbaker/complex/classes/src/functions/acosh.php new file mode 100644 index 0000000..18a992e --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/acosh.php @@ -0,0 +1,34 @@ +isReal() && ($complex->getReal() > 1)) { + return new Complex(\acosh($complex->getReal())); + } + + $acosh = acos($complex) + ->reverse(); + if ($acosh->getReal() < 0.0) { + $acosh = $acosh->invertReal(); + } + + return $acosh; +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/acot.php b/inc/vendor/markbaker/complex/classes/src/functions/acot.php new file mode 100644 index 0000000..11bee46 --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/acot.php @@ -0,0 +1,25 @@ +getReal() == 0.0 && $complex->getImaginary() == 0.0) { + return INF; + } + + return asin(inverse($complex)); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/acsch.php b/inc/vendor/markbaker/complex/classes/src/functions/acsch.php new file mode 100644 index 0000000..bb45d34 --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/acsch.php @@ -0,0 +1,29 @@ +getReal() == 0.0 && $complex->getImaginary() == 0.0) { + return INF; + } + + return asinh(inverse($complex)); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/argument.php b/inc/vendor/markbaker/complex/classes/src/functions/argument.php new file mode 100644 index 0000000..d7209cc --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/argument.php @@ -0,0 +1,28 @@ +getReal() == 0.0 && $complex->getImaginary() == 0.0) { + return INF; + } + + return acos(inverse($complex)); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/asech.php b/inc/vendor/markbaker/complex/classes/src/functions/asech.php new file mode 100644 index 0000000..b36c40e --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/asech.php @@ -0,0 +1,29 @@ +getReal() == 0.0 && $complex->getImaginary() == 0.0) { + return INF; + } + + return acosh(inverse($complex)); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/asin.php b/inc/vendor/markbaker/complex/classes/src/functions/asin.php new file mode 100644 index 0000000..9c982ac --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/asin.php @@ -0,0 +1,37 @@ +getReal() - $complex->getImaginary(), + $invsqrt->getImaginary() + $complex->getReal() + ); + $log = ln($adjust); + + return new Complex( + $log->getImaginary(), + -1 * $log->getReal() + ); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/asinh.php b/inc/vendor/markbaker/complex/classes/src/functions/asinh.php new file mode 100644 index 0000000..c1243fd --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/asinh.php @@ -0,0 +1,33 @@ +isReal() && ($complex->getReal() > 1)) { + return new Complex(\asinh($complex->getReal())); + } + + $asinh = clone $complex; + $asinh = $asinh->reverse() + ->invertReal(); + $asinh = asin($asinh); + return $asinh->reverse() + ->invertImaginary(); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/atan.php b/inc/vendor/markbaker/complex/classes/src/functions/atan.php new file mode 100644 index 0000000..2c75dcf --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/atan.php @@ -0,0 +1,45 @@ +isReal()) { + return new Complex(\atan($complex->getReal())); + } + + $t1Value = new Complex(-1 * $complex->getImaginary(), $complex->getReal()); + $uValue = new Complex(1, 0); + + $d1Value = clone $uValue; + $d1Value = subtract($d1Value, $t1Value); + $d2Value = add($t1Value, $uValue); + $uResult = $d1Value->divideBy($d2Value); + $uResult = ln($uResult); + + return new Complex( + (($uResult->getImaginary() == M_PI) ? -M_PI : $uResult->getImaginary()) * -0.5, + $uResult->getReal() * 0.5, + $complex->getSuffix() + ); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/atanh.php b/inc/vendor/markbaker/complex/classes/src/functions/atanh.php new file mode 100644 index 0000000..c53f2a9 --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/atanh.php @@ -0,0 +1,38 @@ +isReal()) { + $real = $complex->getReal(); + if ($real >= -1.0 && $real <= 1.0) { + return new Complex(\atanh($real)); + } else { + return new Complex(\atanh(1 / $real), (($real < 0.0) ? M_PI_2 : -1 * M_PI_2)); + } + } + + $iComplex = clone $complex; + $iComplex = $iComplex->invertImaginary() + ->reverse(); + return atan($iComplex) + ->invertReal() + ->reverse(); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/conjugate.php b/inc/vendor/markbaker/complex/classes/src/functions/conjugate.php new file mode 100644 index 0000000..bd1984b --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/conjugate.php @@ -0,0 +1,28 @@ +getReal(), + -1 * $complex->getImaginary(), + $complex->getSuffix() + ); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/cos.php b/inc/vendor/markbaker/complex/classes/src/functions/cos.php new file mode 100644 index 0000000..80a4683 --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/cos.php @@ -0,0 +1,34 @@ +isReal()) { + return new Complex(\cos($complex->getReal())); + } + + return conjugate( + new Complex( + \cos($complex->getReal()) * \cosh($complex->getImaginary()), + \sin($complex->getReal()) * \sinh($complex->getImaginary()), + $complex->getSuffix() + ) + ); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/cosh.php b/inc/vendor/markbaker/complex/classes/src/functions/cosh.php new file mode 100644 index 0000000..a4bea65 --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/cosh.php @@ -0,0 +1,32 @@ +isReal()) { + return new Complex(\cosh($complex->getReal())); + } + + return new Complex( + \cosh($complex->getReal()) * \cos($complex->getImaginary()), + \sinh($complex->getReal()) * \sin($complex->getImaginary()), + $complex->getSuffix() + ); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/cot.php b/inc/vendor/markbaker/complex/classes/src/functions/cot.php new file mode 100644 index 0000000..339101e --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/cot.php @@ -0,0 +1,29 @@ +getReal() == 0.0 && $complex->getImaginary() == 0.0) { + return new Complex(INF); + } + + return inverse(tan($complex)); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/coth.php b/inc/vendor/markbaker/complex/classes/src/functions/coth.php new file mode 100644 index 0000000..7fe705a --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/coth.php @@ -0,0 +1,24 @@ +getReal() == 0.0 && $complex->getImaginary() == 0.0) { + return INF; + } + + return inverse(sin($complex)); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/csch.php b/inc/vendor/markbaker/complex/classes/src/functions/csch.php new file mode 100644 index 0000000..f450098 --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/csch.php @@ -0,0 +1,29 @@ +getReal() == 0.0 && $complex->getImaginary() == 0.0) { + return INF; + } + + return inverse(sinh($complex)); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/exp.php b/inc/vendor/markbaker/complex/classes/src/functions/exp.php new file mode 100644 index 0000000..4cac696 --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/exp.php @@ -0,0 +1,34 @@ +getReal() == 0.0) && (\abs($complex->getImaginary()) == M_PI)) { + return new Complex(-1.0, 0.0); + } + + $rho = \exp($complex->getReal()); + + return new Complex( + $rho * \cos($complex->getImaginary()), + $rho * \sin($complex->getImaginary()), + $complex->getSuffix() + ); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/inverse.php b/inc/vendor/markbaker/complex/classes/src/functions/inverse.php new file mode 100644 index 0000000..7d3182a --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/inverse.php @@ -0,0 +1,29 @@ +getReal() == 0.0 && $complex->getImaginary() == 0.0) { + throw new \InvalidArgumentException('Division by zero'); + } + + return $complex->divideInto(1.0); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/ln.php b/inc/vendor/markbaker/complex/classes/src/functions/ln.php new file mode 100644 index 0000000..39071cf --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/ln.php @@ -0,0 +1,33 @@ +getReal() == 0.0) && ($complex->getImaginary() == 0.0)) { + throw new \InvalidArgumentException(); + } + + return new Complex( + \log(rho($complex)), + theta($complex), + $complex->getSuffix() + ); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/log10.php b/inc/vendor/markbaker/complex/classes/src/functions/log10.php new file mode 100644 index 0000000..694d3d0 --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/log10.php @@ -0,0 +1,32 @@ +getReal() == 0.0) && ($complex->getImaginary() == 0.0)) { + throw new \InvalidArgumentException(); + } elseif (($complex->getReal() > 0.0) && ($complex->getImaginary() == 0.0)) { + return new Complex(\log10($complex->getReal()), 0.0, $complex->getSuffix()); + } + + return ln($complex) + ->multiply(\log10(Complex::EULER)); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/log2.php b/inc/vendor/markbaker/complex/classes/src/functions/log2.php new file mode 100644 index 0000000..081f2c4 --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/log2.php @@ -0,0 +1,32 @@ +getReal() == 0.0) && ($complex->getImaginary() == 0.0)) { + throw new \InvalidArgumentException(); + } elseif (($complex->getReal() > 0.0) && ($complex->getImaginary() == 0.0)) { + return new Complex(\log($complex->getReal(), 2), 0.0, $complex->getSuffix()); + } + + return ln($complex) + ->multiply(\log(Complex::EULER, 2)); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/negative.php b/inc/vendor/markbaker/complex/classes/src/functions/negative.php new file mode 100644 index 0000000..dbd1192 --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/negative.php @@ -0,0 +1,31 @@ +getReal(), + -1 * $complex->getImaginary(), + $complex->getSuffix() + ); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/pow.php b/inc/vendor/markbaker/complex/classes/src/functions/pow.php new file mode 100644 index 0000000..18ee269 --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/pow.php @@ -0,0 +1,40 @@ +getImaginary() == 0.0 && $complex->getReal() >= 0.0) { + return new Complex(\pow($complex->getReal(), $power)); + } + + $rValue = \sqrt(($complex->getReal() * $complex->getReal()) + ($complex->getImaginary() * $complex->getImaginary())); + $rPower = \pow($rValue, $power); + $theta = $complex->argument() * $power; + if ($theta == 0) { + return new Complex(1); + } + + return new Complex($rPower * \cos($theta), $rPower * \sin($theta), $complex->getSuffix()); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/rho.php b/inc/vendor/markbaker/complex/classes/src/functions/rho.php new file mode 100644 index 0000000..750f3f9 --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/rho.php @@ -0,0 +1,28 @@ +getReal() * $complex->getReal()) + + ($complex->getImaginary() * $complex->getImaginary()) + ); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/sec.php b/inc/vendor/markbaker/complex/classes/src/functions/sec.php new file mode 100644 index 0000000..7dd43ea --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/sec.php @@ -0,0 +1,25 @@ +isReal()) { + return new Complex(\sin($complex->getReal())); + } + + return new Complex( + \sin($complex->getReal()) * \cosh($complex->getImaginary()), + \cos($complex->getReal()) * \sinh($complex->getImaginary()), + $complex->getSuffix() + ); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/sinh.php b/inc/vendor/markbaker/complex/classes/src/functions/sinh.php new file mode 100644 index 0000000..4c0f650 --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/sinh.php @@ -0,0 +1,32 @@ +isReal()) { + return new Complex(\sinh($complex->getReal())); + } + + return new Complex( + \sinh($complex->getReal()) * \cos($complex->getImaginary()), + \cosh($complex->getReal()) * \sin($complex->getImaginary()), + $complex->getSuffix() + ); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/sqrt.php b/inc/vendor/markbaker/complex/classes/src/functions/sqrt.php new file mode 100644 index 0000000..9c171b8 --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/sqrt.php @@ -0,0 +1,29 @@ +getSuffix()); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/tan.php b/inc/vendor/markbaker/complex/classes/src/functions/tan.php new file mode 100644 index 0000000..014d798 --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/tan.php @@ -0,0 +1,40 @@ +isReal()) { + return new Complex(\tan($complex->getReal())); + } + + $real = $complex->getReal(); + $imaginary = $complex->getImaginary(); + $divisor = 1 + \pow(\tan($real), 2) * \pow(\tanh($imaginary), 2); + if ($divisor == 0.0) { + throw new \InvalidArgumentException('Division by zero'); + } + + return new Complex( + \pow(sech($imaginary)->getReal(), 2) * \tan($real) / $divisor, + \pow(sec($real)->getReal(), 2) * \tanh($imaginary) / $divisor, + $complex->getSuffix() + ); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/tanh.php b/inc/vendor/markbaker/complex/classes/src/functions/tanh.php new file mode 100644 index 0000000..028741d --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/tanh.php @@ -0,0 +1,35 @@ +getReal(); + $imaginary = $complex->getImaginary(); + $divisor = \cos($imaginary) * \cos($imaginary) + \sinh($real) * \sinh($real); + if ($divisor == 0.0) { + throw new \InvalidArgumentException('Division by zero'); + } + + return new Complex( + \sinh($real) * \cosh($real) / $divisor, + 0.5 * \sin(2 * $imaginary) / $divisor, + $complex->getSuffix() + ); +} diff --git a/inc/vendor/markbaker/complex/classes/src/functions/theta.php b/inc/vendor/markbaker/complex/classes/src/functions/theta.php new file mode 100644 index 0000000..d12866c --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/functions/theta.php @@ -0,0 +1,38 @@ +getReal() == 0.0) { + if ($complex->isReal()) { + return 0.0; + } elseif ($complex->getImaginary() < 0.0) { + return M_PI / -2; + } + return M_PI / 2; + } elseif ($complex->getReal() > 0.0) { + return \atan($complex->getImaginary() / $complex->getReal()); + } elseif ($complex->getImaginary() < 0.0) { + return -(M_PI - \atan(\abs($complex->getImaginary()) / \abs($complex->getReal()))); + } + + return M_PI - \atan($complex->getImaginary() / \abs($complex->getReal())); +} diff --git a/inc/vendor/markbaker/complex/classes/src/operations/add.php b/inc/vendor/markbaker/complex/classes/src/operations/add.php new file mode 100644 index 0000000..10bd42f --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/operations/add.php @@ -0,0 +1,46 @@ +isComplex() && $complex->isComplex() && + $result->getSuffix() !== $complex->getSuffix()) { + throw new Exception('Suffix Mismatch'); + } + + $real = $result->getReal() + $complex->getReal(); + $imaginary = $result->getImaginary() + $complex->getImaginary(); + + $result = new Complex( + $real, + $imaginary, + ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix()) + ); + } + + return $result; +} diff --git a/inc/vendor/markbaker/complex/classes/src/operations/divideby.php b/inc/vendor/markbaker/complex/classes/src/operations/divideby.php new file mode 100644 index 0000000..089e0ef --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/operations/divideby.php @@ -0,0 +1,56 @@ +isComplex() && $complex->isComplex() && + $result->getSuffix() !== $complex->getSuffix()) { + throw new Exception('Suffix Mismatch'); + } + if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) { + throw new \InvalidArgumentException('Division by zero'); + } + + $delta1 = ($result->getReal() * $complex->getReal()) + + ($result->getImaginary() * $complex->getImaginary()); + $delta2 = ($result->getImaginary() * $complex->getReal()) - + ($result->getReal() * $complex->getImaginary()); + $delta3 = ($complex->getReal() * $complex->getReal()) + + ($complex->getImaginary() * $complex->getImaginary()); + + $real = $delta1 / $delta3; + $imaginary = $delta2 / $delta3; + + $result = new Complex( + $real, + $imaginary, + ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix()) + ); + } + + return $result; +} diff --git a/inc/vendor/markbaker/complex/classes/src/operations/divideinto.php b/inc/vendor/markbaker/complex/classes/src/operations/divideinto.php new file mode 100644 index 0000000..3dfe085 --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/operations/divideinto.php @@ -0,0 +1,56 @@ +isComplex() && $complex->isComplex() && + $result->getSuffix() !== $complex->getSuffix()) { + throw new Exception('Suffix Mismatch'); + } + if ($result->getReal() == 0.0 && $result->getImaginary() == 0.0) { + throw new \InvalidArgumentException('Division by zero'); + } + + $delta1 = ($complex->getReal() * $result->getReal()) + + ($complex->getImaginary() * $result->getImaginary()); + $delta2 = ($complex->getImaginary() * $result->getReal()) - + ($complex->getReal() * $result->getImaginary()); + $delta3 = ($result->getReal() * $result->getReal()) + + ($result->getImaginary() * $result->getImaginary()); + + $real = $delta1 / $delta3; + $imaginary = $delta2 / $delta3; + + $result = new Complex( + $real, + $imaginary, + ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix()) + ); + } + + return $result; +} diff --git a/inc/vendor/markbaker/complex/classes/src/operations/multiply.php b/inc/vendor/markbaker/complex/classes/src/operations/multiply.php new file mode 100644 index 0000000..bf2473e --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/operations/multiply.php @@ -0,0 +1,48 @@ +isComplex() && $complex->isComplex() && + $result->getSuffix() !== $complex->getSuffix()) { + throw new Exception('Suffix Mismatch'); + } + + $real = ($result->getReal() * $complex->getReal()) - + ($result->getImaginary() * $complex->getImaginary()); + $imaginary = ($result->getReal() * $complex->getImaginary()) + + ($result->getImaginary() * $complex->getReal()); + + $result = new Complex( + $real, + $imaginary, + ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix()) + ); + } + + return $result; +} diff --git a/inc/vendor/markbaker/complex/classes/src/operations/subtract.php b/inc/vendor/markbaker/complex/classes/src/operations/subtract.php new file mode 100644 index 0000000..075ef44 --- /dev/null +++ b/inc/vendor/markbaker/complex/classes/src/operations/subtract.php @@ -0,0 +1,46 @@ +isComplex() && $complex->isComplex() && + $result->getSuffix() !== $complex->getSuffix()) { + throw new Exception('Suffix Mismatch'); + } + + $real = $result->getReal() - $complex->getReal(); + $imaginary = $result->getImaginary() - $complex->getImaginary(); + + $result = new Complex( + $real, + $imaginary, + ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix()) + ); + } + + return $result; +} diff --git a/inc/vendor/markbaker/complex/composer.json b/inc/vendor/markbaker/complex/composer.json new file mode 100644 index 0000000..cb05712 --- /dev/null +++ b/inc/vendor/markbaker/complex/composer.json @@ -0,0 +1,77 @@ +{ + "name": "markbaker/complex", + "type": "library", + "description": "PHP Class for working with complex numbers", + "keywords": ["complex", "mathematics"], + "homepage": "https://github.com/MarkBaker/PHPComplex", + "license": "MIT", + "authors": [ + { + "name": "Mark Baker", + "email": "mark@lange.demon.co.uk" + } + ], + "require": { + "php": "^5.6.0|^7.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35|^5.4.0", + "phpdocumentor/phpdocumentor":"2.*", + "phpmd/phpmd": "2.*", + "sebastian/phpcpd": "2.*", + "phploc/phploc": "2.*", + "squizlabs/php_codesniffer": "^3.3.0", + "phpcompatibility/php-compatibility": "^8.0", + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3" + }, + "autoload": { + "psr-4": { + "Complex\\": "classes/src/" + }, + "files": [ + "classes/src/functions/abs.php", + "classes/src/functions/acos.php", + "classes/src/functions/acosh.php", + "classes/src/functions/acot.php", + "classes/src/functions/acoth.php", + "classes/src/functions/acsc.php", + "classes/src/functions/acsch.php", + "classes/src/functions/argument.php", + "classes/src/functions/asec.php", + "classes/src/functions/asech.php", + "classes/src/functions/asin.php", + "classes/src/functions/asinh.php", + "classes/src/functions/atan.php", + "classes/src/functions/atanh.php", + "classes/src/functions/conjugate.php", + "classes/src/functions/cos.php", + "classes/src/functions/cosh.php", + "classes/src/functions/cot.php", + "classes/src/functions/coth.php", + "classes/src/functions/csc.php", + "classes/src/functions/csch.php", + "classes/src/functions/exp.php", + "classes/src/functions/inverse.php", + "classes/src/functions/ln.php", + "classes/src/functions/log2.php", + "classes/src/functions/log10.php", + "classes/src/functions/negative.php", + "classes/src/functions/pow.php", + "classes/src/functions/rho.php", + "classes/src/functions/sec.php", + "classes/src/functions/sech.php", + "classes/src/functions/sin.php", + "classes/src/functions/sinh.php", + "classes/src/functions/sqrt.php", + "classes/src/functions/tan.php", + "classes/src/functions/tanh.php", + "classes/src/functions/theta.php", + "classes/src/operations/add.php", + "classes/src/operations/subtract.php", + "classes/src/operations/multiply.php", + "classes/src/operations/divideby.php", + "classes/src/operations/divideinto.php" + ] + }, + "minimum-stability": "dev" +} \ No newline at end of file diff --git a/inc/vendor/markbaker/complex/examples/complexTest.php b/inc/vendor/markbaker/complex/examples/complexTest.php new file mode 100644 index 0000000..7dafd8a --- /dev/null +++ b/inc/vendor/markbaker/complex/examples/complexTest.php @@ -0,0 +1,154 @@ +add(456); +echo $x, PHP_EOL; + +$x = new Complex(123.456); +$x->add(789.012); +echo $x, PHP_EOL; + +$x = new Complex(123.456, 78.90); +$x->add(new Complex(-987.654, -32.1)); +echo $x, PHP_EOL; + +$x = new Complex(123.456, 78.90); +$x->add(-987.654); +echo $x, PHP_EOL; + +$x = new Complex(-987.654, -32.1); +$x->add(new Complex(0, 1)); +echo $x, PHP_EOL; + +$x = new Complex(-987.654, -32.1); +$x->add(new Complex(0, -1)); +echo $x, PHP_EOL; + + +echo PHP_EOL, 'Subtract', PHP_EOL; + +$x = new Complex(123); +$x->subtract(456); +echo $x, PHP_EOL; + +$x = new Complex(123.456); +$x->subtract(789.012); +echo $x, PHP_EOL; + +$x = new Complex(123.456, 78.90); +$x->subtract(new Complex(-987.654, -32.1)); +echo $x, PHP_EOL; + +$x = new Complex(123.456, 78.90); +$x->subtract(-987.654); +echo $x, PHP_EOL; + +$x = new Complex(-987.654, -32.1); +$x->subtract(new Complex(0, 1)); +echo $x, PHP_EOL; + +$x = new Complex(-987.654, -32.1); +$x->subtract(new Complex(0, -1)); +echo $x, PHP_EOL; + + +echo PHP_EOL, 'Multiply', PHP_EOL; + +$x = new Complex(123); +$x->multiply(456); +echo $x, PHP_EOL; + +$x = new Complex(123.456); +$x->multiply(789.012); +echo $x, PHP_EOL; + +$x = new Complex(123.456, 78.90); +$x->multiply(new Complex(-987.654, -32.1)); +echo $x, PHP_EOL; + +$x = new Complex(123.456, 78.90); +$x->multiply(-987.654); +echo $x, PHP_EOL; + +$x = new Complex(-987.654, -32.1); +$x->multiply(new Complex(0, 1)); +echo $x, PHP_EOL; + +$x = new Complex(-987.654, -32.1); +$x->multiply(new Complex(0, -1)); +echo $x, PHP_EOL; + + +echo PHP_EOL, 'Divide By', PHP_EOL; + +$x = new Complex(123); +$x->divideBy(456); +echo $x, PHP_EOL; + +$x = new Complex(123.456); +$x->divideBy(789.012); +echo $x, PHP_EOL; + +$x = new Complex(123.456, 78.90); +$x->divideBy(new Complex(-987.654, -32.1)); +echo $x, PHP_EOL; + +$x = new Complex(123.456, 78.90); +$x->divideBy(-987.654); +echo $x, PHP_EOL; + +$x = new Complex(-987.654, -32.1); +$x->divideBy(new Complex(0, 1)); +echo $x, PHP_EOL; + +$x = new Complex(-987.654, -32.1); +$x->divideBy(new Complex(0, -1)); +echo $x, PHP_EOL; + + +echo PHP_EOL, 'Divide Into', PHP_EOL; + +$x = new Complex(123); +$x->divideInto(456); +echo $x, PHP_EOL; + +$x = new Complex(123.456); +$x->divideInto(789.012); +echo $x, PHP_EOL; + +$x = new Complex(123.456, 78.90); +$x->divideInto(new Complex(-987.654, -32.1)); +echo $x, PHP_EOL; + +$x = new Complex(123.456, 78.90); +$x->divideInto(-987.654); +echo $x, PHP_EOL; + +$x = new Complex(-987.654, -32.1); +$x->divideInto(new Complex(0, 1)); +echo $x, PHP_EOL; + +$x = new Complex(-987.654, -32.1); +$x->divideInto(new Complex(0, -1)); +echo $x, PHP_EOL; diff --git a/inc/vendor/markbaker/complex/examples/testFunctions.php b/inc/vendor/markbaker/complex/examples/testFunctions.php new file mode 100644 index 0000000..4d5ed73 --- /dev/null +++ b/inc/vendor/markbaker/complex/examples/testFunctions.php @@ -0,0 +1,52 @@ +getMessage(), PHP_EOL; + } + } + echo PHP_EOL; + } +} diff --git a/inc/vendor/markbaker/complex/examples/testOperations.php b/inc/vendor/markbaker/complex/examples/testOperations.php new file mode 100644 index 0000000..f791263 --- /dev/null +++ b/inc/vendor/markbaker/complex/examples/testOperations.php @@ -0,0 +1,34 @@ + ', $result, PHP_EOL; + +echo PHP_EOL; + +echo 'Subtraction', PHP_EOL; + +$result = \Complex\subtract(...$values); +echo '=> ', $result, PHP_EOL; + +echo PHP_EOL; + +echo 'Multiplication', PHP_EOL; + +$result = \Complex\multiply(...$values); +echo '=> ', $result, PHP_EOL; diff --git a/inc/vendor/markbaker/complex/license.md b/inc/vendor/markbaker/complex/license.md new file mode 100644 index 0000000..5b4b156 --- /dev/null +++ b/inc/vendor/markbaker/complex/license.md @@ -0,0 +1,25 @@ +The MIT License (MIT) +===================== + +Copyright © `2017` `Mark Baker` + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the “Software”), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/inc/vendor/pacificsec/cpe/.gitignore b/inc/vendor/pacificsec/cpe/.gitignore new file mode 100644 index 0000000..a7a214c --- /dev/null +++ b/inc/vendor/pacificsec/cpe/.gitignore @@ -0,0 +1,5 @@ +/.settings/ +/.buildpath +/.project +/vendor/ +/composer.lock diff --git a/inc/vendor/pacificsec/cpe/README.md b/inc/vendor/pacificsec/cpe/README.md index c855f04..d03c72c 100644 --- a/inc/vendor/pacificsec/cpe/README.md +++ b/inc/vendor/pacificsec/cpe/README.md @@ -22,3 +22,45 @@ Features - CPE rich comparison. - CPE Language parsing and evaluation. - MIT Licensed. + +Getting Started +-------- +- Clone repository + +```bash +$ git clone https://github.com/pacificsec/cpe.git +$ cd cpe +``` +- Create a new PHP file to run tests + +```php +unbindURI("cpe:/a:microsoft:internet_explorer%01%01%01%01:?:beta"); +var_dump($wfn); +$wfn = $cpenu->unbindURI("cpe:/a:microsoft:internet_explorer:8.%2a:sp%3f"); +var_dump($wfn); +$wfn = $cpenu->unbindURI("cpe:/a:microsoft:internet_explorer:8.%02:sp%01"); +var_dump($wfn); +$wfn = $cpenu->unbindURI("cpe:/a:hp:insight_diagnostics:7.4.0.1570::~~online~win2003~x64~"); +var_dump($wfn); +$wfn = $cpenu->unbindFS("cpe:2.3:a:micr\\?osoft:internet_explorer:8.0.6001:beta:*:*:*:*:*:*"); +var_dump($wfn); +``` \ No newline at end of file diff --git a/inc/vendor/pacificsec/cpe/composer.json b/inc/vendor/pacificsec/cpe/composer.json new file mode 100644 index 0000000..b386db0 --- /dev/null +++ b/inc/vendor/pacificsec/cpe/composer.json @@ -0,0 +1,26 @@ +{ + "name" : "pacificsec/cpe", + "type" : "library", + "description" : "CPE: Common Platform Enumeration for PHP", + "keywords" : [ + "cpe", + "cve", + "security", + "pacificsec" + ], + "homepage" : "https://github.com/pacificsec/cpe", + "license" : "MIT", + "authors" : [{ + "name" : "Antonio Franco", + "email" : "antonio.franco@pacificsec.com" + } + ], + "require" : { + "php" : ">=5.3.0" + }, + "autoload" : { + "psr-4" : { + "PacificSec\\CPE\\" : "src" + } + } +} \ No newline at end of file diff --git a/inc/vendor/pacificsec/cpe/src/Common/LogicalValue.php b/inc/vendor/pacificsec/cpe/src/Common/LogicalValue.php new file mode 100644 index 0000000..5d13494 --- /dev/null +++ b/inc/vendor/pacificsec/cpe/src/Common/LogicalValue.php @@ -0,0 +1,44 @@ +. + * + * @see cpe.mitre.org for more information. + * @author Antonio Franco + * @email antonio.franco@pacificsec.com + */ +class LogicalValue { + + private $any = false; + private $na = false; + + // Object must be constructed with the string "ANY" or "NA". + public function __construct($type) { + if ($type == "ANY") { + $this->any = true; + } else if ($type == "NA") { + $this->na = true; + } else { + throw new Exception("LogicalValue must be ANY or NA"); + } + } + + public function isANY(){ + return $this->any; + } + + public function isNA(){ + return $this->na; + } + + public function __toString(){ + if ($this->any){ + return "ANY"; + } + return "NA"; + } +} \ No newline at end of file diff --git a/inc/vendor/pacificsec/cpe/src/Common/Utilities.php b/inc/vendor/pacificsec/cpe/src/Common/Utilities.php new file mode 100644 index 0000000..e1e1f03 --- /dev/null +++ b/inc/vendor/pacificsec/cpe/src/Common/Utilities.php @@ -0,0 +1,166 @@ +. + * + * @see cpe.mitre.org for more information. + * @author Antonio Franco + * @email antonio.franco@pacificsec.com + */ +class Utilities { + + /** + * Searches string for special characters * and ? + * @param string $string to be searched + * @return bool true if string contains wildcard, false otherwise + */ + public static function containsWildcards($string) { + if (strpos($string, "*") !== false || strpos($string, "?") !== false) { + if (!(strpos($string, "\\") !== false)) { + return true; + } + } + return false; + } + + /** + * Checks if given number is even or not + * @param int $num number to check + * @return bool true if number is even, false if not + */ + public static function isEvenNumber($num) { + return (is_int($num) && $num % 2 == 0); + } + + /** + * Counts the number of escape characters in the string beginning and ending + * at the given indices + * @param string $str string to search + * @param int $start beginning index + * @param int $end ending index + * @return number of escape characters in string + * @todo fix the use of $str. The Java version is also not using this variable. + */ + public static function countEscapeCharacters($str, $start, $end) { + $result = 0; + $active = false; + $i = 0; + while ($i < $end) { + if ($active && ($i >= $start)) { + $result = $result + 1; + } + $i = $i + 1; + } + return $result; + } + + /** + * Searches a string for the first unescaped colon and returns the index of + * that colon + * @param string $str string to search + * @return int index of first unescaped colon, or 0 if not found + */ + public static function getUnescapedColonIndex($str) { + $found = false; + $colon_idx = 0; + $start_idx = 0; + // Find the first non-escaped colon. + while (!$found) { + $colon_idx = strpos($str, ":", $start_idx + 1); + // If no colon is found, return 0. + if ($colon_idx === false) { + return 0; + } + // Peek at character before colon. + if (substr($str, $colon_idx-1, 1) == "\\") { + // If colon is escaped, keep looking. + $start_idx = $colon_idx; + } else { + $found = true; + } + } + return $colon_idx; + } + + /** + * Returns true if the string contains only + * alphanumeric characters or the underscore character, + * false otherwise. + * @param string $c the string in question + * @return bool true if $c is alphanumeric or underscore, false if not + */ + public static function isAlphanum($c) { + return (preg_match("/^[a-zA-Z0-9\_]+$/", $c) ? true : false); + } + + /** + * This function is not part of the reference implementation pseudo code + * found in the CPE 2.3 specification. It enforces two rules in the + * specification: + * URI must start with the characters "cpe:/" + * A URI may not contain more than 7 components + * If either rule is violated, a Exception is thrown. + * @param $in string with URI to be validated + */ + public static function validateURI($in) { + // make sure uri starts with cpe:/ + if (strpos(strtolower($in), "cpe:/") !== 0) { + throw new Exception("Error: URI must start with 'cpe:/'. Given: " . $in, 0); + } + // make sure uri doesn't contain more than 7 colons + $count = sizeof(explode(":", $in)); + if ($count > 8) { + throw new Exception("Error parsing URI. Found " . ($count - 8) . " extra components in: " . $in, 0); + } + } + + /** + * This function is not part of the reference implementation pseudo code + * found in the CPE 2.3 specification. It enforces three rules found in the + * specification: + * Formatted string must start with the characters "cpe:2.3:" + * A formatted string must contain 11 components + * A formatted string must not contain empty components + * If any rule is violated, a ParseException is thrown. + * @param $in string with FS to be validated + */ + public static function validateFS($in) { + if (strpos(strtolower($in), "cpe:2.3:") !== 0) { + throw new Exception("Error: Formatted String must start with \"cpe:2.3\". Given: " . $in, 0); + } + + $count = 0; + for ($i = 0; $i != strlen($in); $i++){ + if (substr($in, $i, 1) == ":"){ + if (substr($in, $i - 1, 1) != "\\"){ + $count++; + } + if (($i+1) < strlen($in) && substr($in, $i+1, 1) == ":"){ + throw new Exception("Error parsing formatted string. Found empty component", 0); + } + } + } + if ($count > 12){ + $extra = $count - 12; + $s = "Error parsing formatted string. Found " . $extra . " extra component"; + if ($extra > 1){ + $s = $s . "s"; + } + $s = $s . " in: " . $in; + throw new Exception($s, 0); + } + if ($count < 12){ + $missing = 12 - $count; + $s = "Error parsing formatted string. Missing " . $missing . " component"; + if ($missing > 1){ + $s = $s . "s"; + } + throw new Exception($s, 0); + } + } +} \ No newline at end of file diff --git a/inc/vendor/pacificsec/cpe/src/Common/WellFormedName.php b/inc/vendor/pacificsec/cpe/src/Common/WellFormedName.php new file mode 100644 index 0000000..e3a7253 --- /dev/null +++ b/inc/vendor/pacificsec/cpe/src/Common/WellFormedName.php @@ -0,0 +1,210 @@ +. + * + * @see cpe.mitre.org for details. + * @author Antonio Franco + * @email antonio.franco@pacificsec.com + */ +class WellFormedName { + + // Underlying wfn representation. + private $wfn = null; + // All permissible WFN attributes as defined by specification. + private $attributes = array("part", "vendor", "product", "version", + "update", "edition", "language", "sw_edition", "target_sw", + "target_hw", "other"); + + /** + * Constructs a new WellFormedName object, setting each component to the + * given parameter value. If a parameter is null, the component is set to + * the default value "ANY". + * @param $part string representing the part component + * @param $vendor string representing the vendor component + * @param $product string representing the product component + * @param $version string representing the version component + * @param $update string representing the update component + * @param $edition string representing the edition component + * @param $language string representing the language component + * @param $sw_edition string representing the sw_edition component + * @param $target_sw string representing the target_sw component + * @param $target_hw string representing the target_hw component + * @param $other string representing the other component + */ + public function __construct($part = null, $vendor = null, $product = null, $version = null, + $update = null, $edition = null, $language = null, $sw_edition = null, $target_sw = null, + $target_hw = null, $other = null) { + + $this->wfn = array(); + + // Constructs a new WellFormedName object, with all components set to the default value "ANY". + if ($part === null && $vendor === null && $product === null && $version === null && + $update === null && $edition === null && $language === null && $sw_edition === null && $target_sw === null && + $target_hw === null && $other === null){ + foreach ($this->attributes as $a){ + if ($a != "part"){ + $this->set($a, new LogicalValue("ANY")); + } + } + return; + } + + $this->set("part", $part); + $this->set("vendor", $vendor); + $this->set("product", $product); + $this->set("version", $version); + $this->set("update", $update); + $this->set("edition", $edition); + $this->set("language", $language); + $this->set("sw_edition", $sw_edition); + $this->set("target_sw", $target_sw); + $this->set("target_hw", $target_hw); + $this->set("other", $other); + } + + /** + * @param $attribute string representing the component value to get + * @return string the string value of the given component, or default value "ANY" + * if the component does not exist + */ + public function get($attribute){ + if (array_key_exists($attribute, $this->wfn)) + return $this->wfn[$attribute]; + else + return new LogicalValue("ANY"); + } + + /** + * Sets the given attribute to value, if the attribute is in the list of + * permissible components + * @param $attribute string representing the component to set + * @param $value object or string representing the value of the given component + */ + public final function set($attribute, $value){ + // Iterate over permissible attributes. + foreach ($this->attributes as $a){ + // If the argument is a valid attribute, set that attribute's value. + if ($attribute == $a) { + // check to see if we're setting a LogicalValue ANY or NA + if ($value instanceof LogicalValue){ + // don't allow logical values in part component + if ($attribute == "part"){ + var_dump($value); echo "
\n"; + var_dump($a); echo "
\n"; + var_dump($attribute); echo "
\n"; + throw new Exception("Error! part component cannot be a logical value"); + } + // put the Object in the ht and break + $this->wfn[$attribute] = $value; + break; + } + if ($value == null || $value == ""){ + // if value is null or blank, set attribute to default logical ANY + $this->wfn[$attribute] = new LogicalValue("ANY"); + break; + } + $svalue = $value; + // Reg exs + // check for printable characters - no control characters + if (!preg_match("/^[[:print:]]*$/", $svalue)){ + throw new Exception("Error! encountered non printable character in: " . $svalue, 0); + } + // svalue has whitespace + if (preg_match("/^.*\\s+.*$/", $svalue)){ + throw new Exception("Error! component cannot contain whitespace: " . $svalue, 0); + } + // svalue has more than one unquoted star + if (preg_match("/^\\*{2,}.*$/", $svalue) || preg_match("/^.*\\*{2,}$/", $svalue)){ + throw new Exception("Error! component cannot contain more than one * in sequence: " . $svalue, 0); + } + // svalue has unquoted punctuation embedded + if (preg_match("/^.*(?\\@\\[\\]\\^\\`\\{\\|\\}\\~\\-].*$/", $svalue)) { + throw new Exception("Error! component cannot contain unquoted punctuation: " . $svalue, 0); + } + // svalue has an unquoted * + if (preg_match("/^.+(?wfn[$attribute] = $svalue; + break; + } + // remove leading and trailing ?s + $v = $svalue; + while (strpos($v, "?") === 0) { + // remove all leading ?'s + $v = substr($v, 1); + } + $v = strrev($v); + while (strpos($v, "?") === 0) { + // remove all trailing ?'s (string has been reversed) + $v = substr($v, 1); + } + // back to normal + $v = strrev($v); + // after leading and trailing ?s are removed, check if value + // contains unquoted ?s + if (preg_match("/^.+(?wfn[$attribute] = $svalue; + break; + } + } + } + + /** + * + * @return string representation of the WellFormedName + */ + public function __toString() { + $str = "wfn:["; + foreach ($this->attributes as $attr) { + $str = $str . $attr; + $str = $str . "="; + + $o = $this->wfn[$attr]; + if ($o instanceof LogicalValue) { + $str = $str . $o; + $str = $str . ", "; + } else { + $str = $str . "\""; + $str = $str . $o; + $str = $str . "\", "; + } + } + $str = substr($str, 0, strlen($str)-1); + $str = substr($str, 0, strlen($str)-1); + $str = $str . "]"; + + return $str; + } + +} \ No newline at end of file diff --git a/inc/vendor/pacificsec/cpe/src/Matching/CPENameMatcher.php b/inc/vendor/pacificsec/cpe/src/Matching/CPENameMatcher.php new file mode 100644 index 0000000..a4d4ae3 --- /dev/null +++ b/inc/vendor/pacificsec/cpe/src/Matching/CPENameMatcher.php @@ -0,0 +1,287 @@ +. + * + * @see cpe.mitre.org for more information. + * @author Antonio Franco + * @email antonio.franco@pacificsec.com + */ +class CPENameMatcher { + + /** + * Tests two Well Formed Names for disjointness. + * @param $source WellFormedName Source WFN + * @param $target WellFormedName Target WFN + * @return true if the names are disjoint, false otherwise + */ + public function isDisjoint(WellFormedName $source, WellFormedName $target) { + // if any pairwise comparison is disjoint, the names are disjoint. + $resultList = $this->compareWFNs($source, $target); + foreach ($resultList as $result){ + if ($result == Relation::DISJOINT) + return true; + } + return false; + } + + /** + * Tests two Well Formed Names for equality. + * @param $source WellFormedName Source WFN + * @param $target WellFormedName Target WFN + * @return true if the names are equal, false otherwise + */ + public function isEqual(WellFormedName $source, WellFormedName $target) { + // if every pairwise comparison is equal, the names are equal. + $resultList = $this->compareWFNs($source, $target); + foreach ($resultList as $result){ + if ($result != Relation::EQUAL){ + return false; + } + } + return true; + } + + /** + * Tests if the target Well Formed Name is a subset of the source Well Formed + * Name. + * @param $source WellFormedName Source WFN + * @param $target WellFormedName Target WFN + * @return true if the target is a subset of the source, false otherwise + */ + public function isSubset(WellFormedName $source, WellFormedName $target) { + // if any comparison is anything other than subset or equal, then target is + // not a subset of source. + $resultList = $this->compareWFNs($source, $target); + foreach ($resultList as $result){ + if ($result != Relation::SUBSET && $result != Relation::EQUAL) { + return false; + } + } + return true; + } + + /** + * Tests if the target Well Formed name is a superset of the source Well Formed + * Name. + * @param $source WellFormedName Source WFN + * @param $target WellFormedName Target WFN + * @return true if the target is a superset of the source, false otherwise + */ + public function isSuperset(WellFormedName $source, WellFormedName $target) { + // if any comparison is anything other than superset or equal, then target is not + // a superset of source. + $resultList = $this->compareWFNs($source, $target); + foreach ($resultList as $result){ + if ($result != Relation::SUPERSET && $result != Relation::EQUAL) { + return false; + } + } + return true; + } + + /** + * Compares each attribute value pair in two Well Formed Names. + * @param $source WellFormedName Source WFN + * @param $target WellFormedName Target WFN + * @return array A array mapping attribute string to attribute value Relation + */ + public function compareWFNs(WellFormedName $source, WellFormedName $target) { + $result = array(); + $result["part"] = $this->compare($source->get("part"), $target->get("part")); + $result["vendor"] = $this->compare($source->get("vendor"), $target->get("vendor")); + $result["product"] = $this->compare($source->get("product"), $target->get("product")); + $result["version"] = $this->compare($source->get("version"), $target->get("version")); + $result["update"] = $this->compare($source->get("update"), $target->get("update")); + $result["edition"] = $this->compare($source->get("edition"), $target->get("edition")); + $result["language"] = $this->compare($source->get("language"), $target->get("language")); + $result["sw_edition"] = $this->compare($source->get("sw_edition"), $target->get("sw_edition")); + $result["target_sw"] = $this->compare($source->get("target_sw"), $target->get("target_sw")); + $result["target_hw"] = $this->compare($source->get("target_hw"), $target->get("target_hw")); + $result["other"] = $this->compare($source->get("other"), $target->get("other")); + return $result; + } + + /** + * Compares an attribute value pair. + * @param string $source Source attribute value. + * @param string $target Target attribute value. + * @return int The relation between the two attribute values. + */ + private function compare($source, $target) { + // matching is case insensitive, convert strings to lowercase. + if ($this->isString($source)) { + $source = strtolower($source); + } + if ($this->isString($target)) { + $target = strtolower($target); + } + + // Unquoted wildcard characters yield an undefined result. + if ($this->isString($target) && Utilities::containsWildcards($target)) { + return Relation::UNDEFINED; + } + // If source and target values are equal, then result is equal. + if ($source == $target) { + return Relation::EQUAL; + } + + // Check to see if source or target are Logical Values. + $lvSource = null; + $lvTarget = null; + if ($source instanceof LogicalValue) { + $lvSource = $source; + } + if ($target instanceof LogicalValue) { + $lvTarget = $target; + } + if ($lvSource != null && $lvTarget != null) { + // If Logical Values are equal, result is equal. + if ($lvSource->isANY() == $lvTarget->isANY() || $lvSource->isNA() == $lvTarget->isNA()) { + return Relation::EQUAL; + } + } + // If source value is ANY, result is a superset. + if ($lvSource != null) { + if ($lvSource->isANY()) { + return Relation::SUPERSET; + } + } + // If target value is ANY, result is a subset. + if ($lvTarget != null) { + if ($lvTarget->isANY()) { + return Relation::SUBSET; + } + } + // If source or target is NA, result is disjoint. + if ($lvSource != null) { + if ($lvSource->isNA()) { + return Relation::DISJOINT; + } + } + if ($lvTarget != null) { + if ($lvTarget->isNA()) { + return Relation::DISJOINT; + } + } + // only Strings will get to this point, not LogicalValues + return $this->compareStrings($source, $target); + } + + /** + * Compares a source string to a target string, and addresses the condition + * in which the source string includes unquoted special characters. It + * performs a simple regular expression match, with the assumption that + * (as required) unquoted special characters appear only at the beginning + * and/or the end of the source string. It also properly differentiates + * between unquoted and quoted special characters. + * + * @param $source string Source attribute value. + * @param $target string Target attribute value. + * @return Relation between source and target Strings. + */ + private function compareStrings($source, $target) { + $start = 0; + $end = strlen($source); + $begins = 0; + $ends = 0; + $index = 0; $leftover = 0; $escapes = 0; + + if (substr($source, 0, 1) == "*") { + $start = 1; + $begins = -1; + } else { + while (($start < strlen($source)) && (substr($source, $start, 1) == "?")) { + $start = $start + 1; + $begins = $begins + 1; + } + } + if ((substr($source, $end - 1, 1) == "*") && ($this->isEvenWildcards($source, $end - 1))) { //TODO + $end = $end - 1; + $ends = -1; + } else { + while (($end > 0) && substr($source, $end - 1, 1) == "?" && ($this->isEvenWildcards($source, $end - 1))) { //TODO + $end = $end - 1; + $ends = $ends + 1; + } + } + + $source = substr($source, $start, $end-$start); + $index = -1; + $leftover = strlen($target); + while ($leftover > 0) { + $index = strpos($target, $source, $index + 1); + if ($index === false) { + break; + } + $escapes = Utilities::countEscapeCharacters($target, 0, $index); + if (($index > 0) && ($begins != -1) && ($begins < ($index - $escapes))) { + break; + } + $escapes = Utilities::countEscapeCharacters($target, $index + 1, strlen($target)); + $leftover = strlen($target) - $index - $escapes - strlen($source); + if (($leftover > 0) && (($ends != -1) && ($leftover > $ends))) { + continue; + } + return Relation::SUPERSET; + } + return Relation::DISJOINT; + } + + /** + * Searches a string for the backslash character + * @param $str string to search in + * @param int $idx end index + * @return true if the number of backslash characters is even, false if odd + */ + private function isEvenWildcards($str, $idx) { + $result = 0; + while (($idx > 0) && (strpos($str, "\\", $idx - 1)) !== false) { + $idx = $idx - 1; + $result = $result + 1; + } + return Utilities::isEvenNumber($result); + } + + /** + * Tests if an Object is an instance of the String class + * @param mixed $arg the var to test + * @return bool true if arg is a string, false if not + */ + private function isString($arg) { + return is_string($arg); + } + + /* + * Static method to demonstrate this class. + */ + public static function test() { + // Examples. + $wfn = new WellFormedName("a", "microsoft", "internet_explorer", "8\\.0\\.6001", "beta", new LogicalValue("ANY"), "sp2", null, null, null, null); + $wfn2 = new WellFormedName("a", "microsoft", "internet_explorer", new LogicalValue("ANY"), new LogicalValue("ANY"), new LogicalValue("ANY"), new LogicalValue("ANY"), new LogicalValue("ANY"), new LogicalValue("ANY"), new LogicalValue("ANY"), new LogicalValue("ANY")); + $cpenm = new CPENameMatcher(); + $cpenu = new CPENameUnbinder(); + $cpenb = new CPENameBinder(); + $wfn = $cpenu->unbindURI($cpenb->bindToURI($wfn)); + $wfn2 = $cpenu->unbindFS($cpenb->bindToFS($wfn2)); + var_dump($cpenm->isDisjoint($wfn, $wfn2)); // false + var_dump($cpenm->isEqual($wfn, $wfn2)); // false + var_dump($cpenm->isSubset($wfn, $wfn2)); // true, $wfn2 is a subset of wfn + var_dump($cpenm->isSuperset($wfn, $wfn2)); // false + $wfn = $cpenu->unbindFS("cpe:2.3:a:adobe:*:9.*:*:PalmOS:*:*:*:*:*"); + $wfn2 = $cpenu->unbindURI("cpe:/a::Reader:9.3.2:-:-"); + var_dump($cpenm->isDisjoint($wfn, $wfn2)); // true, $wfn2 and wfn are disjoint + var_dump($cpenm->isEqual($wfn, $wfn2)); // false + var_dump($cpenm->isSubset($wfn, $wfn2)); // false + var_dump($cpenm->isSuperset($wfn, $wfn2)); // false + } +} \ No newline at end of file diff --git a/inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Matching/Relation.php b/inc/vendor/pacificsec/cpe/src/Matching/Relation.php similarity index 100% rename from inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Matching/Relation.php rename to inc/vendor/pacificsec/cpe/src/Matching/Relation.php diff --git a/inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Naming/CPENameBinder.php b/inc/vendor/pacificsec/cpe/src/Naming/CPENameBinder.php similarity index 53% rename from inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Naming/CPENameBinder.php rename to inc/vendor/pacificsec/cpe/src/Naming/CPENameBinder.php index 15e489e..864dc8b 100644 --- a/inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Naming/CPENameBinder.php +++ b/inc/vendor/pacificsec/cpe/src/Naming/CPENameBinder.php @@ -7,28 +7,41 @@ use PacificSec\CPE\Common\LogicalValue; /** * The CPENameBinder class is a simple implementation - * of the CPE Name binding algorithm, as specified in the - * CPE Naming Standard version 2.3. It is based on Java version - * implemented by Joshua Kraunelis . - * - * @see cpe.mitre.org for more information. + * of the CPE Name binding algorithm, as specified in the + * CPE Naming Standard version 2.3. + * It is based on Java version + * implemented by Joshua Kraunelis . + * + * @see cpe.mitre.org for more information. * @author Antonio Franco * @email antonio.franco@pacificsec.com */ -class CPENameBinder { +class CPENameBinder +{ /** * Binds a {@link WellFormedName} object to a URI. - * @param $w WellFormedName to be bound to URI - * @return URI binding of WFN + * + * @param $w WellFormedName + * to be bound to URI + * @return string URI binding of WFN */ - public function bindToURI(WellFormedName $w) { + public function bindToURI(WellFormedName $w) + { // Initialize the output with the CPE v2.2 URI prefix. $uri = "cpe:/"; // Define the attributes that correspond to the seven components in a v2.2. CPE. - $attributes = array("part", "vendor", "product", "version", "update", "edition", "language"); + $attributes = array( + "part", + "vendor", + "product", + "version", + "update", + "edition", + "language" + ); // Iterate over the well formed name foreach ($attributes as $a) { @@ -56,15 +69,28 @@ class CPENameBinder { /** * Top-level function used to bind WFN w to formatted string. - * @param $w WellFormedName to bind - * @return Formatted String + * + * @param $w WellFormedName + * to bind + * @return string Formatted String */ - public function bindToFS(WellFormedName $w) { + public function bindToFS(WellFormedName $w) + { // Initialize the output with the CPE v2.3 string prefix. $fs = "cpe:2.3:"; - foreach (array("part", "vendor", "product", "version", - "update", "edition", "language", "sw_edition", "target_sw", - "target_hw", "other") as $a) { + foreach (array( + "part", + "vendor", + "product", + "version", + "update", + "edition", + "language", + "sw_edition", + "target_sw", + "target_hw", + "other" + ) as $a) { $v = $this->bindValueForFS($w->get($a)); $fs = $fs . $v; // add a colon except at the very end @@ -78,10 +104,13 @@ class CPENameBinder { /** * Convert the value v to its proper string representation for insertion to * formatted string. - * @param $v value to convert - * @return Formatted value + * + * @param mixed $v + * value to convert + * @return mixed Formatted value */ - private function bindValueForFS($v) { + private function bindValueForFS($v) + { if ($v instanceof LogicalValue) { $l = $v; // The value NA binds to a blank. @@ -97,30 +126,34 @@ class CPENameBinder { } /** - * Inspect each character in string s. Certain nonalpha characters pass + * Inspect each character in string s. + * Certain nonalpha characters pass * thru without escaping into the result, but most retain escaping. - * @param $s - * @return + * + * @param + * $s + * @return */ - private function processQuotedChars($s) { + private function processQuotedChars($s) + { $result = ""; $idx = 0; while ($idx < strlen($s)) { $c = substr($s, $idx, 1); if ($c != "\\") { // unquoted characters pass thru unharmed. - $result = $result . $c; + $result .= $c; } else { // escaped characters are examined. $nextchr = substr($s, $idx + 1, 1); // the period, hyphen and underscore pass unharmed. if ($nextchr == "." || $nextchr == "-" || $nextchr == "_") { - $result = $result . $nextchr; + $result .= $nextchr; $idx = $idx + 2; continue; } else { // all others retain escaping. - $result = $result . "\\" . $nextchr; + $result .= "\\" . $nextchr; $idx = $idx + 2; continue; } @@ -132,12 +165,16 @@ class CPENameBinder { /** * Converts a string to the proper string for including in - * a CPE v2.2-conformant URI. The logical value ANY binds + * a CPE v2.2-conformant URI. + * The logical value ANY binds * to the blank in the 2.2-conformant URI. - * @param $s string to be converted - * @return converted string + * + * @param $s string + * to be converted + * @return string converted string */ - private function bindValueForURI($s) { + private function bindValueForURI($s) + { if ($s instanceof LogicalValue) { $l = $s; // The value NA binds to a blank. @@ -159,10 +196,13 @@ class CPENameBinder { * - Pass alphanumeric characters thru untouched * - Percent-encode quoted non-alphanumerics as needed * - Unquoted special characters are mapped to their special forms - * @param $s string to be transformed - * @return transformed string + * + * @param $s string + * to be transformed + * @return string transformed string */ - private function transformForURI($s) { + private function transformForURI($s) + { $result = ""; $idx = 0; @@ -171,7 +211,7 @@ class CPENameBinder { $thischar = substr($s, $idx, 1); // Alphanumerics (incl. underscore) pass untouched. if (Utilities::isAlphanum($thischar)) { - $result = $result . $thischar; + $result .= $thischar; $idx = $idx + 1; continue; } @@ -179,17 +219,17 @@ class CPENameBinder { if ($thischar == "\\") { $idx = $idx + 1; $nxtchar = substr($s, $idx, 1); - $result = $result . $this->pctEncode($nxtchar); + $result .= $this->pctEncode($nxtchar); $idx = $idx + 1; continue; } // Bind the unquoted '?' special character to "%01". if ($thischar == "?") { - $result = $result . "%01"; + $result .= "%01"; } // Bind the unquoted '*' special character to "%02". if ($thischar == "*") { - $result = $result . "%02"; + $result .= "%02"; } $idx = $idx + 1; } @@ -199,122 +239,98 @@ class CPENameBinder { /** * Returns the appropriate percent-encoding of character c. * Certain characters are returned without encoding. - * @param $c the single character string to be encoded - * @return the percent encoded string + * + * @param string $c the + * single character string to be encoded + * @return string the percent encoded string */ - private function pctEncode($c) { - if ($c == "!") { - return "%21"; + private function pctEncode($c) + { + switch ($c) { + case '!': + return "%21"; + case "\"": + return "%22"; + case "#": + return "%23"; + case "$": + return "%24"; + case "%": + return "%25"; + case "&": + return "%26"; + case "'": + return "%27"; + case "(": + return "%28"; + case ")": + return "%29"; + case "*": + return "%2a"; + case "+": + return "%2b"; + case ",": + return "%2c"; + case "/": + return "%2f"; + case ":": + return "%3a"; + case ";": + return "%3b"; + case "<": + return "%3c"; + case "=": + return "%3d"; + case ">": + return "%3e"; + case "?": + return "%3f"; + case "@": + return "%40"; + case "[": + return "%5b"; + case "\\": + return "%5c"; + case "]": + return "%5d"; + case "^": + return "%5e"; + case "`": + return "%60"; + case "{": + return "%7b"; + case "|": + return "%7c"; + case "}": + return "%7d"; + case "~": + return "%7e"; + default: + return $c; } - if ($c == "\"") { - return "%22"; - } - if ($c == "#") { - return "%23"; - } - if ($c == "$") { - return "%24"; - } - if ($c == "%") { - return "%25"; - } - if ($c == "&") { - return "%26"; - } - if ($c == "'") { - return "%27"; - } - if ($c == "(") { - return "%28"; - } - if ($c == ")") { - return "%29"; - } - if ($c == "*") { - return "%2a"; - } - if ($c == "+") { - return "%2b"; - } - if ($c == ",") { - return "%2c"; - } - // bound without encoding. - if ($c == "-") { - return $c; - } - // bound without encoding. - if ($c == ".") { - return $c; - } - if ($c == "/") { - return "%2f"; - } - if ($c == ":") { - return "%3a"; - } - if ($c == ";") { - return "%3b"; - } - if ($c == "<") { - return "%3c"; - } - if ($c == "=") { - return "%3d"; - } - if ($c == ">") { - return "%3e"; - } - if ($c == "?") { - return "%3f"; - } - if ($c == "@") { - return "%40"; - } - if ($c == "[") { - return "%5b"; - } - if ($c == "\\") { - return "%5c"; - } - if ($c == "]") { - return "%5d"; - } - if ($c == "^") { - return "%5e"; - } - if ($c == "`") { - return "%60"; - } - if ($c == "{") { - return "%7b"; - } - if ($c == "|") { - return "%7c"; - } - if ($c == "}") { - return "%7d"; - } - if ($c == "~") { - return "%7d"; - } - // Shouldn't reach here, return original character - return $c; } /** - * Packs the values of the five arguments into the single - * edition component. If all the values are blank, the + * Packs the values of the five arguments into the single + * edition component. + * If all the values are blank, the * function returns a blank. - * @param $ed edition string - * @param $sw_ed software edition string - * @param $t_sw target software string - * @param $t_hw target hardware string - * @param $oth other edition information string - * @return the packed string, or blank + * + * @param string $ed edition + * string + * @param string $sw_ed software + * edition string + * @param string $t_sw target + * software string + * @param string $t_hw target + * hardware string + * @param string $oth other + * edition information string + * @return string the packed string, or blank */ - private function pack($ed, $sw_ed, $t_sw, $t_hw, $oth) { - if ($sw_ed == "" && $t_sw == "" && $t_hw == "" && $oth == "") { + private function pack($ed, $sw_ed, $t_sw, $t_hw, $oth) + { + if ($sw_ed == "" && $t_sw == "" && $t_hw == "" && $oth == "") { // All the extended attributes are blank, so don't do // any packing, just return ed. return $ed; @@ -326,13 +342,16 @@ class CPENameBinder { /** * Removes trailing colons from the URI. - * @param $s the string to be trimmed - * @return the trimmed string + * + * @param string $s the + * string to be trimmed + * @return string the trimmed string */ - private function trim($s) { + private function trim($s) + { $s1 = strrev($s); $idx = 0; - for ($i = 0; $i != strlen($s1); $i++) { + for ($i = 0; $i != strlen($s1); $i ++) { if (substr($s1, $i, 1) == ":") { $idx = $idx + 1; } else { @@ -341,30 +360,30 @@ class CPENameBinder { } // Return the substring after all trailing colons, // reversed back to its original character order. - return strrev(substr($s1, $idx, strlen($s1)-$idx)); + return strrev(substr($s1, $idx, strlen($s1) - $idx)); } /* * Static method to demonstrate this class. */ - public static function test() { + public static function test() + { // A few examples. - echo "Testing CPENamingBind...
\n"; - $wfn = new WellFormedName("a", "microsoft", "internet_explorer", "8\\.0\\.6001", - "beta", new LogicalValue("ANY"), "sp2", null, null, null, null); - $wfn2 = new WellFormedName(); - - $wfn2->set("part", "a"); - $wfn2->set("vendor", "foo\\\$bar"); - $wfn2->set("product", "insight"); - $wfn2->set("version", "7\\.4\\.0\\.1570"); - $wfn2->set("target_sw", "win2003"); - $wfn2->set("update", new LogicalValue("NA")); - $wfn2->set("sw_edition", "online"); - $wfn2->set("target_hw", "x64"); - $cpenb = new CPENameBinder(); - - echo $cpenb->bindToURI($wfn) . "
\n"; - echo $cpenb->bindToFS($wfn2) . "
\n"; + echo "Testing CPENamingBind...
\n"; + $wfn = new WellFormedName("a", "microsoft", "internet_explorer", "8\\.0\\.6001", "beta", new LogicalValue("ANY"), "sp2", null, null, null, null); + $wfn2 = new WellFormedName(); + + $wfn2->set("part", "a"); + $wfn2->set("vendor", "foo\\\$bar"); + $wfn2->set("product", "insight"); + $wfn2->set("version", "7\\.4\\.0\\.1570"); + $wfn2->set("target_sw", "win2003"); + $wfn2->set("update", new LogicalValue("NA")); + $wfn2->set("sw_edition", "online"); + $wfn2->set("target_hw", "x64"); + $cpenb = new CPENameBinder(); + + echo $cpenb->bindToURI($wfn) . "
\n"; + echo $cpenb->bindToFS($wfn2) . "
\n"; } } \ No newline at end of file diff --git a/inc/vendor/pacificsec/cpe/src/Naming/CPENameUnbinder.php b/inc/vendor/pacificsec/cpe/src/Naming/CPENameUnbinder.php new file mode 100644 index 0000000..14c3cb4 --- /dev/null +++ b/inc/vendor/pacificsec/cpe/src/Naming/CPENameUnbinder.php @@ -0,0 +1,466 @@ +. + * + * @see cpe.mitre.org for more information. + * @author Antonio Franco + * @email antonio.franco@pacificsec.com + */ +class CPENameUnbinder { + + /** + * Top level function used to unbind a URI to a WFN. + * @param $uri string representing the URI to be unbound. + * @return WellFormedName representing the unbound URI. + * @throws Exception representing parsing errors. + */ + public function unbindURI($uri) { + // Validate the URI + Utilities::validateURI($uri); + // Initialize the empty WFN. + $result = new WellFormedName(); + + for ($i = 0; $i != 8; $i++) { + // get the i'th component of uri + $v = $this->getCompURI($uri, $i); + switch ($i) { + case 1: + $result->set("part", $this->decode($v)); + break; + case 2: + $result->set("vendor", $this->decode($v)); + break; + case 3: + $result->set("product", $this->decode($v)); + break; + case 4: + $result->set("version", $this->decode($v)); + break; + case 5: + $result->set("update", $this->decode($v)); + break; + case 6: + // Special handling for edition component. + // Unpack edition if needed. + if ($v == "" || $v == "-" + || substr($v, 0, 1) != "~") { + // Just a logical value or a non-packed value. + // So unbind to legacy edition, leaving other + // extended attributes unspecified. + $result->set("edition", $this->decode($v)); + } else { + // We have five values packed together here. + $this->unpack($v, $result); + } + break; + case 7: + $result->set("language", $this->decode($v)); + break; + } + } + return $result; + } + + /** + * Top level function to unbind a formatted string to WFN. + * @param string $fs Formatted string to unbind + * @return WellFormedName + * @throws Exception representing parsing error + */ + public function unbindFS($fs) { + // Validate the formatted string + Utilities::validateFS($fs); + // Initialize empty WFN + $result = new WellFormedName(); + // The cpe scheme is the 0th component, the cpe version is the 1st. + // So we start parsing at the 2nd component. + for ($a = 2; $a != 13; $a++) { + // Get the a'th string field. + $v = $this->getCompFS($fs, $a); + // Unbind the string. + $v = $this->unbindValueFS($v); + // Set the value of the corresponding attribute. + switch ($a) { + case 2: + $result->set("part", $v); + break; + case 3: + $result->set("vendor", $v); + break; + case 4: + $result->set("product", $v); + break; + case 5: + $result->set("version", $v); + break; + case 6: + $result->set("update", $v); + break; + case 7: + $result->set("edition", $v); + break; + case 8: + $result->set("language", $v); + break; + case 9: + $result->set("sw_edition", $v); + break; + case 10: + $result->set("target_sw", $v); + break; + case 11: + $result->set("target_hw", $v); + break; + case 12: + $result->set("other", $v); + break; + } + } + return $result; + } + + /** + * Returns the i'th field of the formatted string. The colon is the field + * delimiter unless prefixed by a backslash. + * @param string $fs formatted string to retrieve from + * @param int $i index of field to retrieve from fs. + * @return int value of index of formatted string + */ + private function getCompFS($fs, $i) { + if ($i == 0) { + // return the substring from index 0 to the first occurence of an + // unescaped colon + $colon_idx = Utilities::getUnescapedColonIndex($fs); + // If no colon is found, we are at the end of the formatted string, + // so just return what's left. + if ($colon_idx == 0) { + return $fs; + } + return substr($fs, 0, $colon_idx); + } else { + $substrStart = Utilities::getUnescapedColonIndex($fs) + 1; + $substrLength = strlen($fs) - $substrStart; + return $this->getCompFS(substr($fs, $substrStart, $substrLength), $i - 1); + } + } + + /** + * Takes a string value and returns the appropriate logical value if string + * is the bound form of a logical value. If string is some general value + * string, add quoting of non-alphanumerics as needed. + * @param string $s value to be unbound + * @return string logical value or quoted string + * @throws Exception representing parsing errors + */ + private function unbindValueFS($s) { + if ($s == "*") { + return new LogicalValue("ANY"); + } + if ($s == "-") { + return new LogicalValue("NA"); + } + return $this->addQuoting($s); + } + + /** + * Inspect each character in a string, copying quoted characters, with + * their escaping, into the result. Look for unquoted non alphanumerics + * and if not "*" or "?", add escaping. + * @param $s + * @return + * @throws Exception representing parsing errors. + */ + private function addQuoting($s) { + $result = ""; + $idx = 0; + $embedded = false; + while ($idx < strlen($s)) { + $c = substr($s, $idx, 1); + if (Utilities::isAlphanum($c)) { + // Alphanumeric characters pass untouched. + $result .= $c; + $idx = $idx + 1; + $embedded = true; + continue; + } + if ($c == "\\") { + // Anything quoted in the bound string stays quoted in the + // unbound string. + $result .= substr($s, $idx, 2); + $idx = $idx + 2; + $embedded = true; + continue; + } + if ($c == "*") { + // An unquoted asterisk must appear at the beginning or the end + // of the string. + if ($idx == 0 || $idx == strlen($s) - 1) { + $result .= $c; + $idx = $idx + 1; + $embedded = true; + continue; + } else { + throw new Exception("Error! cannot have unquoted * embedded in formatted string.", 0); + } + } + if ($c == "?") { + // An unquoted question mark must appear at the beginning or + // end of the string, or in a leading or trailing sequence. + if ( // ? legal at beginning or end + (($idx == 0) || ($idx == (strlen($s) - 1))) + // embedded is false, so must be preceded by ? + || (!$embedded && (substr($s, $idx - 1, 1) == "?")) + // embedded is true, so must be followed by ? + || ($embedded && (substr($s, $idx + 1, 1) == "?"))) { + $result .= $c; + $idx = $idx + 1; + $embedded = false; + continue; + } else { + throw new Exception("Error! cannot have unquoted ? embedded in formatted string.", 0); + } + } + // All other characters must be quoted. + $result .= "\\" . $c; + $idx = $idx + 1; + $embedded = true; + } + return $result; + } + + /** + * Return the i'th component of the URI. + * @param $uri string representation of URI to retrieve components from. + * @param int $i Index of component to return. + * @return mixed If i = 0, returns the URI scheme. Otherwise, returns the i'th + * component of uri. + */ + private function getCompURI($uri, $i) { + if ($i == 0) { + return substr($uri, $i, strpos($uri, "/")); + } + $sa = explode(":", $uri); + // If requested component exceeds the number + // of components in URI, return blank + if ($i >= sizeof($sa)) { + return ""; + } + if ($i === 1) { + return substr($sa[$i], 1, strlen($sa[$i])-1); + } + return $sa[$i]; + } + + /** + * Scans a string and returns a copy with all percent-encoded characters + * decoded. This function is the inverse of pctEncode() defined in the + * CPENameBinder class. Only legal percent-encoded forms are decoded. + * Others raise a ParseException. + * @param $s string to be decoded + * @return string decoded string + * @throws Exception representing parsing errors + * @see CPENameBinder#pctEncode + */ + private function decode($s) { + if ($s == "") { + return new LogicalValue("ANY"); + } + if ($s == "-") { + return new LogicalValue("NA"); + } + // Start the scanning loop. + // Normalize: convert all uppercase letters to lowercase first. + $s = strtolower($s); + $result = ""; + $idx = 0; + $embedded = false; + while ($idx < strlen($s)) { + // Get the idx'th character of s. + $c = substr($s, $idx, 1); + // Deal with dot, hyphen, and tilde: decode with quoting. + if ($c == "." || $c == "-" || $c == "~") { + $result .= "\\" . $c; + $idx = $idx + 1; + // a non-%01 encountered. + $embedded = true; + continue; + } + if ($c != "%") { + $result .= $c; + $idx = $idx + 1; + // a non-%01 encountered. + $embedded = true; + continue; + } + // We get here if we have a substring starting w/ '%'. + $form = substr($s, $idx, 3); + if ($form == "%01") { + if (($idx == 0) + || ($idx == strlen($s) - 3) + || (!$embedded && substr($s, $idx - 3, 2) == "%01") + || ($embedded && (strlen($s) >= $idx + 6)) + && (substr($s, $idx + 3, 3) == "%01")) { + $result .= "?"; + $idx = $idx + 3; + continue; + } else { + throw new Exception("Error decoding string", 0); + } + } else if ($form == "%02") { + if (($idx == 0) || ($idx == (strlen($s) - 3))) { + $result .= "*"; + } else { + throw new Exception("Error decoding string", 0); + } + } else if ($form == "%21") { + $result .= "\\!"; + } else if ($form == "%22") { + $result .= "\\\""; + } else if ($form == "%23") { + $result .= "\\#"; + } else if ($form == "%24") { + $result .= "\\$"; + } else if ($form == "%25") { + $result .= "\\%"; + } else if ($form == "%26") { + $result .= "\\&"; + } else if ($form == "%27") { + $result .= "\\'"; + } else if ($form == "%28") { + $result .= "\\("; + } else if ($form == "%29") { + $result .= "\\)"; + } else if ($form == "%2a") { + $result .= "\\*"; + } else if ($form == "%2b") { + $result .= "\\+"; + } else if ($form == "%2c") { + $result .= "\\,"; + } else if ($form == "%2f") { + $result .= "\\/"; + } else if ($form == "%3a") { + $result .= "\\:"; + } else if ($form == "%3b") { + $result .= "\\;"; + } else if ($form == "%3c") { + $result .= "\\<"; + } else if ($form == "%3d") { + $result .= "\\="; + } else if ($form == "%3e") { + $result .= "\\>"; + } else if ($form == "%3f") { + $result .= "\\?"; + } else if ($form == "%40") { + $result .= "\\@"; + } else if ($form == "%5b") { + $result .= "\\["; + } else if ($form == "%5c") { + $result .= "\\\\"; + } else if ($form == "%5d") { + $result .= "\\]"; + } else if ($form == "%5e") { + $result .= "\\^"; + } else if ($form == "%60") { + $result .= "\\`"; + } else if ($form == "%7b") { + $result .= "\\{"; + } else if ($form == "%7c") { + $result .= "\\|"; + } else if ($form == "%7d") { + $result .= "\\}"; + } else if ($form == "%7e") { + $result .= "\\~"; + } else { + throw new Exception("Unknown form: " . $form, 0); + } + $idx = $idx + 3; + $embedded = true; + } + return $result; + } + + /** + * Unpacks the elements in s and sets the attributes in the given + * WellFormedName accordingly. + * @param string $s packed string + * @param $wfn WellFormedName + * @return WellFormedName The augmented WellFormedName. + */ + private function unpack($s, WellFormedName $wfn) { + // Parse out the five elements. + $start = 1; + $ed = ""; $sw_edition = ""; $t_sw = ""; $t_hw = ""; $oth = ""; + $end = strpos($s, "~", $start); + if ($start == $end) { + $ed = ""; + } else { + $ed = substr($s, $start, $end-$start); + } + $start = $end + 1; + $end = strpos($s, "~", $start); + if ($start == $end) { + $sw_edition = ""; + } else { + $sw_edition = substr($s, $start, $end-$start); + } + $start = $end + 1; + $end = strpos($s, "~", $start); + if ($start == $end) { + $t_sw = ""; + } else { + $t_sw = substr($s, $start, $end-$start); + } + $start = $end + 1; + $end = strpos($s, "~", $start); + if ($start == $end) { + $t_hw = ""; + } else { + $t_hw = substr($s, $start, $end-$start); + } + $start = $end + 1; + if ($start >= strlen($s)) { + $oth = ""; + } else { + $oth = substr($s, $start, strlen($s) - 1 - $start); + } + // Set each component in the WFN. + try { + $wfn->set("edition", $this->decode($ed)); + $wfn->set("sw_edition", $this->decode($sw_edition)); + $wfn->set("target_sw", $this->decode($t_sw)); + $wfn->set("target_hw", $this->decode($t_hw)); + $wfn->set("other", $this->decode($oth)); + } catch (Exception $e) { + echo $e->getMessage() . "\n"; + } + return $wfn; + } + + /* + * Static method to demonstrate this class. + */ + public static function test() { + // A few examples. + echo "Testing CPENamingUnbind...
\n"; + $cpenu = new CPENameUnbinder(); + $wfn = $cpenu->unbindURI("cpe:/a:microsoft:internet_explorer%01%01%01%01:?:beta"); + echo $wfn . "
\n"; + $wfn = $cpenu->unbindURI("cpe:/a:microsoft:internet_explorer:8.%2a:sp%3f"); + echo $wfn . "
\n"; + $wfn = $cpenu->unbindURI("cpe:/a:microsoft:internet_explorer:8.%02:sp%01"); + echo $wfn . "
\n"; + $wfn = $cpenu->unbindURI("cpe:/a:hp:insight_diagnostics:7.4.0.1570::~~online~win2003~x64~"); + echo $wfn . "
\n"; + echo $cpenu->unbindFS("cpe:2.3:a:micr\\?osoft:internet_explorer:8.0.6001:beta:*:*:*:*:*:*") . "
\n"; + } +} \ No newline at end of file diff --git a/inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Common/LogicalValue.php b/inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Common/LogicalValue.php deleted file mode 100644 index 43529bd..0000000 --- a/inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Common/LogicalValue.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * @see cpe.mitre.org for more information. - * @author Antonio Franco - * @email antonio.franco@pacificsec.com - */ -class LogicalValue { - - private $any = false; - private $na = false; - - // Object must be constructed with the string "ANY" or "NA". - public function __construct($type) { - if ($type == "ANY") { - $this->any = true; - } else if ($type == "NA") { - $this->na = true; - } else { - throw new Exception("LogicalValue must be ANY or NA"); - } - } - - public function isANY(){ - return $this->any; - } - - public function isNA(){ - return $this->na; - } - - public function __toString(){ - if ($this->any){ - return "ANY"; - } - return "NA"; - } -} \ No newline at end of file diff --git a/inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Common/Utilities.php b/inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Common/Utilities.php deleted file mode 100644 index d93c55a..0000000 --- a/inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Common/Utilities.php +++ /dev/null @@ -1,167 +0,0 @@ -. - * - * @see cpe.mitre.org for more information. - * @author Antonio Franco - * @email antonio.franco@pacificsec.com - */ -class Utilities { - - /** - * Searches string for special characters * and ? - * @param $string to be searched - * @return true if string contains wildcard, false otherwise - */ - public static function containsWildcards($string) { - if (strpos($string, "*") !== false || strpos($string, "?") !== false) { - if (!(strpos($string, "\\") !== false)) { - return true; - } - return false; - } - return false; - } - - /** - * Checks if given number is even or not - * @param $num number to check - * @return true if number is even, false if not - */ - public static function isEvenNumber($num) { - return (is_int($num) && $num % 2 == 0); - } - - /** - * Counts the number of escape characters in the string beginning and ending - * at the given indices - * @param $str string to search - * @param $start beginning index - * @param $end ending index - * @return number of escape characters in string - * @todo fix the use of $str. The Java version is also not using this variable. - */ - public static function countEscapeCharacters($str, $start, $end) { - $result = 0; - $active = false; - $i = 0; - while ($i < $end) { - if ($active && ($i >= $start)) { - $result = $result + 1; - } - $i = $i + 1; - } - return $result; - } - - /** - * Searches a string for the first unescaped colon and returns the index of - * that colon - * @param $str string to search - * @return index of first unescaped colon, or 0 if not found - */ - public static function getUnescapedColonIndex($str) { - $found = false; - $colon_idx = 0; - $start_idx = 0; - // Find the first non-escaped colon. - while (!$found) { - $colon_idx = strpos($str, ":", $start_idx + 1); - // If no colon is found, return 0. - if ($colon_idx === false) { - return 0; - } - // Peek at character before colon. - if (substr($str, $colon_idx-1, 1) == "\\") { - // If colon is escaped, keep looking. - $start_idx = $colon_idx; - } else { - $found = true; - } - } - return $colon_idx; - } - - /** - * Returns true if the string contains only - * alphanumeric characters or the underscore character, - * false otherwise. - * @param $c the string in question - * @return true if $c is alphanumeric or underscore, false if not - */ - public static function isAlphanum($c) { - return (preg_match("/^[a-zA-Z0-9]$/", $c) || $c == "_"); - } - - /** - * This function is not part of the reference implementation pseudo code - * found in the CPE 2.3 specification. It enforces two rules in the - * specification: - * URI must start with the characters "cpe:/" - * A URI may not contain more than 7 components - * If either rule is violated, a Exception is thrown. - * @param $in string with URI to be validated - */ - public static function validateURI($in) { - // make sure uri starts with cpe:/ - if (strpos(strtolower($in), "cpe:/") !== 0) { - throw new Exception("Error: URI must start with 'cpe:/'. Given: " . $in, 0); - } - // make sure uri doesn't contain more than 7 colons - $count = sizeof(explode(":", $in)); - if ($count > 8) { - throw new Exception("Error parsing URI. Found " . ($count - 8) . " extra components in: " . $in, 0); - } - } - - /** - * This function is not part of the reference implementation pseudo code - * found in the CPE 2.3 specification. It enforces three rules found in the - * specification: - * Formatted string must start with the characters "cpe:2.3:" - * A formatted string must contain 11 components - * A formatted string must not contain empty components - * If any rule is violated, a ParseException is thrown. - * @param $in string with FS to be validated - */ - public static function validateFS($in) { - if (strpos(strtolower($in), "cpe:2.3:") !== 0) { - throw new Exception("Error: Formatted String must start with \"cpe:2.3\". Given: " . $in, 0); - } - - $count = 0; - for ($i = 0; $i != strlen($in); $i++){ - if (substr($in, $i, 1) == ":"){ - if (substr($in, $i - 1, 1) != "\\"){ - $count++; - } - if (($i+1) < strlen($in) && substr($in, $i+1, 1) == ":"){ - throw new Exception("Error parsing formatted string. Found empty component", 0); - } - } - } - if ($count > 12){ - $extra = $count - 12; - $s = "Error parsing formatted string. Found " . $extra . " extra component"; - if ($extra > 1){ - $s = $s . "s"; - } - $s = $s . " in: " . $in; - throw new Exception($s, 0); - } - if ($count < 12){ - $missing = 12 - $count; - $s = "Error parsing formatted string. Missing " . $missing . " component"; - if ($missing > 1){ - $s = $s . "s"; - } - throw new Exception($s, 0); - } - } -} \ No newline at end of file diff --git a/inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Common/WellFormedName.php b/inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Common/WellFormedName.php deleted file mode 100644 index 6542532..0000000 --- a/inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Common/WellFormedName.php +++ /dev/null @@ -1,210 +0,0 @@ -. - * - * @see cpe.mitre.org for details. - * @author Antonio Franco - * @email antonio.franco@pacificsec.com - */ -class WellFormedName { - - // Underlying wfn representation. - private $wfn = null; - // All permissible WFN attributes as defined by specification. - const ATTRIBUTES = array("part", "vendor", "product", "version", - "update", "edition", "language", "sw_edition", "target_sw", - "target_hw", "other"); - - /** - * Constructs a new WellFormedName object, setting each component to the - * given parameter value. If a parameter is null, the component is set to - * the default value "ANY". - * @param $part string representing the part component - * @param $vendor string representing the vendor component - * @param $product string representing the product component - * @param $version string representing the version component - * @param $update string representing the update component - * @param $edition string representing the edition component - * @param $language string representing the language component - * @param $sw_edition string representing the sw_edition component - * @param $target_sw string representing the target_sw component - * @param $target_hw string representing the target_hw component - * @param $other string representing the other component - */ - public function __construct($part = null, $vendor = null, $product = null, $version = null, - $update = null, $edition = null, $language = null, $sw_edition = null, $target_sw = null, - $target_hw = null, $other = null) { - - $this->wfn = array(); - - // Constructs a new WellFormedName object, with all components set to the default value "ANY". - if ($part === null && $vendor === null && $product === null && $version === null && - $update === null && $edition === null && $language === null && $sw_edition === null && $target_sw === null && - $target_hw === null && $other === null){ - foreach (WellFormedName::ATTRIBUTES as $a){ - if ($a != "part"){ - $this->set($a, new LogicalValue("ANY")); - } - } - return; - } - - $this->set("part", $part); - $this->set("vendor", $vendor); - $this->set("product", $product); - $this->set("version", $version); - $this->set("update", $update); - $this->set("edition", $edition); - $this->set("language", $language); - $this->set("sw_edition", $sw_edition); - $this->set("target_sw", $target_sw); - $this->set("target_hw", $target_hw); - $this->set("other", $other); - } - - /** - * @param $attribute string representing the component value to get - * @return the string value of the given component, or default value "ANY" - * if the component does not exist - */ - public function get($attribute){ - if (array_key_exists($attribute, $this->wfn)) - return $this->wfn[$attribute]; - else - return new LogicalValue("ANY"); - } - - /** - * Sets the given attribute to value, if the attribute is in the list of - * permissible components - * @param $attribute string representing the component to set - * @param $value object or string representing the value of the given component - */ - public final function set($attribute, $value){ - // Iterate over permissible attributes. - foreach (WellFormedName::ATTRIBUTES as $a){ - // If the argument is a valid attribute, set that attribute's value. - if ($attribute == $a) { - // check to see if we're setting a LogicalValue ANY or NA - if ($value instanceof LogicalValue){ - // don't allow logical values in part component - if ($attribute == "part"){ - var_dump($value); echo "
\n"; - var_dump($a); echo "
\n"; - var_dump($attribute); echo "
\n"; - throw new Exception("Error! part component cannot be a logical value"); - } - // put the Object in the ht and break - $this->wfn[$attribute] = $value; - break; - } - if ($value == null || $value == ""){ - // if value is null or blank, set attribute to default logical ANY - $this->wfn[$attribute] = new LogicalValue("ANY"); - break; - } - $svalue = $value; - // Reg exs - // check for printable characters - no control characters - if (!preg_match("/^[[:print:]]*$/", $svalue)){ - throw new Exception("Error! encountered non printable character in: " . $svalue, 0); - } - // svalue has whitespace - if (preg_match("/^.*\\s+.*$/", $svalue)){ - throw new Exception("Error! component cannot contain whitespace: " . $svalue, 0); - } - // svalue has more than one unquoted star - if (preg_match("/^\\*{2,}.*$/", $svalue) || preg_match("/^.*\\*{2,}$/", $svalue)){ - throw new Exception("Error! component cannot contain more than one * in sequence: " . $svalue, 0); - } - // svalue has unquoted punctuation embedded - if (preg_match("/^.*(?\\@\\[\\]\\^\\`\\{\\|\\}\\~\\-].*$/", $svalue)) { - throw new Exception("Error! component cannot contain unquoted punctuation: " . $svalue, 0); - } - // svalue has an unquoted * - if (preg_match("/^.+(?wfn[$attribute] = $svalue; - break; - } - // remove leading and trailing ?s - $v = $svalue; - while (strpos($v, "?") === 0) { - // remove all leading ?'s - $v = substr($v, 1); - } - $v = strrev($v); - while (strpos($v, "?") === 0) { - // remove all trailing ?'s (string has been reversed) - $v = substr($v, 1); - } - // back to normal - $v = strrev($v); - // after leading and trailing ?s are removed, check if value - // contains unquoted ?s - if (preg_match("/^.+(?wfn[$attribute] = $svalue; - break; - } - } - } - - /** - * - * @return string representation of the WellFormedName - */ - public function __toString() { - $str = "wfn:["; - foreach (WellFormedName::ATTRIBUTES as $attr) { - $str = $str . $attr; - $str = $str . "="; - - $o = $this->wfn[$attr]; - if ($o instanceof LogicalValue) { - $str = $str . $o; - $str = $str . ", "; - } else { - $str = $str . "\""; - $str = $str . $o; - $str = $str . "\", "; - } - } - $str = substr($str, 0, strlen($str)-1); - $str = substr($str, 0, strlen($str)-1); - $str = $str . "]"; - - return $str; - } - -} \ No newline at end of file diff --git a/inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Matching/CPENameMatcher.php b/inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Matching/CPENameMatcher.php deleted file mode 100644 index 029537f..0000000 --- a/inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Matching/CPENameMatcher.php +++ /dev/null @@ -1,287 +0,0 @@ -. - * - * @see cpe.mitre.org for more information. - * @author Antonio Franco - * @email antonio.franco@pacificsec.com - */ -class CPENameMatcher { - - /** - * Tests two Well Formed Names for disjointness. - * @param $source WellFormedName Source WFN - * @param $target WellFormedName Target WFN - * @return true if the names are disjoint, false otherwise - */ - public function isDisjoint(WellFormedName $source, WellFormedName $target) { - // if any pairwise comparison is disjoint, the names are disjoint. - $resultList = $this->compareWFNs($source, $target); - foreach ($resultList as $result){ - if ($result == Relation::DISJOINT) - return true; - } - return false; - } - - /** - * Tests two Well Formed Names for equality. - * @param $source WellFormedName Source WFN - * @param $target WellFormedName Target WFN - * @return true if the names are equal, false otherwise - */ - public function isEqual(WellFormedName $source, WellFormedName $target) { - // if every pairwise comparison is equal, the names are equal. - $resultList = $this->compareWFNs($source, $target); - foreach ($resultList as $result){ - if ($result != Relation::EQUAL){ - return false; - } - } - return true; - } - - /** - * Tests if the target Well Formed Name is a subset of the source Well Formed - * Name. - * @param $source WellFormedName Source WFN - * @param $target WellFormedName Target WFN - * @return true if the target is a subset of the source, false otherwise - */ - public function isSubset(WellFormedName $source, WellFormedName $target) { - // if any comparison is anything other than subset or equal, then target is - // not a subset of source. - $resultList = $this->compareWFNs($source, $target); - foreach ($resultList as $result){ - if ($result != Relation::SUBSET && $result != Relation::EQUAL) { - return false; - } - } - return true; - } - - /** - * Tests if the target Well Formed name is a superset of the source Well Formed - * Name. - * @param $source WellFormedName Source WFN - * @param $target WellFormedName Target WFN - * @return true if the target is a superset of the source, false otherwise - */ - public function isSuperset(WellFormedName $source, WellFormedName $target) { - // if any comparison is anything other than superset or equal, then target is not - // a superset of source. - $resultList = $this->compareWFNs($source, $target); - foreach ($resultList as $result){ - if ($result != Relation::SUPERSET && $result != Relation::EQUAL) { - return false; - } - } - return true; - } - - /** - * Compares each attribute value pair in two Well Formed Names. - * @param $source WellFormedName Source WFN - * @param $target WellFormedName Target WFN - * @return A array mapping attribute string to attribute value Relation - */ - public function compareWFNs(WellFormedName $source, WellFormedName $target) { - $result = array(); - $result["part"] = $this->compare($source->get("part"), $target->get("part")); - $result["vendor"] = $this->compare($source->get("vendor"), $target->get("vendor")); - $result["product"] = $this->compare($source->get("product"), $target->get("product")); - $result["version"] = $this->compare($source->get("version"), $target->get("version")); - $result["update"] = $this->compare($source->get("update"), $target->get("update")); - $result["edition"] = $this->compare($source->get("edition"), $target->get("edition")); - $result["language"] = $this->compare($source->get("language"), $target->get("language")); - $result["sw_edition"] = $this->compare($source->get("sw_edition"), $target->get("sw_edition")); - $result["target_sw"] = $this->compare($source->get("target_sw"), $target->get("target_sw")); - $result["target_hw"] = $this->compare($source->get("target_hw"), $target->get("target_hw")); - $result["other"] = $this->compare($source->get("other"), $target->get("other")); - return $result; - } - - /** - * Compares an attribute value pair. - * @param $source Source attribute value. - * @param $target Target attribute value. - * @return The relation between the two attribute values. - */ - private function compare($source, $target) { - // matching is case insensitive, convert strings to lowercase. - if ($this->isString($source)) { - $source = strtolower($source); - } - if ($this->isString($target)) { - $target = strtolower($target); - } - - // Unquoted wildcard characters yield an undefined result. - if ($this->isString($target) && Utilities::containsWildcards($target)) { - return Relation::UNDEFINED; - } - // If source and target values are equal, then result is equal. - if ($source == $target) { - return Relation::EQUAL; - } - - // Check to see if source or target are Logical Values. - $lvSource = null; - $lvTarget = null; - if ($source instanceof LogicalValue) { - $lvSource = $source; - } - if ($target instanceof LogicalValue) { - $lvTarget = $target; - } - if ($lvSource != null && $lvTarget != null) { - // If Logical Values are equal, result is equal. - if ($lvSource->isANY() == $lvTarget->isANY() || $lvSource->isNA() == $lvTarget->isNA()) { - return Relation::EQUAL; - } - } - // If source value is ANY, result is a superset. - if ($lvSource != null) { - if ($lvSource->isANY()) { - return Relation::SUPERSET; - } - } - // If target value is ANY, result is a subset. - if ($lvTarget != null) { - if ($lvTarget->isANY()) { - return Relation::SUBSET; - } - } - // If source or target is NA, result is disjoint. - if ($lvSource != null) { - if ($lvSource->isNA()) { - return Relation::DISJOINT; - } - } - if ($lvTarget != null) { - if ($lvTarget->isNA()) { - return Relation::DISJOINT; - } - } - // only Strings will get to this point, not LogicalValues - return $this->compareStrings($source, $target); - } - - /** - * Compares a source string to a target string, and addresses the condition - * in which the source string includes unquoted special characters. It - * performs a simple regular expression match, with the assumption that - * (as required) unquoted special characters appear only at the beginning - * and/or the end of the source string. It also properly differentiates - * between unquoted and quoted special characters. - * - * @param $source string Source attribute value. - * @param $target string Target attribute value. - * @return Relation between source and target Strings. - */ - private function compareStrings($source, $target) { - $start = 0; - $end = strlen($source); - $begins = 0; - $ends = 0; - $index = 0; $leftover = 0; $escapes = 0; - - if (substr($source, 0, 1) == "*") { - $start = 1; - $begins = -1; - } else { - while (($start < strlen($source)) && (substr($source, $start, 1) == "?")) { - $start = $start + 1; - $begins = $begins + 1; - } - } - if ((substr($source, $end - 1, 1) == "*") && ($this->isEvenWildcards($source, $end - 1))) { //TODO - $end = $end - 1; - $ends = -1; - } else { - while (($end > 0) && substr($source, $end - 1, 1) == "?" && ($this->isEvenWildcards($source, $end - 1))) { //TODO - $end = $end - 1; - $ends = $ends + 1; - } - } - - $source = substr($source, $start, $end-$start); - $index = -1; - $leftover = strlen($target); - while ($leftover > 0) { - $index = strpos($target, $source, $index + 1); - if ($index === false) { - break; - } - $escapes = Utilities::countEscapeCharacters($target, 0, $index); - if (($index > 0) && ($begins != -1) && ($begins < ($index - $escapes))) { - break; - } - $escapes = Utilities::countEscapeCharacters($target, $index + 1, strlen($target)); - $leftover = strlen($target) - $index - $escapes - strlen($source); - if (($leftover > 0) && (($ends != -1) && ($leftover > $ends))) { - continue; - } - return Relation::SUPERSET; - } - return Relation::DISJOINT; - } - - /** - * Searches a string for the backslash character - * @param $str string to search in - * @param $idx end index - * @return true if the number of backslash characters is even, false if odd - */ - private function isEvenWildcards($str, $idx) { - $result = 0; - while (($idx > 0) && (strpos($str, "\\", $idx - 1)) !== false) { - $idx = $idx - 1; - $result = $result + 1; - } - return Utilities::isEvenNumber($result); - } - - /** - * Tests if an Object is an instance of the String class - * @param $arg the var to test - * @return true if arg is a string, false if not - */ - private function isString($arg) { - is_string($arg); - } - - /* - * Static method to demonstrate this class. - */ - public static function test() { - // Examples. - $wfn = new WellFormedName("a", "microsoft", "internet_explorer", "8\\.0\\.6001", "beta", new LogicalValue("ANY"), "sp2", null, null, null, null); - $wfn2 = new WellFormedName("a", "microsoft", "internet_explorer", new LogicalValue("ANY"), new LogicalValue("ANY"), new LogicalValue("ANY"), new LogicalValue("ANY"), new LogicalValue("ANY"), new LogicalValue("ANY"), new LogicalValue("ANY"), new LogicalValue("ANY")); - $cpenm = new CPENameMatcher(); - $cpenu = new CPENameUnbinder(); - $cpenb = new CPENameBinder(); - $wfn = $cpenu->unbindURI($cpenb->bindToURI($wfn)); - $wfn2 = $cpenu->unbindFS($cpenb->bindToFS($wfn2)); - var_dump($cpenm->isDisjoint($wfn, $wfn2)); // false - var_dump($cpenm->isEqual($wfn, $wfn2)); // false - var_dump($cpenm->isSubset($wfn, $wfn2)); // true, $wfn2 is a subset of wfn - var_dump($cpenm->isSuperset($wfn, $wfn2)); // false - $wfn = $cpenu->unbindFS("cpe:2.3:a:adobe:*:9.*:*:PalmOS:*:*:*:*:*"); - $wfn2 = $cpenu->unbindURI("cpe:/a::Reader:9.3.2:-:-"); - var_dump($cpenm->isDisjoint($wfn, $wfn2)); // true, $wfn2 and wfn are disjoint - var_dump($cpenm->isEqual($wfn, $wfn2)); // false - var_dump($cpenm->isSubset($wfn, $wfn2)); // false - var_dump($cpenm->isSuperset($wfn, $wfn2)); // false - } -} \ No newline at end of file diff --git a/inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Naming/CPENameUnbinder.php b/inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Naming/CPENameUnbinder.php deleted file mode 100644 index 3a1439d..0000000 --- a/inc/vendor/pacificsec/cpe/vendor/PacificSec/CPE/Naming/CPENameUnbinder.php +++ /dev/null @@ -1,466 +0,0 @@ -. - * - * @see cpe.mitre.org for more information. - * @author Antonio Franco - * @email antonio.franco@pacificsec.com - */ -class CPENameUnbinder { - - /** - * Top level function used to unbind a URI to a WFN. - * @param $uri string representing the URI to be unbound. - * @return WellFormedName representing the unbound URI. - * @throws Exception representing parsing errors. - */ - public function unbindURI($uri) { - // Validate the URI - Utilities::validateURI($uri); - // Initialize the empty WFN. - $result = new WellFormedName(); - - for ($i = 0; $i != 8; $i++) { - // get the i'th component of uri - $v = $this->getCompURI($uri, $i); - switch ($i) { - case 1: - $result->set("part", $this->decode($v)); - break; - case 2: - $result->set("vendor", $this->decode($v)); - break; - case 3: - $result->set("product", $this->decode($v)); - break; - case 4: - $result->set("version", $this->decode($v)); - break; - case 5: - $result->set("update", $this->decode($v)); - break; - case 6: - // Special handling for edition component. - // Unpack edition if needed. - if ($v == "" || $v == "-" - || substr($v, 0, 1) != "~") { - // Just a logical value or a non-packed value. - // So unbind to legacy edition, leaving other - // extended attributes unspecified. - $result->set("edition", $this->decode($v)); - } else { - // We have five values packed together here. - $this->unpack($v, $result); - } - break; - case 7: - $result->set("language", $this->decode($v)); - break; - } - } - return $result; - } - - /** - * Top level function to unbind a formatted string to WFN. - * @param $fs Formatted string to unbind - * @return WellFormedName - * @throws Exception representing parsing error - */ - public function unbindFS($fs) { - // Validate the formatted string - Utilities::validateFS($fs); - // Initialize empty WFN - $result = new WellFormedName(); - // The cpe scheme is the 0th component, the cpe version is the 1st. - // So we start parsing at the 2nd component. - for ($a = 2; $a != 13; $a++) { - // Get the a'th string field. - $v = $this->getCompFS($fs, $a); - // Unbind the string. - $v = $this->unbindValueFS($v); - // Set the value of the corresponding attribute. - switch ($a) { - case 2: - $result->set("part", $v); - break; - case 3: - $result->set("vendor", $v); - break; - case 4: - $result->set("product", $v); - break; - case 5: - $result->set("version", $v); - break; - case 6: - $result->set("update", $v); - break; - case 7: - $result->set("edition", $v); - break; - case 8: - $result->set("language", $v); - break; - case 9: - $result->set("sw_edition", $v); - break; - case 10: - $result->set("target_sw", $v); - break; - case 11: - $result->set("target_hw", $v); - break; - case 12: - $result->set("other", $v); - break; - } - } - return $result; - } - - /** - * Returns the i'th field of the formatted string. The colon is the field - * delimiter unless prefixed by a backslash. - * @param $fs formatted string to retrieve from - * @param $i index of field to retrieve from fs. - * @return value of index of formatted string - */ - private function getCompFS($fs, $i) { - if ($i == 0) { - // return the substring from index 0 to the first occurence of an - // unescaped colon - $colon_idx = Utilities::getUnescapedColonIndex($fs); - // If no colon is found, we are at the end of the formatted string, - // so just return what's left. - if ($colon_idx == 0) { - return $fs; - } - return substr($fs, 0, $colon_idx); - } else { - $substrStart = Utilities::getUnescapedColonIndex($fs) + 1; - $substrLength = strlen($fs) - $substrStart; - return $this->getCompFS(substr($fs, $substrStart, $substrLength), $i - 1); - } - } - - /** - * Takes a string value and returns the appropriate logical value if string - * is the bound form of a logical value. If string is some general value - * string, add quoting of non-alphanumerics as needed. - * @param $s value to be unbound - * @return logical value or quoted string - * @throws Exception representing parsing errors - */ - private function unbindValueFS($s) { - if ($s == "*") { - return new LogicalValue("ANY"); - } - if ($s == "-") { - return new LogicalValue("NA"); - } - return $this->addQuoting($s); - } - - /** - * Inspect each character in a string, copying quoted characters, with - * their escaping, into the result. Look for unquoted non alphanumerics - * and if not "*" or "?", add escaping. - * @param $s - * @return - * @throws Exception representing parsing errors. - */ - private function addQuoting($s) { - $result = ""; - $idx = 0; - $embedded = false; - while ($idx < strlen($s)) { - $c = substr($s, $idx, 1); - if (Utilities::isAlphanum($c) || $c == "_") { - // Alphanumeric characters pass untouched. - $result = $result . $c; - $idx = $idx + 1; - $embedded = true; - continue; - } - if ($c == "\\") { - // Anything quoted in the bound string stays quoted in the - // unbound string. - $result = $result . substr($s, $idx, 2); - $idx = $idx + 2; - $embedded = true; - continue; - } - if ($c == "*") { - // An unquoted asterisk must appear at the beginning or the end - // of the string. - if ($idx == 0 || $idx == strlen($s) - 1) { - $result = $result . $c; - $idx = $idx + 1; - $embedded = true; - continue; - } else { - throw new Exception("Error! cannot have unquoted * embedded in formatted string.", 0); - } - } - if ($c == "?") { - // An unquoted question mark must appear at the beginning or - // end of the string, or in a leading or trailing sequence. - if ( // ? legal at beginning or end - (($idx == 0) || ($idx == (strlen($s) - 1))) - // embedded is false, so must be preceded by ? - || (!$embedded && (substr($s, $idx - 1, 1) == "?")) - // embedded is true, so must be followed by ? - || ($embedded && (substr($s, $idx + 1, 1) == "?"))) { - $result = $result . $c; - $idx = $idx + 1; - $embedded = false; - continue; - } else { - throw new Exception("Error! cannot have unquoted ? embedded in formatted string.", 0); - } - } - // All other characters must be quoted. - $result = $result . "\\" . $c; - $idx = $idx + 1; - $embedded = true; - } - return $result; - } - - /** - * Return the i'th component of the URI. - * @param $uri string representation of URI to retrieve components from. - * @param $i Index of component to return. - * @return If i = 0, returns the URI scheme. Otherwise, returns the i'th - * component of uri. - */ - private function getCompURI($uri, $i) { - if ($i == 0) { - return substr($uri, $i, strpos($uri, "/")); - } - $sa = explode(":", $uri); - // If requested component exceeds the number - // of components in URI, return blank - if ($i >= sizeof($sa)) { - return ""; - } - if ($i === 1) { - return substr($sa[$i], 1, strlen($sa[$i])-1); - } - return $sa[$i]; - } - - /** - * Scans a string and returns a copy with all percent-encoded characters - * decoded. This function is the inverse of pctEncode() defined in the - * CPENameBinder class. Only legal percent-encoded forms are decoded. - * Others raise a ParseException. - * @param $s string to be decoded - * @return decoded string - * @throws Exception representing parsing errors - * @see CPENameBinder#pctEncode - */ - private function decode($s) { - if ($s == "") { - return new LogicalValue("ANY"); - } - if ($s == "-") { - return new LogicalValue("NA"); - } - // Start the scanning loop. - // Normalize: convert all uppercase letters to lowercase first. - $s = strtolower($s); - $result = ""; - $idx = 0; - $embedded = false; - while ($idx < strlen($s)) { - // Get the idx'th character of s. - $c = substr($s, $idx, 1); - // Deal with dot, hyphen, and tilde: decode with quoting. - if ($c == "." || $c == "-" || $c == "~") { - $result = $result . "\\" . $c; - $idx = $idx + 1; - // a non-%01 encountered. - $embedded = true; - continue; - } - if ($c != "%") { - $result = $result . $c; - $idx = $idx + 1; - // a non-%01 encountered. - $embedded = true; - continue; - } - // We get here if we have a substring starting w/ '%'. - $form = substr($s, $idx, 3); - if ($form == "%01") { - if (($idx == 0) - || ($idx == strlen($s) - 3) - || (!$embedded && substr($s, $idx - 3, 2) == "%01") - || ($embedded && (strlen($s) >= $idx + 6)) - && (substr($s, $idx + 3, 3) == "%01")) { - $result = $result . "?"; - $idx = $idx + 3; - continue; - } else { - throw new Exception("Error decoding string", 0); - } - } else if ($form == "%02") { - if (($idx == 0) || ($idx == (strlen($s) - 3))) { - $result = $result . "*"; - } else { - throw new Exception("Error decoding string", 0); - } - } else if ($form == "%21") { - $result = $result . "\\!"; - } else if ($form == "%22") { - $result = $result . "\\\""; - } else if ($form == "%23") { - $result = $result . "\\#"; - } else if ($form == "%24") { - $result = $result . "\\$"; - } else if ($form == "%25") { - $result = $result . "\\%"; - } else if ($form == "%26") { - $result = $result . "\\&"; - } else if ($form == "%27") { - $result = $result . "\\'"; - } else if ($form == "%28") { - $result = $result . "\\("; - } else if ($form == "%29") { - $result = $result . "\\)"; - } else if ($form == "%2a") { - $result = $result . "\\*"; - } else if ($form == "%2b") { - $result = $result . "\\+"; - } else if ($form == "%2c") { - $result = $result . "\\,"; - } else if ($form == "%2f") { - $result = $result . "\\/"; - } else if ($form == "%3a") { - $result = $result . "\\))"; - } else if ($form == "%3b") { - $result = $result . "\\;"; - } else if ($form == "%3c") { - $result = $result . "\\<"; - } else if ($form == "%3d") { - $result = $result . "\\="; - } else if ($form == "%3e") { - $result = $result . "\\>"; - } else if ($form == "%3f") { - $result = $result . "\\?"; - } else if ($form == "%40") { - $result = $result . "\\@"; - } else if ($form == "%5b") { - $result = $result . "\\["; - } else if ($form == "%5c") { - $result = $result . "\\\\"; - } else if ($form == "%5d") { - $result = $result . "\\]"; - } else if ($form == "%5e") { - $result = $result . "\\^"; - } else if ($form == "%60") { - $result = $result . "\\`"; - } else if ($form == "%7b") { - $result = $result . "\\{"; - } else if ($form == "%7c") { - $result = $result . "\\|"; - } else if ($form == "%7d") { - $result = $result . "\\}"; - } else if ($form == "%7e") { - $result = $result . "\\~"; - } else { - throw new Exception("Unknown form: " . $form, 0); - } - $idx = $idx + 3; - $embedded = true; - } - return $result; - } - - /** - * Unpacks the elements in s and sets the attributes in the given - * WellFormedName accordingly. - * @param $s packed string - * @param $wfn WellFormedName - * @return The augmented WellFormedName. - */ - private function unpack($s, WellFormedName $wfn) { - // Parse out the five elements. - $start = 1; - $ed = ""; $sw_edition = ""; $t_sw = ""; $t_hw = ""; $oth = ""; - $end = strpos($s, "~", $start); - if ($start == $end) { - $ed = ""; - } else { - $ed = substr($s, $start, $end-$start); - } - $start = $end + 1; - $end = strpos($s, "~", $start); - if ($start == $end) { - $sw_edition = ""; - } else { - $sw_edition = substr($s, $start, $end-$start); - } - $start = $end + 1; - $end = strpos($s, "~", $start); - if ($start == $end) { - $t_sw = ""; - } else { - $t_sw = substr($s, $start, $end-$start); - } - $start = $end + 1; - $end = strpos($s, "~", $start); - if ($start == $end) { - $t_hw = ""; - } else { - $t_hw = substr($s, $start, $end-$start); - } - $start = $end + 1; - if ($start >= strlen($s)) { - $oth = ""; - } else { - $oth = substr($s, $start, strlen($s) - 1 - $start); - } - // Set each component in the WFN. - try { - $wfn->set("edition", $this->decode($ed)); - $wfn->set("sw_edition", $this->decode($sw_edition)); - $wfn->set("target_sw", $this->decode($t_sw)); - $wfn->set("target_hw", $this->decode($t_hw)); - $wfn->set("other", $this->decode($oth)); - } catch (Exception $e) { - echo $e->getMessage() . "\n"; - } - return $wfn; - } - - /* - * Static method to demonstrate this class. - */ - public static function test() { - // A few examples. - echo "Testing CPENamingUnbind...
\n"; - $cpenu = new CPENameUnbinder(); - $wfn = $cpenu->unbindURI("cpe:/a:microsoft:internet_explorer%01%01%01%01:?:beta"); - echo $wfn . "
\n"; - $wfn = $cpenu->unbindURI("cpe:/a:microsoft:internet_explorer:8.%2a:sp%3f"); - echo $wfn . "
\n"; - $wfn = $cpenu->unbindURI("cpe:/a:microsoft:internet_explorer:8.%02:sp%01"); - echo $wfn . "
\n"; - $wfn = $cpenu->unbindURI("cpe:/a:hp:insight_diagnostics:7.4.0.1570::~~online~win2003~x64~"); - echo $wfn . "
\n"; - echo $cpenu->unbindFS("cpe:2.3:a:micr\\?osoft:internet_explorer:8.0.6001:beta:*:*:*:*:*:*") . "
\n"; - } -} \ No newline at end of file diff --git a/inc/vendor/phpoffice/phpspreadsheet/.sami.php b/inc/vendor/phpoffice/phpspreadsheet/.sami.php new file mode 100644 index 0000000..9a2fca3 --- /dev/null +++ b/inc/vendor/phpoffice/phpspreadsheet/.sami.php @@ -0,0 +1,24 @@ +files() + ->name('*.php') + ->in($dir = __DIR__ . '/src'); +$versions = GitVersionCollection::create($dir) + ->addFromTags(function ($version) { + return preg_match('~^\d+\.\d+\.\d+$~', $version); + }) + ->add('master'); + +return new Sami($iterator, [ + 'title' => 'PhpSpreadsheet', + 'versions' => $versions, + 'build_dir' => __DIR__ . '/build/%version%', + 'cache_dir' => __DIR__ . '/cache/%version%', + 'remote_repository' => new GitHubRemoteRepository('PHPOffice/PhpSpreadsheet', dirname($dir)), +]); diff --git a/inc/vendor/phpoffice/phpspreadsheet/.travis.yml b/inc/vendor/phpoffice/phpspreadsheet/.travis.yml index 463f195..3a94e66 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/.travis.yml +++ b/inc/vendor/phpoffice/phpspreadsheet/.travis.yml @@ -10,6 +10,7 @@ php: cache: directories: + - cache - vendor - $HOME/.composer/cache @@ -28,7 +29,7 @@ jobs: php: 7.1 script: - ./vendor/bin/php-cs-fixer fix --diff --verbose --dry-run - - ./vendor/bin/phpcs --report-width=200 --report-summary --report-full samples/ src/ tests/ --ignore=samples/Header.php --standard=PSR2 -n + - ./vendor/bin/phpcs --report-width=200 samples/ src/ tests/ --ignore=samples/Header.php --standard=PSR2 -n - stage: Coverage php: 7.1 @@ -38,3 +39,21 @@ jobs: after_script: - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover tests/coverage-clover.xml + + - stage: API documentation + php: 7.1 + before_script: + - curl -O http://get.sensiolabs.org/sami.phar + script: + - git fetch origin master:master + - git fetch origin --tags + - php sami.phar update .sami.php + - echo '

If you are not automatically redirected, please go to the latest stable API documentation.

' > build/index.html + deploy: + provider: pages + skip-cleanup: true + local-dir: build + github-token: $GITHUB_TOKEN + on: + all_branches: true + condition: $TRAVIS_BRANCH =~ ^master|develop$ diff --git a/inc/vendor/phpoffice/phpspreadsheet/CHANGELOG.md b/inc/vendor/phpoffice/phpspreadsheet/CHANGELOG.md index e2a9bfa..42e6fc2 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/CHANGELOG.md +++ b/inc/vendor/phpoffice/phpspreadsheet/CHANGELOG.md @@ -5,6 +5,95 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [1.4.0] - 2018-08-06 + +### Added + +- Add excel function EXACT(value1, value2) support - [#595](https://github.com/PHPOffice/PhpSpreadsheet/pull/595) +- Support workbook view attributes for Xlsx format - [#523](https://github.com/PHPOffice/PhpSpreadsheet/issues/523) +- Read and write hyperlink for drawing image - [#490](https://github.com/PHPOffice/PhpSpreadsheet/pull/490) +- Added calculation engine support for the new bitwise functions that were added in MS Excel 2013 + - BITAND() Returns a Bitwise 'And' of two numbers + - BITOR() Returns a Bitwise 'Or' of two number + - BITXOR() Returns a Bitwise 'Exclusive Or' of two numbers + - BITLSHIFT() Returns a number shifted left by a specified number of bits + - BITRSHIFT() Returns a number shifted right by a specified number of bits +- Added calculation engine support for other new functions that were added in MS Excel 2013 and MS Excel 2016 + - Text Functions + - CONCAT() Synonym for CONCATENATE() + - NUMBERVALUE() Converts text to a number, in a locale-independent way + - UNICHAR() Synonym for CHAR() in PHPSpreadsheet, which has always used UTF-8 internally + - UNIORD() Synonym for ORD() in PHPSpreadsheet, which has always used UTF-8 internally + - TEXTJOIN() Joins together two or more text strings, separated by a delimiter + - Logical Functions + - XOR() Returns a logical Exclusive Or of all arguments + - Date/Time Functions + - ISOWEEKNUM() Returns the ISO 8601 week number of the year for a given date + - Lookup and Reference Functions + - FORMULATEXT() Returns a formula as a string + - Financial Functions + - PDURATION() Calculates the number of periods required for an investment to reach a specified value + - RRI() Calculates the interest rate required for an investment to grow to a specified future value + - Engineering Functions + - ERF.PRECISE() Returns the error function integrated between 0 and a supplied limit + - ERFC.PRECISE() Synonym for ERFC + - Math and Trig Functions + - SEC() Returns the secant of an angle + - SECH() Returns the hyperbolic secant of an angle + - CSC() Returns the cosecant of an angle + - CSCH() Returns the hyperbolic cosecant of an angle + - COT() Returns the cotangent of an angle + - COTH() Returns the hyperbolic cotangent of an angle + - ACOT() Returns the cotangent of an angle + - ACOTH() Returns the hyperbolic cotangent of an angle +- Refactored Complex Engineering Functions to use external complex number library +- Added calculation engine support for the new complex number functions that were added in MS Excel 2013 + - IMCOSH() Returns the hyperbolic cosine of a complex number + - IMCOT() Returns the cotangent of a complex number + - IMCSC() Returns the cosecant of a complex number + - IMCSCH() Returns the hyperbolic cosecant of a complex number + - IMSEC() Returns the secant of a complex number + - IMSECH() Returns the hyperbolic secant of a complex number + - IMSINH() Returns the hyperbolic sine of a complex number + - IMTAN() Returns the tangent of a complex number + +### Fixed + +- Fix ISFORMULA() function to work with a cell reference to another worksheet +- Xlsx reader crashed when reading a file with workbook protection - [#553](https://github.com/PHPOffice/PhpSpreadsheet/pull/553) +- Cell formats with escaped spaces were causing incorrect date formatting - [#557](https://github.com/PHPOffice/PhpSpreadsheet/issues/557) +- Could not open CSV file containing HTML fragment - [#564](https://github.com/PHPOffice/PhpSpreadsheet/issues/564) +- Exclude the vendor folder in migration - [#481](https://github.com/PHPOffice/PhpSpreadsheet/issues/481) +- Chained operations on cell ranges involving borders operated on last cell only [#428](https://github.com/PHPOffice/PhpSpreadsheet/issues/428) +- Avoid memory exhaustion when cloning worksheet with a drawing [#437](https://github.com/PHPOffice/PhpSpreadsheet/issues/437) +- Migration tool keep variables containing $PHPExcel untouched [#598](https://github.com/PHPOffice/PhpSpreadsheet/issues/598) +- Rowspans/colspans were incorrect when adding worksheet using loadIntoExisting [#619](https://github.com/PHPOffice/PhpSpreadsheet/issues/619) + +## [1.3.1] - 2018-06-12 + +### Fixed + +- Ranges across Z and AA columns incorrectly threw an exception - [#545](https://github.com/PHPOffice/PhpSpreadsheet/issues/545) + +## [1.3.0] - 2018-06-10 + +### Added + +- Support to read Xlsm templates with form elements, macros, printer settings, protected elements and back compatibility drawing, and save result without losing important elements of document - [#435](https://github.com/PHPOffice/PhpSpreadsheet/issues/435) +- Expose sheet title maximum length as `Worksheet::SHEET_TITLE_MAXIMUM_LENGTH` - [#482](https://github.com/PHPOffice/PhpSpreadsheet/issues/482) +- Allow escape character to be set in CSV reader – [#492](https://github.com/PHPOffice/PhpSpreadsheet/issues/492) + +### Fixed + +- Subtotal 9 in a group that has other subtotals 9 exclude the totals of the other subtotals in the range - [#332](https://github.com/PHPOffice/PhpSpreadsheet/issues/332) +- `Helper\Html` support UTF-8 HTML input - [#444](https://github.com/PHPOffice/PhpSpreadsheet/issues/444) +- Xlsx loaded an extra empty comment for each real comment - [#375](https://github.com/PHPOffice/PhpSpreadsheet/issues/375) +- Xlsx reader do not read rows and columns filtered out in readFilter at all - [#370](https://github.com/PHPOffice/PhpSpreadsheet/issues/370) +- Make newer Excel versions properly recalculate formulas on document open - [#456](https://github.com/PHPOffice/PhpSpreadsheet/issues/456) +- `Coordinate::extractAllCellReferencesInRange()` throws an exception for an invalid range – [#519](https://github.com/PHPOffice/PhpSpreadsheet/issues/519) +- Fixed parsing of conditionals in COUNTIF functions - [#526](https://github.com/PHPOffice/PhpSpreadsheet/issues/526) +- Corruption errors for saved Xlsx docs with frozen panes - [#532](https://github.com/PHPOffice/PhpSpreadsheet/issues/532) + ## [1.2.1] - 2018-04-10 ### Fixed diff --git a/inc/vendor/phpoffice/phpspreadsheet/README.md b/inc/vendor/phpoffice/phpspreadsheet/README.md index 0a138d7..e63e26e 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/README.md +++ b/inc/vendor/phpoffice/phpspreadsheet/README.md @@ -18,9 +18,7 @@ PhpSpreadsheet is a library written in pure PHP and providing a set of classes t ## Documentation -Read more about it, including install instructions, in the official documentation: - -https://phpspreadsheet.readthedocs.io +Read more about it, including install instructions, in the [official documentation](https://phpspreadsheet.readthedocs.io). Or check out the [API documentation](https://phpoffice.github.io/PhpSpreadsheet/master). Please ask your support questions on [StackOverflow](http://stackoverflow.com/questions/tagged/phpspreadsheet), or have a quick chat on [Gitter](https://gitter.im/PHPOffice/PhpSpreadsheet). diff --git a/inc/vendor/phpoffice/phpspreadsheet/composer.json b/inc/vendor/phpoffice/phpspreadsheet/composer.json index 1c033bb..4a08707 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/composer.json +++ b/inc/vendor/phpoffice/phpspreadsheet/composer.json @@ -25,7 +25,7 @@ "scripts": { "check": [ "php-cs-fixer fix --ansi --dry-run --diff", - "phpcs --report-width=200 --report-summary --report-full samples/ src/ tests/ --ignore=samples/Header.php --standard=PSR2 -n", + "phpcs --report-width=200 samples/ src/ tests/ --ignore=samples/Header.php --standard=PSR2 -n", "phpunit --color=always" ], "fix": [ @@ -46,16 +46,17 @@ "ext-xmlwriter": "*", "ext-zip": "*", "ext-zlib": "*", - "psr/simple-cache": "^1.0" + "psr/simple-cache": "^1.0", + "markbaker/complex": "^1.4.1" }, "require-dev": { "tecnickcom/tcpdf": "^6.2", - "squizlabs/php_codesniffer": "^2.7", "phpunit/phpunit": "^5.7", "dompdf/dompdf": "^0.8.0", "mpdf/mpdf": "^7.0.0", "jpgraph/jpgraph": "^4.0", - "friendsofphp/php-cs-fixer": "@stable" + "friendsofphp/php-cs-fixer": "@stable", + "squizlabs/php_codesniffer": "^3.3" }, "suggest": { "mpdf/mpdf": "Option for rendering PDF with PDF Writer", diff --git a/inc/vendor/phpoffice/phpspreadsheet/composer.lock b/inc/vendor/phpoffice/phpspreadsheet/composer.lock index 2991465..fe9fbc6 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/composer.lock +++ b/inc/vendor/phpoffice/phpspreadsheet/composer.lock @@ -1,11 +1,106 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e61a906bd83393400add286703f10557", + "content-hash": "66067b3ab7afd673a28cf0b31eb9ae20", "packages": [ + { + "name": "markbaker/complex", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/MarkBaker/PHPComplex.git", + "reference": "615f5443473cf37729666e2354fd8dfa2cb48e91" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/615f5443473cf37729666e2354fd8dfa2cb48e91", + "reference": "615f5443473cf37729666e2354fd8dfa2cb48e91", + "shasum": "" + }, + "require": { + "php": "^5.6.0|^7.0.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3", + "phpdocumentor/phpdocumentor": "2.*", + "phploc/phploc": "2.*", + "phpmd/phpmd": "2.*", + "phpunit/phpunit": "^4.8.35|^5.4.0", + "sebastian/phpcpd": "2.*", + "squizlabs/php_codesniffer": "^3.1.1", + "wimg/php-compatibility": "^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Complex\\": "classes/src/" + }, + "files": [ + "classes/src/functions/abs.php", + "classes/src/functions/acos.php", + "classes/src/functions/acosh.php", + "classes/src/functions/acot.php", + "classes/src/functions/acoth.php", + "classes/src/functions/acsc.php", + "classes/src/functions/acsch.php", + "classes/src/functions/argument.php", + "classes/src/functions/asec.php", + "classes/src/functions/asech.php", + "classes/src/functions/asin.php", + "classes/src/functions/asinh.php", + "classes/src/functions/atan.php", + "classes/src/functions/atanh.php", + "classes/src/functions/conjugate.php", + "classes/src/functions/cos.php", + "classes/src/functions/cosh.php", + "classes/src/functions/cot.php", + "classes/src/functions/coth.php", + "classes/src/functions/csc.php", + "classes/src/functions/csch.php", + "classes/src/functions/exp.php", + "classes/src/functions/inverse.php", + "classes/src/functions/ln.php", + "classes/src/functions/log2.php", + "classes/src/functions/log10.php", + "classes/src/functions/negative.php", + "classes/src/functions/pow.php", + "classes/src/functions/rho.php", + "classes/src/functions/sec.php", + "classes/src/functions/sech.php", + "classes/src/functions/sin.php", + "classes/src/functions/sinh.php", + "classes/src/functions/sqrt.php", + "classes/src/functions/tan.php", + "classes/src/functions/tanh.php", + "classes/src/functions/theta.php", + "classes/src/operations/add.php", + "classes/src/operations/subtract.php", + "classes/src/operations/multiply.php", + "classes/src/operations/divideby.php", + "classes/src/operations/divideinto.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Baker", + "email": "mark@lange.demon.co.uk" + } + ], + "description": "PHP Class for working with complex numbers", + "homepage": "https://github.com/MarkBaker/PHPComplex", + "keywords": [ + "complex", + "mathematics" + ], + "time": "2018-07-24T19:47:28+00:00" + }, { "name": "psr/simple-cache", "version": "1.0.0", @@ -2106,64 +2201,37 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "2.8.1", + "version": "3.3.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d" + "reference": "628a481780561150481a9ec74709092b9759b3ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d", - "reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/628a481780561150481a9ec74709092b9759b3ec", + "reference": "628a481780561150481a9ec74709092b9759b3ec", "shasum": "" }, "require": { "ext-simplexml": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", - "php": ">=5.1.2" + "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "bin": [ - "scripts/phpcs", - "scripts/phpcbf" + "bin/phpcs", + "bin/phpcbf" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "2.x-dev" + "dev-master": "3.x-dev" } }, - "autoload": { - "classmap": [ - "CodeSniffer.php", - "CodeSniffer/CLI.php", - "CodeSniffer/Exception.php", - "CodeSniffer/File.php", - "CodeSniffer/Fixer.php", - "CodeSniffer/Report.php", - "CodeSniffer/Reporting.php", - "CodeSniffer/Sniff.php", - "CodeSniffer/Tokens.php", - "CodeSniffer/Reports/", - "CodeSniffer/Tokenizers/", - "CodeSniffer/DocGenerators/", - "CodeSniffer/Standards/AbstractPatternSniff.php", - "CodeSniffer/Standards/AbstractScopeSniff.php", - "CodeSniffer/Standards/AbstractVariableSniff.php", - "CodeSniffer/Standards/IncorrectPatternException.php", - "CodeSniffer/Standards/Generic/Sniffs/", - "CodeSniffer/Standards/MySource/Sniffs/", - "CodeSniffer/Standards/PEAR/Sniffs/", - "CodeSniffer/Standards/PSR1/Sniffs/", - "CodeSniffer/Standards/PSR2/Sniffs/", - "CodeSniffer/Standards/Squiz/Sniffs/", - "CodeSniffer/Standards/Zend/Sniffs/" - ] - }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" @@ -2180,7 +2248,7 @@ "phpcs", "standards" ], - "time": "2017-03-01T22:17:45+00:00" + "time": "2018-07-26T23:47:18+00:00" }, { "name": "symfony/console", diff --git a/inc/vendor/phpoffice/phpspreadsheet/docs/extra/extra.js b/inc/vendor/phpoffice/phpspreadsheet/docs/extra/extra.js deleted file mode 100644 index fdef958..0000000 --- a/inc/vendor/phpoffice/phpspreadsheet/docs/extra/extra.js +++ /dev/null @@ -1,57 +0,0 @@ -var nodemcu = nodemcu || {}; -(function () { - 'use strict'; - - $(document).ready(function () { - fixSearch(); - }); - - /* - * RTD messes up MkDocs' search feature by tinkering with the search box defined in the theme, see - * https://github.com/rtfd/readthedocs.org/issues/1088. This function sets up a DOM4 MutationObserver - * to react to changes to the search form (triggered by RTD on doc ready). It then reverts everything - * the RTD JS code modified. - */ - function fixSearch() { - var target = document.getElementById('rtd-search-form'); - var config = {attributes: true, childList: true}; - - var observer = new MutationObserver(function (mutations) { - // if it isn't disconnected it'll loop infinitely because the observed element is modified - observer.disconnect(); - var form = $('#rtd-search-form'); - form.empty(); - form.attr('action', 'https://' + window.location.hostname + '/en/' + determineSelectedBranch() + '/search.html'); - $('').attr({ - type: "text", - name: "q", - placeholder: "Search docs" - }).appendTo(form); - }); - - if (window.location.origin.indexOf('readthedocs') > -1) { - observer.observe(target, config); - } - } - - /** - * Analyzes the URL of the current page to find out what the selected GitHub branch is. It's usually - * part of the location path. The code needs to distinguish between running MkDocs standalone - * and docs served from RTD. If no valid branch could be determined 'dev' returned. - * - * @returns GitHub branch name - */ - function determineSelectedBranch() { - var branch = 'dev', path = window.location.pathname; - if (window.location.origin.indexOf('readthedocs') > -1) { - // path is like /en///build/ -> extract 'lang' - // split[0] is an '' because the path starts with the separator - var thirdPathSegment = path.split('/')[2]; - // 'latest' is an alias on RTD for the 'dev' branch - which is the default for 'branch' here - if (thirdPathSegment !== 'latest') { - branch = thirdPathSegment; - } - } - return branch; - } -}()); \ No newline at end of file diff --git a/inc/vendor/phpoffice/phpspreadsheet/docs/index.md b/inc/vendor/phpoffice/phpspreadsheet/docs/index.md index 79d884d..08a9199 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/docs/index.md +++ b/inc/vendor/phpoffice/phpspreadsheet/docs/index.md @@ -95,6 +95,8 @@ architecture](./topics/architecture.md), [accessing cells](./topics/accessing-cells.md) and [reading and writing to files](./topics/reading-and-writing-to-file.md). +Or browse the [API documentation](https://phpoffice.github.io/PhpSpreadsheet/master). + # Credits Please refer to the [contributor diff --git a/inc/vendor/phpoffice/phpspreadsheet/docs/references/features-cross-reference.md b/inc/vendor/phpoffice/phpspreadsheet/docs/references/features-cross-reference.md index 2d28cd4..716a378 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/docs/references/features-cross-reference.md +++ b/inc/vendor/phpoffice/phpspreadsheet/docs/references/features-cross-reference.md @@ -750,6 +750,24 @@ + + Drawing hyperlink + + ✔ + + + + + + + ✔ + + + + + $drawing->getHyperlink()->getUrl() + $drawing->setHyperlink()->setUrl($url) + Cell Formatting diff --git a/inc/vendor/phpoffice/phpspreadsheet/docs/references/function-list-by-category.md b/inc/vendor/phpoffice/phpspreadsheet/docs/references/function-list-by-category.md index 5561828..185bf4c 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/docs/references/function-list-by-category.md +++ b/inc/vendor/phpoffice/phpspreadsheet/docs/references/function-list-by-category.md @@ -41,6 +41,7 @@ DAYS360 | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::DAYS360 EDATE | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::EDATE EOMONTH | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::EOMONTH HOUR | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::HOUROFDAY +ISOWEEKNUM | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::ISOWEEKNUM MINUTE | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::MINUTE MONTH | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::MONTHOFYEAR NETWORKDAYS | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::NETWORKDAYS @@ -73,7 +74,9 @@ DEC2HEX | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::DECTOHE DEC2OCT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::DECTOOCT DELTA | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::DELTA ERF | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::ERF +ERF.PRECISE | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::ERFPRECISE ERFC | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::ERFC +ERFC.PRECISE | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::ERFC GESTEP | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::GESTEP HEX2BIN | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::HEXTOBIN HEX2DEC | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::HEXTODEC @@ -83,6 +86,10 @@ IMAGINARY | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMAGINA IMARGUMENT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMARGUMENT IMCONJUGATE | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCONJUGATE IMCOS | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCOS +IMCOSH | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCOSH +IMCOT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCOT +IMCSC | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCSC +IMCSCH | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCSCH IMDIV | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMDIV IMEXP | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMEXP IMLN | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMLN @@ -91,10 +98,14 @@ IMLOG2 | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMLOG2 IMPOWER | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMPOWER IMPRODUCT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMPRODUCT IMREAL | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMREAL +IMSEC | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSEC +IMSECH | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSECH IMSIN | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSIN +IMSINH | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSINH IMSQRT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSQRT IMSUB | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSUB IMSUM | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSUM +IMTAN | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMTAN OCT2BIN | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::OCTTOBIN OCT2DEC | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::OCTTODEC OCT2HEX | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::OCTTOHEX @@ -137,6 +148,7 @@ ODDFPRICE | **Not yet Implemented** ODDFYIELD | **Not yet Implemented** ODDLPRICE | **Not yet Implemented** ODDLYIELD | **Not yet Implemented** +PDURATION | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PDURATION PMT | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PMT PPMT | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PPMT PRICE | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PRICE @@ -145,6 +157,7 @@ PRICEMAT | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PRICEMAT PV | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PV RATE | \PhpOffice\PhpSpreadsheet\Calculation\Financial::RATE RECEIVED | \PhpOffice\PhpSpreadsheet\Calculation\Financial::RECEIVED +RRI | \PhpOffice\PhpSpreadsheet\Calculation\Financial::RRI SLN | \PhpOffice\PhpSpreadsheet\Calculation\Financial::SLN SYD | \PhpOffice\PhpSpreadsheet\Calculation\Financial::SYD TBILLEQ | \PhpOffice\PhpSpreadsheet\Calculation\Financial::TBILLEQ @@ -169,6 +182,7 @@ ISBLANK | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_BLANK ISERR | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_ERR ISERROR | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_ERROR ISEVEN | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_EVEN +ISFORMULA | \PhpOffice\PhpSpreadsheet\Calculation\Functions::ISFORMULA ISLOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_LOGICAL ISNA | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_NA ISNONTEXT | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_NONTEXT @@ -184,13 +198,14 @@ TYPE | \PhpOffice\PhpSpreadsheet\Calculation\Functions::TYPE Excel Function | PhpSpreadsheet Function --------------------|------------------------------------------- -AND | \PhpOffice\PhpSpreadsheet\Calculation\Logical::LOGICAL_AND +AND | \PhpOffice\PhpSpreadsheet\Calculation\Logical::logicalAnd FALSE | \PhpOffice\PhpSpreadsheet\Calculation\Logical::FALSE IF | \PhpOffice\PhpSpreadsheet\Calculation\Logical::STATEMENT_IF IFERROR | \PhpOffice\PhpSpreadsheet\Calculation\Logical::IFERROR NOT | \PhpOffice\PhpSpreadsheet\Calculation\Logical::NOT -OR | \PhpOffice\PhpSpreadsheet\Calculation\Logical::LOGICAL_OR +OR | \PhpOffice\PhpSpreadsheet\Calculation\Logical::logicalOr TRUE | \PhpOffice\PhpSpreadsheet\Calculation\Logical::TRUE +XOR | \PhpOffice\PhpSpreadsheet\Calculation\Logical::logicalXor ## CATEGORY_LOOKUP_AND_REFERENCE @@ -201,8 +216,9 @@ AREAS | **Not yet Implemented** CHOOSE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::CHOOSE COLUMN | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::COLUMN COLUMNS | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::COLUMNS +FORMULATEXT | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::FORMULATEXT GETPIVOTDATA | **Not yet Implemented** -HLOOKUP | **Not yet Implemented** +HLOOKUP | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::HLOOKUP HYPERLINK | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::HYPERLINK INDEX | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::INDEX INDIRECT | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::INDIRECT @@ -222,6 +238,8 @@ Excel Function | PhpSpreadsheet Function ABS | abs ACOS | acos ACOSH | acosh +ACOT | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ACOT +ACOTH | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ACOTH ASIN | asin ASINH | asinh ATAN | atan @@ -231,6 +249,10 @@ CEILING | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::CEILING COMBIN | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::COMBIN COS | cos COSH | cosh +COT | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::COT +COTH | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::COTH +CSC | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::CSC +CSCH | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::CSCH DEGREES | rad2deg EVEN | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::EVEN EXP | exp @@ -261,6 +283,8 @@ ROMAN | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ROMAN ROUND | round ROUNDDOWN | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ROUNDDOWN ROUNDUP | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ROUNDUP +SEC | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SEC +SECH | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SECH SERIESSUM | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SERIESSUM SIGN | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SIGN SIN | sin @@ -270,7 +294,7 @@ SQRTPI | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SQRTPI SUBTOTAL | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUBTOTAL SUM | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUM SUMIF | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMIF -SUMIFS | **Not yet Implemented** +SUMIFS | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMIFS SUMPRODUCT | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMPRODUCT SUMSQ | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMSQ SUMX2MY2 | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMX2MY2 @@ -336,6 +360,7 @@ MIN | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MIN MINA | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MINA MINIF | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MINIF MODE | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MODE +MODE.SNGL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MODE NEGBINOMDIST | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::NEGBINOMDIST NORMDIST | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::NORMDIST NORMINV | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::NORMINV @@ -355,6 +380,8 @@ SLOPE | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::SLOPE SMALL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::SMALL STANDARDIZE | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STANDARDIZE STDEV | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEV +STDEV.S | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEV +STDEV.P | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVP STDEVA | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVA STDEVP | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVP STDEVPA | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVPA @@ -365,6 +392,8 @@ TREND | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::TREND TRIMMEAN | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::TRIMMEAN TTEST | **Not yet Implemented** VAR | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARFunc +VAR.P | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARP +VAR.S | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARFunc VARA | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARA VARP | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARP VARPA | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARPA @@ -380,9 +409,10 @@ BAHTTEXT | **Not yet Implemented** CHAR | \PhpOffice\PhpSpreadsheet\Calculation\TextData::CHARACTER CLEAN | \PhpOffice\PhpSpreadsheet\Calculation\TextData::TRIMNONPRINTABLE CODE | \PhpOffice\PhpSpreadsheet\Calculation\TextData::ASCIICODE +CONCAT | \PhpOffice\PhpSpreadsheet\Calculation\TextData::CONCATENATE CONCATENATE | \PhpOffice\PhpSpreadsheet\Calculation\TextData::CONCATENATE DOLLAR | \PhpOffice\PhpSpreadsheet\Calculation\TextData::DOLLAR -EXACT | **Not yet Implemented** +EXACT | \PhpOffice\PhpSpreadsheet\Calculation\TextData::EXACT FIND | \PhpOffice\PhpSpreadsheet\Calculation\TextData::SEARCHSENSITIVE FINDB | \PhpOffice\PhpSpreadsheet\Calculation\TextData::SEARCHSENSITIVE FIXED | \PhpOffice\PhpSpreadsheet\Calculation\TextData::FIXEDFORMAT @@ -394,6 +424,7 @@ LENB | \PhpOffice\PhpSpreadsheet\Calculation\TextData::STRINGLENG LOWER | \PhpOffice\PhpSpreadsheet\Calculation\TextData::LOWERCASE MID | \PhpOffice\PhpSpreadsheet\Calculation\TextData::MID MIDB | \PhpOffice\PhpSpreadsheet\Calculation\TextData::MID +NUMBERVALUE | \PhpOffice\PhpSpreadsheet\Calculation\TextData::NUMBERVALUE PHONETIC | **Not yet Implemented** PROPER | \PhpOffice\PhpSpreadsheet\Calculation\TextData::PROPERCASE REPLACE | \PhpOffice\PhpSpreadsheet\Calculation\TextData::REPLACE @@ -406,6 +437,9 @@ SEARCHB | \PhpOffice\PhpSpreadsheet\Calculation\TextData::SEARCHINSE SUBSTITUTE | \PhpOffice\PhpSpreadsheet\Calculation\TextData::SUBSTITUTE T | \PhpOffice\PhpSpreadsheet\Calculation\TextData::RETURNSTRING TEXT | \PhpOffice\PhpSpreadsheet\Calculation\TextData::TEXTFORMAT +TEXTJOIN | \PhpOffice\PhpSpreadsheet\Calculation\TextData::TEXTJOIN TRIM | \PhpOffice\PhpSpreadsheet\Calculation\TextData::TRIMSPACES +UNICHAR | \PhpOffice\PhpSpreadsheet\Calculation\TextData::CHARACTER +UNICODE | \PhpOffice\PhpSpreadsheet\Calculation\TextData::ASCIICODE UPPER | \PhpOffice\PhpSpreadsheet\Calculation\TextData::UPPERCASE -VALUE | **Not yet Implemented** +VALUE | \PhpOffice\PhpSpreadsheet\Calculation\TextData::VALUE diff --git a/inc/vendor/phpoffice/phpspreadsheet/docs/references/function-list-by-name.md b/inc/vendor/phpoffice/phpspreadsheet/docs/references/function-list-by-name.md index 8b7ad95..a8caca6 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/docs/references/function-list-by-name.md +++ b/inc/vendor/phpoffice/phpspreadsheet/docs/references/function-list-by-name.md @@ -9,10 +9,12 @@ ACCRINT | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet ACCRINTM | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::ACCRINTM ACOS | CATEGORY_MATH_AND_TRIG | acos ACOSH | CATEGORY_MATH_AND_TRIG | acosh +ACOT | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ACOT +ACOTH | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ACOTH ADDRESS | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::CELL_ADDRESS AMORDEGRC | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::AMORDEGRC AMORLINC | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::AMORLINC -AND | CATEGORY_LOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Logical::LOGICAL_AND +AND | CATEGORY_LOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Logical::logicalAnd AREAS | CATEGORY_LOOKUP_AND_REFERENCE | **Not yet Implemented** ASC | CATEGORY_TEXT_AND_DATA | **Not yet Implemented** ASIN | CATEGORY_MATH_AND_TRIG | asin @@ -59,12 +61,15 @@ COLUMN | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet COLUMNS | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::COLUMNS COMBIN | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::COMBIN COMPLEX | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::COMPLEX +CONCAT | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::CONCATENATE CONCATENATE | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::CONCATENATE CONFIDENCE | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::CONFIDENCE CONVERT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::CONVERTUOM CORREL | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::CORREL COS | CATEGORY_MATH_AND_TRIG | cos COSH | CATEGORY_MATH_AND_TRIG | cosh +COT | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::COT +COTH | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::COTH COUNT | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::COUNT COUNTA | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::COUNTA COUNTBLANK | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::COUNTBLANK @@ -78,6 +83,8 @@ COUPNUM | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet COUPPCD | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::COUPPCD COVAR | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::COVAR CRITBINOM | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::CRITBINOM +CSC | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::CSC +CSCH | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::CSCH CUBEKPIMEMBER | CATEGORY_CUBE | **Not yet Implemented** CUBEMEMBER | CATEGORY_CUBE | **Not yet Implemented** CUBEMEMBERPROPERTY | CATEGORY_CUBE | **Not yet Implemented** @@ -131,10 +138,12 @@ EDATE | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet EFFECT | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::EFFECT EOMONTH | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::EOMONTH ERF | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::ERF +ERF.PRECISE | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::ERFPRECISE ERFC | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::ERFC +ERFC.PRECISE | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::ERFC ERROR.TYPE | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::ERROR_TYPE EVEN | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::EVEN -EXACT | CATEGORY_TEXT_AND_DATA | **Not yet Implemented** +EXACT | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::EXACT EXP | CATEGORY_MATH_AND_TRIG | exp EXPONDIST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::EXPONDIST @@ -154,6 +163,7 @@ FISHERINV | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet FIXED | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::FIXEDFORMAT FLOOR | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::FLOOR FORECAST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::FORECAST +FORMULATEXT | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::FORMULATEXT FREQUENCY | CATEGORY_STATISTICAL | **Not yet Implemented** FTEST | CATEGORY_STATISTICAL | **Not yet Implemented** FV | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::FV @@ -180,7 +190,7 @@ HARMEAN | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet HEX2BIN | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::HEXTOBIN HEX2DEC | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::HEXTODEC HEX2OCT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::HEXTOOCT -HLOOKUP | CATEGORY_LOOKUP_AND_REFERENCE | **Not yet Implemented** +HLOOKUP | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::HLOOKUP HOUR | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::HOUROFDAY HYPERLINK | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::HYPERLINK HYPGEOMDIST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::HYPGEOMDIST @@ -196,6 +206,10 @@ IMAGINARY | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet IMARGUMENT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMARGUMENT IMCONJUGATE | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCONJUGATE IMCOS | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCOS +IMCOSH | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCOSH +IMCOT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCOT +IMCSC | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCSC +IMCSCH | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCSCH IMDIV | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMDIV IMEXP | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMEXP IMLN | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMLN @@ -204,10 +218,14 @@ IMLOG2 | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet IMPOWER | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMPOWER IMPRODUCT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMPRODUCT IMREAL | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMREAL +IMSEC | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSEC +IMSECH | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSECH IMSIN | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSIN +IMSINH | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSINH IMSQRT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSQRT IMSUB | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSUB IMSUM | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSUM +IMTAN | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMTAN INDEX | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::INDEX INDIRECT | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::INDIRECT INFO | CATEGORY_INFORMATION | **Not yet Implemented** @@ -220,11 +238,13 @@ ISBLANK | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet ISERR | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_ERR ISERROR | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_ERROR ISEVEN | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_EVEN +ISFORMULA | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::ISFORMULA ISLOGICAL | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_LOGICAL ISNA | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_NA ISNONTEXT | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_NONTEXT ISNUMBER | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_NUMBER ISODD | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_ODD +ISOWEEKNUM | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::ISOWEEKNUM ISPMT | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::ISPMT ISREF | CATEGORY_INFORMATION | **Not yet Implemented** ISTEXT | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_TEXT @@ -284,6 +304,7 @@ MIRR | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet MMULT | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::MMULT MOD | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::MOD MODE | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MODE +MODE.SNGL | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MODE MONTH | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::MONTHOFYEAR MROUND | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::MROUND MULTINOMIAL | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::MULTINOMIAL @@ -305,6 +326,7 @@ NOT | CATEGORY_LOGICAL | \PhpOffice\PhpSpreadsheet NOW | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::DATETIMENOW NPER | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::NPER NPV | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::NPV +NUMBERVALUE | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::NUMBERVALUE ## O @@ -319,12 +341,13 @@ ODDFYIELD | CATEGORY_FINANCIAL | **Not yet Implemented** ODDLPRICE | CATEGORY_FINANCIAL | **Not yet Implemented** ODDLYIELD | CATEGORY_FINANCIAL | **Not yet Implemented** OFFSET | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::OFFSET -OR | CATEGORY_LOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Logical::LOGICAL_OR +OR | CATEGORY_LOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Logical::logicalOr ## P Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- +PDURATION | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PDURATION PEARSON | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::CORREL PERCENTILE | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::PERCENTILE PERCENTRANK | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::PERCENTRANK @@ -371,6 +394,7 @@ ROUNDDOWN | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet ROUNDUP | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ROUNDUP ROW | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::ROW ROWS | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::ROWS +RRI | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::RRI RSQ | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::RSQ RTD | CATEGORY_LOOKUP_AND_REFERENCE | **Not yet Implemented** @@ -380,6 +404,8 @@ Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- SEARCH | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::SEARCHINSENSITIVE SEARCHB | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::SEARCHINSENSITIVE +SEC | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SEC +SECH | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SECH SECOND | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::SECOND SERIESSUM | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SERIESSUM SIGN | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SIGN @@ -393,6 +419,8 @@ SQRT | CATEGORY_MATH_AND_TRIG | sqrt SQRTPI | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SQRTPI STANDARDIZE | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STANDARDIZE STDEV | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEV +STDEV.S | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEV +STDEV.P | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVP STDEVA | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVA STDEVP | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVP STDEVPA | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVPA @@ -401,7 +429,7 @@ SUBSTITUTE | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet SUBTOTAL | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUBTOTAL SUM | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUM SUMIF | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMIF -SUMIFS | CATEGORY_MATH_AND_TRIG | **Not yet Implemented** +SUMIFS | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMIFS SUMPRODUCT | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMPRODUCT SUMSQ | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMSQ SUMX2MY2 | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMX2MY2 @@ -421,6 +449,7 @@ TBILLPRICE | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet TBILLYIELD | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::TBILLYIELD TDIST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::TDIST TEXT | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::TEXTFORMAT +TEXTJOIN | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::TEXTJOIN TIME | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::TIME TIMEVALUE | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::TIMEVALUE TINV | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::TINV @@ -438,6 +467,8 @@ TYPE | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- +UNICHAR | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::CHARACTER +UNICODE | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::ASCIICODE UPPER | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::UPPERCASE USDOLLAR | CATEGORY_FINANCIAL | **Not yet Implemented** @@ -445,8 +476,10 @@ USDOLLAR | CATEGORY_FINANCIAL | **Not yet Implemented** Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- -VALUE | CATEGORY_TEXT_AND_DATA | **Not yet Implemented** +VALUE | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::VALUE VAR | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARFunc +VAR.P | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARP +VAR.S | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARFunc VARA | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARA VARP | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARP VARPA | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARPA @@ -468,6 +501,8 @@ Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- XIRR | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::XIRR XNPV | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::XNPV +XOR | CATEGORY_LOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Logical::logicalXor + ## Y diff --git a/inc/vendor/phpoffice/phpspreadsheet/docs/topics/accessing-cells.md b/inc/vendor/phpoffice/phpspreadsheet/docs/topics/accessing-cells.md index c85fb0f..f14e2bd 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/docs/topics/accessing-cells.md +++ b/inc/vendor/phpoffice/phpspreadsheet/docs/topics/accessing-cells.md @@ -426,9 +426,9 @@ for ($row = 1; $row <= $highestRow; ++$row) { echo '' . PHP_EOL; ``` -Note that we can't use a <= comparison here, because 'AA' would match -as <= 'B', so we increment the highest column letter and then loop -while \$col != the incremented highest column. +Note that we can't use a `<=` comparison here, because `'AA'` would match +as `<= 'B'`, so we increment the highest column letter and then loop +while `$col !=` the incremented highest column. ## Using value binders to facilitate data entry diff --git a/inc/vendor/phpoffice/phpspreadsheet/docs/topics/autofilters.md b/inc/vendor/phpoffice/phpspreadsheet/docs/topics/autofilters.md index f7c9421..66321ee 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/docs/topics/autofilters.md +++ b/inc/vendor/phpoffice/phpspreadsheet/docs/topics/autofilters.md @@ -285,8 +285,8 @@ $columnFilter->createRule() We also set the rule type to CUSTOMFILTER. -This defined two rules, filtering numbers that are >= -20 OR <= -20, so we also need to modify the join condition to reflect AND rather +This defined two rules, filtering numbers that are `>= -20` OR `<= +20`, so we also need to modify the join condition to reflect AND rather than OR. ``` php diff --git a/inc/vendor/phpoffice/phpspreadsheet/docs/topics/reading-and-writing-to-file.md b/inc/vendor/phpoffice/phpspreadsheet/docs/topics/reading-and-writing-to-file.md index d9cb9a7..cf58e54 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/docs/topics/reading-and-writing-to-file.md +++ b/inc/vendor/phpoffice/phpspreadsheet/docs/topics/reading-and-writing-to-file.md @@ -634,16 +634,16 @@ $writer->setSheetIndex(0); #### Setting the images root of the HTML file There might be situations where you want to explicitly set the included -images root. For example, one might want to see +images root. For example, instead of: + + ``` html + + ``` + +You might want to see: ``` html - -``` - -instead of - -``` html -. + ``` You can use the following code to achieve this result: diff --git a/inc/vendor/phpoffice/phpspreadsheet/docs/topics/recipes.md b/inc/vendor/phpoffice/phpspreadsheet/docs/topics/recipes.md index 0c6c313..0b40cf3 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/docs/topics/recipes.md +++ b/inc/vendor/phpoffice/phpspreadsheet/docs/topics/recipes.md @@ -3,12 +3,12 @@ The following pages offer you some widely-used PhpSpreadsheet recipes. Please note that these do NOT offer complete documentation on specific PhpSpreadsheet API functions, but just a bump to get you started. If you -need specific API functions, please refer to the API documentation. +need specific API functions, please refer to the [API documentation](https://phpoffice.github.io/PhpSpreadsheet/master). For example, [setting a worksheet's page orientation and size ](#setting-a-worksheets-page-orientation-and-size) covers setting a page orientation to A4. Other paper formats, like US Letter, are not covered -in this document, but in the PhpSpreadsheet API documentation. +in this document, but in the PhpSpreadsheet [API documentation](https://phpoffice.github.io/PhpSpreadsheet/master). ## Setting a spreadsheet's metadata @@ -132,7 +132,7 @@ will take care of displaying the formula according the applications language. Translation is taken care of by the application! The following line of code writes the formula -`=IF(C4>500,"profit","loss")` into the cell B8. Note that the +`=IF(C4>500,"profit","loss")` into the cell B8. Note that the formula must start with `=` to make PhpSpreadsheet recognise this as a formula. @@ -301,7 +301,7 @@ $spreadsheet->getActiveSheet()->getPageSetup() ``` Note that there are additional page settings available. Please refer to -the API documentation for all possible options. +the [API documentation](https://phpoffice.github.io/PhpSpreadsheet/master) for all possible options. ### Page Setup: Scaling options diff --git a/inc/vendor/phpoffice/phpspreadsheet/docs/topics/worksheets.md b/inc/vendor/phpoffice/phpspreadsheet/docs/topics/worksheets.md index 6100d3a..f97a006 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/docs/topics/worksheets.md +++ b/inc/vendor/phpoffice/phpspreadsheet/docs/topics/worksheets.md @@ -31,8 +31,6 @@ index, use the `getSheet()` method. $spreadsheet->getSheet(1); ``` -If you don't specify a sheet index, then the first worksheet will be -returned. Methods also exist allowing you to reorder the worksheets in the workbook. @@ -71,7 +69,7 @@ $spreadsheet->createSheet(); ``` A new worksheet created using this method will be called -"Worksheet<n>" where "<n>" is the lowest number possible to +`Worksheet` where `` is the lowest number possible to guarantee that the title is unique. Alternatively, you can instantiate a new worksheet (setting the title to diff --git a/inc/vendor/phpoffice/phpspreadsheet/mkdocs.yml b/inc/vendor/phpoffice/phpspreadsheet/mkdocs.yml index 0062000..1a224f5 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/mkdocs.yml +++ b/inc/vendor/phpoffice/phpspreadsheet/mkdocs.yml @@ -5,7 +5,3 @@ edit_uri: edit/develop/docs/ theme: readthedocs extra_css: - extra/extra.css - -extra_javascript: - - extra/extra.js - \ No newline at end of file diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/Autofilter/10_Autofilter_selection_1.php b/inc/vendor/phpoffice/phpspreadsheet/samples/Autofilter/10_Autofilter_selection_1.php index 4f1fc48..30efc19 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/samples/Autofilter/10_Autofilter_selection_1.php +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/Autofilter/10_Autofilter_selection_1.php @@ -125,7 +125,7 @@ $autoFilter->getColumn('C') ) ->setRuleType(Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); // Filter the Date column on a filter value of the first day of every period of the current year -// We us a dateGroup ruletype for this, although it is still a standard filter +// We us a dateGroup ruletype for this, although it is still a standard filter foreach ($periods as $period) { $endDate = date('t', mktime(0, 0, 0, $period, 1, $currentYear)); diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/Autofilter/10_Autofilter_selection_2.php b/inc/vendor/phpoffice/phpspreadsheet/samples/Autofilter/10_Autofilter_selection_2.php index 63f11a2..1520c97 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/samples/Autofilter/10_Autofilter_selection_2.php +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/Autofilter/10_Autofilter_selection_2.php @@ -108,7 +108,7 @@ $spreadsheet->getActiveSheet()->setAutoFilter($spreadsheet->getActiveSheet()->ca $autoFilter = $spreadsheet->getActiveSheet()->getAutoFilter(); $helper->log('Set active filters'); // Filter the Country column on a filter value of Germany -// As it's just a simple value filter, we can use FILTERTYPE_FILTER +// As it's just a simple value filter, we can use FILTERTYPE_FILTER $autoFilter->getColumn('C') ->setFilterType(Column::AUTOFILTER_FILTERTYPE_FILTER) ->createRule() diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/Autofilter/10_Autofilter_selection_display.php b/inc/vendor/phpoffice/phpspreadsheet/samples/Autofilter/10_Autofilter_selection_display.php index b2b77b7..50986bf 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/samples/Autofilter/10_Autofilter_selection_display.php +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/Autofilter/10_Autofilter_selection_display.php @@ -125,7 +125,7 @@ $autoFilter->getColumn('C') ) ->setRuleType(Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); // Filter the Date column on a filter value of the first day of every period of the current year -// We us a dateGroup ruletype for this, although it is still a standard filter +// We us a dateGroup ruletype for this, although it is still a standard filter foreach ($periods as $period) { $endDate = date('t', mktime(0, 0, 0, $period, 1, $currentYear)); diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/Basic/08_Conditional_formatting.php b/inc/vendor/phpoffice/phpspreadsheet/samples/Basic/08_Conditional_formatting.php index 0ad45c3..2f54863 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/samples/Basic/08_Conditional_formatting.php +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/Basic/08_Conditional_formatting.php @@ -84,7 +84,7 @@ $conditionalStyles[] = $conditional2; $conditionalStyles[] = $conditional3; $spreadsheet->getActiveSheet()->getStyle('B2')->setConditionalStyles($conditionalStyles); -// duplicate the conditional styles across a range of cells +// duplicate the conditional styles across a range of cells $helper->log('Duplicate the conditional formatting across a range of cells'); $spreadsheet->getActiveSheet()->duplicateConditionalStyle( $spreadsheet->getActiveSheet()->getStyle('B2')->getConditionalStyles(), diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/Basic/08_Conditional_formatting_2.php b/inc/vendor/phpoffice/phpspreadsheet/samples/Basic/08_Conditional_formatting_2.php index 607578c..818cdd9 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/samples/Basic/08_Conditional_formatting_2.php +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/Basic/08_Conditional_formatting_2.php @@ -59,7 +59,7 @@ $conditionalStyles[] = $conditional1; $conditionalStyles[] = $conditional3; $spreadsheet->getActiveSheet()->getStyle('A1')->setConditionalStyles($conditionalStyles); -// duplicate the conditional styles across a range of cells +// duplicate the conditional styles across a range of cells $helper->log('Duplicate the conditional formatting across a range of cells'); $spreadsheet->getActiveSheet()->duplicateConditionalStyle( $spreadsheet->getActiveSheet()->getStyle('A1')->getConditionalStyles(), diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/32_Chart_read_write_HTML.php b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/32_Chart_read_write_HTML.php index 8071edd..5febbf9 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/32_Chart_read_write_HTML.php +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/32_Chart_read_write_HTML.php @@ -5,7 +5,7 @@ use PhpOffice\PhpSpreadsheet\Settings; require __DIR__ . '/../Header.php'; -// Change these values to select the Rendering library that you wish to use +// Change these values to select the Rendering library that you wish to use Settings::setChartRenderer(\PhpOffice\PhpSpreadsheet\Chart\Renderer\JpGraph::class); $inputFileType = 'Xlsx'; diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/32_Chart_read_write_PDF.php b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/32_Chart_read_write_PDF.php index 7cc5156..ee3ad0e 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/32_Chart_read_write_PDF.php +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/32_Chart_read_write_PDF.php @@ -7,7 +7,7 @@ require __DIR__ . '/../Header.php'; IOFactory::registerWriter('Pdf', \PhpOffice\PhpSpreadsheet\Writer\Pdf\Mpdf::class); -// Change these values to select the Rendering library that you wish to use +// Change these values to select the Rendering library that you wish to use Settings::setChartRenderer(\PhpOffice\PhpSpreadsheet\Chart\Renderer\JpGraph::class); $inputFileType = 'Xlsx'; diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_area.php b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_area.php index f44232f..4478d2d 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_area.php +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_area.php @@ -23,42 +23,42 @@ $worksheet->fromArray( ] ); -// Set the Labels for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Labels for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesLabels = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // 2010 - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // 2010 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 ]; -// Set the X-Axis Labels -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the X-Axis Labels +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $xAxisTickValues = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; -// Set the Data values for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Data values for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesValues = [ new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$B$2:$B$5', null, 4), new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$5', null, 4), new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$D$2:$D$5', null, 4), ]; -// Build the dataseries +// Build the dataseries $series = new DataSeries( DataSeries::TYPE_AREACHART, // plotType DataSeries::GROUPING_PERCENT_STACKED, // plotGrouping @@ -68,15 +68,15 @@ $series = new DataSeries( $dataSeriesValues // plotValues ); -// Set the series in the plot area +// Set the series in the plot area $plotArea = new PlotArea(null, [$series]); -// Set the chart legend +// Set the chart legend $legend = new Legend(Legend::POSITION_TOPRIGHT, null, false); $title = new Title('Test %age-Stacked Area Chart'); $yAxisLabel = new Title('Value ($k)'); -// Create the chart +// Create the chart $chart = new Chart( 'chart1', // name $title, // title @@ -88,11 +88,11 @@ $chart = new Chart( $yAxisLabel // yAxisLabel ); -// Set the position where the chart should appear in the worksheet +// Set the position where the chart should appear in the worksheet $chart->setTopLeftPosition('A7'); $chart->setBottomRightPosition('H20'); -// Add the chart to the worksheet +// Add the chart to the worksheet $worksheet->addChart($chart); // Save Excel 2007 file diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_bar_stacked.php b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_bar_stacked.php index 16654a1..7ba4d8d 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_bar_stacked.php +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_bar_stacked.php @@ -23,42 +23,42 @@ $worksheet->fromArray( ] ); -// Set the Labels for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Labels for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesLabels = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // 2010 - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // 2010 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 ]; -// Set the X-Axis Labels -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the X-Axis Labels +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $xAxisTickValues = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; -// Set the Data values for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Data values for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesValues = [ new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$B$2:$B$5', null, 4), new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$5', null, 4), new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$D$2:$D$5', null, 4), ]; -// Build the dataseries +// Build the dataseries $series = new DataSeries( DataSeries::TYPE_BARCHART, // plotType DataSeries::GROUPING_STACKED, // plotGrouping @@ -67,19 +67,19 @@ $series = new DataSeries( $xAxisTickValues, // plotCategory $dataSeriesValues // plotValues ); -// Set additional dataseries parameters -// Make it a horizontal bar rather than a vertical column graph +// Set additional dataseries parameters +// Make it a horizontal bar rather than a vertical column graph $series->setPlotDirection(DataSeries::DIRECTION_BAR); -// Set the series in the plot area +// Set the series in the plot area $plotArea = new PlotArea(null, [$series]); -// Set the chart legend +// Set the chart legend $legend = new Legend(Legend::POSITION_RIGHT, null, false); $title = new Title('Test Chart'); $yAxisLabel = new Title('Value ($k)'); -// Create the chart +// Create the chart $chart = new Chart( 'chart1', // name $title, // title @@ -91,11 +91,11 @@ $chart = new Chart( $yAxisLabel // yAxisLabel ); -// Set the position where the chart should appear in the worksheet +// Set the position where the chart should appear in the worksheet $chart->setTopLeftPosition('A7'); $chart->setBottomRightPosition('H20'); -// Add the chart to the worksheet +// Add the chart to the worksheet $worksheet->addChart($chart); // Save Excel 2007 file diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_column.php b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_column.php index bc67644..9ffe9d3 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_column.php +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_column.php @@ -23,42 +23,42 @@ $worksheet->fromArray( ] ); -// Set the Labels for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Labels for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesLabels = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // 2010 - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // 2010 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 ]; -// Set the X-Axis Labels -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the X-Axis Labels +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $xAxisTickValues = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; -// Set the Data values for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Data values for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesValues = [ new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$B$2:$B$5', null, 4), new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$5', null, 4), new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$D$2:$D$5', null, 4), ]; -// Build the dataseries +// Build the dataseries $series = new DataSeries( DataSeries::TYPE_BARCHART, // plotType DataSeries::GROUPING_STANDARD, // plotGrouping @@ -67,19 +67,19 @@ $series = new DataSeries( $xAxisTickValues, // plotCategory $dataSeriesValues // plotValues ); -// Set additional dataseries parameters -// Make it a vertical column rather than a horizontal bar graph +// Set additional dataseries parameters +// Make it a vertical column rather than a horizontal bar graph $series->setPlotDirection(DataSeries::DIRECTION_COL); -// Set the series in the plot area +// Set the series in the plot area $plotArea = new PlotArea(null, [$series]); -// Set the chart legend +// Set the chart legend $legend = new Legend(Legend::POSITION_RIGHT, null, false); $title = new Title('Test Column Chart'); $yAxisLabel = new Title('Value ($k)'); -// Create the chart +// Create the chart $chart = new Chart( 'chart1', // name $title, // title @@ -91,11 +91,11 @@ $chart = new Chart( $yAxisLabel // yAxisLabel ); -// Set the position where the chart should appear in the worksheet +// Set the position where the chart should appear in the worksheet $chart->setTopLeftPosition('A7'); $chart->setBottomRightPosition('H20'); -// Add the chart to the worksheet +// Add the chart to the worksheet $worksheet->addChart($chart); // Save Excel 2007 file diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_column_2.php b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_column_2.php index a00b23b..bba9210 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_column_2.php +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_column_2.php @@ -31,42 +31,42 @@ $worksheet->fromArray( ] ); -// Set the Labels for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Labels for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesLabels = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 'Budget' - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 'Forecast' - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$E$1', null, 1), // 'Actual' + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 'Budget' + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 'Forecast' + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$E$1', null, 1), // 'Actual' ]; -// Set the X-Axis Labels -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the X-Axis Labels +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $xAxisTickValues = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$B$13', null, 12), // Q1 to Q4 for 2010 to 2012 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$B$13', null, 12), // Q1 to Q4 for 2010 to 2012 ]; -// Set the Data values for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Data values for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesValues = [ new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$13', null, 12), new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$D$2:$D$13', null, 12), new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$E$2:$E$13', null, 12), ]; -// Build the dataseries +// Build the dataseries $series = new DataSeries( DataSeries::TYPE_BARCHART, // plotType DataSeries::GROUPING_CLUSTERED, // plotGrouping @@ -75,20 +75,20 @@ $series = new DataSeries( $xAxisTickValues, // plotCategory $dataSeriesValues // plotValues ); -// Set additional dataseries parameters -// Make it a vertical column rather than a horizontal bar graph +// Set additional dataseries parameters +// Make it a vertical column rather than a horizontal bar graph $series->setPlotDirection(DataSeries::DIRECTION_COL); -// Set the series in the plot area +// Set the series in the plot area $plotArea = new PlotArea(null, [$series]); -// Set the chart legend +// Set the chart legend $legend = new Legend(Legend::POSITION_BOTTOM, null, false); $title = new Title('Test Grouped Column Chart'); $xAxisLabel = new Title('Financial Period'); $yAxisLabel = new Title('Value ($k)'); -// Create the chart +// Create the chart $chart = new Chart( 'chart1', // name $title, // title @@ -100,11 +100,11 @@ $chart = new Chart( $yAxisLabel // yAxisLabel ); -// Set the position where the chart should appear in the worksheet +// Set the position where the chart should appear in the worksheet $chart->setTopLeftPosition('G2'); $chart->setBottomRightPosition('P20'); -// Add the chart to the worksheet +// Add the chart to the worksheet $worksheet->addChart($chart); // Save Excel 2007 file diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_composite.php b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_composite.php index 272048d..83dc34a 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_composite.php +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_composite.php @@ -31,46 +31,46 @@ $worksheet->fromArray( ] ); -// Set the Labels for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Labels for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesLabels1 = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // Temperature + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // Temperature ]; $dataSeriesLabels2 = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // Rainfall + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // Rainfall ]; $dataSeriesLabels3 = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // Humidity + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // Humidity ]; -// Set the X-Axis Labels -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the X-Axis Labels +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $xAxisTickValues = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$13', null, 12), // Jan to Dec + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$13', null, 12), // Jan to Dec ]; -// Set the Data values for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Data values for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesValues1 = [ new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$B$2:$B$13', null, 12), ]; -// Build the dataseries +// Build the dataseries $series1 = new DataSeries( DataSeries::TYPE_BARCHART, // plotType DataSeries::GROUPING_CLUSTERED, // plotGrouping @@ -79,22 +79,22 @@ $series1 = new DataSeries( $xAxisTickValues, // plotCategory $dataSeriesValues1 // plotValues ); -// Set additional dataseries parameters -// Make it a vertical column rather than a horizontal bar graph +// Set additional dataseries parameters +// Make it a vertical column rather than a horizontal bar graph $series1->setPlotDirection(DataSeries::DIRECTION_COL); -// Set the Data values for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Data values for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesValues2 = [ new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$13', null, 12), ]; -// Build the dataseries +// Build the dataseries $series2 = new DataSeries( DataSeries::TYPE_LINECHART, // plotType DataSeries::GROUPING_STANDARD, // plotGrouping @@ -104,18 +104,18 @@ $series2 = new DataSeries( $dataSeriesValues2 // plotValues ); -// Set the Data values for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Data values for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesValues3 = [ new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$D$2:$D$13', null, 12), ]; -// Build the dataseries +// Build the dataseries $series3 = new DataSeries( DataSeries::TYPE_AREACHART, // plotType DataSeries::GROUPING_STANDARD, // plotGrouping @@ -125,14 +125,14 @@ $series3 = new DataSeries( $dataSeriesValues3 // plotValues ); -// Set the series in the plot area +// Set the series in the plot area $plotArea = new PlotArea(null, [$series1, $series2, $series3]); -// Set the chart legend +// Set the chart legend $legend = new Legend(Legend::POSITION_RIGHT, null, false); $title = new Title('Average Weather Chart for Crete'); -// Create the chart +// Create the chart $chart = new Chart( 'chart1', // name $title, // title @@ -144,11 +144,11 @@ $chart = new Chart( null // yAxisLabel ); -// Set the position where the chart should appear in the worksheet +// Set the position where the chart should appear in the worksheet $chart->setTopLeftPosition('F2'); $chart->setBottomRightPosition('O16'); -// Add the chart to the worksheet +// Add the chart to the worksheet $worksheet->addChart($chart); // Save Excel 2007 file diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_line.php b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_line.php index 3961d70..bdaf011 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_line.php +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_line.php @@ -23,35 +23,35 @@ $worksheet->fromArray( ] ); -// Set the Labels for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Labels for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesLabels = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // 2010 - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // 2010 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 ]; -// Set the X-Axis Labels -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the X-Axis Labels +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $xAxisTickValues = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; -// Set the Data values for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Data values for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesValues = [ new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$B$2:$B$5', null, 4), new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$5', null, 4), @@ -59,7 +59,7 @@ $dataSeriesValues = [ ]; $dataSeriesValues[2]->setLineWidth(60000); -// Build the dataseries +// Build the dataseries $series = new DataSeries( DataSeries::TYPE_LINECHART, // plotType DataSeries::GROUPING_STACKED, // plotGrouping @@ -69,15 +69,15 @@ $series = new DataSeries( $dataSeriesValues // plotValues ); -// Set the series in the plot area +// Set the series in the plot area $plotArea = new PlotArea(null, [$series]); -// Set the chart legend +// Set the chart legend $legend = new Legend(Legend::POSITION_TOPRIGHT, null, false); $title = new Title('Test Stacked Line Chart'); $yAxisLabel = new Title('Value ($k)'); -// Create the chart +// Create the chart $chart = new Chart( 'chart1', // name $title, // title @@ -89,11 +89,11 @@ $chart = new Chart( $yAxisLabel // yAxisLabel ); -// Set the position where the chart should appear in the worksheet +// Set the position where the chart should appear in the worksheet $chart->setTopLeftPosition('A7'); $chart->setBottomRightPosition('H20'); -// Add the chart to the worksheet +// Add the chart to the worksheet $worksheet->addChart($chart); // Save Excel 2007 file diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_multiple_charts.php b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_multiple_charts.php index b907a39..10a11e1 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_multiple_charts.php +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_multiple_charts.php @@ -23,42 +23,42 @@ $worksheet->fromArray( ] ); -// Set the Labels for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Labels for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesLabels1 = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // 2010 - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // 2010 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 ]; -// Set the X-Axis Labels -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the X-Axis Labels +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $xAxisTickValues1 = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; -// Set the Data values for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Data values for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesValues1 = [ new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$B$2:$B$5', null, 4), new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$5', null, 4), new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$D$2:$D$5', null, 4), ]; -// Build the dataseries +// Build the dataseries $series1 = new DataSeries( DataSeries::TYPE_AREACHART, // plotType DataSeries::GROUPING_PERCENT_STACKED, // plotGrouping @@ -68,15 +68,15 @@ $series1 = new DataSeries( $dataSeriesValues1 // plotValues ); -// Set the series in the plot area +// Set the series in the plot area $plotArea1 = new PlotArea(null, [$series1]); -// Set the chart legend +// Set the chart legend $legend1 = new Legend(Legend::POSITION_TOPRIGHT, null, false); $title1 = new Title('Test %age-Stacked Area Chart'); $yAxisLabel1 = new Title('Value ($k)'); -// Create the chart +// Create the chart $chart1 = new Chart( 'chart1', // name $title1, // title @@ -88,49 +88,49 @@ $chart1 = new Chart( $yAxisLabel1 // yAxisLabel ); -// Set the position where the chart should appear in the worksheet +// Set the position where the chart should appear in the worksheet $chart1->setTopLeftPosition('A7'); $chart1->setBottomRightPosition('H20'); -// Add the chart to the worksheet +// Add the chart to the worksheet $worksheet->addChart($chart1); -// Set the Labels for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Labels for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesLabels2 = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // 2010 - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // 2010 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 ]; -// Set the X-Axis Labels -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the X-Axis Labels +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $xAxisTickValues2 = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; -// Set the Data values for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Data values for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesValues2 = [ new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$B$2:$B$5', null, 4), new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$5', null, 4), new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$D$2:$D$5', null, 4), ]; -// Build the dataseries +// Build the dataseries $series2 = new DataSeries( DataSeries::TYPE_BARCHART, // plotType DataSeries::GROUPING_STANDARD, // plotGrouping @@ -139,19 +139,19 @@ $series2 = new DataSeries( $xAxisTickValues2, // plotCategory $dataSeriesValues2 // plotValues ); -// Set additional dataseries parameters -// Make it a vertical column rather than a horizontal bar graph +// Set additional dataseries parameters +// Make it a vertical column rather than a horizontal bar graph $series2->setPlotDirection(DataSeries::DIRECTION_COL); -// Set the series in the plot area +// Set the series in the plot area $plotArea2 = new PlotArea(null, [$series2]); -// Set the chart legend +// Set the chart legend $legend2 = new Legend(Legend::POSITION_RIGHT, null, false); $title2 = new Title('Test Column Chart'); $yAxisLabel2 = new Title('Value ($k)'); -// Create the chart +// Create the chart $chart2 = new Chart( 'chart2', // name $title2, // title @@ -163,11 +163,11 @@ $chart2 = new Chart( $yAxisLabel2 // yAxisLabel ); -// Set the position where the chart should appear in the worksheet +// Set the position where the chart should appear in the worksheet $chart2->setTopLeftPosition('I7'); $chart2->setBottomRightPosition('P20'); -// Add the chart to the worksheet +// Add the chart to the worksheet $worksheet->addChart($chart2); // Save Excel 2007 file diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_pie.php b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_pie.php index 4972644..d4ec075 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_pie.php +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_pie.php @@ -24,38 +24,38 @@ $worksheet->fromArray( ] ); -// Set the Labels for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Labels for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesLabels1 = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 ]; -// Set the X-Axis Labels -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the X-Axis Labels +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $xAxisTickValues1 = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; -// Set the Data values for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Data values for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesValues1 = [ new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$5', null, 4), ]; -// Build the dataseries +// Build the dataseries $series1 = new DataSeries( DataSeries::TYPE_PIECHART, // plotType null, // plotGrouping (Pie charts don't have any grouping) @@ -65,19 +65,19 @@ $series1 = new DataSeries( $dataSeriesValues1 // plotValues ); -// Set up a layout object for the Pie chart +// Set up a layout object for the Pie chart $layout1 = new Layout(); $layout1->setShowVal(true); $layout1->setShowPercent(true); -// Set the series in the plot area +// Set the series in the plot area $plotArea1 = new PlotArea($layout1, [$series1]); -// Set the chart legend +// Set the chart legend $legend1 = new Legend(Legend::POSITION_RIGHT, null, false); $title1 = new Title('Test Pie Chart'); -// Create the chart +// Create the chart $chart1 = new Chart( 'chart1', // name $title1, // title @@ -86,48 +86,48 @@ $chart1 = new Chart( true, // plotVisibleOnly 0, // displayBlanksAs null, // xAxisLabel - null // yAxisLabel - Pie charts don't have a Y-Axis + null // yAxisLabel - Pie charts don't have a Y-Axis ); -// Set the position where the chart should appear in the worksheet +// Set the position where the chart should appear in the worksheet $chart1->setTopLeftPosition('A7'); $chart1->setBottomRightPosition('H20'); -// Add the chart to the worksheet +// Add the chart to the worksheet $worksheet->addChart($chart1); -// Set the Labels for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Labels for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesLabels2 = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 ]; -// Set the X-Axis Labels -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the X-Axis Labels +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $xAxisTickValues2 = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; -// Set the Data values for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Data values for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesValues2 = [ new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$5', null, 4), ]; -// Build the dataseries +// Build the dataseries $series2 = new DataSeries( DataSeries::TYPE_DONUTCHART, // plotType null, // plotGrouping (Donut charts don't have any grouping) @@ -137,17 +137,17 @@ $series2 = new DataSeries( $dataSeriesValues2 // plotValues ); -// Set up a layout object for the Pie chart +// Set up a layout object for the Pie chart $layout2 = new Layout(); $layout2->setShowVal(true); $layout2->setShowCatName(true); -// Set the series in the plot area +// Set the series in the plot area $plotArea2 = new PlotArea($layout2, [$series2]); $title2 = new Title('Test Donut Chart'); -// Create the chart +// Create the chart $chart2 = new Chart( 'chart2', // name $title2, // title @@ -156,14 +156,14 @@ $chart2 = new Chart( true, // plotVisibleOnly 0, // displayBlanksAs null, // xAxisLabel - null // yAxisLabel - Like Pie charts, Donut charts don't have a Y-Axis + null // yAxisLabel - Like Pie charts, Donut charts don't have a Y-Axis ); -// Set the position where the chart should appear in the worksheet +// Set the position where the chart should appear in the worksheet $chart2->setTopLeftPosition('I7'); $chart2->setBottomRightPosition('P20'); -// Add the chart to the worksheet +// Add the chart to the worksheet $worksheet->addChart($chart2); // Save Excel 2007 file diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_radar.php b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_radar.php index 9d05f85..e57914a 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_radar.php +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_radar.php @@ -32,41 +32,41 @@ $worksheet->fromArray( ] ); -// Set the Labels for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Labels for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesLabels = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 ]; -// Set the X-Axis Labels -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the X-Axis Labels +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $xAxisTickValues = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$13', null, 12), // Jan to Dec - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$13', null, 12), // Jan to Dec + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$13', null, 12), // Jan to Dec + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$13', null, 12), // Jan to Dec ]; -// Set the Data values for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Data values for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesValues = [ new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$13', null, 12), new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$D$2:$D$13', null, 12), ]; -// Build the dataseries +// Build the dataseries $series = new DataSeries( DataSeries::TYPE_RADARCHART, // plotType null, // plotGrouping (Radar charts don't have any grouping) @@ -79,17 +79,17 @@ $series = new DataSeries( DataSeries::STYLE_MARKER // plotStyle ); -// Set up a layout object for the Pie chart +// Set up a layout object for the Pie chart $layout = new Layout(); -// Set the series in the plot area +// Set the series in the plot area $plotArea = new PlotArea($layout, [$series]); -// Set the chart legend +// Set the chart legend $legend = new Legend(Legend::POSITION_RIGHT, null, false); $title = new Title('Test Radar Chart'); -// Create the chart +// Create the chart $chart = new Chart( 'chart1', // name $title, // title @@ -98,14 +98,14 @@ $chart = new Chart( true, // plotVisibleOnly 0, // displayBlanksAs null, // xAxisLabel - null // yAxisLabel - Radar charts don't have a Y-Axis + null // yAxisLabel - Radar charts don't have a Y-Axis ); -// Set the position where the chart should appear in the worksheet +// Set the position where the chart should appear in the worksheet $chart->setTopLeftPosition('F2'); $chart->setBottomRightPosition('M15'); -// Add the chart to the worksheet +// Add the chart to the worksheet $worksheet->addChart($chart); // Save Excel 2007 file diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_scatter.php b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_scatter.php index 2070fe2..12fc2bd 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_scatter.php +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_scatter.php @@ -23,36 +23,36 @@ $worksheet->fromArray( ] ); -// Set the Labels for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Labels for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesLabels = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // 2010 - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // 2010 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 ]; -// Set the X-Axis Labels +// Set the X-Axis Labels $xAxisTickValues = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; -// Set the Data values for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Data values for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesValues = [ new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$B$2:$B$5', null, 4), new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$5', null, 4), new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$D$2:$D$5', null, 4), ]; -// Build the dataseries +// Build the dataseries $series = new DataSeries( DataSeries::TYPE_SCATTERCHART, // plotType null, // plotGrouping (Scatter charts don't have any grouping) @@ -65,15 +65,15 @@ $series = new DataSeries( DataSeries::STYLE_LINEMARKER // plotStyle ); -// Set the series in the plot area +// Set the series in the plot area $plotArea = new PlotArea(null, [$series]); -// Set the chart legend +// Set the chart legend $legend = new Legend(Legend::POSITION_TOPRIGHT, null, false); $title = new Title('Test Scatter Chart'); $yAxisLabel = new Title('Value ($k)'); -// Create the chart +// Create the chart $chart = new Chart( 'chart1', // name $title, // title @@ -85,11 +85,11 @@ $chart = new Chart( $yAxisLabel // yAxisLabel ); -// Set the position where the chart should appear in the worksheet +// Set the position where the chart should appear in the worksheet $chart->setTopLeftPosition('A7'); $chart->setBottomRightPosition('H20'); -// Add the chart to the worksheet +// Add the chart to the worksheet $worksheet->addChart($chart); // Save Excel 2007 file diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_stock.php b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_stock.php index 2342d1a..7a9f727 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_stock.php +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/Chart/33_Chart_create_stock.php @@ -29,36 +29,36 @@ $worksheet->fromArray( ); $worksheet->getStyle('B2:E6')->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_NUMBER_00); -// Set the Labels for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Labels for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesLabels = [ new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), //Max / Open new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), //Min / Close new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), //Min Threshold / Min new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$E$1', null, 1), //Max Threshold / Max ]; -// Set the X-Axis Labels -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the X-Axis Labels +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $xAxisTickValues = [ - new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$6', null, 5), // Counts + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$6', null, 5), // Counts ]; -// Set the Data values for each data series we want to plot -// Datatype -// Cell reference for data -// Format Code -// Number of datapoints in series -// Data values -// Data Marker +// Set the Data values for each data series we want to plot +// Datatype +// Cell reference for data +// Format Code +// Number of datapoints in series +// Data values +// Data Marker $dataSeriesValues = [ new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$B$2:$B$6', null, 5), new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$6', null, 5), @@ -66,7 +66,7 @@ $dataSeriesValues = [ new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$E$2:$E$6', null, 5), ]; -// Build the dataseries +// Build the dataseries $series = new DataSeries( DataSeries::TYPE_STOCKCHART, // plotType null, // plotGrouping - if we set this to not null, then xlsx throws error @@ -76,16 +76,16 @@ $series = new DataSeries( $dataSeriesValues // plotValues ); -// Set the series in the plot area +// Set the series in the plot area $plotArea = new PlotArea(null, [$series]); -// Set the chart legend +// Set the chart legend $legend = new Legend(Legend::POSITION_RIGHT, null, false); $title = new Title('Test Stock Chart'); $xAxisLabel = new Title('Counts'); $yAxisLabel = new Title('Values'); -// Create the chart +// Create the chart $chart = new Chart( 'stock-chart', // name $title, // title @@ -97,11 +97,11 @@ $chart = new Chart( $yAxisLabel // yAxisLabel ); -// Set the position where the chart should appear in the worksheet +// Set the position where the chart should appear in the worksheet $chart->setTopLeftPosition('A7'); $chart->setBottomRightPosition('H20'); -// Add the chart to the worksheet +// Add the chart to the worksheet $worksheet->addChart($chart); // Save Excel 2007 file diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/Reader/11_Reading_a_workbook_in_chunks_using_a_configurable_read_filter_(version_1).php b/inc/vendor/phpoffice/phpspreadsheet/samples/Reader/11_Reading_a_workbook_in_chunks_using_a_configurable_read_filter_(version_1).php index 892ab33..1856221 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/samples/Reader/11_Reading_a_workbook_in_chunks_using_a_configurable_read_filter_(version_1).php +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/Reader/11_Reading_a_workbook_in_chunks_using_a_configurable_read_filter_(version_1).php @@ -57,7 +57,7 @@ for ($startRow = 2; $startRow <= 240; $startRow += $chunkSize) { // Load only the rows that match our filter from $inputFileName to a PhpSpreadsheet Object $spreadsheet = $reader->load($inputFileName); - // Do some processing here + // Do some processing here $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); var_dump($sheetData); diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/Reader/12_Reading_a_workbook_in_chunks_using_a_configurable_read_filter_(version_2).php b/inc/vendor/phpoffice/phpspreadsheet/samples/Reader/12_Reading_a_workbook_in_chunks_using_a_configurable_read_filter_(version_2).php index 0a3e8f3..1f39ec4 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/samples/Reader/12_Reading_a_workbook_in_chunks_using_a_configurable_read_filter_(version_2).php +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/Reader/12_Reading_a_workbook_in_chunks_using_a_configurable_read_filter_(version_2).php @@ -60,7 +60,7 @@ for ($startRow = 2; $startRow <= 240; $startRow += $chunkSize) { // Load only the rows that match our filter from $inputFileName to a PhpSpreadsheet Object $spreadsheet = $reader->load($inputFileName); - // Do some processing here + // Do some processing here $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); var_dump($sheetData); diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/Reader/20_Reader_worksheet_hyperlink_image.php b/inc/vendor/phpoffice/phpspreadsheet/samples/Reader/20_Reader_worksheet_hyperlink_image.php new file mode 100644 index 0000000..0636e46 --- /dev/null +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/Reader/20_Reader_worksheet_hyperlink_image.php @@ -0,0 +1,54 @@ +log('Start'); + +$spreadsheet = new Spreadsheet(); + +$aSheet = $spreadsheet->getActiveSheet(); + +$gdImage = @imagecreatetruecolor(120, 20); +$textColor = imagecolorallocate($gdImage, 255, 255, 255); +imagestring($gdImage, 1, 5, 5, 'Created with PhpSpreadsheet', $textColor); + +$baseUrl = 'https://phpspreadsheet.readthedocs.io/'; + +$drawing = new \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing(); +$drawing->setName('In-Memory image 1'); +$drawing->setDescription('In-Memory image 1'); +$drawing->setCoordinates('A1'); +$drawing->setImageResource($gdImage); +$drawing->setRenderingFunction( + \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing::RENDERING_JPEG +); +$drawing->setMimeType(\PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing::MIMETYPE_DEFAULT); +$drawing->setHeight(36); +$helper->log('Write image'); + +$hyperLink = new \PhpOffice\PhpSpreadsheet\Cell\Hyperlink($baseUrl, 'test image'); +$drawing->setHyperlink($hyperLink); +$helper->log('Write link: ' . $baseUrl); + +$drawing->setWorksheet($aSheet); + +$filename = tempnam(\PhpOffice\PhpSpreadsheet\Shared\File::sysGetTempDir(), 'phpspreadsheet-test'); + +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, $inputFileType); +$writer->save($filename); + +$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); + +$reloadedSpreadsheet = $reader->load($filename); +unlink($filename); + +$helper->log('reloaded Spreadsheet'); + +foreach ($reloadedSpreadsheet->getActiveSheet()->getDrawingCollection() as $pDrawing) { + $helper->log('Read link: ' . $pDrawing->getHyperlink()->getUrl()); +} + +$helper->log('end'); diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/Reading_workbook_data/Custom_properties.php b/inc/vendor/phpoffice/phpspreadsheet/samples/Reading_workbook_data/Custom_properties.php index 3c40440..1c222b5 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/samples/Reading_workbook_data/Custom_properties.php +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/Reading_workbook_data/Custom_properties.php @@ -25,24 +25,24 @@ foreach ($customPropertyList as $customPropertyName) { // Manipulate properties as appropriate for display purposes switch ($propertyType) { - case 'i': // integer + case 'i': // integer $propertyType = 'integer number'; break; - case 'f': // float + case 'f': // float $propertyType = 'floating point number'; break; - case 's': // string + case 's': // string $propertyType = 'string'; break; - case 'd': // date + case 'd': // date $propertyValue = date('l, d<\s\up>S F Y g:i A', $propertyValue); $propertyType = 'date'; break; - case 'b': // boolean + case 'b': // boolean $propertyValue = ($propertyValue) ? 'TRUE' : 'FALSE'; $propertyType = 'boolean'; diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/bootstrap/js/bootstrap.min.js b/inc/vendor/phpoffice/phpspreadsheet/samples/bootstrap/js/bootstrap.min.js index e1cd129..9bcd2fc 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/samples/bootstrap/js/bootstrap.min.js +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/bootstrap/js/bootstrap.min.js @@ -1,7 +1,7 @@ -/*! - * Bootstrap v3.3.7 (http://getbootstrap.com) - * Copyright 2011-2016 Twitter, Inc. - * Licensed under the MIT license - */ -if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.7",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.7",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.7",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.7",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.7",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return e=a-d&&"bottom"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); \ No newline at end of file diff --git a/inc/vendor/phpoffice/phpspreadsheet/samples/bootstrap/js/jquery.min.js b/inc/vendor/phpoffice/phpspreadsheet/samples/bootstrap/js/jquery.min.js index 03b23ae..f6a6a99 100644 --- a/inc/vendor/phpoffice/phpspreadsheet/samples/bootstrap/js/jquery.min.js +++ b/inc/vendor/phpoffice/phpspreadsheet/samples/bootstrap/js/jquery.min.js @@ -1,4 +1,4 @@ -/*! jQuery v3.1.0 | (c) jQuery Foundation | jquery.org/license */ -!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.1.0",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null!=a?a<0?this[a+this.length]:this[a]:f.call(this)},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"label"in b&&b.disabled===a||"form"in b&&b.disabled===a||"form"in b&&b.disabled===!1&&(b.isDisabled===a||b.isDisabled!==!a&&("label"in b||!ea(b))!==a)}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(_,aa),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=V.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(_,aa),$.test(j[0].type)&&qa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&sa(j),!a)return G.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||$.test(a)&&qa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(a,b,c){if(r.isFunction(b))return r.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return r.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(C.test(b))return r.filter(b,a,c);b=r.filter(b,a)}return r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType})}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),B.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function J(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return J(a,"nextSibling")},prev:function(a){return J(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return a.contentDocument||r.merge([],a.childNodes)}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}});var K=/\S+/g;function L(a){var b={};return r.each(a.match(K)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(void 0,a)}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b=f&&(d!==N&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R),a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)S(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0, -r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h1,null,!0)},removeData:function(a){return this.each(function(){W.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add(function(){V.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length\x20\t\r\n\f]+)/i,ja=/^$|\/(?:java|ecma)script/i,ka={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ka.optgroup=ka.option,ka.tbody=ka.tfoot=ka.colgroup=ka.caption=ka.thead,ka.th=ka.td;function la(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&r.nodeName(a,b)?r.merge([a],c):c}function ma(a,b){for(var c=0,d=a.length;c-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=la(l.appendChild(f),"script"),j&&ma(g),c){k=0;while(f=g[k++])ja.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var pa=d.documentElement,qa=/^key/,ra=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,sa=/^([^.]*)(?:\.(.+)|)/;function ta(){return!0}function ua(){return!1}function va(){try{return d.activeElement}catch(a){}}function wa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)wa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ua;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(pa,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(K)||[""],j=b.length;while(j--)h=sa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.hasData(a)&&V.get(a);if(q&&(i=q.events)){b=(b||"").match(K)||[""],j=b.length;while(j--)if(h=sa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&V.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(V.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c-1:r.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h\x20\t\r\n\f]*)[^>]*)\/>/gi,ya=/\s*$/g;function Ca(a,b){return r.nodeName(a,"table")&&r.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function Da(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ea(a){var b=Aa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(V.hasData(a)&&(f=V.access(a),g=V.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c1&&"string"==typeof q&&!o.checkClone&&za.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(m&&(e=oa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(la(e,"script"),Da),i=h.length;l")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=la(h),f=la(a),d=0,e=f.length;d0&&ma(g,!i&&la(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(T(c)){if(b=c[V.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[V.expando]=void 0}c[W.expando]&&(c[W.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return S(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(la(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return S(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!ya.test(a)&&!ka[(ia.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c1)}});function Xa(a,b,c,d,e){return new Xa.prototype.init(a,b,c,d,e)}r.Tween=Xa,Xa.prototype={constructor:Xa,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=Xa.propHooks[this.prop];return a&&a.get?a.get(this):Xa.propHooks._default.get(this)},run:function(a){var b,c=Xa.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Xa.propHooks._default.set(this),this}},Xa.prototype.init.prototype=Xa.prototype,Xa.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},Xa.propHooks.scrollTop=Xa.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=Xa.prototype.init,r.fx.step={};var Ya,Za,$a=/^(?:toggle|show|hide)$/,_a=/queueHooks$/;function ab(){Za&&(a.requestAnimationFrame(ab),r.fx.tick())}function bb(){return a.setTimeout(function(){Ya=void 0}),Ya=r.now()}function cb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=aa[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function db(a,b,c){for(var d,e=(gb.tweeners[b]||[]).concat(gb.tweeners["*"]),f=0,g=e.length;f1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?hb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&r.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(K); -if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),hb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ib[b]||r.find.attr;ib[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=ib[g],ib[g]=e,e=null!=c(a,b,d)?g:null,ib[g]=f),e}});var jb=/^(?:input|select|textarea|button)$/i,kb=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return S(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):jb.test(a.nodeName)||kb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});var lb=/[\t\r\n\f]/g;function mb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,mb(this)))});if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=mb(c),d=1===c.nodeType&&(" "+e+" ").replace(lb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=r.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,mb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=mb(c),d=1===c.nodeType&&(" "+e+" ").replace(lb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=r.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,mb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(K)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=mb(this),b&&V.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":V.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+mb(c)+" ").replace(lb," ").indexOf(b)>-1)return!0;return!1}});var nb=/\r/g,ob=/[\x20\t\r\n\f]+/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":r.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(nb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:r.trim(r.text(a)).replace(ob," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type,g=f?null:[],h=f?e+1:d.length,i=e<0?h:f?e:0;i-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(r.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var pb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!pb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,pb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(V.get(h,"events")||{})[b.type]&&V.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&T(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!T(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=V.access(d,b);e||d.addEventListener(a,c,!0),V.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=V.access(d,b)-1;e?V.access(d,b,e):(d.removeEventListener(a,c,!0),V.remove(d,b))}}});var qb=a.location,rb=r.now(),sb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var tb=/\[\]$/,ub=/\r?\n/g,vb=/^(?:submit|button|image|reset|file)$/i,wb=/^(?:input|select|textarea|keygen)/i;function xb(a,b,c,d){var e;if(r.isArray(b))r.each(b,function(b,e){c||tb.test(a)?d(a,e):xb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)xb(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(r.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)xb(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&wb.test(this.nodeName)&&!vb.test(a)&&(this.checked||!ha.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:r.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(ub,"\r\n")}}):{name:b.name,value:c.replace(ub,"\r\n")}}).get()}});var yb=/%20/g,zb=/#.*$/,Ab=/([?&])_=[^&]*/,Bb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Cb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Db=/^(?:GET|HEAD)$/,Eb=/^\/\//,Fb={},Gb={},Hb="*/".concat("*"),Ib=d.createElement("a");Ib.href=qb.href;function Jb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(K)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Kb(a,b,c,d){var e={},f=a===Gb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Lb(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Mb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Nb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:qb.href,type:"GET",isLocal:Cb.test(qb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Hb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Lb(Lb(a,r.ajaxSettings),b):Lb(r.ajaxSettings,a)},ajaxPrefilter:Jb(Fb),ajaxTransport:Jb(Gb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Bb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||qb.href)+"").replace(Eb,qb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(K)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Ib.protocol+"//"+Ib.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Kb(Fb,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Db.test(o.type),f=o.url.replace(zb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(yb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(sb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Ab,""),n=(sb.test(f)?"&":"?")+"_="+rb++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Hb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Kb(Gb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Mb(o,y,d)),v=Nb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Ob={0:200,1223:204},Pb=r.ajaxSettings.xhr();o.cors=!!Pb&&"withCredentials"in Pb,o.ajax=Pb=!!Pb,r.ajaxTransport(function(b){var c,d;if(o.cors||Pb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Ob[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("