private function neovetus() { if ($this->get_request_method() != "POST") { $this->response('', 406); } $data = json_decode(file_get_contents("php://input"), true); $culture = $data['culture']; $neo = NeovetusFactory::create(); if (is_null($neo)) { $this->response('', 406); } else { $this->response($this->json($neo->GetNeovetus($culture)), 200); } }
<?php header('Content-Type: text/html; charset=utf-8'); require 'Neovetus.php'; function json($data) { if (is_array($data)) { return json_encode($data); } } echo "Programme de test pour données Neovetus"; $func = NeovetusFactory::create(); if (is_null($func)) { echo "Nothing in Savoir Faire XML"; } else { $culture = "en"; $result = $func->GetNeovetus($culture); echo json($result); }