public function get_postString() { if ($this->postString === null) { if ($this->get_httpMethod() === "GET") { $this->postString = ""; } else { $this->postString = php_Web::getPostData(); } if ($this->postString === null) { $this->postString = ""; } $this->postString = urldecode($this->postString); } return $this->postString; }
static function getParamValues($param) { $reg = new EReg("^" . $param . "(\\[|%5B)([0-9]*?)(\\]|%5D)=(.*?)\$", ""); $res = new _hx_array(array()); $explore = array(new _hx_lambda(array(&$param, &$reg, &$res), "php_Web_0"), 'execute'); call_user_func_array($explore, array(str_replace(";", "&", php_Web::getParamsString()))); call_user_func_array($explore, array(php_Web::getPostData())); if ($res->length === 0) { $post = php_Lib::hashOfAssociativeArray($_POST); $data = $post->get($param); $k = 0; $v = ""; if (is_array($data)) { reset($data); while (list($k, $v) = each($data)) { $res[$k] = $v; } } } if ($res->length === 0) { return null; } return $res; }
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); }
static function getParamValues($param) { $reg = new EReg("^" . $param . "(\\[|%5B)([0-9]*?)(\\]|%5D)=(.*?)\$", ""); $res = new _hx_array(array()); $explore = array(new _hx_lambda(array("explore" => &$explore, "param" => &$param, "reg" => &$reg, "res" => &$res), null, array('data'), "{\n\t\t\tif(\$data === null || strlen(\$data) === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t{\n\t\t\t\t\$_g = 0; \$_g1 = _hx_explode(\"&\", \$data);\n\t\t\t\twhile(\$_g < \$_g1->length) {\n\t\t\t\t\t\$part = \$_g1[\$_g];\n\t\t\t\t\t++\$_g;\n\t\t\t\t\tif(\$reg->match(\$part)) {\n\t\t\t\t\t\t\$idx = \$reg->matched(2);\n\t\t\t\t\t\t\$val = urldecode(\$reg->matched(4));\n\t\t\t\t\t\tif(\$idx == \"\") {\n\t\t\t\t\t\t\t\$res->push(\$val);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\$res[Std::parseInt(\$idx)] = \$val;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tunset(\$val,\$part,\$idx);\n\t\t\t\t}\n\t\t\t}\n\t\t}"), 'execute1'); call_user_func_array($explore, array(str_replace(";", "&", $_SERVER['QUERY_STRING']))); call_user_func_array($explore, array(php_Web::getPostData())); if ($res->length === 0) { $post = php_Lib::hashOfAssociativeArray($_POST); $data = $post->get($param); $k = 0; $v = ""; if (is_array($data)) { reset($data); while (list($k, $v) = each($data)) { $res[$k] = $v; } } } if ($res->length === 0) { return null; } return $res; }