summaryrefslogtreecommitdiff
path: root/lib/Kolab/FreeBusy/SourceURL.php
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2013-01-17 13:50:12 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2013-01-17 13:50:12 (GMT)
commitf507d75cb6761e42eba846a7cc4b6a34d736150b (patch)
treea3f7e6b91407c99bcf5841c39a5707cf6855b811 /lib/Kolab/FreeBusy/SourceURL.php
parent2b0104f82c9c11789ad81b6f8d1db1e086c13392 (diff)
downloadkolab-freebusy-f507d75cb6761e42eba846a7cc4b6a34d736150b.tar.gz
Improve logging setup; support syslog driver
Diffstat (limited to 'lib/Kolab/FreeBusy/SourceURL.php')
-rw-r--r--lib/Kolab/FreeBusy/SourceURL.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/Kolab/FreeBusy/SourceURL.php b/lib/Kolab/FreeBusy/SourceURL.php
index d165bd5..e838640 100644
--- a/lib/Kolab/FreeBusy/SourceURL.php
+++ b/lib/Kolab/FreeBusy/SourceURL.php
@@ -29,18 +29,21 @@ class SourceURL extends Source
'header' => "Authorization: Basic " . base64_encode($config['user'] . ':' . $config['pass']) . "\r\n",
),
));
- $config['url'] = self::getUrl($config); // re-compose url without user:pass
+ $config['url'] = self::composeUrl($config); // re-compose url without user:pass
}
- // TODO: so some logging
+ $data = file_get_contents($config['url'], false, $context);
- return file_get_contents($config['url'], false, $context);
+ // log this...
+ Logger::get('url')->addInfo("Fetching data from " . $config['url'] . ": " . ($data ? 'OK' : 'FAILED'));
+
+ return $data;
}
/**
* Compose a full url from the given config (previously extracted with parse_url())
*/
- private static function getUrl($config)
+ private static function composeUrl($config)
{
$scheme = isset($config['scheme']) ? $config['scheme'] . '://' : '';
$host = isset($config['host']) ? $config['host'] : '';