From 895b7fa70883b60ad7ee15fefed6f908020310b9 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sun, 11 Dec 2016 19:55:39 +0100 Subject: add linebreak to error message --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index ef3944c..6c62e34 100644 --- a/index.php +++ b/index.php @@ -1,7 +1,7 @@ getSlug()); + + if(isset($conf['MAX_CONFERENCE_AGE'])) + { + date_diff() + return time() >= $this->endsAt(); + } + +} diff --git a/config.php b/config.php index 1dbea27..57be966 100644 --- a/config.php +++ b/config.php @@ -24,7 +24,7 @@ $GLOBALS['CONFIG']['PREVIEW_DOMAIN'] = 'xlocalhost'; * Protokollfreie URLs (welche, die mit // beginnen), werden automatisch mit dem korrekten Protokoll ergänzt. * In diesem Fall wird auch ein SSL-Umschalt-Button im Header angezeigt */ -if($_SERVER['SERVER_NAME'] == 'localhost') +if(@$_SERVER['SERVER_NAME'] == 'localhost') { // keine Konfiguration -> BASEURL wird automatisch erraten } @@ -38,3 +38,28 @@ else // Set a safe Default $GLOBALS['CONFIG']['BASEURL'] = '//streaming.media.ccc.de/'; } + + +/** + * Konfiguration für den Datei-Download Cronjob + */ +$GLOBALS['CONFIG']['DOWNLOAD'] = [ + /** + * Verweigeren Download, wenn der PHP-Prozess unter einem anderen Benutzer als diesem läuft + * Auskommentieren um alle Benutzer zu erlauben + */ + //'REQUIRE_USER' => 'www-data', + + /** + * Wartende HTTP-Downloads nach dieser Anzahl von Sekunden abbrechen + */ + 'HTTP_TIMEOUT' => 5 /* Sekunden */, + + /** + * Nur Dateien von Konferenzen herunterladen, die weniger als + * diese Aanzahl von Tagen alt sind (gemessen am END_DATE) + * + * Auskommentieren, um alle Konferenzen zu beachten + */ + 'MAX_CONFERENCE_AGE' => 30 /* Tage */, +]; diff --git a/index.php b/index.php index 6c62e34..9b4689c 100644 --- a/index.php +++ b/index.php @@ -27,6 +27,22 @@ require_once('model/Upcoming.php'); ob_start(); +if(isset($argv) && isset($argv[1])) +{ + require('lib/command-helper.php'); + + switch($argv[1]) + { + case 'download': + require('command/download.php'); + exit(0); + } + + stderr("Unknown Command: %s", $argv[1]); + exit(1); +} + + try { if(isset($_GET['htaccess'])) { -- cgit v1.2.3 From 3c3d0ac7301e818b14d01b9bbc949ca13d2cf798 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sun, 11 Dec 2016 19:57:20 +0100 Subject: commandline helper functions --- lib/command-helper.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lib/command-helper.php diff --git a/lib/command-helper.php b/lib/command-helper.php new file mode 100644 index 0000000..c406b9e --- /dev/null +++ b/lib/command-helper.php @@ -0,0 +1,15 @@ +getSlug()); + $months = intval($conf['MAX_CONFERENCE_AGE']); + $conferencesAfter = new DateTime(); + $conferencesAfter->sub(new DateInterval('P'.$months.'D')); - if(isset($conf['MAX_CONFERENCE_AGE'])) - { - date_diff() - return time() >= $this->endsAt(); - } + stdout('Filtering before %s', $conferencesAfter->format('Y-m-d')); + $conferences = array_filter($conferences, function($conference) use ($conferencesAfter) { + $isBefore = $conference->endsAt() < $conferencesAfter; + + if($isBefore) { + stdout( + ' %s: %s', + $conference->endsAt()->format('Y-m-d'), + $conference->getSlug() + ); + } + return !$isBefore; + }); +} + +stdout(''); +foreach ($conferences as $conference) +{ + stdout('== %s ==', $conference->getSlug()); } diff --git a/config.php b/config.php index 57be966..1b5e84f 100644 --- a/config.php +++ b/config.php @@ -61,5 +61,5 @@ $GLOBALS['CONFIG']['DOWNLOAD'] = [ * * Auskommentieren, um alle Konferenzen zu beachten */ - 'MAX_CONFERENCE_AGE' => 30 /* Tage */, + 'MAX_CONFERENCE_AGE' => 14 /* Tage */, ]; diff --git a/model/Conference.php b/model/Conference.php index 07d72dd..ae5ab41 100644 --- a/model/Conference.php +++ b/model/Conference.php @@ -33,11 +33,17 @@ class Conference extends ModelBase } public function startsAt() { - return $this->get('CONFERENCE.STARTS_AT'); + if(!$this->has('CONFERENCE.STARTS_AT')) + return null; + + return DateTime::createFromFormat('U', $this->get('CONFERENCE.STARTS_AT')); } public function endsAt() { - return $this->get('CONFERENCE.ENDS_AT'); + if(!$this->has('CONFERENCE.ENDS_AT')) + return null; + + return DateTime::createFromFormat('U', $this->get('CONFERENCE.ENDS_AT')); } public function hasBegun() { @@ -62,7 +68,8 @@ class Conference extends ModelBase } if($this->has('CONFERENCE.STARTS_AT')) { - return time() >= $this->get('CONFERENCE.STARTS_AT'); + $now = new DateTime('now'); + return $now >= $this->startsAt(); } else { return true; } @@ -84,7 +91,8 @@ class Conference extends ModelBase } if($this->has('CONFERENCE.ENDS_AT')) { - return time() >= $this->get('CONFERENCE.ENDS_AT'); + $now = new DateTime('now'); + return $now >= $this->endsAt(); } else { return false; } diff --git a/model/Conferences.php b/model/Conferences.php index 2dc9f35..8de4029 100644 --- a/model/Conferences.php +++ b/model/Conferences.php @@ -48,7 +48,7 @@ class Conferences $sorted = Conferences::getConferences(); usort($sorted, function($a, $b) { - return $b->startsAt() - $a->endsAt(); + return $b->startsAt() > $a->endsAt() ? 1 : -1; }); return $sorted; -- cgit v1.2.3 From 4c9cc1f8e6bcb8c68e5106437fcb41bbbc380885 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sun, 11 Dec 2016 20:27:58 +0100 Subject: list conferences sorted on startpage --- model/Conferences.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/Conferences.php b/model/Conferences.php index 8de4029..f930e32 100644 --- a/model/Conferences.php +++ b/model/Conferences.php @@ -33,7 +33,7 @@ class Conferences public static function getActiveConferences() { return array_values(array_filter( - Conferences::getConferences(), + Conferences::getConferencesSorted(), function($conference) { return !$conference->isClosed(); } -- cgit v1.2.3 From 6e0f7423769174b83d6b5618db7c33d54967099a Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sun, 11 Dec 2016 21:17:30 +0100 Subject: download files of forced-open conferences --- command/download.php | 13 ++++++++++++- model/Conference.php | 6 +++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/command/download.php b/command/download.php index cb0987d..d0999b4 100644 --- a/command/download.php +++ b/command/download.php @@ -23,8 +23,19 @@ if(isset($conf['MAX_CONFERENCE_AGE'])) $conferencesAfter = new DateTime(); $conferencesAfter->sub(new DateInterval('P'.$months.'D')); - stdout('Filtering before %s', $conferencesAfter->format('Y-m-d')); + stdout('Skipping Conferences before %s', $conferencesAfter->format('Y-m-d')); $conferences = array_filter($conferences, function($conference) use ($conferencesAfter) { + if($conference->isOpen()) + { + stdout( + ' %s: %s', + '---open---', + $conference->getSlug() + ); + + return true; + } + $isBefore = $conference->endsAt() < $conferencesAfter; if($isBefore) { diff --git a/model/Conference.php b/model/Conference.php index ae5ab41..be62fdb 100644 --- a/model/Conference.php +++ b/model/Conference.php @@ -19,7 +19,7 @@ class Conference extends ModelBase } public function isPreviewEnabled() { - if($GLOBALS['forceopen']) + if(@$GLOBALS['forceopen']) return true; if($this->has('PREVIEW_DOMAIN') && ($this->get('PREVIEW_DOMAIN') == $_SERVER['SERVER_NAME'])) @@ -32,6 +32,10 @@ class Conference extends ModelBase return !$this->hasBegun() || $this->hasEnded(); } + public function isOpen() { + return !$this->isClosed(); + } + public function startsAt() { if(!$this->has('CONFERENCE.STARTS_AT')) return null; -- cgit v1.2.3 From 284878f0f9917b55359cd464b86508cacc472653 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sun, 11 Dec 2016 21:46:01 +0100 Subject: add cache-file getters and download preparations --- command/download.php | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++ model/Conference.php | 4 ++++ model/Relive.php | 5 ++++ model/Schedule.php | 7 +++++- 4 files changed, 83 insertions(+), 1 deletion(-) diff --git a/command/download.php b/command/download.php index d0999b4..8deb454 100644 --- a/command/download.php +++ b/command/download.php @@ -54,4 +54,72 @@ stdout(''); foreach ($conferences as $conference) { stdout('== %s ==', $conference->getSlug()); + + $relive = $conference->getRelive(); + if($relive->isEnabled()) + { + download( + 'relive-json', + $conference, + $relive->getJsonUrl(), + $relive->getJsonCache() + ); + } + + $schedule = $conference->getSchedule(); + if($schedule->isEnabled()) + { + download( + 'schedule-xml', + $conference, + $schedule->getScheduleUrl(), + $schedule->getScheduleCache() + ); + } + + foreach($conference->getExtraFiles() as $file) + { + download( + 'extra-file', + $conference, + $file, + get_file_cache($conference, $file) + ); + } +} + + + + +function get_file_cache($conference, $url) +{ + $info = parse_url($url); + $host = trim(preg_replace('/[^a-z0-9]/i', '_', $info['host']), '_'); + $path = trim(preg_replace('/[^a-z0-9]/i', '_', $info['path']), '_'); + return sprintf('/tmp/file-cache-%s_%s_%s-%s', $conference->getSlug(), $host, $path, md5($url)); +} + +function download($what, $conference, $url, $cache) +{ + stdout( + ' downloading %s from %s to %s', + $what, + $url, + $cache + ); + if(!do_download($url, $cache)) + { + stderr( + '!! download %s for conference %s from %s to %s failed miserably !!', + $what, + $conference->getSlug(), + $url, + $cache + ); + } +} + +function do_download($url, $cache) +{ + return true; } diff --git a/model/Conference.php b/model/Conference.php index be62fdb..6c14746 100644 --- a/model/Conference.php +++ b/model/Conference.php @@ -221,4 +221,8 @@ class Conference extends ModelBase public function getRelive() { return new Relive($this); } + + public function getExtraFiles() { + return $this->get('EXTRA_FILES', []); + } } diff --git a/model/Relive.php b/model/Relive.php index 7f0e747..5676b62 100644 --- a/model/Relive.php +++ b/model/Relive.php @@ -24,6 +24,11 @@ class Relive return $this->getConference()->get('CONFERENCE.RELIVE_JSON'); } + public function getJsonCache() + { + return sprintf('/tmp/relive-cache-%s', $this->getConference()->getSlug()); + } + public function getTalks() { if(!file_exists($this->getJsonUrl())) diff --git a/model/Schedule.php b/model/Schedule.php index eb9fe05..4032ecb 100644 --- a/model/Schedule.php +++ b/model/Schedule.php @@ -265,11 +265,16 @@ class Schedule return ((int)$parts[0] * 60 + (int)$parts[1]) * 60; } - private function getScheduleUrl() + public function getScheduleUrl() { return $this->getConference()->get('SCHEDULE.URL'); } + public function getScheduleCache() + { + return sprintf('/tmp/schedule-cache-%s', $this->getConference()->getSlug()); + } + public function getScheduleToRoomSlugMapping() { $mapping = array(); -- cgit v1.2.3 From 9c7bccc3f2cc226cd5043752403e4c5d39c8b5b5 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sun, 11 Dec 2016 21:46:54 +0100 Subject: access relive config through relive-model --- model/Conference.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/Conference.php b/model/Conference.php index 6c14746..8d387a0 100644 --- a/model/Conference.php +++ b/model/Conference.php @@ -140,10 +140,10 @@ class Conference extends ModelBase } public function hasRelive() { - return $this->has('CONFERENCE.RELIVE_JSON'); + return $this->getRelive()->isEnabled(); } public function getReliveUrl() { - if($this->has('CONFERENCE.RELIVE_JSON')) + if($this->getRelive()->isEnabled()) return joinpath([$this->getSlug(), 'relive']).url_params(); else -- cgit v1.2.3 From 3384e963da66e9089b71c546750c8981be8c6ed8 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sat, 17 Dec 2016 14:11:47 +0100 Subject: change storage paths according to issue description --- command/download.php | 13 +++++-------- index.php | 3 +++ model/Relive.php | 2 +- model/Schedule.php | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/command/download.php b/command/download.php index 8deb454..17ae7c9 100644 --- a/command/download.php +++ b/command/download.php @@ -77,13 +77,13 @@ foreach ($conferences as $conference) ); } - foreach($conference->getExtraFiles() as $file) + foreach($conference->getExtraFiles() as $filename => $url) { download( 'extra-file', $conference, - $file, - get_file_cache($conference, $file) + $url, + get_file_cache($conference, $filename) ); } } @@ -91,12 +91,9 @@ foreach ($conferences as $conference) -function get_file_cache($conference, $url) +function get_file_cache($conference, $filename) { - $info = parse_url($url); - $host = trim(preg_replace('/[^a-z0-9]/i', '_', $info['host']), '_'); - $path = trim(preg_replace('/[^a-z0-9]/i', '_', $info['path']), '_'); - return sprintf('/tmp/file-cache-%s_%s_%s-%s', $conference->getSlug(), $host, $path, md5($url)); + return joinpath([$GLOBALS['BASEDIR'], 'configs/conferences', $conference->getSlug(), $filename]); } function download($what, $conference, $url, $cache) diff --git a/index.php b/index.php index 9b4689c..ca0a6d4 100644 --- a/index.php +++ b/index.php @@ -3,6 +3,9 @@ if(!ini_get('short_open_tag')) die("`short_open_tag = On` is required\n"); +$GLOBALS['BASEDIR'] = dirname(__FILE__); +chdir($GLOBALS['BASEDIR']); + require_once('config.php'); require_once('lib/helper.php'); diff --git a/model/Relive.php b/model/Relive.php index 5676b62..1e8266a 100644 --- a/model/Relive.php +++ b/model/Relive.php @@ -26,7 +26,7 @@ class Relive public function getJsonCache() { - return sprintf('/tmp/relive-cache-%s', $this->getConference()->getSlug()); + return sprintf('/tmp/relive-cache-%s.json', $this->getConference()->getSlug()); } public function getTalks() diff --git a/model/Schedule.php b/model/Schedule.php index 4032ecb..6536864 100644 --- a/model/Schedule.php +++ b/model/Schedule.php @@ -272,7 +272,7 @@ class Schedule public function getScheduleCache() { - return sprintf('/tmp/schedule-cache-%s', $this->getConference()->getSlug()); + return sprintf('/tmp/schedule-cache-%s.xml', $this->getConference()->getSlug()); } public function getScheduleToRoomSlugMapping() -- cgit v1.2.3 From f4b2cb58b2e62e365103cbcffc3d8c2999b3f300 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sat, 17 Dec 2016 14:12:36 +0100 Subject: warn on old-style paths --- command/download.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/command/download.php b/command/download.php index 17ae7c9..c9fc5cd 100644 --- a/command/download.php +++ b/command/download.php @@ -98,6 +98,18 @@ function get_file_cache($conference, $filename) function download($what, $conference, $url, $cache) { + $info = parse_url($url); + if(!isset($info['scheme']) || !isset($info['host'])) + { + stderr( + ' !! %s url for conference %s does look like an old-style path: "%s". please update to a full http/https url', + $what, + $conference->getSlug(), + $url + ); + return false; + } + stdout( ' downloading %s from %s to %s', $what, -- cgit v1.2.3 From e7b0c27b54cdbcf248db191bcd34d5b8b4de2e99 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sat, 17 Dec 2016 14:12:56 +0100 Subject: improve log formatting --- command/download.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/command/download.php b/command/download.php index c9fc5cd..4018a9a 100644 --- a/command/download.php +++ b/command/download.php @@ -119,13 +119,14 @@ function download($what, $conference, $url, $cache) if(!do_download($url, $cache)) { stderr( - '!! download %s for conference %s from %s to %s failed miserably !!', + ' !! download %s for conference %s from %s to %s failed miserably !!', $what, $conference->getSlug(), $url, $cache ); } + return true; } function do_download($url, $cache) -- cgit v1.2.3 From 63967f91dacca321a63d91be4dd76d0ed3eb4956 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sat, 17 Dec 2016 14:13:14 +0100 Subject: implement actual downloading --- command/download.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/command/download.php b/command/download.php index 4018a9a..486c7af 100644 --- a/command/download.php +++ b/command/download.php @@ -131,5 +131,33 @@ function download($what, $conference, $url, $cache) function do_download($url, $cache) { + $handle = curl_init($url); + curl_setopt_array($handle, [ + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_MAXREDIRS => 10, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_SSL_VERIFYPEER => false, /* accept all certificates, even self-signed */ + CURLOPT_SSL_VERIFYHOST => 2, /* verify hostname is in cert */ + CURLOPT_CONNECTTIMEOUT => 3, /* connect-timeout in seconds */ + CURLOPT_TIMEOUT => 5, /* transfer timeout im seconds */ + CURLOPT_REDIR_PROTOCOLS => CURLPROTO_HTTP | CURLPROTO_HTTPS, + CURLOPT_REFERER => 'https://streaming.media.ccc.de/', + CURLOPT_USERAGENT => '@c3voc Streaming-Website Downloader-Cronjob, Contact voc AT c3voc DOT de in case of problems. Might the Winkekatze be with you', + ]); + + $return = curl_exec($handle); + $info = curl_getinfo($handle); + curl_close($handle); + + if($info['http_code'] != 200) + return false; + + $tempfile = tempnam(dirname($cache), 'dl-'); + if(false === file_put_contents($tempfile, $return)) + return false; + + chmod($tempfile, 0644); + rename($tempfile, $cache); + return true; } -- cgit v1.2.3 From 295b97b1cc23c709c6edfa5bfb8bcd4038ff0f65 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sun, 18 Dec 2016 10:36:48 +0100 Subject: configure 33c3, dg & cr to use the new schema --- configs/conferences/32c3/config.php | 6 ++++++ configs/conferences/chaosradio/config.php | 2 +- configs/conferences/chaosradio/download.sh | 3 --- configs/conferences/datengarten/config.php | 3 +-- configs/conferences/datengarten/download.sh | 3 --- 5 files changed, 8 insertions(+), 9 deletions(-) delete mode 100644 configs/conferences/chaosradio/download.sh delete mode 100644 configs/conferences/datengarten/download.sh diff --git a/configs/conferences/32c3/config.php b/configs/conferences/32c3/config.php index eda9450..f1cc5a6 100644 --- a/configs/conferences/32c3/config.php +++ b/configs/conferences/32c3/config.php @@ -667,5 +667,11 @@ $CONFIG['TWITTER'] = array( 'TEXT' => '#32C3 #%s', ); +$CONFIG['EXTRA_FILES'] = array( + 'schedule.xml' => 'https://events.ccc.de/congress/2015/Fahrplan/schedule.xml', + 'schedule.json' => 'https://events.ccc.de/congress/2015/Fahrplan/schedule.json', + 'everything.schedule.xml' => 'http://data.testi.ber.c3voc.de/32C3/everything.schedule.xml', + 'everything.schedule.json' => 'http://data.testi.ber.c3voc.de/32C3/everything.schedule.json', +); return $CONFIG; diff --git a/configs/conferences/chaosradio/config.php b/configs/conferences/chaosradio/config.php index f776552..a435760 100644 --- a/configs/conferences/chaosradio/config.php +++ b/configs/conferences/chaosradio/config.php @@ -121,7 +121,7 @@ $CONFIG['CONFERENCE'] = array( * * Wird diese Zeile auskommentiert, wird der Link nicht angezeigt */ - 'RELIVE_JSON' => 'configs/conferences/chaosradio/vod.json', + 'RELIVE_JSON' => 'http://live.dus.c3voc.de/relive/chaosradio/index.json', ); /** diff --git a/configs/conferences/chaosradio/download.sh b/configs/conferences/chaosradio/download.sh deleted file mode 100644 index 5474658..0000000 --- a/configs/conferences/chaosradio/download.sh +++ /dev/null @@ -1,3 +0,0 @@ -# vod json -wget -q "http://live.dus.c3voc.de/relive/chaosradio/index.json" -O /tmp/vod.json && mv /tmp/vod.json vod.json -rm -f /tmp/vod.json diff --git a/configs/conferences/datengarten/config.php b/configs/conferences/datengarten/config.php index e2e21eb..f8514be 100644 --- a/configs/conferences/datengarten/config.php +++ b/configs/conferences/datengarten/config.php @@ -117,8 +117,7 @@ $CONFIG['CONFERENCE'] = array( * * Wird diese Zeile auskommentiert, wird der Link nicht angezeigt */ - //'RELIVE_JSON' => 'configs/vod.json', - 'RELIVE_JSON' => 'configs/conferences/datengarten/vod.json', + 'RELIVE_JSON' => 'http://live.dus.c3voc.de/relive/datengarten/index.json', ); /** diff --git a/configs/conferences/datengarten/download.sh b/configs/conferences/datengarten/download.sh deleted file mode 100644 index 5834c4b..0000000 --- a/configs/conferences/datengarten/download.sh +++ /dev/null @@ -1,3 +0,0 @@ -# vod json -wget -q "http://live.dus.c3voc.de/relive/datengarten/index.json" -O /tmp/vod.json && mv /tmp/vod.json vod.json -rm -f /tmp/vod.json -- cgit v1.2.3 From da739f3b60a30d5dd5c7877742f8b5c292f25f46 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sun, 18 Dec 2016 10:37:10 +0100 Subject: use the new cache-files for viewing --- model/Relive.php | 2 +- model/Schedule.php | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/model/Relive.php b/model/Relive.php index 1e8266a..542836d 100644 --- a/model/Relive.php +++ b/model/Relive.php @@ -31,7 +31,7 @@ class Relive public function getTalks() { - if(!file_exists($this->getJsonUrl())) + if(!file_exists($this->getJsonCache())) return array(); $talks = file_get_contents($this->getJsonUrl()); diff --git a/model/Schedule.php b/model/Schedule.php index 6536864..b54709e 100644 --- a/model/Schedule.php +++ b/model/Schedule.php @@ -36,17 +36,10 @@ class Schedule private function fetchSchedule() { - $opts = array( - 'http' => array( - 'timeout' => 2, - 'user_agent' => 'C3VOC Universal Streaming-Website Backend @ '.$_SERVER['HTTP_HOST'], - ) - ); - $context = stream_context_create($opts); - $schedule = file_get_contents($this->getScheduleUrl(), false, $context); + $schedule = file_get_contents($this->getScheduleCache()); if(!$schedule) - throw new ScheduleException("Error Downloading Schedule from ".$this->getConference()->getScheduleUrl()); + throw new ScheduleException("Error Loading Schedule from ".$this->getScheduleCache()); return simplexml_load_string($schedule); } -- cgit v1.2.3