} // ensure we have enough time to process next script Safe::set_time_limit(30); // avoid timeouts if (!($index++ % 50)) { Safe::set_time_limit(30); SQL::ping(); } } // report to surfer if (is_array($footprints)) { $context['text'] .= sprintf(i18n::s('%d scripts have been parsed.'), count($footprints)) . "\n"; } $context['text'] .= "</p>\n"; // generate the php documentation $context['text'] .= $documentation->generate(); // start the footprints file $content = '<?php' . "\n" . '// This file has been created by the building script scripts/build.php' . "\n" . '// on ' . gmdate("F j, Y, g:i a") . ' GMT, for ' . Surfer::get_name() . '. Please do not modify it manually.' . "\n"; // process gathered footprints if (is_array($footprints)) { reset($footprints); ksort($footprints); // ensure this variable is globally visible on file inclusion $content .= 'global $footprints;' . "\n" . 'if(!isset($footprints)) $footprints = array();' . "\n"; // global statistics $global_scripts = 0; $global_lines = 0; foreach ($footprints as $file => $footprint) { $content .= "\$footprints['{$file}']=array({$footprint['0']}, '{$footprint['1']}');\n"; // global statistics $global_scripts += 1;