How to use phoromatic_schedules class

Best Phoronix-test-suite code snippet using phoromatic_schedules

phoromatic_server.php

Source:phoromatic_server.php Github

copy

Full Screen

...171 // Account Database172 self::$db->exec('CREATE TABLE phoromatic_accounts (AccountID TEXT PRIMARY KEY, ValidateID TEXT NOT NULL, CreatedOn TEXT NOT NULL, Salt TEXT NOT NULL)');173 self::$db->exec('CREATE TABLE phoromatic_account_settings (AccountID TEXT PRIMARY KEY, ArchiveResultsLocally INTEGER, UploadSystemLogs INTEGER DEFAULT 1, RunInstallCommand INTEGER DEFAULT 1, ForceInstallTests INTEGER, SystemSensorMonitoring INTEGER)');174 self::$db->exec('CREATE TABLE phoromatic_users (UserID TEXT PRIMARY KEY, AccountID TEXT NOT NULL, UserName TEXT UNIQUE, Email TEXT, Password TEXT NOT NULL, CreatedOn TEXT NOT NULL, LastLogin TEXT, LastIP TEXT)');175 self::$db->exec('CREATE TABLE phoromatic_schedules (AccountID TEXT, ScheduleID INTEGER, Title TEXT, Description TEXT, State INTEGER, ActiveOn TEXT, RunAt TEXT, SetContextPreInstall TEXT, SetContextPostInstall TEXT, SetContextPreRun TEXT, SetContextPostRun TEXT, LastModifiedBy TEXT, LastModifiedOn TEXT, PublicKey TEXT, UNIQUE(AccountID, ScheduleID) ON CONFLICT IGNORE)');176 //self::$db->exec('CREATE TABLE phoromatic_schedules_systems (AccountID TEXT UNIQUE, ScheduleID INTEGER UNIQUE, SystemID TEXT UNIQUE)');177 self::$db->exec('CREATE TABLE phoromatic_schedules_tests (AccountID TEXT, ScheduleID INTEGER, TestProfile TEXT, TestArguments TEXT, TestDescription TEXT, UNIQUE(AccountID, ScheduleID, TestProfile, TestArguments) ON CONFLICT REPLACE)');178 self::$db->exec('CREATE TABLE phoromatic_schedules_triggers (AccountID TEXT, ScheduleID INTEGER, Trigger TEXT, TriggerTarget TEXT, TriggeredOn TEXT, UNIQUE(AccountID, ScheduleID, Trigger) ON CONFLICT IGNORE)');179 self::$db->exec('CREATE TABLE phoromatic_user_settings (AccountID TEXT, UserID TEXT, NotifyOnResultUploads INTEGER, NotifyOnWarnings INTEGER, NotifyOnNewSystems INTEGER, UNIQUE(AccountID, UserID) ON CONFLICT IGNORE)');180 self::$db->exec('CREATE TABLE phoromatic_systems (AccountID TEXT, SystemID TEXT, Title TEXT, Description TEXT, Groups TEXT, Hardware TEXT, Software TEXT, ClientVersion TEXT, GSID TEXT, CurrentTask TEXT, EstimatedTimeForTask TEXT, CreatedOn TEXT, LastCommunication TEXT, LastIP TEXT, State INTEGER, LocalIP TEXT, NetworkMAC TEXT, Flags TEXT, UNIQUE(AccountID, SystemID) ON CONFLICT IGNORE)');181 self::$db->exec('CREATE TABLE phoromatic_system_warnings (AccountID TEXT, SystemID TEXT, Warning TEXT, WarningTime TEXT)');182 self::$db->exec('CREATE TABLE phoromatic_results (AccountID TEXT, UploadID INTEGER, ScheduleID INTEGER, Trigger TEXT, UploadTime TEXT, Title TEXT, OpenBenchmarkingID TEXT, SystemID TEXT, UNIQUE(AccountID, UploadID) ON CONFLICT IGNORE)');183 self::$db->exec('CREATE TABLE phoromatic_groups (AccountID TEXT, GroupName TEXT, Description TEXT, UNIQUE(AccountID, GroupName) ON CONFLICT IGNORE)');184 self::$db->exec('PRAGMA user_version = 1');185 case 1:186 // phoromatic_results changes for schema mostly from OB187 // Changes made 20 September / post 5.4-M1188 self::$db->exec('ALTER TABLE phoromatic_results ADD COLUMN Description TEXT');189 self::$db->exec('ALTER TABLE phoromatic_results ADD COLUMN SystemCount INTEGER');190 self::$db->exec('ALTER TABLE phoromatic_results ADD COLUMN ResultCount INTEGER');191 self::$db->exec('ALTER TABLE phoromatic_results ADD COLUMN DisplayStatus INTEGER DEFAULT 1');192 self::$db->exec('ALTER TABLE phoromatic_results ADD COLUMN TimesViewed INTEGER DEFAULT 0');193 self::$db->exec('ALTER TABLE phoromatic_results ADD COLUMN XmlUploadHash TEXT');194 self::$db->exec('ALTER TABLE phoromatic_results ADD COLUMN ComparisonHash TEXT');195 // Add phoromatic_results_results as test_results_results equivalent from OB196 self::$db->exec('CREATE TABLE phoromatic_results_results (AccountID TEXT, UploadID INTEGER, AbstractID INTEGER, TestProfile TEXT, ComparisonHash TEXT, UNIQUE(AccountID, UploadID, AbstractID) ON CONFLICT IGNORE)');197 self::$db->exec('CREATE TABLE phoromatic_results_systems (AccountID TEXT, UploadID INTEGER, SystemIdentifier TEXT, Hardware TEXT, Software TEXT, UNIQUE(AccountID, UploadID, SystemIdentifier) ON CONFLICT IGNORE)');198 self::$db->exec('PRAGMA user_version = 2');199 case 2:200 // Change made 4 October to introduce machine self ID as a new identifier for local systems without Internet not having OpenBenchmarking.org GSID, etc201 self::$db->exec('ALTER TABLE phoromatic_systems ADD COLUMN MachineSelfID TEXT');202 self::$db->exec('PRAGMA user_version = 3');203 case 3:204 // Change made 8 October for targeting the SystemID / GroupNames of systems to test in schedules205 self::$db->exec('ALTER TABLE phoromatic_schedules ADD COLUMN RunTargetSystems TEXT');206 self::$db->exec('ALTER TABLE phoromatic_schedules ADD COLUMN RunTargetGroups TEXT');207 self::$db->exec('PRAGMA user_version = 4');208 case 4:209 // Change made 11 October for administrative level210 self::$db->exec('ALTER TABLE phoromatic_users ADD COLUMN AdminLevel INTEGER DEFAULT 1');211 self::$db->exec('PRAGMA user_version = 5');212 case 5:213 self::$db->exec('CREATE TABLE phoromatic_activity_stream (AccountID TEXT, ActivityTime TEXT, ActivityCreator TEXT, ActivityCreatorType TEXT, ActivityEvent TEXT, ActivityEventID TEXT, ActivityEventType TEXT)');214 self::$db->exec('PRAGMA user_version = 6');215 case 6:216 self::$db->exec('CREATE TABLE phoromatic_system_client_errors (AccountID TEXT, SystemID TEXT, UploadTime TEXT, ScheduleID INTEGER, TriggerID TEXT, ErrorMessage TEXT, TestIdentifier TEXT, TestArguments TEXT)');217 self::$db->exec('PRAGMA user_version = 7');218 case 7:219 // Change made 11 October for administrative level220 self::$db->exec('ALTER TABLE phoromatic_account_settings ADD COLUMN UploadResultsToOpenBenchmarking INTEGER DEFAULT 0');221 self::$db->exec('PRAGMA user_version = 8');222 case 8:223 // Change made 24 November 2014 Wake On LAN info for client systems224 self::$db->exec('ALTER TABLE phoromatic_systems ADD COLUMN NetworkWakeOnLAN TEXT');225 self::$db->exec('PRAGMA user_version = 9');226 case 9:227 // Change made 24 November 2014 for new user/account settings228 self::$db->exec('ALTER TABLE phoromatic_user_settings ADD COLUMN NotifyOnHungSystems INTEGER DEFAULT 0');229 self::$db->exec('ALTER TABLE phoromatic_account_settings ADD COLUMN PowerOffWhenDone INTEGER DEFAULT 0');230 self::$db->exec('ALTER TABLE phoromatic_account_settings ADD COLUMN NetworkPowerUpWhenNeeded INTEGER DEFAULT 0');231 self::$db->exec('PRAGMA user_version = 10');232 case 10:233 // Change made 25 November for user context logging234 self::$db->exec('CREATE TABLE phoromatic_system_context_logs (AccountID TEXT, SystemID TEXT, UploadTime TEXT, ScheduleID INTEGER, TriggerID TEXT, UserContextStep TEXT, UserContextLog TEXT)');235 self::$db->exec('PRAGMA user_version = 11');236 case 11:237 // Change made 27 November for time elapsed during benchmarking238 self::$db->exec('ALTER TABLE phoromatic_results ADD COLUMN ElapsedTime INTEGER DEFAULT 0');239 self::$db->exec('PRAGMA user_version = 12');240 case 12:241 // Change made 27 November for IP/MAC address claiming to accounts242 self::$db->exec('CREATE TABLE phoromatic_system_association_claims (AccountID TEXT, IPAddress TEXT, NetworkMAC TEXT, CreationTime TEXT, UNIQUE(IPAddress, NetworkMAC) ON CONFLICT IGNORE)');243 self::$db->exec('PRAGMA user_version = 13');244 case 13:245 // Change made 30 November for percent complete246 self::$db->exec('ALTER TABLE phoromatic_systems ADD COLUMN TaskPercentComplete INTEGER DEFAULT 0');247 self::$db->exec('PRAGMA user_version = 14');248 case 14:249 // Change made 1 December for more reporting features250 self::$db->exec('ALTER TABLE phoromatic_systems ADD COLUMN CurrentProcessSchedule INTEGER');251 self::$db->exec('ALTER TABLE phoromatic_systems ADD COLUMN TimeToNextCommunication INTEGER DEFAULT 0');252 self::$db->exec('PRAGMA user_version = 15');253 case 15:254 // Change made 1 December for maintenance mode255 self::$db->exec('ALTER TABLE phoromatic_systems ADD COLUMN MaintenanceMode INTEGER DEFAULT 0');256 self::$db->exec('PRAGMA user_version = 16');257 case 16:258 // Change made 31 January for group name259 self::$db->exec('ALTER TABLE phoromatic_accounts ADD COLUMN GroupName TEXT');260 self::$db->exec('PRAGMA user_version = 17');261 case 17:262 // Change made 31 January for Phoromatic Public Result ID263 self::$db->exec('ALTER TABLE phoromatic_results ADD COLUMN PPRID TEXT');264 self::$db->exec('PRAGMA user_version = 18');265 case 18:266 // Change made 31 January for Phoromatic Public Result ID267 self::rebuild_pprid_entries();268 self::$db->exec('CREATE UNIQUE INDEX IF NOT EXISTS public_result_id ON phoromatic_results (PPRID)');269 self::$db->exec('PRAGMA user_version = 19');270 case 19:271 // Change made 31 January272 self::$db->exec('ALTER TABLE phoromatic_account_settings ADD COLUMN LetOtherGroupsViewResults INTEGER DEFAULT 0');273 self::$db->exec('PRAGMA user_version = 20');274 case 20:275 // Change made 4 February276 self::$db->exec('ALTER TABLE phoromatic_account_settings ADD COLUMN PreSeedTestInstalls INTEGER DEFAULT 0');277 self::$db->exec('PRAGMA user_version = 21');278 case 21:279 // Change made 8 February280 self::$db->exec('CREATE TABLE phoromatic_benchmark_tickets (AccountID TEXT, TicketID INTEGER, TicketIssueTime TEXT, Title TEXT, ResultIdentifier TEXT, SuiteToRun TEXT, Description TEXT, State INTEGER DEFAULT 1, LastModifiedBy TEXT, LastModifiedOn TEXT, RunTargetSystems TEXT, RunTargetGroups TEXT, UNIQUE(AccountID, TicketID) ON CONFLICT IGNORE)');281 self::$db->exec('PRAGMA user_version = 22');282 case 22:283 // Change made 8 February284 self::$db->exec('ALTER TABLE phoromatic_results ADD COLUMN BenchmarkTicketID INTEGER');285 self::$db->exec('PRAGMA user_version = 23');286 case 23:287 // Change made 24 February288 self::$db->exec('ALTER TABLE phoromatic_systems ADD COLUMN SystemVariables TEXT');289 self::$db->exec('PRAGMA user_version = 24');290 case 24:291 // Change made 24 February292 self::$db->exec('ALTER TABLE phoromatic_benchmark_tickets ADD COLUMN EnvironmentVariables TEXT');293 self::$db->exec('PRAGMA user_version = 25');294 case 25:295 // Change made 10 March296 self::$db->exec('CREATE TABLE phoromatic_annotations (AccountID TEXT, Type TEXT, ID TEXT, SecondaryID TEXT, AnnotatedTime TEXT, AnnotatedBy TEXT, Annotation TEXT)');297 self::$db->exec('PRAGMA user_version = 26');298 case 26:299 // Change made 26 March300 self::$db->exec('ALTER TABLE phoromatic_systems ADD COLUMN BlockPowerOffs INTEGER DEFAULT 0');301 self::$db->exec('PRAGMA user_version = 27');302 case 27:303 // Change made 27 March304 self::$db->exec('ALTER TABLE phoromatic_account_settings ADD COLUMN PowerOnSystemDaily INTEGER DEFAULT 0');305 self::$db->exec('PRAGMA user_version = 28');306 case 28:307 // Change made 13 April308 self::$db->exec('ALTER TABLE phoromatic_account_settings ADD COLUMN LetPublicViewResults INTEGER DEFAULT 0');309 self::$db->exec('PRAGMA user_version = 29');310 case 29:311 // Change made 12 May312 self::$db->exec('ALTER TABLE phoromatic_systems ADD COLUMN TickThreadEvent TEXT');313 self::$db->exec('PRAGMA user_version = 30');314 case 30:315 // Change made 3 June316 self::$db->exec('ALTER TABLE phoromatic_systems ADD COLUMN CoreVersion INTEGER');317 self::$db->exec('PRAGMA user_version = 31');318 case 31:319 // Change made 5 June320 self::$db->exec('CREATE TABLE phoromatic_schedules_trigger_skips (AccountID TEXT, ScheduleID INTEGER, Trigger TEXT, UNIQUE(AccountID, ScheduleID, Trigger) ON CONFLICT IGNORE)');321 self::$db->exec('PRAGMA user_version = 32');322 case 32:323 // Change made 10 June324 self::$db->exec('ALTER TABLE phoromatic_schedules_triggers ADD COLUMN SubTarget TEXT');325 self::$db->exec('PRAGMA user_version = 33');326 case 33:327 // Change made 4 October328 self::$db->exec('ALTER TABLE phoromatic_account_settings ADD COLUMN AutoApproveNewSystems INTEGER DEFAULT 0');329 self::$db->exec('PRAGMA user_version = 34');330 case 34:331 // Change made 7 January 2016332 self::$db->exec('ALTER TABLE phoromatic_account_settings ADD COLUMN LimitNetworkCommunication INTEGER DEFAULT 0');333 self::$db->exec('PRAGMA user_version = 35');334 case 35:335 // Change made 15 April 2016336 self::$db->exec('ALTER TABLE phoromatic_systems ADD COLUMN CurrentProcessTicket INTEGER DEFAULT 0');337 self::$db->exec('PRAGMA user_version = 36');338 case 36:339 // Change made 30 May 2017 for introducing run priority340 self::$db->exec('ALTER TABLE phoromatic_schedules ADD COLUMN RunPriority INTEGER DEFAULT 100');341 self::$db->exec('PRAGMA user_version = 37');342 }343 chmod($db_file, 0600);344 if(!defined('PHOROMATIC_DB_INIT'))345 {346 define('PHOROMATIC_DB_INIT', true);347 }348 }349 public static function generate_result_export_dump($account_id)350 {351 ini_set('memory_limit', '4G');352 pts_file_io::mkdir(self::phoromatic_path() . 'result-export/');353 $export_path = self::phoromatic_path() . 'result-export/' . $account_id . '/';354 pts_file_io::mkdir($export_path);355 $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_schedules WHERE AccountID = :account_id AND State = 1 AND (SELECT COUNT(*) FROM phoromatic_schedules_tests WHERE AccountID = :account_id AND ScheduleID = phoromatic_schedules.ScheduleID) > 0 AND (SELECT COUNT(*) FROM phoromatic_results WHERE AccountID = :account_id AND ScheduleID = phoromatic_schedules.ScheduleID) > 4 ORDER BY Title ASC');356 $stmt->bindValue(':account_id', $account_id);357 $result = $stmt->execute();358 $exported_result_index = array('phoromatic' => array());359 $error_index = array('phoromatic' => array());360 while($result && $row = $result->fetchArray())361 {362 $id = str_replace(' ', '-', strtolower($row['Title']));363 $triggers = array();364 $first_time = time();365 $latest_time = 0;366 $stmt2 = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_results WHERE AccountID = :account_id AND ScheduleID = :schedule_id ORDER BY UploadTime DESC');367 $stmt2->bindValue(':account_id', $row['AccountID']);368 $stmt2->bindValue(':schedule_id', $row['ScheduleID']);369 $result2 = $stmt2->execute();370 pts_file_io::mkdir($export_path);371 while($result2 && $row2 = $result2->fetchArray())372 {373 $composite_xml = phoromatic_server::phoromatic_account_result_path($row2['AccountID'], $row2['UploadID']) . 'composite.xml';374 if(is_file($composite_xml))375 {376 pts_file_io::mkdir($export_path . $id . '/' . $row2['Trigger']);377 pts_file_io::mkdir($export_path . $id . '/' . $row2['Trigger'] . '/' . phoromatic_server::system_id_to_name($row2['SystemID'], $row2['AccountID']));378 copy($composite_xml, $export_path . $id . '/' . $row2['Trigger'] . '/' . phoromatic_server::system_id_to_name($row2['SystemID'], $row2['AccountID']) . '/composite.xml');379 }380 pts_arrays::unique_push($triggers, $row2['Trigger']);381 $utime = strtotime($row2['UploadTime']);382 $first_time = min($first_time, $utime);383 $latest_time = max($latest_time, $utime);384 }385 $exported_result_index['phoromatic'][$id] = array(386 'title' => $row['Title'],387 'id' => $id,388 'description' => $row['Description'],389 'triggers' => $triggers,390 'first_result_time' => $first_time,391 'last_result_time' => $latest_time392 );393 $stmt2 = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_system_client_errors WHERE AccountID = :account_id AND ScheduleID = :schedule_id ORDER BY UploadTime DESC');394 $stmt2->bindValue(':account_id', $row['AccountID']);395 $stmt2->bindValue(':schedule_id', $row['ScheduleID']);396 $result2 = $stmt2->execute();397 $error_index['phoromatic'][$id] = array();398 while($result2 && $row2 = $result2->fetchArray())399 {400 // Only show last month of errors for now401 if(strtotime('-1 month') > strtotime($row2['UploadTime']))402 continue;403 $error_index['phoromatic'][$id][] = array(404 'system' => phoromatic_server::system_id_to_name($row2['SystemID'], $row2['AccountID']),405 'trigger' => $row2['TriggerID'],406 'test' => $row2['TestIdentifier'],407 'test_description' => $row2['TestArguments'],408 'error' => $row2['ErrorMessage'],409 'error_time' => strtotime($row2['UploadTime']),410 );411 }412 }413 $exported_result_index = json_encode($exported_result_index, JSON_PRETTY_PRINT);414 $error_index = json_encode($error_index, JSON_PRETTY_PRINT);415 file_put_contents($export_path . '/export-index.json', $exported_result_index);416 file_put_contents($export_path . '/export-test-errors.json', $error_index);417 }418 public static function send_email($to, $subject, $from, $body)419 {420 // return;421 $msg = '<html><body>' . $body . '422 <hr />423 <p><img src="http://www.phoronix-test-suite.com/web/pts-logo-60.png" /></p>424 <h6><em>The <a href="http://www.phoronix-test-suite.com/">Phoronix Test Suite</a>, <a href="http://www.phoromatic.com/">Phoromatic</a>, and <a href="http://openbenchmarking.org/">OpenBenchmarking.org</a> are products of <a href="http://www.phoronix-media.com/">Phoronix Media</a>.<br />The Phoronix Test Suite is open-source under terms of the GNU GPL. Commercial support, custom engineering, and other services are available by contacting Phoronix Media.<br />&copy; ' . date('Y') . ' Phoronix Media.</em></h6>425 </body></html>';426 $headers = "MIME-Version: 1.0\r\n";427 $headers .= "Content-type:text/html;charset=UTF-8\r\n";428 $headers .= "From: Phoromatic - Phoronix Test Suite <no-reply@phoromatic.com>\r\n";429 $headers .= "Reply-To: " . $from . " <" . $from . ">\r\n";430 mail($to, $subject, $msg, $headers);431 }432 protected static function rebuild_pprid_entries()433 {434 $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_results ORDER BY UploadTime ASC');435 $result = $stmt ? $stmt->execute() : false;436 while($result && ($row = $result->fetchArray()))437 {438 $stmt = phoromatic_server::$db->prepare('UPDATE phoromatic_results SET PPRID = :pprid WHERE AccountID = :account_id AND UploadID = :upload_id');439 $stmt->bindValue(':account_id', $row['AccountID']);440 $stmt->bindValue(':upload_id', $row['UploadID']);441 $stmt->bindValue(':pprid', phoromatic_server::compute_pprid($row['AccountID'], $row['SystemID'], $row['UploadTime'], $row['XmlUploadHash']));442 $stmt->execute();443 }444 }445 public static function compute_pprid($account_id, $system_id, $upload_time, $xml_upload_hash)446 {447 return base_convert(sha1($account_id . ' ' . $system_id . ' ' . $xml_upload_hash . ' ' . $upload_time), 10, 36);448 }449 public static function system_id_to_name($system_id, $aid = false)450 {451 static $system_names;452 if(!isset($system_names[$system_id]) || empty($system_names[$system_id]))453 {454 $stmt = phoromatic_server::$db->prepare('SELECT Title FROM phoromatic_systems WHERE AccountID = :account_id AND SystemID = :system_id');455 $stmt->bindValue(':account_id', ($aid ? $aid : $_SESSION['AccountID']));456 $stmt->bindValue(':system_id', $system_id);457 $result = $stmt->execute();458 $row = $result ? $result->fetchArray() : false;459 $system_names[$system_id] = isset($row['Title']) ? $row['Title'] : false;460 }461 return $system_names[$system_id];462 }463 public static function system_id_variables($system_id, $aid = false)464 {465 $stmt = phoromatic_server::$db->prepare('SELECT SystemVariables FROM phoromatic_systems WHERE AccountID = :account_id AND SystemID = :system_id');466 $stmt->bindValue(':account_id', ($aid ? $aid : $_SESSION['AccountID']));467 $stmt->bindValue(':system_id', $system_id);468 $result = $stmt->execute();469 $row = $result ? $result->fetchArray() : false;470 return isset($row['SystemVariables']) ? $row['SystemVariables'] : null;471 }472 public static function schedule_id_to_name($schedule_id, $aid = false)473 {474 static $schedule_names;475 if(!isset($schedule_names[$schedule_id]) || empty($schedule_names[$schedule_id]))476 {477 $stmt = phoromatic_server::$db->prepare('SELECT Title FROM phoromatic_schedules WHERE AccountID = :account_id AND ScheduleID = :schedule_id');478 $stmt->bindValue(':account_id', ($aid ? $aid : $_SESSION['AccountID']));479 $stmt->bindValue(':schedule_id', $schedule_id);480 $result = $stmt->execute();481 $row = $result ? $result->fetchArray() : false;482 $schedule_names[$schedule_id] = isset($row['Title']) ? $row['Title'] : false;483 }484 return $schedule_names[$schedule_id];485 }486 public static function ticket_id_to_name($ticket_id, $aid = false)487 {488 static $ticket_names;489 if(!isset($ticket_names[$ticket_id]) || empty($ticket_names[$ticket_id]))490 {491 $stmt = phoromatic_server::$db->prepare('SELECT Title FROM phoromatic_benchmark_tickets WHERE AccountID = :account_id AND TicketID = :ticket_id');492 $stmt->bindValue(':account_id', ($aid ? $aid : $_SESSION['AccountID']));493 $stmt->bindValue(':ticket_id', $ticket_id);494 $result = $stmt->execute();495 $row = $result ? $result->fetchArray() : false;496 $ticket_names[$ticket_id] = isset($row['Title']) ? $row['Title'] : false;497 }498 return $ticket_names[$ticket_id];499 }500 public static function account_id_to_group_admin_email($account_id)501 {502 $stmt = phoromatic_server::$db->prepare('SELECT Email FROM phoromatic_users WHERE AccountID = :account_id AND AdminLevel = 1 ORDER BY CreatedOn ASC LIMIT 1');503 $stmt->bindValue(':account_id', $account_id);504 $result = $stmt->execute();505 $row = $result ? $result->fetchArray() : false;506 return isset($row['Email']) ? $row['Email'] : false;507 }508 public static function account_id_to_group_name($account_id)509 {510 static $group_names;511 if(!isset($group_names[$account_id]) || empty($group_names[$account_id]))512 {513 $stmt = phoromatic_server::$db->prepare('SELECT GroupName FROM phoromatic_accounts WHERE AccountID = :account_id');514 $stmt->bindValue(':account_id', $account_id);515 $result = $stmt->execute();516 $row = $result ? $result->fetchArray() : false;517 $group_names[$account_id] = isset($row['GroupName']) ? $row['GroupName'] : null;518 }519 return $group_names[$account_id];520 }521 public static function account_created_on($account_id)522 {523 static $created_dates;524 if(!isset($created_dates[$account_id]) || empty($created_dates[$account_id]))525 {526 $stmt = phoromatic_server::$db->prepare('SELECT CreatedOn FROM phoromatic_accounts WHERE AccountID = :account_id');527 $stmt->bindValue(':account_id', $account_id);528 $result = $stmt->execute();529 $row = $result ? $result->fetchArray() : false;530 $created_dates[$account_id] = isset($row['CreatedOn']) ? $row['CreatedOn'] : null;531 }532 return $created_dates[$account_id];533 }534 public static function recently_active_systems($account_id)535 {536 $systems = array();537 $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_systems WHERE AccountID = :account_id AND State >= 0 ORDER BY LastCommunication DESC');538 $stmt->bindValue(':account_id', $account_id);539 $result = $stmt->execute();540 while($result && $row = $result->fetchArray())541 {542 if(strtotime($row['LastCommunication']) < (time() - 21600))543 break;544 if(stripos($row['CurrentTask'], 'shutdown') !== false || stripos($row['CurrentTask'], 'exit') !== false)545 continue;546 $systems[] = $row;547 }548 return $systems;549 }550 public static function check_for_benchmark_ticket_result_match($benchmark_id, $account_id, $system_id, $ticket_issue_time)551 {552 $stmt = phoromatic_server::$db->prepare('SELECT UploadID FROM phoromatic_results WHERE AccountID = :account_id AND SystemID = :system_id AND BenchmarkTicketID = :benchmark_id AND UploadTime > :ticket_issue_time');553 $stmt->bindValue(':account_id', $account_id);554 $stmt->bindValue(':system_id', $system_id);555 $stmt->bindValue(':benchmark_id', $benchmark_id);556 $stmt->bindValue(':ticket_issue_time', $ticket_issue_time);557 $result = $stmt->execute();558 if($result && $result->fetchArray() != false)559 {560 return true;561 }562 return false;563 }564 public static function check_for_triggered_result_match($schedule_id, $trigger_id, $account_id, $system_id)565 {566 $stmt = phoromatic_server::$db->prepare('SELECT UploadID FROM phoromatic_results WHERE AccountID = :account_id AND ScheduleID = :schedule_id AND Trigger = :trigger AND SystemID = :system_id');567 $stmt->bindValue(':account_id', $account_id);568 $stmt->bindValue(':system_id', $system_id);569 $stmt->bindValue(':schedule_id', $schedule_id);570 $stmt->bindValue(':trigger', $trigger_id);571 $result = $stmt->execute();572 if($result && $result->fetchArray() != false)573 {574 return true;575 }576 // See if the system attempted to run the trigger/schedule combination but reported an error during the process....577 $stmt = phoromatic_server::$db->prepare('SELECT COUNT(ErrorMessage) AS ErrorCount FROM phoromatic_system_client_errors WHERE AccountID = :account_id AND SystemID = :system_id AND ScheduleID = :schedule_id AND TriggerID = :trigger');578 $stmt->bindValue(':account_id', $account_id);579 $stmt->bindValue(':system_id', $system_id);580 $stmt->bindValue(':schedule_id', $schedule_id);581 $stmt->bindValue(':trigger', $trigger_id);582 $result = $stmt->execute();583 if($result != false && ($row = $result->fetchArray()) != false)584 {585 $error_count = $row['ErrorCount'];586 $stmt = phoromatic_server::$db->prepare('SELECT COUNT(*) AS TestCount FROM phoromatic_schedules_tests WHERE AccountID = :account_id AND ScheduleID = :schedule_id');587 $stmt->bindValue(':account_id', $account_id);588 $stmt->bindValue(':schedule_id', $schedule_id);589 $result = $stmt->execute();590 $row = $result ? $result->fetchArray() : null;591 // See if error count was greater than test count, meaning all of the tests might have failed592 if($error_count >= $row['TestCount'])593 {594 return true;595 }596 }597 $stmt = phoromatic_server::$db->prepare('SELECT ScheduleID FROM phoromatic_schedules_trigger_skips WHERE AccountID = :account_id AND ScheduleID = :schedule_id AND Trigger = :trigger');598 $stmt->bindValue(':account_id', $account_id);599 $stmt->bindValue(':schedule_id', $schedule_id);600 $stmt->bindValue(':trigger', $trigger_id);601 $result = $stmt->execute();602 if($result && $result->fetchArray() != false)603 {604 return true;605 }606 return false;607 }608 public static function user_friendly_timedate($time)609 {610 return date('j F H:i', strtotime($time));611 }612 public static function get_system_details($account_id, $system_id)613 {614 $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_systems WHERE AccountID = :account_id AND SystemID = :system_id LIMIT 1');615 $stmt->bindValue(':account_id', $account_id);616 $stmt->bindValue(':system_id', $system_id);617 $result = $stmt->execute();618 $row = $result ? $result->fetchArray() : null;619 return $row;620 }621 public static function systems_associated_with_schedule($account_id, $schedule_id)622 {623 $system_ids = array();624 $stmt = phoromatic_server::$db->prepare('SELECT RunTargetSystems, RunTargetGroups FROM phoromatic_schedules WHERE AccountID = :account_id AND ScheduleID = :schedule_id LIMIT 1');625 $stmt->bindValue(':account_id', $account_id);626 $stmt->bindValue(':schedule_id', $schedule_id);627 $result = $stmt->execute();628 if($result && $row = $result->fetchArray())629 {630 foreach(explode(',', $row['RunTargetSystems']) as $sys)631 {632 if(empty($sys))633 continue;634 $system_ids[] = $sys;635 }636 foreach(explode(',', $row['RunTargetGroups']) as $group)637 {638 if(empty($group))639 continue;640 $stmt = phoromatic_server::$db->prepare('SELECT SystemID FROM phoromatic_systems WHERE AccountID = :account_id AND Groups LIKE :sgroup AND State > 0 ORDER BY Title ASC');641 $stmt->bindValue(':account_id', $account_id);642 $stmt->bindValue(':sgroup', '%#' . $group . '#%');643 $result = $stmt->execute();644 while($result && $row = $result->fetchArray())645 {646 $system_ids[] = $row['SystemID'];647 }648 }649 }650 return array_unique($system_ids);651 }652 public static function schedules_that_run_on_system($account_id, $system_id)653 {654 $schedules = array();655 $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_schedules WHERE AccountID = :account_id AND State = 1 ORDER BY TITLE ASC');656 $stmt->bindValue(':account_id', $account_id);657 $result = $stmt->execute();658 while($result && $row = $result->fetchArray())659 {660 // Make sure this test schedule is supposed to work on given system661 if(!in_array($system_id, explode(',', $row['RunTargetSystems'])))662 {663 $stmt = phoromatic_server::$db->prepare('SELECT Groups FROM phoromatic_systems WHERE AccountID = :account_id AND SystemID = :system_id LIMIT 1');664 $stmt->bindValue(':account_id', $account_id);665 $stmt->bindValue(':system_id', $system_id);666 $sys_result = $stmt->execute();667 $sys_row = $sys_result ? $sys_result->fetchArray() : null;668 $matches_to_group = false;669 foreach(explode(',', $row['RunTargetGroups']) as $group)670 {671 if(stripos($sys_row['Groups'], '#' . $group . '#') !== false)672 {673 $matches_to_group = true;674 break;675 }676 }677 if($matches_to_group == false)678 continue;679 }680 $schedules[] = $row;681 }682 return $schedules;683 }684 public static function system_has_outstanding_jobs($account_id, $system_id, $time_offset = 0, $include_low_priority_work = true)685 {686 $stmt = phoromatic_server::$db->prepare('SELECT Groups FROM phoromatic_systems WHERE AccountID = :account_id AND SystemID = :system_id LIMIT 1');687 $stmt->bindValue(':account_id', $account_id);688 $stmt->bindValue(':system_id', $system_id);689 $sys_result = $stmt->execute();690 $sys_row = $sys_result ? $sys_result->fetchArray() : null;691 // See if there's an open schedule to run for system692 $schedule_row = self::system_check_for_open_schedule_run($account_id, $system_id, $time_offset, $sys_row, $include_low_priority_work);693 if($schedule_row != false)694 {695 return $schedule_row;696 }697 // See if there's an open benchmark ticket for system698 $ticket_row = self::system_check_for_open_benchmark_ticket($account_id, $system_id, $sys_row);699 if($ticket_row != false)700 {701 return $ticket_row;702 }703 return false;704 }705 public static function system_check_for_open_schedule_run($account_id, $system_id, $time_offset = 0, &$sys_row, $include_low_priority_work = true)706 {707 if($include_low_priority_work)708 {709 $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_schedules WHERE AccountID = :account_id AND State = 1 AND (SELECT COUNT(*) FROM phoromatic_schedules_tests WHERE AccountID = :account_id AND ScheduleID = phoromatic_schedules.ScheduleID) > 0 ORDER BY RunPriority DESC');710 }711 else712 {713 // Only include higher priority work714 $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_schedules WHERE AccountID = :account_id AND State = 1 AND RunPriority >= 100 AND (SELECT COUNT(*) FROM phoromatic_schedules_tests WHERE AccountID = :account_id AND ScheduleID = phoromatic_schedules.ScheduleID) > 0 ORDER BY RunPriority DESC');715 }716 $stmt->bindValue(':account_id', $account_id);717 $result = $stmt->execute();718 $day_of_week_int = date('N') - 1;719 while($result && $row = $result->fetchArray())720 {721 // Make sure this test schedule is supposed to work on given system722 if(!in_array($system_id, explode(',', $row['RunTargetSystems'])))723 {724 $matches_to_group = false;725 foreach(explode(',', $row['RunTargetGroups']) as $group)726 {727 if(stripos($sys_row['Groups'], '#' . $group . '#') !== false)728 {729 $matches_to_group = true;730 break;731 }732 }733 if($matches_to_group == false)734 continue;735 }736 // See if test is a time-based schedule due to run today and now or past the time scheduled to run737 if(strpos($row['ActiveOn'], strval($day_of_week_int)) !== false)738 {739 if($row['RunAt'] <= date('H.i', (time() + $time_offset)))740 {741 $trigger_id = date('Y-m-d');742 if(!phoromatic_server::check_for_triggered_result_match($row['ScheduleID'], $trigger_id, $account_id, $system_id))743 {744 return $row;745 }746 }747 }748 // See if custom trigger...749 $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_schedules_triggers WHERE AccountID = :account_id AND ScheduleID = :schedule_id ORDER BY TriggeredOn DESC');750 $stmt->bindValue(':account_id', $account_id);751 $stmt->bindValue(':schedule_id', $row['ScheduleID']);752 $trigger_result = $stmt->execute();753 while($trigger_result && $trigger_row = $trigger_result->fetchArray())754 {755 // See if any sub-targeting is happening756 if($trigger_row['SubTarget'] !== null)757 {758 $sub_targets = explode(',', $trigger_row['SubTarget']);759 if(!empty($sub_targets) && !in_array($system_id, $sub_targets))760 {761 // This system isn't part of the sub-targeted trigger762 continue;763 }764 }765 if(substr($trigger_row['TriggeredOn'], 0, 10) == date('Y-m-d') || substr($trigger_row['TriggeredOn'], 0, 10) == date('Y-m-d', (time() - 60 * 60 * 24)))766 {767 if(!phoromatic_server::check_for_triggered_result_match($row['ScheduleID'], $trigger_row['Trigger'], $account_id, $system_id))768 {769 $row['Trigger'] = $trigger_row['Trigger'];770 return $row;771 }772 }773 }774 }775 return false;776 }777 public static function system_check_for_open_benchmark_ticket($account_id, $system_id, &$sys_row)778 {779 $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_benchmark_tickets WHERE AccountID = :account_id AND State = 1 AND TicketIssueTime < :current_time AND TicketIssueTime > :yesterday ORDER BY TicketIssueTime ASC');780 //echo phoromatic_server::$db->lastErrorMsg();781 $stmt->bindValue(':account_id', $account_id);782 $stmt->bindValue(':current_time', time());783 $stmt->bindValue(':yesterday', (time() - (60 * 60 * 24)));784 $result = $stmt->execute();785 while($result && $row = $result->fetchArray())786 {787 // Make sure this test schedule is supposed to work on given system788 if(!in_array($system_id, explode(',', $row['RunTargetSystems'])))789 {790 $matches_to_group = false;791 foreach(explode(',', $row['RunTargetGroups']) as $group)792 {793 if(stripos($sys_row['Groups'], '#' . $group . '#') !== false)794 {795 $matches_to_group = true;796 break;797 }798 }799 if($matches_to_group == false)800 continue;801 }802 if(!phoromatic_server::check_for_benchmark_ticket_result_match($row['TicketID'], $account_id, $system_id, $row['TicketIssueTime']))803 {804 if(strpos($row['EnvironmentVariables'], 'PTS_CONCURRENT_TEST_RUNS') !== false && is_file(phoromatic_server::phoromatic_account_stress_log_path($account_id, $row['TicketID']) . $system_id . '.log') && filemtime(phoromatic_server::phoromatic_account_stress_log_path($account_id, $row['TicketID']) . $system_id . '.log') > $row['TicketIssueTime'])805 {806 // Stress log uploaded807 continue;808 }809 return $row;810 }811 }812 return false;813 }814 public static function time_to_next_scheduled_job($account_id, $system_id)815 {816 $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_schedules WHERE AccountID = :account_id AND State = 1 AND (SELECT COUNT(*) FROM phoromatic_schedules_tests WHERE AccountID = :account_id AND ScheduleID = phoromatic_schedules.ScheduleID) > 0');817 $stmt->bindValue(':account_id', $account_id);818 $result = $stmt->execute();819 $scheduled_times = array();820 while($result && $row = $result->fetchArray())821 {822 // Make sure this test schedule is supposed to work on given system823 if(!in_array($system_id, explode(',', $row['RunTargetSystems'])))824 {825 $stmt = phoromatic_server::$db->prepare('SELECT Groups FROM phoromatic_systems WHERE AccountID = :account_id AND SystemID = :system_id LIMIT 1');826 $stmt->bindValue(':account_id', $account_id);827 $stmt->bindValue(':system_id', $system_id);828 $sys_result = $stmt->execute();829 $sys_row = $sys_result ? $sys_result->fetchArray() : null;830 $matches_to_group = false;831 foreach(explode(',', $row['RunTargetGroups']) as $group)832 {833 if(stripos($sys_row['Groups'], '#' . $group . '#') !== false)834 {835 $matches_to_group = true;836 break;837 }838 }839 if($matches_to_group == false)840 continue;841 }842 foreach(explode(',', $row['ActiveOn']) as $active_day)843 {844 list($hour, $minute) = explode('.', $row['RunAt']);845 $scheduled_times[] = (($active_day * 1440) + ($hour * 60) + $minute );846 }847 }848 sort($scheduled_times);849 $now_time = ((date('N') - 1) * 1440) + (date('G') * 60) + date('i');850 foreach($scheduled_times as $i => $time_to_next_job)851 {852 if($now_time > $time_to_next_job)853 unset($scheduled_times[$i]);854 }855 if(!empty($scheduled_times))856 return array_shift($scheduled_times) - $now_time;857 return false;858 }859 public static function estimated_time_remaining_diff($estimated_minutes, $last_comm)860 {861 if($estimated_minutes > 0)862 {863 $estimated_completion = strtotime($last_comm) + ($estimated_minutes * 60);864 // Positive if ahead, negative number if the task elapsed865 return ceil(($estimated_completion - time()) / 60);866 }867 return 0;868 }869 public static function systems_appearing_down($account_id = null)870 {871 if(isset($_SESSION['AccountID']))872 $account_id = $_SESSION['AccountID'];873 $systems = array();874 $stmt = phoromatic_server::$db->prepare('SELECT SystemID, Title, LastCommunication, CurrentTask FROM phoromatic_systems WHERE AccountID = :account_id AND State >= 0 ORDER BY LastCommunication DESC');875 $stmt->bindValue(':account_id', $account_id);876 $result = $stmt->execute();877 while($result && $row = $result->fetchArray())878 {879 if(phoromatic_server::system_check_if_down($_SESSION['AccountID'], $row['SystemID'], $row['LastCommunication'], $row['CurrentTask']))880 {881 $systems[] = $row['SystemID'];882 }883 }884 return $systems;885 }886 public static function schedules_today($account_id)887 {888 $schedules = array();889 $show_day_of_week = date('N') - 1;890 $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_schedules WHERE AccountID = :account_id AND State = 1 AND (SELECT COUNT(*) FROM phoromatic_schedules_tests WHERE AccountID = :account_id AND ScheduleID = phoromatic_schedules.ScheduleID) > 0 AND ActiveOn LIKE :active_day ORDER BY RunAt ASC');891 $stmt->bindValue(':account_id', $account_id);892 $stmt->bindValue(':active_day', '%' . $show_day_of_week . '%');893 $result = $stmt->execute();894 while($result && $row = $result->fetchArray())895 {896 $schedules[] = $row;897 }898 return $schedules;899 }900 public static function schedules_total($account_id)901 {902 $schedules = array();903 $show_day_of_week = date('N') - 1;904 $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_schedules WHERE AccountID = :account_id AND State = 1 AND (SELECT COUNT(*) FROM phoromatic_schedules_tests WHERE AccountID = :account_id AND ScheduleID = phoromatic_schedules.ScheduleID) > 0 ORDER BY RunAt ASC');905 $stmt->bindValue(':account_id', $account_id);906 $result = $stmt->execute();907 while($result && $row = $result->fetchArray())908 {909 $schedules[] = $row;910 }911 return $schedules;912 }913 public static function benchmark_tickets_today($account_id)914 {915 $tickets = array();916 $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_benchmark_tickets WHERE AccountID = :account_id AND State >= 0 AND TicketIssueTime > :time_cutoff ORDER BY TicketIssueTime DESC');917 $stmt->bindValue(':account_id', $account_id);918 $stmt->bindValue(':time_cutoff', (time() - (60 * 60 * 24 * 14)));...

Full Screen

Full Screen

phoromatic_schedules

Using AI Code Generation

copy

Full Screen

1require_once('phoromatic_schedules.php');2require_once('phoromatic_systems.php');3require_once('phoromatic_results.php');4require_once('phoromatic_users.php');5require_once('phoromatic_server.php');6require_once('phoromatic_accounts.php');7require_once('phoromatic_settings.php');8require_once('phoromatic_websocket.php');9require_once('phoromatic_results_viewer.php');10require_once('phoromatic_storage_manager.php');11require_once('phoromatic_upload_handler.php');12require_once('phoromatic_graphs.php');13require_once('phoromatic_test_profile.php');14require_once('phoromatic_test_suite.php');15require_once('phoromatic_test_profile_manager.php');16require_once('phoromatic_test_suite_manager.php');17require_once('phoromatic_test_profile_viewer.php');18require_once('phoromatic_test_suite_viewer.php');19require_once('phoromatic_results_viewer.php');

Full Screen

Full Screen

phoromatic_schedules

Using AI Code Generation

copy

Full Screen

1require_once('pts-core/objects/client/phoromatic_schedules.php');2require_once('pts-core/objects/client/phoromatic_server.php');3require_once('pts-core/objects/client/phoromatic_account_profile.php');4require_once('pts-core/objects/client/phoromatic_user.php');5require_once('pts-core/objects/client/phoromatic_systems.php');6require_once('pts-core/objects/client/phoromatic_results_viewer.php');7require_once('pts-core/objects/client/phoromatic_results_analyzer.php');8require_once('pts-core/objects/client/phoromatic_results_upload.php');9require_once('pts-core/objects/client/phoromatic_results_export.php');10require_once('pts-core/objects/client/phoromatic_results_compare.php');11require_once('pts-core/objects/client/phoromatic_results.php');12require_once('pts-core/objects/client/phoromatic_test_profile.php');13require_once('pts-core/objects/client/phoromatic_systems.php');14require_once('pts-core/objects/client/phoromatic_system.php');15require_once('pts-core/objects/client/phoromatic_server.php');16require_once('pts-core/objects/client/phoromatic_schedules.php');

Full Screen

Full Screen

phoromatic_schedules

Using AI Code Generation

copy

Full Screen

1require_once('pts-core/phoromatic_schedules.php');2require_once('pts-core/phoromatic_server.php');3require_once('pts-core/phoromatic_user.php');4require_once('pts-core/phoromatic_results.php');5require_once('pts-core/phoromatic_system_activity.php');6require_once('pts-core/phoromatic_accounts.php');7require_once('pts-core/phoromatic_websocket.php');8require_once('pts-core/phoromatic_websocket_server.php');9require_once('pts-core/phoromatic_websocket_client.php');10require_once('pts-core/phoromatic_websocket_client_handler.php');11require_once('pts-core/phoromatic_websocket_server_handler.php');12require_once('pts-core/phoromatic_websocket_server_handler.php');13require_once('pts-core/phoromatic_websocket_server_handler.php');14require_once('pts-core/phoromatic_websocket_server_handler.php');15require_once('pts-core/phoromatic_websocket_server_handler.php');16require_once('pts-core/phoromatic_websocket_server_handler.php');17require_once('pts-core/phoromatic_web

Full Screen

Full Screen

phoromatic_schedules

Using AI Code Generation

copy

Full Screen

1require_once('phoromatic_schedules.php');2$phoromatic_schedules = new phoromatic_schedules();3$phoromatic_schedules->get_schedules();4require_once('phoromatic_schedules.php');5$phoromatic_schedules = new phoromatic_schedules();6$phoromatic_schedules->get_schedules();7require_once('phoromatic_schedules.php');8$phoromatic_schedules = new phoromatic_schedules();9$phoromatic_schedules->get_schedules();10require_once('phoromatic_schedules.php');11$phoromatic_schedules = new phoromatic_schedules();12$phoromatic_schedules->get_schedules();13require_once('phoromatic_schedules.php');14$phoromatic_schedules = new phoromatic_schedules();15$phoromatic_schedules->get_schedules();16require_once('phoromatic_schedules.php');17$phoromatic_schedules = new phoromatic_schedules();18$phoromatic_schedules->get_schedules();19require_once('phoromatic_schedules.php');20$phoromatic_schedules = new phoromatic_schedules();21$phoromatic_schedules->get_schedules();22require_once('phoromatic_schedules.php');23$phoromatic_schedules = new phoromatic_schedules();24$phoromatic_schedules->get_schedules();25require_once('phoromatic_schedules.php');26$phoromatic_schedules = new phoromatic_schedules();

Full Screen

Full Screen

phoromatic_schedules

Using AI Code Generation

copy

Full Screen

1require_once("phoromatic_schedules.php");2$phoromatic_schedules = new phoromatic_schedules();3$phoromatic_schedules->set_schedule_name("schedule_name");4$phoromatic_schedules->set_schedule_description("schedule_description");5$phoromatic_schedules->set_schedule_start_date("schedule_start_date");6$phoromatic_schedules->set_schedule_end_date("schedule_end_date");7$phoromatic_schedules->set_schedule_repeat("schedule_repeat");8$phoromatic_schedules->set_schedule_repeat_on("schedule_repeat_on");9$phoromatic_schedules->set_schedule_repeat_type("schedule_repeat_type");10$phoromatic_schedules->set_schedule_repeat_every("schedule_repeat_every");11$phoromatic_schedules->set_schedule_repeat_until("schedule_repeat_until");12$phoromatic_schedules->set_schedule_repeat_on("schedule_repeat_on");13$phoromatic_schedules->set_schedule_days("schedule_days");14$phoromatic_schedules->set_schedule_months("schedule_months");15$phoromatic_schedules->set_schedule_start_time("schedule_start_time");16$phoromatic_schedules->set_schedule_end_time("schedule_end_time");17$phoromatic_schedules->set_schedule_timezone("schedule_timezone");18$phoromatic_schedules->set_schedule_status("schedule_status");19$phoromatic_schedules->set_schedule_test("schedule_test");20$phoromatic_schedules->set_schedule_arguments("schedule_arguments");21$phoromatic_schedules->set_schedule_systems("schedule_systems");22$phoromatic_schedules->set_schedule_uploads("schedule_uploads");23$phoromatic_schedules->set_schedule_priority("schedule_priority");24$phoromatic_schedules->set_schedule_triggers("schedule_triggers");25$phoromatic_schedules->set_schedule_triggers_type("schedule_triggers_type");26$phoromatic_schedules->set_schedule_triggers_value("schedule_triggers_value");27$phoromatic_schedules->set_schedule_triggers_action("schedule_triggers_action");28$phoromatic_schedules->set_schedule_triggers_action_value("schedule_triggers_action_value");29$phoromatic_schedules->set_schedule_triggers_action_message("schedule_triggers_action_message");30$phoromatic_schedules->set_schedule_triggers_action_email("schedule_triggers_action_email");31$phoromatic_schedules->set_schedule_triggers_action_email_subject("schedule_triggers_action_email_subject");

Full Screen

Full Screen

phoromatic_schedules

Using AI Code Generation

copy

Full Screen

1require_once('pts-core/phoromatic_schedules.php');2$phoromatic_schedules = new phoromatic_schedules();3$schedule_id = $_GET['schedule_id'];4$schedule_details = $phoromatic_schedules->get_schedule_details($schedule_id);5$schedule_name = $schedule_details['schedule_name'];6$schedule_description = $schedule_details['schedule_description'];7$schedule_notes = $schedule_details['schedule_notes'];8$schedule_status = $schedule_details['schedule_status'];9$schedule_start_date = $schedule_details['schedule_start_date'];10$schedule_end_date = $schedule_details['schedule_end_date'];11$schedule_start_time = $schedule_details['schedule_start_time'];12$schedule_end_time = $schedule_details['schedule_end_time'];13$schedule_time_zone = $schedule_details['schedule_time_zone'];14$schedule_run_time = $schedule_details['schedule_run_time'];15$schedule_trigger_type = $schedule_details['schedule_trigger_type'];16$schedule_trigger_id = $schedule_details['schedule_trigger_id'];

Full Screen

Full Screen

phoromatic_schedules

Using AI Code Generation

copy

Full Screen

1$phoromatic_schedule = new phoromatic_schedules();2$schedule_id = $phoromatic_schedule->get_schedule_id();3$phoromatic_test = new phoromatic_test();4$test_id = $phoromatic_test->get_test_id();5$phoromatic_test = new phoromatic_test();6$test_name = $phoromatic_test->get_test_name();7$phoromatic_test = new phoromatic_test();8$test_description = $phoromatic_test->get_test_description();9$phoromatic_test = new phoromatic_test();10$test_arguments = $phoromatic_test->get_test_arguments();11$phoromatic_test = new phoromatic_test();12$test_suite = $phoromatic_test->get_test_suite();13$phoromatic_test = new phoromatic_test();14$test_suite_version = $phoromatic_test->get_test_suite_version();15$phoromatic_test = new phoromatic_test();16$test_suite_arguments = $phoromatic_test->get_test_suite_arguments();17$phoromatic_test = new phoromatic_test();18$test_suite_description = $phoromatic_test->get_test_suite_description();19$phoromatic_test = new phoromatic_test();20$test_suite_name = $phoromatic_test->get_test_suite_name();21$phoromatic_test = new phoromatic_test();22$test_suite_type = $phoromatic_test->get_test_suite_type();23$phoromatic_test = new phoromatic_test();24$test_suite_version = $phoromatic_test->get_test_suite_version();25$phoromatic_test = new phoromatic_test();26$test_suite_version = $phoromatic_test->get_test_suite_version();27$phoromatic_test = new phoromatic_test();28$test_suite_version = $phoromatic_test->get_test_suite_version();

Full Screen

Full Screen

phoromatic_schedules

Using AI Code Generation

copy

Full Screen

1require_once('phoromatic_schedules.php');2$schedules = new PhoromaticSchedules();3echo $schedules->GetSchedules();4require_once('phoromatic_schedules.php');5$schedules = new PhoromaticSchedules();6echo $schedules->GetSchedules();7require_once('phoromatic_schedules.php');8$schedules = new PhoromaticSchedules();9echo $schedules->GetSchedules();10require_once('phoromatic_schedules.php');11$schedules = new PhoromaticSchedules();12echo $schedules->GetSchedules();13require_once('phoromatic_schedules.php');14$schedules = new PhoromaticSchedules();15echo $schedules->GetSchedules();16require_once('phoromatic_schedules.php');17$schedules = new PhoromaticSchedules();18echo $schedules->GetSchedules();19require_once('phoromatic_schedules.php');20$schedules = new PhoromaticSchedules();21echo $schedules->GetSchedules();

Full Screen

Full Screen

phoromatic_schedules

Using AI Code Generation

copy

Full Screen

1require_once(PTS_CORE_STATIC_PATH . 'phoromatic/phoromatic_schedules.php');2$schedules = phoromatic_schedules::get_schedules();3if($schedules)4{5 foreach($schedules as $schedule)6 {7 echo $schedule->name;8 }9}10{11 echo 'No schedules found';12}13require_once(PTS_CORE_STATIC_PATH . 'phoromatic/phoromatic_schedules.php');14$schedules = phoromatic_schedules::get_schedules();15if($schedules)16{17 foreach($schedules as $schedule)18 {19 echo $schedule->name;20 }21}22{23 echo 'No schedules found';24}25require_once(PTS_CORE_STATIC_PATH . 'phoromatic/phoromatic_schedules.php');26$schedules = phoromatic_schedules::get_schedules();27if($schedules)28{29 foreach($schedules as $schedule)30 {31 echo $schedule->name;32 }33}34{35 echo 'No schedules found';36}37require_once(PTS_CORE_STATIC_PATH . 'phoromatic/phoromatic_schedules.php');38$schedules = phoromatic_schedules::get_schedules();

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Phoronix-test-suite automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used methods in phoromatic_schedules

Run Selenium Automation Tests on LambdaTest Cloud Grid

Trigger Selenium automation tests on a cloud-based Grid of 3000+ real browsers and operating systems.

Test now for Free

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful