Example #1
0
 static function main()
 {
     haxe_Log::$trace = isset(me_cunity_php_Debug::$_trace) ? me_cunity_php_Debug::$_trace : array("me_cunity_php_Debug", "_trace");
     S::$conf = Config::load("appData.js");
     php_Session::start();
     $pd = php_Web::getPostData();
     haxe_Log::trace($pd, _hx_anonymous(array("fileName" => "S.hx", "lineNumber" => 54, "className" => "S", "methodName" => "main")));
     $params = php_Web::getParams();
     if ($params->get("debug") === "1") {
         header("Content-Type" . ": " . "text/html; charset=utf-8");
         S::$headerSent = true;
         php_Lib::println("<div><pre>");
         php_Lib::println($params);
     }
     haxe_Log::trace(Date::now()->toString(), _hx_anonymous(array("fileName" => "S.hx", "lineNumber" => 63, "className" => "S", "methodName" => "main")));
     haxe_Log::trace($params, _hx_anonymous(array("fileName" => "S.hx", "lineNumber" => 64, "className" => "S", "methodName" => "main")));
     $action = $params->get("action");
     if (strlen($action) === 0 || $params->get("className") === null) {
         S::dump(_hx_anonymous(array("error" => "required params missing")));
         return;
     }
     S::$my = new MySQLi("localhost", S::$dbUser, S::$dbPass, S::$db, null, null);
     $auth = S::checkAuth();
     haxe_Log::trace(_hx_string_or_null($action) . ":" . Std::string($auth), _hx_anonymous(array("fileName" => "S.hx", "lineNumber" => 77, "className" => "S", "methodName" => "main")));
     if (!$auth) {
         S::hexit("AUTH FAILURE");
         return;
     }
     $result = Model::dispatch($params);
     haxe_Log::trace($result, _hx_anonymous(array("fileName" => "S.hx", "lineNumber" => 85, "className" => "S", "methodName" => "main")));
     if (!S::$headerSent) {
         header("Content-Type" . ": " . "application/json");
         S::$headerSent = true;
     }
     php_Lib::println($result);
 }