This repository was archived by the owner on May 29, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-15
lines changed Expand file tree Collapse file tree 2 files changed +7
-15
lines changed Original file line number Diff line number Diff line change 2929
3030require_once (__DIR__ . '/common.inc.php ' );
3131
32+ if (isset ($ argc )) {
33+ $ _REQUEST ['cal ' ] = $ argv [1 ];
34+ $ _REQUEST ['canvas_url ' ] = $ argv [2 ];
35+ $ _REQUEST ['schedule ' ] = $ argv [3 ];
36+ }
37+
3238/**
3339 * compute the calendar context for the canvas object based on its URL
3440 **/
Original file line number Diff line number Diff line change 55
66require_once (APP_PATH . '/include/canvas-api.inc.php ' );
77require_once (APP_PATH . '/include/mysql.inc.php ' );
8- require_once (APP_PATH . '/include/Pest.php ' );
98
109require_once (__DIR__ . '/common.inc.php ' );
1110
1918 `synced` ASC
2019 " );
2120
22- $ import = new Pest (preg_replace ('%(https?://)(.*)% ' , '\\1 ' . MYSQL_USER . ': ' . MYSQL_PASSWORD . '@ \\2 ' , $ argv [INDEX_WEB_PATH ]));
2321while ($ schedule = $ schedulesResponse ->fetch_assoc ()) {
2422 $ calendarResponse = mysqlQuery ("
2523 SELECT *
2826 `id` = ' {$ schedule ['calendar ' ]}'
2927 " );
3028 if ($ calendar = $ calendarResponse ->fetch_assoc ()) {
31- try {
32- $ import ->get (
33- 'import ' , // assumes ../.htaccess with RewriteCond
34- array (
35- 'cal ' => $ calendar ['ics_url ' ],
36- 'canvas_url ' => $ calendar ['canvas_url ' ],
37- 'schedule ' => $ schedule ['id ' ]
38- )
39- );
40- } catch (Exception $ e ) {
41- debugFlag ($ e ->getMessage ());
42- exit ;
43- }
29+ shell_exec ("php import.php {$ calendar ['ics_url ' ]} {$ calendar ['canvas_url ' ]} {$ schedule ['id ' ]}" );
4430 }
4531}
4632
You can’t perform that action at this time.
0 commit comments