Code Duplication    Length = 11-12 lines in 2 locations

lib/ar/template/filesystem.php 2 locations

@@ 43-54 (lines=12) @@
40
			return false;
41
		}
42
43
		public function load($path, $name) {
44
			$arpath = path::collapse($path);
45
46
			if ( strpos($arpath, $this->path, 0) !== 0) {
47
				return ar('error')->raiseError('invalide path for loading template',500);
48
			}
49
50
			$realpath = $this->config['path'] . substr($arpath,strlen($this->path));
51
			$realpath = realpath($realpath) .'/';
52
53
			return file_get_contents($realpath . $name);
54
		}
55
56
		public function ls($path) {
57
			$arpath = path::collapse($path);
@@ 124-134 (lines=11) @@
121
		public function rm($path, $name){
122
		}
123
124
		public function exists($path, $name) {
125
			$arpath = path::collapse($path);
126
127
			if ( strpos($arpath, $this->path, 0) !== 0) {
128
				return ar('error')->raiseError('invalide path for loading template',500);
129
			}
130
131
			$realpath = $this->config['path'] . substr($arpath,strlen($this->path));
132
			$realpath = realpath($realpath) .'/';
133
			return file_exists($realpath . $name);
134
		}
135
136
		public function compile($path, $name) {
137
			global $AR;