Subversion Repositories cheapmusic

Rev

Rev 18 | Rev 58 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 18 Rev 44
Line 31... Line 31...
31
				}
31
				}
32
			}
32
			}
33
 
33
 
34
			if (isset($xml->urls)) {
34
			if (isset($xml->urls)) {
35
				foreach ($xml->urls->url as $n) {
35
				foreach ($xml->urls->url as $n) {
-
 
36
					if (!empty($n)) {
36
					fputcsv2($fhUrls, array($id, $n), ',', '"', true);
37
						fputcsv2($fhUrls, array($id, $n), ',', '"');
-
 
38
					}
37
				}
39
				}
38
			}
40
			}
39
 
41
 
40
			$arr = array(
42
			$arr = array(
41
				$id,
43
				$id,
42
				$name,
44
				$name,
43
				$parentLabel,
45
				$parentLabel,
44
				join(", ", $sublabels)
46
				join(", ", $sublabels)
45
			);
47
			);
46
 
48
 
47
			fputcsv2($fh, $arr, ',', '"', true);
49
			fputcsv2($fh, $arr, ',', '"');
48
		}
50
		}
49
 
51
 
50
		return true;
52
		return true;
51
	}
53
	}
52
}
54
}
53
 
55
 
54
$xmlfile = "./in/discogs_20190601_labels.xml.gz";
56
$xmlfile = "./in/discogs_20190701_labels.xml.gz";
55
 
57
 
56
$fh = fopen("out/labels.load", "w+");
58
$fh = fopen("out/labels.load", "w+");
57
$fhUrls = fopen("out/labelUrls.load", "w+");
59
$fhUrls = fopen("out/labelUrls.load", "w+");
58
 
60
 
59
$xmlstream = "compress.zlib://$xmlfile";
61
$xmlstream = "compress.zlib://$xmlfile";