Code Duplication    Length = 13-15 lines in 2 locations

www/install/upgrade/8.4/upgrade.files.php 1 location

@@ 6-18 (lines=13) @@
3
	$files = $store->get_config("files")."files/";
4
	$needsUpgrade = array();
5
6
	function pathToObjectID($path) {
7
		global $files;
8
		$objectID = 0;
9
		$subpath = substr($path,strlen($files));
10
		$numbers = explode('/',$subpath);;
11
		while (count($numbers)){
12
			$pathicle = array_pop($numbers);
13
			$objectID = $objectID * 100;
14
			$objectID += (int)$pathicle;
15
		}
16
17
		return $objectID;
18
	}
19
20
	function parseFile($file) {
21
		preg_match('/^_((?<nls>[a-z]{2})_)?(?<file>.+)$/',$file,$matches);

www/install/upgrade/all/upgrade.templates.php 1 location

@@ 20-34 (lines=15) @@
17
		return $result;
18
	}
19
20
	function pathToObjectID($path) {
21
		global $templates;
22
		$objectID = 0;
23
		$subpath = substr($path,strlen($templates));
24
		$numbers = explode('/',$subpath);;
25
		while (count($numbers)){
26
			$pathicle = array_pop($numbers);
27
			#print "objectID  == ".$objectID." and pathicle == ".$pathicle."\n";
28
			$objectID = $objectID * 100;
29
			$objectID += (int)$pathicle;
30
		}
31
32
		#print "End Result: ".$objectID."\n";
33
		return $objectID;
34
	}
35
36
	function showCompilerError($compiler, $pinp_template) {
37
		echo "\n------------------\n";