本文整理汇总了PHP中_hx_qtype函数的典型用法代码示例。如果您正苦于以下问题:PHP _hx_qtype函数的具体用法?PHP _hx_qtype怎么用?PHP _hx_qtype使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_hx_qtype函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute()
{
$uriParts = $this->context->actionContext->get_uriParts();
$this->setBaseUri($uriParts);
$params = $this->context->request->get_params();
$method = $this->context->request->get_httpMethod();
$this->context->actionContext->controller = $this;
$this->context->actionContext->action = "execute";
try {
$this->context->actionContext->action = "showMessage";
$this->context->actionContext->args = new _hx_array(array());
$this->context->actionContext->get_uriParts()->splice(0, 0);
$wrappingRequired = null;
$i = haxe_rtti_Meta::getFields(_hx_qtype("ufront.app.DefaultUfrontController"))->showMessage->wrapResult[0];
$wrappingRequired = $i;
$result = $this->wrapResult($this->showMessage(), $wrappingRequired);
$this->setContextActionResultWhenFinished($result);
return $result;
throw new HException(ufront_web_HttpError::pageNotFound(_hx_anonymous(array("fileName" => "ControllerMacros.hx", "lineNumber" => 442, "className" => "ufront.app.DefaultUfrontController", "methodName" => "execute"))));
} catch (Exception $__hx__e) {
$_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e;
$e = $_ex_;
return ufront_core_SurpriseTools::asSurpriseError($e, "Uncaught error while executing " . Std::string($this->context->actionContext->controller) . "." . _hx_string_or_null($this->context->actionContext->action) . "()", _hx_anonymous(array("fileName" => "ControllerMacros.hx", "lineNumber" => 445, "className" => "ufront.app.DefaultUfrontController", "methodName" => "execute")));
}
}
示例2: run
static function run()
{
if (testsite_Server::$ufrontApp === null) {
testsite_Server::$ufrontApp = new ufront_app_UfrontApplication(_hx_anonymous(array("indexController" => _hx_qtype("testsite.Routes"), "logFile" => "log.txt", "contentDirectory" => "../uf-content/", "authImplementation" => _hx_qtype("ufront.auth.NobodyAuthHandler"), "sessionImplementation" => _hx_qtype("ufront.web.session.VoidSession"), "basePath" => "/php/")));
}
testsite_Server::$ufrontApp->executeRequest();
}
示例3: initialise
static function initialise()
{
CompileTimeClassList::$lists = new haxe_ds_StringMap();
$m = haxe_rtti_Meta::getType(_hx_qtype("CompileTimeClassList"));
if ($m->classLists !== null) {
$_g = 0;
$_g1 = $m->classLists;
while ($_g < $_g1->length) {
$item = $_g1[$_g];
++$_g;
$array = $item;
$listID = $array[0];
$list = new HList();
$_g2 = 0;
$_g3 = _hx_explode(",", $array[1]);
while ($_g2 < $_g3->length) {
$typeName = $_g3[$_g2];
++$_g2;
$type = Type::resolveClass($typeName);
if ($type !== null) {
$list->push($type);
}
unset($typeName, $type);
}
unset($_g3, $_g2);
CompileTimeClassList::$lists->set($listID, $list);
unset($listID, $list, $item, $array);
}
}
}
示例4: getProxy
public function getProxy()
{
$proxy = Reflect::field(_hx_qtype("haxe.Http"), "PROXY");
if ($proxy === null) {
return null;
}
return $proxy;
}
示例5: rethrow
static function rethrow($e)
{
if (Std::is($e, _hx_qtype("php.Exception"))) {
$__rtex__ = $e;
throw $__rtex__;
} else {
throw new HException($e);
}
}
示例6: evalValue
static function evalValue($v)
{
$str = null;
if (Std::is($v, _hx_qtype("String"))) {
$str = "'" . Std::string($v) . "'";
} else {
$str = Std::string($v);
}
return $str;
}
示例7: _trace
static function _trace($v, $i = null)
{
$info = null;
if ($i !== null) {
$info = _hx_string_or_null($i->fileName) . ":" . _hx_string_or_null($i->methodName) . ":" . _hx_string_rec($i->lineNumber, "") . ":";
} else {
$info = "";
}
file_put_contents(me_cunity_php_Debug::$logFile, _hx_string_or_null($info) . ":" . _hx_string_or_null(Std::is($v, _hx_qtype("String")) || Std::is($v, _hx_qtype("Int")) || Std::is($v, _hx_qtype("Float")) ? $v : print_r($v, 1)) . "\n", FILE_APPEND);
}
示例8: wrap
static function wrap($resultValue)
{
if ($resultValue === null) {
return new ufront_web_result_EmptyResult(null);
} else {
$actionResultValue = Std::instance($resultValue, _hx_qtype("ufront.web.result.ActionResult"));
if ($actionResultValue === null) {
$actionResultValue = new ufront_web_result_ContentResult(Std::string($resultValue), null);
}
return $actionResultValue;
}
}
示例9: handleRequest
public function handleRequest($httpContext)
{
$doneTrigger = new tink_core_FutureTrigger();
if (ufront_remoting_RemotingHandler_0($this, $doneTrigger, $httpContext)) {
$r = $httpContext->response;
$remotingResponse = null;
$r->setOk();
$path = null;
$args = null;
try {
$this->initializeContext($httpContext->injector);
$params = $httpContext->request->get_params();
if (!$params->exists("__x")) {
throw new HException("Remoting call did not have parameter `__x` which describes which API call to make. Aborting");
}
$remotingCall = null;
$s = ufront_core__MultiValueMap_MultiValueMap_Impl_::get($params, "__x");
$remotingCall = urldecode($s);
$u = new haxe_Unserializer($remotingCall);
$path = $u->unserialize();
$args = $u->unserialize();
$apiCallFinished = $this->executeApiCall($path, $args, $this->context, $httpContext->actionContext);
$remotingResponse = tink_core__Future_Future_Impl_::map($apiCallFinished, array(new _hx_lambda(array(&$apiCallFinished, &$args, &$doneTrigger, &$httpContext, &$params, &$path, &$r, &$remotingCall, &$remotingResponse, &$u), "ufront_remoting_RemotingHandler_1"), 'execute'), null);
} catch (Exception $__hx__e) {
$_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e;
$e = $_ex_;
$error = $e;
$apiNotFoundMessages = new _hx_array(array("Invalid path", "No such object", "Can't access", "No such method"));
if ($path !== null && $args !== null && Std::is($e, _hx_qtype("String")) && Lambda::exists($apiNotFoundMessages, array(new _hx_lambda(array(&$apiNotFoundMessages, &$args, &$doneTrigger, &$e, &$error, &$httpContext, &$path, &$r, &$remotingResponse), "ufront_remoting_RemotingHandler_2"), 'execute'))) {
$remotingResponse = tink_core__Future_Future_Impl_::sync("Unable to access " . _hx_string_or_null($path->join(".")) . " - API Not Found (" . _hx_string_or_null($error) . "). See " . Std::string($this->context->objects));
$r->setNotFound();
} else {
$r->setInternalError();
$remotingResponse = tink_core__Future_Future_Impl_::sync($this->remotingError($e, $httpContext));
}
}
$remotingResponse(array(new _hx_lambda(array(&$args, &$doneTrigger, &$e, &$httpContext, &$path, &$r, &$remotingResponse), "ufront_remoting_RemotingHandler_3"), 'execute'));
} else {
$result1 = tink_core_Outcome::Success(tink_core_Noise::$Noise);
if ($doneTrigger->{"list"} === null) {
false;
} else {
$list1 = $doneTrigger->{"list"};
$doneTrigger->{"list"} = null;
$doneTrigger->result = $result1;
tink_core__Callback_CallbackList_Impl_::invoke($list1, $result1);
tink_core__Callback_CallbackList_Impl_::clear($list1);
true;
}
}
return $doneTrigger->future;
}
示例10: call
public function call()
{
$obj = Type::createEmptyInstance($this->scope);
$method = Reflect::field($obj, $this->func);
if ($method === null) {
throw new HException($obj . " does not contain " . $this->func);
}
if (!Reflect::isFunction($method)) {
throw new HException($this->func . " is not a method of " . $obj);
}
$ret = Reflect::callMethod($obj, $method, new _hx_array(array()));
haxe_Log::trace("Returned: " . $ret, _hx_anonymous(array("fileName" => "Route.hx", "lineNumber" => 28, "className" => "sinatra.Route", "methodName" => "call")));
return Std::is($ret, _hx_qtype("String")) ? new sinatra_View($ret, null) : eval("if(isset(\$this)) \$»this =& \$this;\$tmp = \$ret;\n\t\t\t\$»r = (Std::is(\$tmp, _hx_qtype(\"sinatra.View\")) ? \$tmp : eval(\"if(isset(\\\$this)) \\\$»this =& \\\$this;throw new HException(\\\"Class cast error\\\");\n\t\t\t\treturn \\\$»r2;\n\t\t\t\"));\n\t\t\treturn \$»r;\n\t\t");
}
示例11: setProperty
static function setProperty($o, $field, $value)
{
if (null === $o) {
null;
return;
}
$cls = Std::is($o, _hx_qtype("Class")) ? $o->__tname__ : get_class($o);
$cls_vars = get_class_vars($cls);
if (isset($cls_vars['__properties__']) && isset($cls_vars['__properties__']['set_' . $field]) && ($field = $cls_vars['__properties__']['set_' . $field])) {
$o->{$field}($value);
return;
} else {
$o->{$field} = $value;
return;
}
}
示例12: __construct
public function __construct()
{
if (!php_Boot::$skip_constructor) {
$this->get("/", _hx_qtype("controller.Home"), "index");
$this->get("/user/:id.:format", _hx_qtype("controller.User"), "get");
$this->get("/user/(\\d+)", _hx_qtype("controller.User"), "get");
$this->get("/user/**/*.xml", _hx_qtype("controller.User"), "get");
$this->post("/user", _hx_qtype("controller.User"), "update");
$this->put("/user", _hx_qtype("controller.User"), "create");
$this->delete("/user", _hx_qtype("controller.User"), "delete");
$p = new Params();
$p->id = "123";
$p[0] = "321";
haxe_Log::trace($p, _hx_anonymous(array("fileName" => "Application.hx", "lineNumber" => 23, "className" => "Application", "methodName" => "new")));
}
}
示例13: sure
static function sure($outcome)
{
switch ($outcome->index) {
case 0:
$data = _hx_deref($outcome)->params[0];
return $data;
break;
case 1:
$failure = _hx_deref($outcome)->params[0];
if (Std::is($failure, _hx_qtype("tink.core.TypedError"))) {
return $failure->throwSelf();
} else {
throw new HException($failure);
}
break;
}
}
示例14: typeof
static function typeof($v)
{
if ($v === null) {
return ValueType::$TNull;
}
if (is_array($v)) {
if (is_callable($v)) {
return ValueType::$TFunction;
}
return ValueType::TClass(_hx_qtype("Array"));
}
if (is_string($v)) {
if (_hx_is_lambda($v)) {
return ValueType::$TFunction;
}
return ValueType::TClass(_hx_qtype("String"));
}
if (is_bool($v)) {
return ValueType::$TBool;
}
if (is_int($v)) {
return ValueType::$TInt;
}
if (is_float($v)) {
return ValueType::$TFloat;
}
if ($v instanceof _hx_anonymous) {
return ValueType::$TObject;
}
if ($v instanceof _hx_enum) {
return ValueType::$TObject;
}
if ($v instanceof _hx_class) {
return ValueType::$TObject;
}
$c = _hx_ttype(get_class($v));
if ($c instanceof _hx_enum) {
return ValueType::TEnum($c);
}
if ($c instanceof _hx_class) {
return ValueType::TClass($c);
}
return ValueType::$TUnknown;
}
示例15: unserializeObject
public function unserializeObject($o)
{
while (true) {
if ($this->pos >= $this->length) {
throw new HException("Invalid object");
}
if (ord(substr($this->buf, $this->pos, 1)) === 103) {
break;
}
$k = $this->unserialize();
if (!Std::is($k, _hx_qtype("String"))) {
throw new HException("Invalid object key");
}
$v = $this->unserialize();
$o->{$k} = $v;
unset($v, $k);
}
$this->pos++;
}