summaryrefslogtreecommitdiff
path: root/lib/Kolab/FreeBusy/SourceFile.php
blob: 29840a6bc201b241a8aaa38647890aa50444a91a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php

namespace Kolab\FreeBusy;

/**
 * Implementation of a Free/Busy data source reading from the local file system
 */
class SourceFile extends Source
{
	/**
	 * @see Source::getFreeBusyData()
	 */
	public function getFreeBusyData($user, $extended)
	{
		// get source config with placeholders replaced
		$config = $this->getUserConfig($user);

		// deliver file contents if found
		if (is_readable($config['path'])) {
			return file_get_contents($config['path']);
		}

		// not found
		return false;
	}
}