| 1 | <?php |
||
| 12 | class TwitalResource implements ResourceInterface |
||
| 13 | { |
||
| 14 | |||
| 15 | private $loader; |
||
| 16 | |||
| 17 | private $resource; |
||
| 18 | |||
| 19 | 1 | public function __construct(TwitalLoader $loader, ResourceInterface $resource) |
|
| 24 | |||
| 25 | 1 | public function getContent() |
|
| 26 | { |
||
| 27 | 1 | $source = $this->resource->getContent(); |
|
| 28 | |||
| 29 | 1 | if ($adapter = $this->loader->getSourceAdapter(strval($this->resource))) { |
|
| 30 | $source = $this->loader->getTwital()->compile($adapter, $source); |
||
| 31 | } |
||
| 32 | |||
| 33 | 1 | return $source; |
|
| 34 | } |
||
| 35 | |||
| 36 | public function isFresh($timestamp) |
||
| 40 | |||
| 41 | 1 | public function __toString() |
|
| 45 | } |
||
| 46 |