static function formatMessage($m)
 {
     $m->msg = "" . Std::string($m->msg);
     if ($m->pos->customParams !== null) {
         $_g = new _hx_array(array());
         $_g1 = 0;
         $_g2 = $m->pos->customParams;
         while ($_g1 < $_g2->length) {
             $p = $_g2[$_g1];
             ++$_g1;
             $_g->push("" . Std::string($p));
             unset($p);
         }
         $m->pos->customParams = $_g;
     }
     return "hxt" . _hx_string_or_null(haxe_Serializer::run($m));
 }
 public function remotingError($e, $httpContext)
 {
     $httpContext->messages->push(_hx_anonymous(array("msg" => $e, "pos" => _hx_anonymous(array("fileName" => "RemotingHandler.hx", "lineNumber" => 199, "className" => "ufront.remoting.RemotingHandler", "methodName" => "remotingError")), "type" => ufront_log_MessageType::$MError)));
     if (ufront_remoting_RemotingHandler_4($this, $e, $httpContext)) {
         $s = new haxe_Serializer();
         $s->serializeException($e);
         $serializedException = "hxe" . _hx_string_or_null($s->toString());
         return $serializedException;
     } else {
         $s1 = new haxe_Serializer();
         $s1->serializeException($e);
         return "hxr" . _hx_string_or_null($s1->toString());
     }
 }
 static function run($v)
 {
     $s = new haxe_Serializer();
     $s->serialize($v);
     return $s->toString();
 }
Exemplo n.º 4
0
 static function cached_query($sql_cmd, $args = null, $dirty_pages = null)
 {
     $s_args = $args->join(":");
     $header = _hx_string_or_null($sql_cmd) . _hx_string_or_null($s_args);
     $filename = _hx_string_or_null(system_base_Wet_base::$cache_path) . _hx_string_rec(system_base_Hashes::do_hash($header), "");
     $resultset = null;
     $cached_results = null;
     $rows = new HList();
     $data = null;
     $total_rows = null;
     $results = null;
     $return_data = _hx_anonymous(array("rows" => $rows, "total_rows" => 0));
     if (strtoupper(_hx_substr(ltrim($sql_cmd), 0, 6)) !== "SELECT") {
         system_base_Database::get_instance(null, null, null, null, null, null, null, null);
         $resultset = system_base_Database::query($sql_cmd, $args, null);
         return _hx_anonymous(array("rows" => $resultset->results(), "total_rows" => $resultset->get_length()));
     }
     if (file_exists($filename)) {
         $fin = sys_io_File::read($filename, false);
         $results = $fin->readLine();
         if ($results === $header) {
             $cached_results = $fin->readLine();
             $return_data = haxe_Unserializer::run($cached_results);
         } else {
             $m = "Database cache collision running query: " . _hx_string_or_null($sql_cmd) . "\n";
             $m = Std::string(Date::now()) . ": " . _hx_string_or_null($m);
             system_base_Database::get_instance(null, null, null, null, null, null, null, null);
             $resultset = system_base_Database::query($sql_cmd, $args, null);
             return _hx_anonymous(array("rows" => $resultset->results(), "total_rows" => $resultset->get_length()));
         }
     } else {
         system_base_Database::get_instance(null, null, null, null, null, null, null, null);
         $resultset = system_base_Database::query($sql_cmd, $args, null);
         $data = haxe_Serializer::run(_hx_anonymous(array("rows" => $resultset->results(), "total_rows" => $resultset->get_length())));
         $fout = sys_io_File::write($filename, false);
         $fout->writeString(_hx_string_or_null($header) . "\n");
         $fout->writeString(_hx_string_or_null($data) . "\n");
         $fout->close();
     }
     return $return_data;
 }
 public function doSaveSessionContent($_)
 {
     if ($this->commitFlag && $this->sessionData !== null) {
         $filePath = "" . _hx_string_or_null($this->savePath) . _hx_string_or_null($this->sessionID) . ".sess";
         $content = null;
         try {
             $content = haxe_Serializer::run($this->sessionData);
         } catch (Exception $__hx__e) {
             $_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e;
             $e = $_ex_;
             return $e->asSurpriseError("Failed to serialize session content");
         }
         return ufront_core_SurpriseTools::tryCatchSurprise(array(new _hx_lambda(array(&$_, &$content, &$e, &$filePath), "ufront_web_session_FileSession_4"), 'execute'), null, _hx_anonymous(array("fileName" => "FileSession.hx", "lineNumber" => 344, "className" => "ufront.web.session.FileSession", "methodName" => "doSaveSessionContent")));
     } else {
         return ufront_core_SurpriseTools::success();
     }
 }