summaryrefslogtreecommitdiffstats
path: root/makelist
blob: de3393e98179b3e20f5b66eb043343568caf535b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env php
<?php

if ($_SERVER['argc'] < 2) {
	die ("Usage ". $_SERVER['argv'][0] . "  version\n");
}
$ver = $_SERVER['argv'][1];

@mkdir($ver);

$zip = new ZipArchive();
foreach(glob("instantclient*-$ver.zip") as $archive) {
	$zip->open($archive);
	echo "+ $archive (" . $zip->numFiles . ")\n";
	$txt = array();
	for ($i = 0; $i < $zip->numFiles; $i++) {
     	$name = $zip->getNameIndex($i);
		$pos = strpos($name, '/')+1;
		$txt[] = substr($name, $pos);
	}
	sort($txt);
	file_put_contents(
		$ver . '/' . basename($archive, "-$ver.zip"),
		implode("\n", $txt)
	);
}
echo "Done\n";