本文整理汇总了PHP中_hx_deref函数的典型用法代码示例。如果您正苦于以下问题:PHP _hx_deref函数的具体用法?PHP _hx_deref怎么用?PHP _hx_deref使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_hx_deref函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: request
public function request($post)
{
$proxy = $this->getProxy();
if ($proxy !== null && $proxy->host !== null && strlen($proxy->host) > 0) {
$hpa = $proxy->auth;
if ($hpa->user !== null && strlen($hpa->user) > 0) {
$data = _hx_deref(new com_wiris_system_Base64())->encodeBytes(haxe_io_Bytes::ofString($hpa->user . ":" . $hpa->pass))->toString();
$this->setHeader("Proxy-Authorization", "Basic " . $data);
}
}
parent::request($post);
}
示例2: writeXml
public function writeXml($rset)
{
$fout = php_io_File::write("RomanianDictionary.xml", false);
$fout->writeString(_hx_deref(new haxe_Template(haxe_Resource::getString("header")))->execute(_hx_anonymous(array()), null));
$wordTemplate = new haxe_Template(haxe_Resource::getString("word"));
$»it = $rset;
while ($»it->hasNext()) {
$row = $»it->next();
$properties = _hx_anonymous(array("id" => $row->id, "word" => $row->lexicon, "definition" => $row->htmlRep));
$fout->writeString($wordTemplate->execute($properties, null) . "\n");
unset($properties);
}
$fout->writeString(_hx_deref(new haxe_Template(haxe_Resource::getString("footer")))->execute(_hx_anonymous(array()), null));
$fout->close();
}
示例3: __construct
public function __construct($name)
{
if (!php_Boot::$skip_constructor) {
if (_hx_deref(new EReg("^(\\d{1,3}\\.){3}\\d{1,3}\$", ""))->match($name)) {
$this->_ip = $name;
} else {
$this->_ip = gethostbyname($name);
if ($this->_ip === $name) {
$this->ip = 0;
return;
}
}
$p = _hx_explode(".", $this->_ip);
$this->ip = intval(sprintf("%02X%02X%02X%02X", $p[3], $p[2], $p[1], $p[0]), 16);
}
}
示例4: checkAuth
static function checkAuth()
{
S::$user = php_Session::get("PHP_AUTH_USER");
haxe_Log::trace(S::$user, _hx_anonymous(array("fileName" => "S.hx", "lineNumber" => 98, "className" => "S", "methodName" => "checkAuth")));
if (S::$user === null) {
return false;
}
$pass = php_Session::get("PHP_AUTH_PW");
if ($pass === null) {
return false;
}
$res = php_Lib::hashOfAssociativeArray(_hx_deref(new Model(null))->query("SELECT use_non_latin,webroot_writable,pass_hash_enabled,pass_key,pass_cost,hosted_settings FROM system_settings"));
if (S_0($pass, $res) === "1") {
S::hexit("ENCRYPTED PASSWORDS NOT IMPLEMENTED");
}
$res = php_Lib::hashOfAssociativeArray(_hx_deref(new Model(null))->query("SELECT count(*) AS cnt FROM vicidial_users WHERE user=\"" . _hx_string_or_null(S::$user) . "\" and pass=\"" . _hx_string_or_null($pass) . "\" and user_level > 7 and active=\"Y\""));
return $res->exists("0") && S_1($pass, $res) === "1";
}
示例5: itemToString
static function itemToString($b, $s)
{
switch ($s->index) {
case 0:
$b->add("a C function");
break;
case 1:
$m = _hx_deref($s)->params[0];
$b->add("module ");
$b->add($m);
break;
case 2:
$line = _hx_deref($s)->params[2];
$file = _hx_deref($s)->params[1];
$s1 = _hx_deref($s)->params[0];
if ($s1 !== null) {
haxe_CallStack::itemToString($b, $s1);
$b->add(" (");
}
$b->add($file);
$b->add(" line ");
$b->add($line);
if ($s1 !== null) {
$b->add(")");
}
break;
case 3:
$meth = _hx_deref($s)->params[1];
$cname = _hx_deref($s)->params[0];
$b->add($cname);
$b->add(".");
$b->add($meth);
break;
case 4:
$n = _hx_deref($s)->params[0];
$b->add("local function #");
$b->add($n);
break;
}
}
示例6: addRow
public function addRow($r, $txt)
{
$json = _hx_deref(new haxe_format_JsonParser($txt))->parseRec();
if ($this->columns === null) {
$this->columns = new haxe_ds_StringMap();
}
$w = $this->tab->get_width();
$h = $this->tab->get_height();
$resize = false;
$_g = 0;
$_g1 = Reflect::fields($json);
while ($_g < $_g1->length) {
$name = $_g1[$_g];
++$_g;
if (!$this->columns->exists($name)) {
$this->columns->set($name, $w);
$w++;
$resize = true;
}
unset($name);
}
if ($r >= $h) {
$h = $r + 1;
$resize = true;
}
if ($resize) {
$this->tab->resize($w, $h);
}
$_g2 = 0;
$_g11 = Reflect::fields($json);
while ($_g2 < $_g11->length) {
$name1 = $_g11[$_g2];
++$_g2;
$v = Reflect::field($json, $name1);
$c = $this->columns->get($name1);
$this->tab->setCell($c, $r, $v);
unset($v, $name1, $c);
}
}
示例7: tink_core__Outcome_OutcomeMapper_Impl__1
function tink_core__Outcome_OutcomeMapper_Impl__1(&$f, $o)
{
switch ($o->index) {
case 0:
$d = _hx_deref($o)->params[0];
$_g = call_user_func_array($f, array($d));
switch ($_g->index) {
case 0:
$d1 = _hx_deref($_g)->params[0];
return tink_core_Outcome::Success($d1);
break;
case 1:
$f1 = _hx_deref($_g)->params[0];
return tink_core_Outcome::Failure(tink_core_Either::Right($f1));
break;
}
break;
case 1:
$f2 = _hx_deref($o)->params[0];
return tink_core_Outcome::Failure(tink_core_Either::Left($f2));
break;
}
}
示例8: responseOut
public function responseOut($ctx)
{
if (strtolower($ctx->request->get_httpMethod()) === "post" && $ctx->request->isMultipart()) {
$_g = 0;
$_g1 = $this->files;
while ($_g < $_g1->length) {
$f = $_g1[$_g];
++$_g;
$_g2 = $f->deleteTemporaryFile();
switch ($_g2->index) {
case 1:
$e = _hx_deref($_g2)->params[0];
$ctx->messages->push(_hx_anonymous(array("msg" => $e, "pos" => _hx_anonymous(array("fileName" => "TmpFileUploadMiddleware.hx", "lineNumber" => 120, "className" => "ufront.web.upload.TmpFileUploadMiddleware", "methodName" => "responseOut")), "type" => ufront_log_MessageType::$MError)));
break;
default:
break;
}
unset($_g2);
unset($f);
}
}
return ufront_core_SurpriseTools::success();
}
示例9: testNdjsonLoop
public function testNdjsonLoop()
{
$t = harness_Native::table(new _hx_array(array()));
_hx_deref(new coopy_Ndjson($t))->parse("{\"a\":1,\"b\":2}\n{\"a\":11,\"b\":22}\r\n{\"a\":111,\"b\":222}\n");
$txt = _hx_deref(new coopy_Ndjson($t))->render();
$t2 = harness_Native::table(new _hx_array(array()));
_hx_deref(new coopy_Ndjson($t2))->parse($txt);
$ca = null;
if (_hx_equal($t->getCell(0, 0), "a")) {
$ca = 0;
} else {
$ca = 1;
}
$cb = 1 - $ca;
$this->assertEquals("a", $t->getCell($ca, 0), _hx_anonymous(array("fileName" => "JsonTest.hx", "lineNumber" => 55, "className" => "harness.JsonTest", "methodName" => "testNdjsonLoop")));
$this->assertEquals("b", $t->getCell($cb, 0), _hx_anonymous(array("fileName" => "JsonTest.hx", "lineNumber" => 56, "className" => "harness.JsonTest", "methodName" => "testNdjsonLoop")));
$this->assertEquals(1, $t->getCell($ca, 1), _hx_anonymous(array("fileName" => "JsonTest.hx", "lineNumber" => 57, "className" => "harness.JsonTest", "methodName" => "testNdjsonLoop")));
$this->assertEquals(2, $t->getCell($cb, 1), _hx_anonymous(array("fileName" => "JsonTest.hx", "lineNumber" => 58, "className" => "harness.JsonTest", "methodName" => "testNdjsonLoop")));
$this->assertEquals(11, $t->getCell($ca, 2), _hx_anonymous(array("fileName" => "JsonTest.hx", "lineNumber" => 59, "className" => "harness.JsonTest", "methodName" => "testNdjsonLoop")));
$this->assertEquals(22, $t->getCell($cb, 2), _hx_anonymous(array("fileName" => "JsonTest.hx", "lineNumber" => 60, "className" => "harness.JsonTest", "methodName" => "testNdjsonLoop")));
$this->assertEquals(111, $t->getCell($ca, 3), _hx_anonymous(array("fileName" => "JsonTest.hx", "lineNumber" => 61, "className" => "harness.JsonTest", "methodName" => "testNdjsonLoop")));
$this->assertEquals(222, $t->getCell($cb, 3), _hx_anonymous(array("fileName" => "JsonTest.hx", "lineNumber" => 62, "className" => "harness.JsonTest", "methodName" => "testNdjsonLoop")));
}
示例10: key
public function key()
{
$reg = "^";
$chars = _hx_explode("", $this->str);
$ch = "";
$inKey = false;
$keyName = "";
$matchIndex = 0;
$keys = new Hash();
while (($ch = $chars->shift()) !== null) {
if ($ch == ":") {
$matchIndex++;
$keyName = "";
$inKey = true;
} else {
if ($inKey && _hx_deref(new EReg("[^a-z]", "i"))->match($ch)) {
$inKey = false;
$keys->set($keyName, $matchIndex);
$reg .= "([a-zA-Z0-9]+)" . $this->escape($ch);
} else {
if ($inKey) {
$keyName .= $ch;
} else {
$reg .= $this->escape($ch);
}
}
}
}
if ($inKey) {
$keys->set($keyName, $matchIndex);
$reg .= "([a-zA-Z0-9]+)";
}
$reg .= "\$";
haxe_Log::trace("(key) From pattern: " . $this->str . " we created expression: " . $reg . " and found these keys: " . $keys, _hx_anonymous(array("fileName" => "Route.hx", "lineNumber" => 144, "className" => "sinatra.RouteParser", "methodName" => "key")));
return new EReg($reg, "");
}
示例11: ufront_web_Controller_2
function ufront_web_Controller_2(&$_g, &$result, $outcome)
{
switch ($outcome->index) {
case 0:
$ar = _hx_deref($outcome)->params[0];
$_g->context->actionContext->actionResult = $ar;
break;
default:
break;
}
}
示例12: map
static function map($outcome, $transform)
{
switch ($outcome->index) {
case 0:
$a = _hx_deref($outcome)->params[0];
return tink_core_Outcome::Success(call_user_func_array($transform, array($a)));
break;
case 1:
$f = _hx_deref($outcome)->params[0];
return tink_core_Outcome::Failure($f);
break;
}
}
示例13: buildCond
public function buildCond($whereParam, $sob, $phValues, $first = null)
{
if ($first === null) {
$first = true;
}
$sb = new StringBuf();
$where = _hx_explode(",", $whereParam);
if ($where->length === 0) {
return false;
}
$_g = 0;
while ($_g < $where->length) {
$w = $where[$_g];
++$_g;
$wData = _hx_string_call($w, "split", array("|"));
$values = $wData->slice(2, null);
$filter_tables = null;
if (Util::any2bool($this->param) && $this->param->exists("filter_tables") && Util::any2bool($this->param->get("filter_tables"))) {
$jt = $this->param->get("filter_tables");
$filter_tables = _hx_explode(",", $jt);
unset($jt);
}
haxe_Log::trace(Std::string($wData) . ":" . _hx_string_or_null($this->joinTable) . ":" . Std::string($filter_tables), _hx_anonymous(array("fileName" => "Model.hx", "lineNumber" => 386, "className" => "Model", "methodName" => "buildCond")));
if (_hx_deref(new EReg("^pay_[a-zA-Z_]+\\.", ""))->match($wData[0]) && _hx_array_get(_hx_explode(".", $wData[0]), 0) !== $this->joinTable) {
continue;
}
if ($first) {
$sb->add(" WHERE ");
} else {
$sb->add(" AND ");
}
$first = false;
$_g1 = strtoupper($wData[1]);
switch ($_g1) {
case "BETWEEN":
if (!($values->length === 2) && Lambda::hforeach($values, array(new _hx_lambda(array(&$_g, &$_g1, &$filter_tables, &$first, &$phValues, &$sb, &$sob, &$values, &$w, &$wData, &$where, &$whereParam), "Model_13"), 'execute'))) {
S::hexit("BETWEEN needs 2 values - got only:" . _hx_string_or_null($values->join(",")));
}
$sb->add($this->quoteField($wData[0]));
$sb->add(" BETWEEN ? AND ?");
$phValues->push(new _hx_array(array($wData[0], $values[0])));
$phValues->push(new _hx_array(array($wData[0], $values[1])));
break;
case "IN":
$sb->add($this->quoteField($wData[0]));
$sb->add(" IN(");
$sb->add($values->map(array(new _hx_lambda(array(&$_g, &$_g1, &$filter_tables, &$first, &$phValues, &$sb, &$sob, &$values, &$w, &$wData, &$where, &$whereParam), "Model_14"), 'execute'))->join(","));
$sb->add(")");
break;
case "LIKE":
$sb->add($this->quoteField($wData[0]));
$sb->add(" LIKE ?");
$phValues->push(new _hx_array(array($wData[0], $wData[2])));
break;
default:
$sb->add($this->quoteField($wData[0]));
if (_hx_deref(new EReg("^(<|>)", ""))->match($wData[1])) {
$eR = new EReg("^(<|>)", "");
$eR->match($wData[1]);
$val = Std::parseFloat($eR->matchedRight());
$sb->add(_hx_string_or_null($eR->matched(0)) . "?");
$phValues->push(new _hx_array(array($wData[0], $val)));
continue 2;
}
if ($wData[1] === "NULL") {
$sb->add(" IS NULL");
} else {
$sb->add(" = ?");
$phValues->push(new _hx_array(array($wData[0], $wData[1])));
}
break;
}
unset($_g1);
unset($wData, $w, $values, $filter_tables);
}
$sob->add($sb->b);
return true;
}
示例14: main
static function main()
{
_hx_deref(new zcale_sys_db_tests_DatabaseTest())->run();
}
示例15: snap
static function snap($this1, $period)
{
$time = null;
switch ($period->index) {
case 0:
$d = _hx_deref($period)->params[0];
$time = datetime_utils_DateTimeSnapUtils::snapYear($this1 - 62135596800.0 + 62135596800.0, $d);
break;
case 1:
$d1 = _hx_deref($period)->params[0];
$time = datetime_utils_DateTimeSnapUtils::snapMonth($this1 - 62135596800.0 + 62135596800.0, $d1);
break;
case 2:
$d2 = _hx_deref($period)->params[0];
$time = datetime_utils_DateTimeSnapUtils::snapDay($this1 - 62135596800.0 + 62135596800.0, $d2);
break;
case 3:
$d3 = _hx_deref($period)->params[0];
$time = datetime_utils_DateTimeSnapUtils::snapHour($this1 - 62135596800.0 + 62135596800.0, $d3);
break;
case 4:
$d4 = _hx_deref($period)->params[0];
$time = datetime_utils_DateTimeSnapUtils::snapMinute($this1 - 62135596800.0 + 62135596800.0, $d4);
break;
case 5:
$d5 = _hx_deref($period)->params[0];
if ($d5 === 1) {
$time = $this1 - 62135596800.0 + 1;
} else {
$time = $this1 - 62135596800.0;
}
break;
case 6:
$day = _hx_deref($period)->params[1];
$d6 = _hx_deref($period)->params[0];
$time = datetime_utils_DateTimeSnapUtils::snapWeek($this1 - 62135596800.0 + 62135596800.0, $d6, $day);
break;
}
return $time + 62135596800.0;
}