Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 522 lines (434 sloc) 17.834 kb
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
1 <?php
2
3 /*
4 * Minifies javascript and CSS files, copying static files to www/_media/
5 * and saving cache information in build/.
6 *
7 * Usage:
8 * php make.php [clean|js|css|media|lib_cache|path_cache|all]
9 */
10
11 chdir(__DIR__);
12
13 require_once "scripts/cmdline.php";
14
15 class Build
f14492d use content hashes in URL of css/js files to do automatic, granular c…
Jesse Young authored
16 {
17 static function all()
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
18 {
d7f37dc change how modules are defined in order to reduce overhead on every r…
Jesse Young authored
19 Build::build_cache();
f14492d use content hashes in URL of css/js files to do automatic, granular c…
Jesse Young authored
20 Build::path_cache();
21 Build::media();
22 Build::css();
23 Build::js();
71c815f move GPL licensed sphinxapi.php out of source tree; automatically dow…
Jesse Young authored
24 Build::vendors();
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
25 }
26
f14492d use content hashes in URL of css/js files to do automatic, granular c…
Jesse Young authored
27 /*
28 * Removes all files generated by make.php
29 */
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
30 static function clean()
31 {
f14492d use content hashes in URL of css/js files to do automatic, granular c…
Jesse Young authored
32 system('rm -rf build/*.php');
a25031d reorganize config settings, allow lazy loading like language keys; re…
Jesse Young authored
33 system('rm -rf config/default_build.php');
b15de89 improve path cache so that Engine::get_real_path works in O(1) time (…
Jesse Young authored
34 system('rm -rf build/path_cache');
a25031d reorganize config settings, allow lazy loading like language keys; re…
Jesse Young authored
35 system('rm -rf www/_media/*');
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
36 }
37
b15de89 improve path cache so that Engine::get_real_path works in O(1) time (…
Jesse Young authored
38 /*
71c815f move GPL licensed sphinxapi.php out of source tree; automatically dow…
Jesse Young authored
39 * Downloads code for 3rd party libraries that can't be distributed with our source code
40 * because their licensing is incompatible with ours.
41 */
42 static function vendors()
43 {
67ffe5e @youngj switch from kestrel to rabbitmq; update sphinx; compatibility with la…
authored
44 $sphinx_ver = "rel20";
71c815f move GPL licensed sphinxapi.php out of source tree; automatically dow…
Jesse Young authored
45 $sphinx_api_filename = "sphinxapi.{$sphinx_ver}.php";
46 $sphinx_api_path = __DIR__."/vendors/$sphinx_api_filename";
47 if (!is_file($sphinx_api_path))
48 {
49 $sphinx_url = "http://sphinxsearch.googlecode.com/svn/branches/{$sphinx_ver}/api/sphinxapi.php";
50
51 $sphinx_api_php = file_get_contents($sphinx_url);
52 static::write_file($sphinx_api_path, $sphinx_api_php);
53 }
54 static::write_file(__DIR__."/vendors/sphinxapi.php",
55 "<?php require_once __DIR__.'/$sphinx_api_filename';");
56 }
57
d7f37dc change how modules are defined in order to reduce overhead on every r…
Jesse Young authored
58 static function build_cache()
59 {
60 @unlink("build/cache.php");
61
62 require_once "scripts/analysis/phpparentanalyzer.php";
63 require_once "start.php";
64
65 ob_start();
66 echo "<?php class RealBuildCache extends BuildCache {\n";
67
7a922ba bug fixes for module refactoring
Jesse Young authored
68 echo "function _get_lib_paths() { return array(".implode(',', array_map(
d7f37dc change how modules are defined in order to reduce overhead on every r…
Jesse Young authored
69 function($p) { return var_export($p, true); }, Engine::get_lib_paths()
70 ))."); }\n";
71
a25031d reorganize config settings, allow lazy loading like language keys; re…
Jesse Young authored
72 $default_keys = array();
73
74 foreach (Config::get('languages') as $lang)
75 {
76 $default_keys[$lang]["lang:$lang"] = __("lang:$lang", $lang);
77 }
78
79 echo "function _get_default_translations() { return ".var_export($default_keys, true)."; }\n";
80
d7f37dc change how modules are defined in order to reduce overhead on every r…
Jesse Young authored
81 $analyzer = new PHPParentAnalyzer();
82 $analyzer->parse_dir(__DIR__);
83
84 $parent_classes = $analyzer->parent_classes;
85 $paths = $analyzer->paths;
86
87 $parent_cache = array();
88
7a922ba bug fixes for module refactoring
Jesse Young authored
89 ksort($paths);
90
d7f37dc change how modules are defined in order to reduce overhead on every r…
Jesse Young authored
91 foreach ($paths as $cls => $path)
92 {
7a922ba bug fixes for module refactoring
Jesse Young authored
93 echo "function {$cls}(&\$a,&\$b,&\$c){";
d7f37dc change how modules are defined in order to reduce overhead on every r…
Jesse Young authored
94
95 echo "\$a=".var_export($path, true).";";
96 if (isset($parent_classes[$cls]))
97 {
98 $parent_cls = $parent_classes[$cls];
99 if (isset($paths[$parent_cls]))
100 {
101 $lparent = strtolower($parent_cls);
102 echo "\$b=".var_export($lparent, true).";";
103 }
104 }
105 echo "\$c=".var_export(strtolower($cls), true).';';
106
107 echo "}\n";
108 }
109
110 echo "}";
111 $php = ob_get_clean();
112
113 static::write_file("build/cache.php", $php);
114 }
115
71c815f move GPL licensed sphinxapi.php out of source tree; automatically dow…
Jesse Young authored
116 /*
b15de89 improve path cache so that Engine::get_real_path works in O(1) time (…
Jesse Young authored
117 * Generates a cache of all the paths of files in the engine, themes, languages, and views
118 * directories, which might be referenced via virtual paths in calls to Engine::get_real_path() .
119 * This cache allows Engine::get_real_path() to work in O(1) time instead of O(num_modules) time.
120 *
f14492d use content hashes in URL of css/js files to do automatic, granular c…
Jesse Young authored
121 * Also generates a cache of all the paths of files in the lib/ directory.
122 *
b15de89 improve path cache so that Engine::get_real_path works in O(1) time (…
Jesse Young authored
123 * Uses relative paths so the same cache files work in any root directory
124 * and can be copied to different systems without needing to regenerate them.
125 */
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
126 static function path_cache()
127 {
f14492d use content hashes in URL of css/js files to do automatic, granular c…
Jesse Young authored
128 // remove previous build files before including start.php
129 // so that Engine class doesn't use previous path cache when building the new path cache
130 @unlink("build/path_cache.php");
131 system('rm -rf build/path_cache');
132
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
133 require_once "start.php";
d7f37dc change how modules are defined in order to reduce overhead on every r…
Jesse Young authored
134
b15de89 improve path cache so that Engine::get_real_path works in O(1) time (…
Jesse Young authored
135 $dir_paths = array(
136 // allows us to test if the path cache actually works like it should
137 'views/default/admin' => array(
138 'views/default/admin/path_cache_test.php' => 'build/path_cache_info.php'
139 )
903007c move some more envaya.org specific code into envaya_org module
Jesse Young authored
140 );
b15de89 improve path cache so that Engine::get_real_path works in O(1) time (…
Jesse Young authored
141
a25031d reorganize config settings, allow lazy loading like language keys; re…
Jesse Young authored
142 $virtual_dirs = array('themes', 'languages', 'views', 'config');
cfe5d41 remove core->translate dependencies; allow mixins to be inherited by …
Jesse Young authored
143
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
144 $modules = Config::get('modules');
145 foreach ($modules as $module)
146 {
b15de89 improve path cache so that Engine::get_real_path works in O(1) time (…
Jesse Young authored
147 foreach ($virtual_dirs as $virtual_dir)
148 {
149 static::add_paths_in_dir("mod/{$module}/", $virtual_dir, $dir_paths);
150 }
151 }
152
cfe5d41 remove core->translate dependencies; allow mixins to be inherited by …
Jesse Young authored
153 foreach ($virtual_dirs as $virtual_dir)
154 {
155 static::add_paths_in_dir('', $virtual_dir, $dir_paths);
a25031d reorganize config settings, allow lazy loading like language keys; re…
Jesse Young authored
156 }
cfe5d41 remove core->translate dependencies; allow mixins to be inherited by …
Jesse Young authored
157
b15de89 improve path cache so that Engine::get_real_path works in O(1) time (…
Jesse Young authored
158 static::add_nonexistent_view_paths($dir_paths);
4b8e20c cache container entities and logged-in user for performance
Jesse Young authored
159
160 static::add_nonexistent_language_paths($dir_paths);
b15de89 improve path cache so that Engine::get_real_path works in O(1) time (…
Jesse Young authored
161
162 // create a cache file for each virtual directory
f14492d use content hashes in URL of css/js files to do automatic, granular c…
Jesse Young authored
163 mkdir('build/path_cache');
b15de89 improve path cache so that Engine::get_real_path works in O(1) time (…
Jesse Young authored
164 foreach ($dir_paths as $dir => $paths)
165 {
166 $cache_name = str_replace('/','__', $dir);
167 static::write_file("build/path_cache/$cache_name.php", static::get_array_php($paths));
168 }
169
170 // list of commonly used virtual directories whose paths will be included in
171 // build/path_cache.php, rather than needing to open a cache file for each directory
a25031d reorganize config settings, allow lazy loading like language keys; re…
Jesse Young authored
172 $default_dirs = array(
b15de89 improve path cache so that Engine::get_real_path works in O(1) time (…
Jesse Young authored
173 'languages/en',
174 'themes',
175 'views/default',
176 'views/default/home',
177 'views/default/js',
178 'views/default/layouts',
179 'views/default/page_elements',
180 'views/default/input',
181 'views/default/object',
182 'views/default/output',
183 'views/default/translation',
184 'views/default/messages',
185 );
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
186
b15de89 improve path cache so that Engine::get_real_path works in O(1) time (…
Jesse Young authored
187 $default_paths = array();
188 foreach ($default_dirs as $default_dir)
189 {
3105628 reorganize code for standalone web server, and make it independent fr…
Jesse Young authored
190 if (isset($dir_paths[$default_dir]))
191 {
192 $default_paths = array_merge($default_paths, $dir_paths[$default_dir]);
193 }
b15de89 improve path cache so that Engine::get_real_path works in O(1) time (…
Jesse Young authored
194 }
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
195
b15de89 improve path cache so that Engine::get_real_path works in O(1) time (…
Jesse Young authored
196 static::write_file("build/path_cache.php", static::get_array_php($default_paths));
197
198 // create a file with cache information to display on the admin statistics page
199 // (which also verifies that the path cache is basically working)
200 $num_default_paths = sizeof($default_paths);
201 $num_files = sizeof($dir_paths);
202 static::write_file("build/path_cache_info.php",
203 "<div>The path cache is enabled. ($num_default_paths default paths + $num_files files)</div>");
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
204 }
f14492d use content hashes in URL of css/js files to do automatic, granular c…
Jesse Young authored
205
206 /*
207 * Minifies all CSS files defined in each module's views/default/css/ directory,
208 * and copies to www/_media/css/.
209 */
210 static function css($name = '*')
211 {
212 require_once "start.php";
213
214 $modules = static::module_glob();
215 $css_paths = glob("{views/default/css/$name.php,mod/$modules/views/default/css/$name.php}", GLOB_BRACE);
216
217 $output_dir = 'www/_media/css';
218
219 if (!is_dir($output_dir))
220 {
221 mkdir($output_dir);
222 }
223
224 $build_config = static::get_build_config();
225
226 foreach ($css_paths as $css_path)
227 {
228 $pathinfo = pathinfo($css_path);
229 $filename = $pathinfo['filename'];
230 $css_temp = "scripts/$filename.tmp.css";
231 $raw_css = view("css/$filename");
232
233 if (preg_match('/http(s)?:[^\s\)\"\']*/', $raw_css, $matches))
234 {
235 throw new Exception("Absolute URL {$matches[0]} found in $css_path. In order to work on both dev/production without recompiling, CSS files must not contain absolute paths.");
236 }
237
238 file_put_contents($css_temp, $raw_css);
239 $compressed = static::minify($css_temp, "$output_dir/$filename.css", 'css');
240 unlink($css_temp);
241
a25031d reorganize config settings, allow lazy loading like language keys; re…
Jesse Young authored
242 $build_config["build:hash:css:$filename"] = static::get_content_hash($compressed);
f14492d use content hashes in URL of css/js files to do automatic, granular c…
Jesse Young authored
243 }
244
245 static::write_build_config($build_config);
246 }
d7f37dc change how modules are defined in order to reduce overhead on every r…
Jesse Young authored
247
f14492d use content hashes in URL of css/js files to do automatic, granular c…
Jesse Young authored
248
249 /*
250 * Minifies Javascript in each module's js/ directory, and copie to www/_media/.
251 */
252 static function js($name = '*')
253 {
254 require_once "start.php";
255 $modules = static::module_glob();
256
257 static::js_minify_dir(".", $name);
258
259 foreach (Config::get('modules') as $module)
260 {
261 static::js_minify_dir("mod/$module", $name);
262 }
263 }
264
265 /*
266 * Copies static files from each module's _media/ directory to www/_media/.
267 */
268 static function media()
269 {
270 require_once "start.php";
271
67ffe5e @youngj switch from kestrel to rabbitmq; update sphinx; compatibility with la…
authored
272 static::system("rsync -rp --chmod=ugo=rwX _media/ www/_media/");
f14492d use content hashes in URL of css/js files to do automatic, granular c…
Jesse Young authored
273
274 foreach (Config::get('modules') as $module)
275 {
276 if (is_dir("mod/$module/_media"))
277 {
67ffe5e @youngj switch from kestrel to rabbitmq; update sphinx; compatibility with la…
authored
278 static::system("rsync -rp --chmod=ugo=rwX mod/$module/_media/ www/_media/");
f14492d use content hashes in URL of css/js files to do automatic, granular c…
Jesse Young authored
279 }
280 }
281 }
282
283 private static function module_glob()
284 {
285 return "{".implode(',',Config::get('modules'))."}";
286 }
287
288 private static function minify($srcFile, $destFile, $type='js')
289 {
290 $src = file_get_contents($srcFile);
291
292 system("java -jar vendors/yuicompressor-2.4.2.jar --type $type -o ".escapeshellarg($destFile). " ".escapeshellarg($srcFile));
293
294 $compressed = file_get_contents($destFile);
295
296 echo strlen($src)." ".strlen($compressed)." $destFile\n";
297
298 return $compressed;
299 }
4b8e20c cache container entities and logged-in user for performance
Jesse Young authored
300
301 private static function add_nonexistent_language_paths(&$dir_paths)
302 {
303 $language = Language::get(Config::get('language'));
304
305 $default_group = $language->get_group('default');
306
307 $pseudo_groups = array('admin' => true);
308
309 foreach ($default_group as $key => $tr)
310 {
3459f88 move partnerships into network module, fix modularity bugs
Jesse Young authored
311 @list($group_name, $etc) = explode(':', $key, 2);
4b8e20c cache container entities and logged-in user for performance
Jesse Young authored
312 if ($etc)
313 {
314 $pseudo_groups[$group_name] = true;
315 }
316 }
317
318 foreach ($pseudo_groups as $group_name => $v)
319 {
320 foreach (Language::all() as $language)
321 {
322 if (!$language->get_group_path($group_name))
323 {
324 $code = $language->get_code();
325 $dir = "languages/{$code}";
326 $virtual_path = "$dir/{$code}_{$group_name}.php";
327 $dir_paths[$dir][$virtual_path] = 0;
328 }
329 }
330 }
331 }
f14492d use content hashes in URL of css/js files to do automatic, granular c…
Jesse Young authored
332
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
333
b15de89 improve path cache so that Engine::get_real_path works in O(1) time (…
Jesse Young authored
334 private static function add_nonexistent_view_paths(&$dir_paths)
335 {
336 // add cache entries for non-existent views in view types other than default
337 // since the view() function will check if they exist before using the default view.
338
339 $view_types = array();
340 $default_views = array();
341
342 foreach ($dir_paths as $dir => $paths)
343 {
344 if (preg_match('#^views/(\w+)#', $dir, $matches))
345 {
346 $view_type = $matches[1];
347 if ($view_type == 'default')
348 {
349 foreach ($paths as $virtual_path => $real_path)
350 {
351 $default_views[] = substr($virtual_path, strlen('views/default/'));
352 }
353 }
354 else // collect names of all view types other than default
355 {
356 $view_types[$view_type] = $view_type;
357 }
358 }
359 }
360
361 foreach ($default_views as $view_path)
362 {
363 foreach ($view_types as $view_type)
364 {
365 // is this view not defined for this view type?
366 $virtual_path = "views/$view_type/$view_path";
367 if (!Engine::filesystem_get_real_path($virtual_path))
368 {
369 $dir = dirname($virtual_path);
370
371 if (!isset($paths[$dir][$virtual_path]))
372 {
373 // 0 is sentinel for nonexistent keys in path cache
374 $dir_paths[$dir][$virtual_path] = 0;
375 }
376 }
377 }
378 }
379 }
380
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
381 static function write_file($filename, $contents)
382 {
383 echo strlen($contents) . " ".$filename."\n";
384 file_put_contents($filename, $contents);
385 }
386
b15de89 improve path cache so that Engine::get_real_path works in O(1) time (…
Jesse Young authored
387 private static function add_paths_in_dir($rel_base, $dir, &$paths)
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
388 {
a25031d reorganize config settings, allow lazy loading like language keys; re…
Jesse Young authored
389 $root = Engine::$root;
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
390 $handle = @opendir("{$root}/{$rel_base}{$dir}");
391 if ($handle)
392 {
393 while ($file = readdir($handle))
394 {
395 $virtual_path = "{$dir}/{$file}";
396 $real_rel_path = "{$rel_base}{$virtual_path}";
397 $real_path = "{$root}/{$real_rel_path}";
398
399 if (preg_match('/\.php$/', $file))
400 {
b15de89 improve path cache so that Engine::get_real_path works in O(1) time (…
Jesse Young authored
401 if (!isset($paths[$dir][$virtual_path]))
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
402 {
b15de89 improve path cache so that Engine::get_real_path works in O(1) time (…
Jesse Young authored
403 $paths[$dir][$virtual_path] = $real_rel_path;
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
404 }
b15de89 improve path cache so that Engine::get_real_path works in O(1) time (…
Jesse Young authored
405 }
406 if ($file[0] != '.' && is_dir($real_path))
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
407 {
b15de89 improve path cache so that Engine::get_real_path works in O(1) time (…
Jesse Young authored
408 static::add_paths_in_dir($rel_base, $virtual_path, $paths);
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
409 }
410 }
411 }
412 }
413
414 private static function get_array_php($arr)
415 {
416 return "<?php return ".var_export($arr, true).";";
417 }
418
f14492d use content hashes in URL of css/js files to do automatic, granular c…
Jesse Young authored
419 private static function get_build_config()
420 {
0c6dbf8 upgrade from tinymce 3.3.7 to 3.4.7 and merge envaya customizations
Jesse Young authored
421 $res = @include("config/default_build.php");
422
423 return is_array($res) ? $res : array();
f14492d use content hashes in URL of css/js files to do automatic, granular c…
Jesse Young authored
424 }
425
426 private static function write_build_config($build_config)
427 {
a25031d reorganize config settings, allow lazy loading like language keys; re…
Jesse Young authored
428 static::write_file("config/default_build.php", static::get_array_php($build_config));
f14492d use content hashes in URL of css/js files to do automatic, granular c…
Jesse Young authored
429 }
430
431 /*
432 * Returns a short hash code that can be used as part of a file's URL, to ensure that
433 * browser/proxy caches are invalidated automatically whenever the content is changed.
434 */
435 private static function get_content_hash($content)
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
436 {
f14492d use content hashes in URL of css/js files to do automatic, granular c…
Jesse Young authored
437 // 16^10 hash values should be enough to avoid collisions within an Expires timeout of 1 year
438 // (not important to avoid intentional collisions)
439 return substr(md5($content), 0, 10);
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
440 }
441
a0385dc @youngj verify that all controller actions to have permissions check (even pu…
authored
442 public static function get_output($file)
443 {
444 ob_start();
445 require $file;
446 return ob_get_clean();
447 }
448
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
449 private static function js_minify_dir($base, $name = '*', $dir = '')
450 {
6f4f24f use ACE code editor for input fields that need code (html/css/xml); u…
Jesse Young authored
451 $js_src_files = glob("$base/js/{$dir}{$name}.{js,php}", GLOB_BRACE);
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
452 foreach ($js_src_files as $js_src_file)
453 {
454 $basename = pathinfo($js_src_file, PATHINFO_BASENAME);
6f4f24f use ACE code editor for input fields that need code (html/css/xml); u…
Jesse Young authored
455 $filename = pathinfo($js_src_file, PATHINFO_FILENAME);
456 $extension = pathinfo($js_src_file, PATHINFO_EXTENSION);
457
458 $output_file = "www/_media/{$dir}{$filename}.js";
459
460 if ($extension == 'php')
461 {
462 $js_temp_file = "scripts/$basename.tmp.js";
a0385dc @youngj verify that all controller actions to have permissions check (even pu…
authored
463 $raw_js = static::get_output($js_src_file);
6f4f24f use ACE code editor for input fields that need code (html/css/xml); u…
Jesse Young authored
464 file_put_contents($js_temp_file, $raw_js);
d3d9494 fix selenium tests broken with upgrade to new version of tinymce
Jesse Young authored
465 $compressed = static::minify($js_temp_file, $output_file);
6f4f24f use ACE code editor for input fields that need code (html/css/xml); u…
Jesse Young authored
466 unlink($js_temp_file);
467 }
468 else
a0385dc @youngj verify that all controller actions to have permissions check (even pu…
authored
469 {
d3d9494 fix selenium tests broken with upgrade to new version of tinymce
Jesse Young authored
470 $compressed = static::minify($js_src_file, $output_file);
6f4f24f use ACE code editor for input fields that need code (html/css/xml); u…
Jesse Young authored
471 }
f14492d use content hashes in URL of css/js files to do automatic, granular c…
Jesse Young authored
472
473 if ($dir != 'inline/') // inline JS does not need content hashes because it is never loaded by URL
474 {
475 $build_config = static::get_build_config();
a25031d reorganize config settings, allow lazy loading like language keys; re…
Jesse Young authored
476 $build_config["build:hash:js:$filename"] = static::get_content_hash($compressed);
f14492d use content hashes in URL of css/js files to do automatic, granular c…
Jesse Young authored
477 static::write_build_config($build_config);
478 }
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
479 }
480
481 $subdirs = glob("$base/js/{$dir}*", GLOB_ONLYDIR);
482 foreach ($subdirs as $subdir)
483 {
484 $basename = pathinfo($subdir, PATHINFO_BASENAME);
6f4f24f use ACE code editor for input fields that need code (html/css/xml); u…
Jesse Young authored
485 if ($basename == 'src')
486 {
487 continue;
488 }
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
489
490 if (!is_dir("www/_media/{$dir}{$basename}"))
491 {
492 mkdir("www/_media/{$dir}{$basename}");
493 }
494 static::js_minify_dir($base, $name, "{$dir}{$basename}/");
495 }
496 }
497
498 static function system($cmd)
499 {
500 echo "$cmd\n";
501 return system($cmd);
f14492d use content hashes in URL of css/js files to do automatic, granular c…
Jesse Young authored
502 }
1477543 start to move envaya.org-specific code into envaya_org module; re-add…
Jesse Young authored
503 }
504
505 $target = @$argv[1] ?: 'all';
506 $arg = @$argv[2];
507 if (method_exists('Build', $target))
508 {
509 if ($arg)
510 {
511 Build::$target($arg);
512 }
513 else
514 {
515 Build::$target();
516 }
517 }
518 else
519 {
520 echo "Build::$target is not defined\n";
d7f37dc change how modules are defined in order to reduce overhead on every r…
Jesse Young authored
521 }
Something went wrong with that request. Please try again.