@@ 44-55 (lines=12) @@ | ||
41 | return false; |
|
42 | } |
|
43 | ||
44 | public function load($path, $name) { |
|
45 | $arpath = path::collapse($path); |
|
46 | ||
47 | if ( strpos($arpath, $this->path, 0) !== 0) { |
|
48 | return ar('error')->raiseError('invalide path for loading template',500); |
|
49 | } |
|
50 | ||
51 | $realpath = $this->config['path'] . substr($arpath,strlen($this->path)); |
|
52 | $realpath = realpath($realpath) .'/'; |
|
53 | ||
54 | return file_get_contents($realpath . $name); |
|
55 | } |
|
56 | ||
57 | public function ls($path) { |
|
58 | $arpath = path::collapse($path); |
|
@@ 150-160 (lines=11) @@ | ||
147 | public function rm($path, $name){ |
|
148 | } |
|
149 | ||
150 | public function exists($path, $name) { |
|
151 | $arpath = path::collapse($path); |
|
152 | ||
153 | if ( strpos($arpath, $this->path, 0) !== 0) { |
|
154 | return ar('error')->raiseError('invalide path for loading template',500); |
|
155 | } |
|
156 | ||
157 | $realpath = $this->config['path'] . substr($arpath,strlen($this->path)); |
|
158 | $realpath = realpath($realpath) .'/'; |
|
159 | return file_exists($realpath . $name); |
|
160 | } |
|
161 | ||
162 | public function compile($path, $name) { |
|
163 | global $AR; |