static function loadFunctionList() { $cachefile = sugar_cached("Expressions/actions_cache.php"); if (!is_file($cachefile)) { ActionFactory::buildActionCache(); } else { include $cachefile; ActionFactory::$loaded_actions = $actions; } }
if ($silent === false) { echo "</ul>"; } return array("function_map" => $contents, "javascript" => $js_contents); } $silent = isset($GLOBALS['updateSilent']) ? $GLOBALS['updateSilent'] : false; // the new contents of the functionmap.php file $contents = recursiveParse("include/Expressions/Expression", $silent); if (is_dir("custom/include/Expressions/Expression")) { $customContents = recursiveParse("custom/include/Expressions/Expression", $silent); $contents["function_map"] .= $customContents["function_map"]; $contents["javascript"] .= $customContents["javascript"]; } //Parse Actions into the cached javascript. require_once "include/Expressions/Actions/ActionFactory.php"; $contents["javascript"] .= ActionFactory::buildActionCache($silent); $new_contents = "<?php\n\$FUNCTION_MAP = array(\n"; $new_contents .= $contents["function_map"]; $new_contents .= ");\n"; $new_contents .= "?>"; create_cache_directory("Expressions/functionmap.php"); $fmap = sugar_cached("Expressions/functionmap.php"); // now write the new contents to functionmap.php sugar_file_put_contents($fmap, $new_contents); // write the functions cache file $cache_contents = $contents["javascript"]; require_once $fmap; $cache_contents .= <<<EOQ /** * The function to object map that is used by the Parser * to parse expressions into objects.