ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
FileResource.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of the Assetic package, an OpenSky project.
5 *
6 * (c) 2010-2014 OpenSky Project Inc
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
13
20{
21 private $path;
22
28 public function __construct($path)
29 {
30 $this->path = $path;
31 }
32
33 public function isFresh($timestamp)
34 {
35 return file_exists($this->path) && filemtime($this->path) <= $timestamp;
36 }
37
38 public function getContent()
39 {
40 return file_exists($this->path) ? file_get_contents($this->path) : '';
41 }
42
43 public function __toString()
44 {
45 return $this->path;
46 }
47}
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81
A resource is something formulae can be loaded from.
getContent()
Returns the content of the resource.
isFresh($timestamp)
Checks if a timestamp represents the latest resource.
__toString()
Returns a unique string for the current resource.
An exception for terminatinating execution or to throw for unit testing.
A resource is something formulae can be loaded from.