diff --git a/schedule/class.SmartCurl.php b/schedule/class.SmartCurl.php index b963a31..6ebda1c 100644 --- a/schedule/class.SmartCurl.php +++ b/schedule/class.SmartCurl.php @@ -71,17 +71,16 @@ class SmartCurl { } if (curl_setopt($this->ch, CURLOPT_URL, $url) === false) { - throw new Exception('set url failed'); + throw new Exception('set url failed: ' . $url); } - $cache_file = $this->cache_dir . DIRECTORY_SEPARATOR . $filename; - + $cache_file = $this->cache_dir . DIRECTORY_SEPARATOR . str_replace('/', '@', $filename); $etag = array_key_exists($url, static::$etags) && file_exists($cache_file) ? static::$etags[$url] : null; if (curl_setopt($this->ch, CURLOPT_HTTPHEADER, [ 'If-None-Match:' . (is_null($etag) ? '' : ' ' . $etag), ]) === false) { - throw new Exception('set etag failed'); + throw new Exception('set etag failed: ' . $url); } $response = curl_exec($this->ch); @@ -123,12 +122,6 @@ class SmartCurl { $body = substr($response, $header_size); if ($http_code === 200) { - $dirname = dirname($filename); - - if ($dirname !== '.') { - mkdir($this->cache_dir . DIRECTORY_SEPARATOR . $dirname, 0777, true); - } - file_put_contents($cache_file, $body); } diff --git a/schedule/config.php b/schedule/config.php index d0ab77b..3cdc9ee 100644 --- a/schedule/config.php +++ b/schedule/config.php @@ -5,11 +5,28 @@ function getSchedConfig($year = 2015) { 'cfp_url' => 'https://cfp.openfest.org', 'cut_len' => 70, ]; - + $config = [ + 2014 => [ + 'conferenceId' => 1, + 'eventTypes' => [ + 'lecture' => 1, + 'workshop' => 2, + ], + ], 2015 => [ - 'allowedHallIds' => [6, 7, 8], - + 'conferenceId' => 2, + 'eventTypes' => [ + 'lecture' => 3, + 'workshop' => 4, + ], + ], + 2016 => [ + 'conferenceId' => 3, + 'eventTypes' => [ + 'lecture' => 5, + 'workshop' => 6, + ], ], ]; diff --git a/schedule/index.php b/schedule/index.php index ba026a3..a8739d9 100644 --- a/schedule/index.php +++ b/schedule/index.php @@ -43,24 +43,14 @@ foreach ($content['lines'] as $line) {