diff options
Diffstat (limited to 'includes/refresh.php')
-rw-r--r-- | includes/refresh.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/includes/refresh.php b/includes/refresh.php index 98bda15..8c50dfb 100644 --- a/includes/refresh.php +++ b/includes/refresh.php @@ -137,4 +137,19 @@ chdir("../.."); echo("Fetched school information\n"); +echo("Updating address book...\n"); + +$contacts = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/addressbook/contacts.json"), true); + +foreach ($contacts as $id => $_) { + $out = []; + exec("cd /_ch/includes/jobs && php UpdateContactMethods.php {\\\"contact\\\":\\\"$id\\\"}", $out); + + foreach ($out as $line) { + echo(" " . $line . "\n"); + } +} + +echo("Updated address book\n"); + echo("Completed.\n");
\ No newline at end of file |