public function fullParse() { return fullParsePi($this->pageText); $this->allCmds = $this->extractPiCommandsFromString($this->pageText); $itrsFinished = false; while (!$itrsFinished) { //////var_dump($this->pageText); //echo("hrer\n"); $tempTxt = $this->pageText; //var_dump($this->pageText); $this->pageText = $this->setupIterators(); $itrsFinished = $this->pageText == $tempTxt; $this->allCmds = $this->extractPiCommandsFromString($this->pageText); } while (count($this->allCmds) > 0) { $last = array_pop($this->allCmds); $this->pageText = $last->fillWithResult($this->pageText); $this->allCmds = $this->extractPiCommandsFromString($this->pageText); } return $this->pageText; }
function shortcodeWrapper($atts, $content = '') { return fullParsePi($content); }
<?php include __DIR__ . "/piPress.php"; //var_dump($_POST); //die(); //$_POST["payload"] = '[piEcho:"Tests" + "\n"]'; if (isset($_POST["payload"])) { //echo base64_decode($_POST["payload"]); $data = base64_decode(base64_decode($_POST["payload"])); echo fullParsePi($data); }
} $genStr .= "function " . $point["ShortCode"] . '($' . implode(', $', $adjusted) . ") {" . ' $method = "' . $point["Method"] . '"; $endpoint = endpointWith("' . $point["Path"] . '", $method); global $verbose; checkAuth(); $data = array(' . implode(",\n\t", $arrCreator) . ' ); if ($method != "GET") { $data = formattedParametersWithData($endpoint, $data); } $newPath = fillEndpointPathWithRequirements($endpoint, $data); $data = cleanEndpointRequirementsFromData($endpoint, $data); return send' . $point["Method"] . '(defaultHeader(), $data, $newPath);' . "\n}\n\n"; $cnt++; } $genStr .= '?>'; echo $genStr; file_put_contents("autogen/piShort-auto.php", $genStr); } //genShortCodes(); $verbose = false; if ($verbose) { $verbose = false; $testPage = file_get_contents("tests/newPiSyntax.js"); $modded = fullParsePi($testPage); echo "******************\nParsed File:\n" . $modded . "\n******************\n"; }