private static function init() { if (self::$app === null) { self::$app = new Controller(); self::$app->inc("nmesh"); } }
die("No posted data"); } require "nm-controller.php"; $action = $_SERVER['QUERY_STRING']; $xml = new SimpleXMLElement(stripslashes($_POST['request'])) or die("Invalid XML"); //Create a network if ($action == "create") { //validate user if (users::find((string) $xml->auth, true) === false) { die("Authkey invalid"); } $nn = NeuralMesh::createNetwork((int) $xml->inputs, (int) $xml->outputs, (int) $xml->hidden, (int) $xml->layers); echo "<response><authkey>{$nn->authkey}</authkey></response>"; exit; } else { $nn = NeuralMesh::getNetwork($xml->auth); } switch ($action) { case "destory": $nn->destroy(); break; /** * Run the network */ /** * Run the network */ case "run": $outputs = $nn->run((string) $xml->input); echo "<response><outputs>"; foreach ($outputs as $output) {