|
4 | 4 | require('lib/Example.class.php'); |
5 | 5 | $benchmark_start = microtime_float(); |
6 | 6 |
|
7 | | -$local = true; |
| 7 | +//$local = true; |
8 | 8 |
|
9 | 9 | // Redefine location on local machine for examples in processing trunk |
10 | | -if ($local) { |
| 10 | +//if ($local) { |
11 | 11 | //define('BASEDIR', '/Users/REAS/Documents/reas@processing.org/trunk/'); |
12 | | - define('EXAMPLESOURCEDIR', '/Users/REAS/Documents/reas@processing.org/trunk/processing/java/examples/'); |
13 | | -} else { |
14 | | - define('EXAMPLESOURCEDIR', '/Users/REAS/Documents/reas@processing.org/trunk/processing/java/examples/'); |
15 | | -} |
| 12 | + //define('EXAMPLESOURCEDIR', '/Users/REAS/Documents/reas@processing.org/trunk/processing/java/examples/'); |
| 13 | +//} else { |
| 14 | + define('EXAMPLESOURCEDIR', '../../processing/java/examples/'); |
| 15 | +//} |
16 | 16 | //define('CONTENTDIR', BASEDIR.'processing/java/'); |
17 | 17 | //define('EXAMPLESDIR', BASEDIR.'learning/'); |
18 | 18 |
|
19 | | - |
20 | | -// Update the files on the server via SVN |
21 | | - |
22 | | -// look for the .subversion folder somewhere else |
23 | | -// otherwise will go looking for /home/root/.subversion or some other user |
24 | 19 | $where = CONTENTDIR . 'examples'; |
25 | 20 | $there = CONTENTDIR; |
26 | 21 | putenv('HOME=' . CONTENTDIR); |
27 | 22 |
|
28 | 23 | // do the initial checkout |
29 | 24 | //`cd /var/www/processing && /usr/local/bin/svn co svn://processing.org/trunk/web/content/`; |
30 | 25 |
|
31 | | -if (!$local) { |
32 | | - `cd $there && /usr/local/bin/svn update examples_basics.xml`; |
33 | | - `cd $there && /usr/local/bin/svn update examples_topics.xml`; |
34 | | - `cd $where && /usr/local/bin/svn update`; |
35 | | -} |
| 26 | +//if (!$local) { |
| 27 | +`cd $there && /usr/local/bin/svn update examples_basics.xml`; |
| 28 | +`cd $there && /usr/local/bin/svn update examples_topics.xml`; |
| 29 | +`cd $where && /usr/local/bin/svn update`; |
| 30 | +//} |
36 | 31 |
|
37 | 32 |
|
38 | 33 | # --------------------------------- Basics |
|
67 | 62 | $html = "<div class=\"ref-col\">\n"; |
68 | 63 | foreach ($categories as $cat => $array) { |
69 | 64 |
|
70 | | - #$html .= "<h3><img src=\"images/".strtolower(removesymbols($cat)).".gif\" alt=\"$cat\" /></h3>\n<p>"; |
71 | 65 | $html .= "<p><br /><b>$cat</b><br /><br />"; |
72 | 66 | foreach ($array as $file => $name) { |
73 | 67 | $thisfile = strtolower($file); |
|
85 | 79 | $page->content($html); |
86 | 80 | writeFile('learning/'.strtolower($subdir).'/index.html', $page->out()); |
87 | 81 |
|
88 | | -// Copy over a shared core.jar |
89 | | -//if (!copy(CONTENTDIR . 'examples/core.jar', |
90 | | -// EXAMPLESDIR.strtolower($subdir).'/media/core.jar')) { |
91 | | -// echo 'Could not copy core.jar to ' . $subdir . '.'; |
92 | | -//} |
93 | | -//if (!copy(CONTENTDIR . 'examples/loading.gif', |
94 | | -// EXAMPLESDIR.strtolower($subdir).'/media/loading.gif')) { |
95 | | -// echo 'Could not copy loading.gif to ' . $subdir . '.'; |
96 | | -//} |
97 | | - |
98 | 82 |
|
99 | 83 | # --------------------------------- Topics |
100 | 84 |
|
|
126 | 110 |
|
127 | 111 | $html = "<div class=\"ref-col\">\n"; |
128 | 112 | foreach ($categories as $cat => $array) { |
129 | | - |
130 | | - #$html .= "<h3><img src=\"images/".strtolower(removesymbols($cat)).".gif\" alt=\"$cat\" /></h3>\n<p>"; |
131 | 113 | $html .= "<p><br /><b>$cat</b><br /><br />"; |
132 | 114 | foreach ($array as $file => $name) { |
133 | 115 | $thisfile = strtolower($file); |
|
145 | 127 | $page->content($html); |
146 | 128 | writeFile('learning/'.strtolower($subdir).'/index.html', $page->out()); |
147 | 129 |
|
148 | | -/** |
149 | | -if (!copy(CONTENTDIR . 'examples/core.jar', |
150 | | - EXAMPLESDIR.strtolower($subdir).'/media/core.jar')) { |
151 | | - echo 'Could not copy core.jar to ' . $subdir . '.'; |
152 | | -} |
153 | | -if (!copy(CONTENTDIR . 'examples/loading.gif', |
154 | | - EXAMPLESDIR.strtolower($subdir).'/media/loading.gif')) { |
155 | | - echo 'Could not copy loading.gif to ' . $subdir . '.'; |
156 | | -} |
157 | | -*/ |
158 | | - |
159 | | -/** |
160 | | -# --------------------------------- 3D |
161 | | -
|
162 | | -
|
163 | | -$categories = get_examples_list('examples_3D.xml'); |
164 | | -$break_after = array('Transform', 'Lights'); |
165 | | -$subdir = '3D'; |
166 | | -$dir = CONTENTDIR.'examples/'.$subdir.'/'; |
167 | | -
|
168 | | -$count = 0; |
169 | | -foreach ($categories as $cat => $array) { |
170 | | - if ($dp = opendir($dir.$cat)) { |
171 | | - while ($fp = readdir($dp)) { |
172 | | - if (substr($fp, 0, 1) != '.') { |
173 | | - $ex = new Example($fp, $subdir."/".$cat, $subdir); |
174 | | - //$ex = new Example($fp, $cat); |
175 | | - $ex->output_file($categories); |
176 | | - $count++; |
177 | | - } |
178 | | - } |
179 | | - } |
180 | | -} |
181 | | -
|
182 | | -$page = new Page('3D', '3D'); |
183 | | -$page->subtemplate('template.examples-3d.html'); |
184 | | -
|
185 | | -$html = "<div class=\"ref-col\">\n"; |
186 | | -foreach ($categories as $cat => $array) { |
187 | | - |
188 | | - #$html .= "<h3><img src=\"images/".strtolower(removesymbols($cat)).".gif\" alt=\"$cat\" /></h3>\n<p>"; |
189 | | - $html .= "<p><br /><b>$cat</b><br /><br />"; |
190 | | - foreach ($array as $file => $name) { |
191 | | - $thisfile = strtolower($file); |
192 | | - $html .= "\t<a href=\"$thisfile\">$name</a><br />\n"; |
193 | | - } |
194 | | - #echo '</p>'; |
195 | | - $html .= '</p>'; |
196 | | - |
197 | | - if (in_array($cat, $break_after)) { |
198 | | - $html .= "</div><div class=\"ref-col\">"; |
199 | | - } |
200 | | -} |
201 | | -$html .= "</div>"; |
202 | | -
|
203 | | -$page->content($html); |
204 | | -writeFile('learning/'.strtolower($subdir).'/index.html', $page->out()); |
205 | | -if (!copy(CONTENTDIR . 'examples/core.jar', |
206 | | - EXAMPLESDIR.strtolower($subdir).'/media/core.jar')) { |
207 | | - echo 'Could not copy core.jar to ' . $subdir . '.'; |
208 | | -} |
209 | | -if (!copy(CONTENTDIR . 'examples/loading.gif', |
210 | | - EXAMPLESDIR.strtolower($subdir).'/media/loading.gif')) { |
211 | | - echo 'Could not copy loading.gif to ' . $subdir . '.'; |
212 | | -} |
213 | | -
|
214 | | -*/ |
215 | | - |
216 | 130 |
|
217 | 131 | $benchmark_end = microtime_float(); |
218 | 132 | $execution_time = round($benchmark_end - $benchmark_start, 4); |
|
0 commit comments