fb_.parsedfile = fb_.parsedfile & fb_.CRLF & repeatString(fb_.indentBlock, min(fb_.maxIndentLevel, fb_.indentLevel)) & '<!-'&'-- assertion is TRUE; do nothing --'&'->'; fb_.indentLevel = fb_.indentLevel - 1; fb_.parsedfile = fb_.parsedfile & fb_.CRLF & repeatString(fb_.indentBlock, min(fb_.maxIndentLevel, fb_.indentLevel)) & '<cfelse>'; fb_.indentLevel = fb_.indentLevel + 1; */ fb_appendSegment('__cfthrow(array("type"=>"fusebox.failedAssertion", "message"=>"' . $fb_["fuseQ"][$fb_["i"]]["xmlAttributes"]["message"] . '", "detail"=>"The assertion, ' . str_replace("\$", "\\\$", $fb_["fuseQ"][$fb_["i"]]["xmlAttributes"]["expression"]) . ', failed at run-time in fuseaction ' . $fb_["fuseQ"][$fb_["i"]]["circuit"] . '.' . $fb_["fuseQ"][$fb_["i"]]["fuseaction"] . '."));'); /* fb_.indentLevel = fb_.indentLevel - 1; */ fb_appendSegment('}'); fb_appendSegment('</assertion> *' . '/'); fb_appendNewLine(); $fb_["hasAssertions"] = true; break; default: if ($application["fusebox"]["allowLexicon"] && __ListLen($fb_["fuseQ"][$fb_["i"]]["xmlName"], '.') > 1) { $fb_["lexicon"] = __ListFirst($fb_["fuseQ"][$fb_["i"]]["xmlName"], '.'); $fb_["lexiconVerb"] = __ListRest($fb_["fuseQ"][$fb_["i"]]["xmlName"], '.'); $fb_["verbInfo"] = array(); $fb_["verbInfo"]["lexicon"] = $fb_["lexicon"]; $fb_["verbInfo"]["verb"] = $fb_["lexiconVerb"]; $fb_["verbInfo"]["attributes"] = $fb_["fuseQ"][$fb_["i"]]["xmlAttributes"]; if (array_key_exists($fb_["lexicon"], $application["fusebox"]["lexicons"])) { if (file_exists($application["fusebox"]["approotdirectory"] . $application["fusebox"]["lexiconPath"] . $application["fusebox"]["lexicons"][$fb_["lexicon"]]["path"] . $fb_["lexiconVerb"] . '.' . $application["fusebox"]["scriptFileDelimiter"])) { include ereg_replace("[\\/]+", "/", $application["fusebox"]["WebRootToAppRootPath"] . $application["fusebox"]["lexiconPath"] . $application["fusebox"]["lexicons"][$fb_["lexicon"]]["path"] . $fb_["lexiconVerb"] . '.' . $application["fusebox"]["scriptFileDelimiter"]); } else { if (!$application["fusebox"]["ignoreBadGrammar"]) { __cfthrow(array("type" => "fusebox.badGrammar", "message" => "Bad Grammar verb in circuit file", "detail" => "The implementation file for the '" . $fb_["lexiconVerb"] . "' verb from the '" . $fb_["lexicon"] . "' custom lexicon could not be found. It is used in the '" . $fb_["fuseQ"][$fb_["i"]]["circuit"] . "' circuit.")); } else { // do nothing }
} else { $fb_["xnPostFA"] = $application["fusebox"]["circuits"][$myFusebox["thisCircuit"]]["postfuseaction"]["xml"]["xmlChildren"]; for ($fb_["j"] = 0; $fb_["j"] < count($fb_["xnPostFA"]); $fb_["j"]++) { if (!isset($fb_["xnPostFA"][$fb_["j"]]["circuit"])) { $fb_["xnPostFA"][$fb_["j"]]["circuit"] = $myFusebox["thisCircuit"]; } if (!isset($fb_["xnPostFA"][$fb_["j"]]["fuseaction"])) { $fb_["xnPostFA"][$fb_["j"]]["fuseaction"] = $myFusebox["thisFuseaction"]; } // remember that any <include> needs to know its local circuit as an attribute if (strtolower($fb_["xnPostFA"][$fb_["j"]]["xmlName"]) == "include") { $fb_["xnPostFA"][$fb_["j"]]["xmlAttributes"]["circuit"] = $myFusebox["thisCircuit"]; } // some special handling for do's if (strtolower($fb_["xnPostFA"][$fb_["j"]]["xmlName"]) == "do") { if (__ListLen($fb_["xnPostFA"][$fb_["j"]]["xmlAttributes"]["action"], '.') == 1) { // remember that any <do> might have only a fuseaction specified and only imply its local circuit do clarify all <do>s with explicit circuits $fb_["xnPostFA"][$fb_["j"]]["xmlAttributes"]["action"] = $myFusebox["thisCircuit"] . "." . $fb_["xnPostFA"][$fb_["j"]]["xmlAttributes"]["action"]; } } } } } // now assemble all these together $fb_["xnFA"] = array(); $fb_["xnFA"] = array_merge($fb_["xnInitFA"], $fb_["xnPlugins"]["preFuseaction"], $fb_["xnPreFA"], $fb_["xnThisFA"], $fb_["xnPostFA"], $fb_["xnPlugins"]["postFuseaction"], $fb_["xnPlugins"]["fuseactionException"], $fb_["xnCloseFA"]); // if this fuseaction has an exceptionHandler then insert space-holders for opening and closing <CFTRY></CFTRY> tags // we also did this when first parsing this <do> if (count($application["fusebox"]["pluginphases"]["fuseactionException"]) > 0) { $fb_["temp"] = array(); $fb_["temp"]["xmlName"] = "endExceptionHandler";
// does this app give higher precedence to URL scope over FORM scope? If so, adjust if ($application["fusebox"]["precedenceFormOrUrl"] == "URL") { $attributes = array_merge($_POST, $_GET); } // if it exists, load the fusebox.init file in the application root if (file_exists($application["fusebox"]["WebRootToAppRootPath"] . "fusebox.init.php")) { include $application["fusebox"]["WebRootToAppRootPath"] . "fusebox.init.php"; } // how about a default fuseaction? if (!isset($attributes[$application["fusebox"]["fuseactionVariable"]])) { $attributes[$application["fusebox"]["fuseactionVariable"]] = $application["fusebox"]["defaultFuseaction"]; } // copy the value of the fuseactionVariable into the variable "attributes.fuseaction" for standardization $attributes["fuseaction"] = $attributes[$application["fusebox"]["fuseactionVariable"]]; //set the myFusebox.originalCircuit, myFusebox.originalFuseaction if (__ListLen($attributes["fuseaction"], '.') == 2) { $myFusebox["thisCircuit"] = strtok($attributes["fuseaction"], "."); $myFusebox["thisFuseaction"] = strtok("."); $myFusebox["originalCircuit"] = $myFusebox["thisCircuit"]; $myFusebox["originalFuseaction"] = $myFusebox["thisFuseaction"]; } else { __cfthrow(array("type" => "fusebox.malformedFuseaction", "message" => "malformed Fuseaction", "detail" => "You specified a malformed Fuseaction of " . $attributes["fuseaction"] . ". A fully qualified Fuseaction must be in the form [Circuit].[Fuseaction].")); } // if the circuit specified by myFusebox.originalCircuit does not exist throw an error // if the fuseaction specified by myFusebox.originalFuseaction does not exist throw an error if (!isset($application["fusebox"]["circuits"][$myFusebox["originalCircuit"]])) { __cfthrow(array("type" => "fusebox.undefinedCircuit", "message" => "undefined Circuit", "detail" => "You specified a Circuit of " . $myFusebox["originalCircuit"] . " which is not defined.")); } else { if (!isset($application["fusebox"]["circuits"][$myFusebox["originalCircuit"]]["fuseactions"][$myFusebox["originalFuseaction"]])) { __cfthrow(array("type" => "fusebox.undefinedFuseaction", "message" => "undefined Fuseaction", "detail" => "You specified a Fuseaction of " . $myFusebox["originalFuseaction"] . " which is not defined in Circuit " . $myFusebox["originalCircuit"] . ".")); }