本文整理汇总了PHP中Std::is方法的典型用法代码示例。如果您正苦于以下问题:PHP Std::is方法的具体用法?PHP Std::is怎么用?PHP Std::is使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Std
的用法示例。
在下文中一共展示了Std::is方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: instance
static function instance($value, $c)
{
if (Std::is($value, $c)) {
return $value;
} else {
return null;
}
}
示例2: rethrow
static function rethrow($e)
{
if (Std::is($e, _hx_qtype("php.Exception"))) {
$__rtex__ = $e;
throw $__rtex__;
} else {
throw new HException($e);
}
}
示例3: _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);
}
示例4: 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;
}
示例5: wrap
static function wrap($e, $msg = null, $pos = null)
{
if ($msg === null) {
$msg = "Internal Server Error";
}
if (Std::is($e, _hx_qtype("tink.core.TypedError"))) {
return $e;
} else {
return tink_core_TypedError::withData(500, $msg, $e, $pos);
}
}
示例6: rethrow
static function rethrow($e)
{
if (isset($__e__)) {
throw $__e__;
}
if (Std::is($e, Exception)) {
$__rtex__ = $e;
throw $__rtex__;
} else {
throw new HException($e);
}
}
示例7: 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;
}
示例8: 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");
}
示例9: 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;
}
}
示例10: 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;
}
}
示例11: 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++;
}
示例12: getModulesThatRequireInit
public function getModulesThatRequireInit()
{
$moduleSets = new _hx_array(array($this->requestMiddleware, $this->requestHandlers, $this->responseMiddleware, $this->logHandlers, $this->errorHandlers));
$modules = new _hx_array(array());
$_g = 0;
while ($_g < $moduleSets->length) {
$set = $moduleSets[$_g];
++$_g;
$_g1 = 0;
while ($_g1 < $set->length) {
$module = $set[$_g1];
++$_g1;
if (Std::is($module, _hx_qtype("ufront.app.UFInitRequired"))) {
$modules->push($module);
}
unset($module);
}
unset($set, $_g1);
}
return $modules;
}
示例13: _hx_cast
function _hx_cast($v, $type)
{
if (Std::is($v, $type)) {
return $v;
} else {
throw new HException('Class cast error');
}
}
示例14: isHash
static function isHash($o)
{
return Std::is($o, _hx_qtype("Hash"));
}
示例15: save
public function save($q)
{
$lead_id = Std::parseInt($q->get("lead_id"));
$res = S::$my->query("INSERT INTO vicidial_lead_log SELECT * FROM (SELECT NULL AS log_id," . _hx_string_rec($lead_id, "") . " AS lead_id,NOW() AS entry_date) AS ll JOIN (SELECT modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id FROM `vicidial_list`WHERE `lead_id`=" . _hx_string_rec($lead_id, "") . ")AS vl", null);
$log_id = S::$my->insert_id;
if ($log_id > 0) {
$cTable = "custom_" . Std::string($q->get("entry_list_id"));
haxe_Log::trace(_hx_string_or_null($cTable) . " log_id:" . _hx_string_rec($log_id, ""), _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 110, "className" => "model.QC", "methodName" => "save")));
if ($this->checkOrCreateCustomTable($cTable, null)) {
$cLogTable = _hx_string_or_null($cTable) . "_log";
$res = S::$my->query("INSERT INTO " . _hx_string_or_null($cLogTable) . " SELECT * FROM (SELECT " . _hx_string_rec($log_id, "") . " AS log_id) AS ll JOIN (SELECT * FROM `" . _hx_string_or_null($cTable) . "`WHERE `lead_id`=" . _hx_string_rec($lead_id, "") . ")AS cl", null);
haxe_Log::trace("INSERT INTO " . _hx_string_or_null($cLogTable) . " ..." . _hx_string_or_null(S::$my->error) . "<", _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 117, "className" => "model.QC", "methodName" => "save")));
if (S::$my->error === "") {
$primary_id = S::$my->real_escape_string($q->get("primary_id"));
$sql = new StringBuf();
$sql->add("UPDATE " . _hx_string_or_null($cTable) . " SET ");
$cFields = S::tableFields("" . _hx_string_or_null($cTable), null);
haxe_Log::trace("" . _hx_string_or_null($cTable) . " fields:" . _hx_string_or_null($cFields->toString()), _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 125, "className" => "model.QC", "methodName" => "save")));
$cFields->remove($primary_id);
$bindTypes = "";
$values2bind = null;
$i = 0;
$dbFieldTypes = php_Lib::hashOfAssociativeArray(php_Lib::associativeArrayOfObject(S::$conf->get("dbFieldTypes")));
$sets = new _hx_array(array());
$_g = 0;
while ($_g < $cFields->length) {
$c = $cFields[$_g];
++$_g;
$val = $q->get($c);
if ($val !== null) {
if (Std::is($val, _hx_qtype("String"))) {
$values2bind[$i++] = $val;
} else {
$values2bind[$i++] = $val[0];
}
$type = $dbFieldTypes->get($c);
if (Util::any2bool($type)) {
$bindTypes .= _hx_string_or_null($type);
} else {
$bindTypes .= "s";
}
$sets->push(_hx_string_or_null($c) . "=?");
unset($type);
}
unset($val, $c);
}
$sql->add($sets->join(","));
$sql->add(" WHERE lead_id=" . _hx_string_rec($lead_id, ""));
$stmt = S::$my->stmt_init();
haxe_Log::trace($sql->b, _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 147, "className" => "model.QC", "methodName" => "save")));
$success = $stmt->prepare($sql->b);
if (!$success) {
haxe_Log::trace($stmt->error, _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 151, "className" => "model.QC", "methodName" => "save")));
return false;
}
$success = myBindParam($stmt, $values2bind, $bindTypes);
haxe_Log::trace("success:" . Std::string($success), _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 155, "className" => "model.QC", "methodName" => "save")));
if ($success) {
$success = $stmt->execute();
if (!$success) {
haxe_Log::trace($stmt->error, _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 161, "className" => "model.QC", "methodName" => "save")));
return false;
}
$sql = new StringBuf();
$uFields = model_QC::$vicdial_list_fields;
$uFields->remove($primary_id);
$bindTypes = "";
$values2bind = null;
$i = 0;
$sql->add("UPDATE vicidial_list SET ");
$sets = new _hx_array(array());
$_g1 = 0;
while ($_g1 < $uFields->length) {
$c1 = $uFields[$_g1];
++$_g1;
$val1 = $q->get($c1);
if ($val1 !== null) {
if (Std::is($val1, _hx_qtype("String"))) {
$values2bind[$i++] = $val1;
} else {
$values2bind[$i++] = $val1[0];
}
$type1 = $dbFieldTypes->get($c1);
if (Util::any2bool($type1)) {
$bindTypes .= _hx_string_or_null($type1);
} else {
$bindTypes .= "s";
}
$sets->push(_hx_string_or_null($c1) . "=?");
unset($type1);
}
unset($val1, $c1);
}
$values2bind[$i++] = S::$user;
$bindTypes .= "s";
$sets->push("security_phrase=?");
if (_hx_equal($q->get("status"), "MITGL")) {
$list_id = 10000;
$mID = Std::parseInt($q->get("vendor_lead_code"));
if ($mID === null) {
//.........这里部分代码省略.........