-
-
Notifications
You must be signed in to change notification settings - Fork 173
Expand file tree
/
Copy pathstaticpages.php
More file actions
executable file
·90 lines (66 loc) · 2.88 KB
/
Copy pathstaticpages.php
File metadata and controls
executable file
·90 lines (66 loc) · 2.88 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
require_once('../config.php');
$benchmark_start = microtime_float();
// make troubleshooting page
$source = CONTENTDIR."static";
$path = BASEDIR;
// update the files on the server via SVN
// look for the .subversion folder somewhere else
// otherwise will go looking for /home/root/.subversion or some other user
$where = CONTENTDIR . 'static';
putenv('HOME=' . CONTENTDIR);
//`cd $where && /usr/bin/svn update`;
// Switch from SVN to GIT, 14 FEB 2013
// Disabled for now, so we can test generate scripts without pulling latest from repo. -SM
//`cd $path && /usr/bin/git pull https://github.com/processing/processing-docs/`;
// make troubleshooting page
$source = CONTENTDIR."static/";
$page = new Page("Overview", "Overview");
$page->content(file_get_contents($source."overview.html"));
writeFile('overview/index.html', $page->out());
#copydirr($source.'/images', $path.'/images');
#$page = new Page("Foundation", "Foundation");
#$page->content(file_get_contents($source."foundation.html"));
#writeFile('foundation/index.html', $page->out());
$page = new Page("People", "People");
$page->content(file_get_contents($source."people.html"));
writeFile('people/index.html', $page->out());
$page = new Page("Books", "Books");
$page->content(file_get_contents($source."books.html"));
writeFile('books/index.html', $page->out());
$page = new Page("Handbook", "Handbook");
$page->content(file_get_contents($source."handbook.html"));
writeFile('handbook/index.html', $page->out());
// Added 4 April 2017 for Membership Initiative
$page = new Page("Support", "Donate");
$page->content(file_get_contents($source."support.html"));
writeFile('download/support.html', $page->out());
// Added 6 April 2017 for Membership Initiative
$page = new Page("Download", "Download");
$page->content(file_get_contents($source."download.html"));
writeFile('download/index.html', $page->out());
// Copy over the errata file for Processing: A Programming Handbook...
// copy($source.'processing-errata.txt', $path.'books/processing-errata.txt');
// Copy over the media.zip file for Getting Started with Processing...
copy($source.'media.zip', $path.'books/media.zip');
$page = new Page("Copyright", "Copyright");
$page->content(file_get_contents($source."copyright.html"));
writeFile('copyright.html', $page->out());
// Copy over the images for the shop index
#if (!is_dir($path.'shop')) {
# mkdir($path.'shop', 0757);
#}
#if (!is_dir($path.'shop/imgs')) {
# mkdir($path.'shop/imgs', 0757);
#}
#if (is_dir($path.'shop/imgs')) {
# copydirr($source.'shop/imgs', $path.'shop/imgs', null, 0757, false);
#}
#$page = new Page("Shop", "Shop");
#$page->content(file_get_contents($source.'shop/'."index.html"));
#writeFile('shop/index.html', $page->out());
$benchmark_end = microtime_float();
$execution_time = round($benchmark_end - $benchmark_start, 4);
?>
<h2>Static page generation Successful</h2>
<p>Generated files in <?=$execution_time?> seconds.</p>