-
Notifications
You must be signed in to change notification settings - Fork 1
/
manifest.php
44 lines (37 loc) · 1.04 KB
/
manifest.php
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**
* Adapted from:
* Building iPhone Apps with HTML, CSS, and JavaScript: Making App Store Apps Without Objective-C or Cocoa
* by Jonathan Stark
*
*/
header('Content-Type: text/cache-manifest');
echo "CACHE MANIFEST\n";
$hashes = "";
$dir = new RecursiveDirectoryIterator(".");
foreach(new RecursiveIteratorIterator($dir) as $file) {
if ($file->IsFile() &&
$file != "./manifest.php" &&
strrpos($file, "svn") === false &&
strrpos($file, "tmproj") === false &&
strrpos($file, "./build") === false &&
strrpos($file, "./dev") === false &&
strrpos($file, "./test") === false &&
substr($file->getFilename(),0,1) != ".") {
echo $file . "\n";
$hashes .= md5_file($file);
}
}
// Hash the $hashes string and output
echo "# Hash: " . md5($hashes) . "\n";
date_default_timezone_set('UTC');
$nowDate = getdate();
$uniqueDate = $nowDate['year']
.$nowDate['mon']
.$nowDate['wday']
.$nowDate['hours']
.$nowDate['minutes']
.$nowDate['seconds'];
//echo "# Date; ".$uniqueDate . "\n";
//echo "# Hash: " . md5($hashes) . "\n";
?>