|
@@ 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); |
|
@@ 143-153 (lines=11) @@
|
| 140 |
|
public function rm($path, $name){ |
| 141 |
|
} |
| 142 |
|
|
| 143 |
|
public function exists($path, $name) { |
| 144 |
|
$arpath = path::collapse($path); |
| 145 |
|
|
| 146 |
|
if ( strpos($arpath, $this->path, 0) !== 0) { |
| 147 |
|
return ar('error')->raiseError('invalide path for loading template',500); |
| 148 |
|
} |
| 149 |
|
|
| 150 |
|
$realpath = $this->config['path'] . substr($arpath,strlen($this->path)); |
| 151 |
|
$realpath = realpath($realpath) .'/'; |
| 152 |
|
return file_exists($realpath . $name); |
| 153 |
|
} |
| 154 |
|
|
| 155 |
|
public function compile($path, $name) { |
| 156 |
|
global $AR; |