-
Notifications
You must be signed in to change notification settings - Fork 39
/
Abstract.php
60 lines (52 loc) · 1.39 KB
/
Abstract.php
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
abstract class Kwf_Assets_Dependency_Abstract
{
const DEPENDENCY_TYPE_ALL = 'all';
const DEPENDENCY_TYPE_REQUIRES = 'requires';
const DEPENDENCY_TYPE_USES = 'uses';
const DEPENDENCY_TYPE_COMMONJS = 'commonjs';
protected $_dependencies = array();
protected $_providerList;
public function __construct(Kwf_Assets_ProviderList_Abstract $providerList)
{
$this->_providerList = $providerList;
}
public function getContentsSource()
{
return array(
'type' => 'contents',
'contents' => '',
);
}
public function getContentsSourceString()
{
$src = $this->getContentsSource();
if ($src['type'] == 'file') {
return file_get_contents($src['file']);
} else if ($src['type'] == 'contents') {
return $src['contents'];
} else {
throw new Kwf_Exception_NotYetImplemented();
}
}
public function getMimeType()
{
return null;
}
public function __toString()
{
return get_class($this);
}
public function getIdentifier()
{
throw new Kwf_Exception("getIdentifier is not implemented for '$this'");
}
public function getCacheId()
{
return $this->getIdentifier();
}
public function toDebug()
{
return get_class($this).': '.$this->__toString()."\n";
}
}