Completed
Push — develop ( 879d74...52dce9 )
by Seth
04:03
created
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
define('IGNORE_LTI', true);
4
	
5
require_once('common.inc.php');
6
7
// FIXME: should filter so that the syncs for the server we're running against (INDEX_WEB_PATH) are called (or is that already happening?)
8
$schedulesResponse = $sql->query("
9
	SELECT *
10
		FROM `schedules`
11
		WHERE
12
			`schedule` = '" . $sql->real_escape_string($argv[1]) . "'
13
		ORDER BY
14
			`synced` ASC
15
");
16
17
while($schedule = $schedulesResponse->fetch_assoc()) {
18
	$calendarResponse = $sql->query("
19
		SELECT *
20
			FROM `calendars`
21
			WHERE
22
				`id` = '{$schedule['calendar']}'
23
	");
24
	if ($calendar = $calendarResponse->fetch_assoc()) {
25
		echo shell_exec('php ' . __DIR__ . '/import.php ' . $calendar['ics_url'] . ' ' . $calendar['canvas_url'] . ' ' . $schedule['id']);
26
	}
27
}
28
29
?>
0 ignored issues
show
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...