summaryrefslogtreecommitdiffstats
path: root/application/libraries/Ddownload/Ddownload.php
blob: 3a98d4154af260653f967e5a22379a1ef54bfb13 (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
27
28
29
30
31
32
33
34
<?php
/*
 * Copyright 2013 Pierre Schmitz <pierre@archlinux.de>
 *
 * Licensed under AGPLv3
 * (see COPYING for full license text)
 *
 */

abstract class Ddownload_Driver extends CI_Driver {

	abstract public function serveFile($file, $filename, $type);
}

class Ddownload extends CI_Driver_Library {

	protected $_adapter = null;

	protected $valid_drivers = array(
		'php', 'nginx', 'lighttpd'
	);

	function __construct()
	{
		$CI =& get_instance();

		$this->_adapter = $CI->config->item('download_driver');
	}

	public function serveFile($file, $filename, $type)
	{
		$this->{$this->_adapter}->serveFile($file, $filename, $type);
	}
}