public static function getInstance() { if (self::$theInstance == null) { self::$theInstance = new StringTracer(); } return self::$theInstance; }
public function setPercentageDoorOpen($aPercentageDoorOpen) { $wasSet = false; $this->percentageDoorOpen = $aPercentageDoorOpen; $wasSet = true; StringTracer::execute("percentageDoorOpen={$aPercentageDoorOpen}"); return $wasSet; }
<?php require_once "ui/framework.php"; $tracer = StringTracer::getInstance(); if (isset($_POST["buttonNext"])) { $building = retrieveObject("inputBuilding"); $oldTracer = retrieveObject("inputTracer"); foreach ($oldTracer->getTraces() as $trace) { $tracer->addTrace($trace); } if (isset($_POST["inputAction"]) && $_POST["inputAction"] != "") { handleActions($building, $_POST["inputAction"]); } $building->nextStep(); $autoChecked = isset($_POST["inputAutomatic"]) ? "checked" : ""; } else { $building = createBuilding(); $autoChecked = ""; } assignRandomFloor($building); ?> <html> <head> <style> h1 { padding: 2px 0 2px 0; margin: 0; } h2 { padding: 10px 0 12px 0; margin: 0; } h3 { padding: 0 0 10px 0; margin: 0; font-size: 12pt; } table tr td { vertical-align: top; } table.elevatorshaft, table.elevatorshaft tr {padding:0;margin:0;} table.elevatorshaft td {width:50px;height:100px;background-color:#7E8B8B;} div.open {background-color:blue;width:50%;height:100%;}