本文整理汇总了PHP中_hx_string_rec函数的典型用法代码示例。如果您正苦于以下问题:PHP _hx_string_rec函数的具体用法?PHP _hx_string_rec怎么用?PHP _hx_string_rec使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_hx_string_rec函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toString
public function toString()
{
if ($this->format === com_wiris_util_json_JSonIntegerFormat::$HEXADECIMAL) {
return "0x" . StringTools::hex($this->n, 0);
}
return "" . _hx_string_rec($this->n, "");
}
示例2: toString
static function toString($this1)
{
$years = $this1->getYears();
$months = $this1->getMonths();
$days = $this1->getDays();
$hours = $this1->getHours();
$minutes = $this1->getMinutes();
$seconds = $this1->getSeconds();
$parts = new _hx_array(array());
if ($years !== 0) {
$parts->push("" . _hx_string_rec($years, "") . "y");
}
if ($months !== 0) {
$parts->push("" . _hx_string_rec($months, "") . "m");
}
if ($days !== 0) {
$parts->push("" . _hx_string_rec($days, "") . "d");
}
if ($hours !== 0) {
$parts->push("" . _hx_string_rec($hours, "") . "hrs");
}
if ($minutes !== 0) {
$parts->push("" . _hx_string_rec($minutes, "") . "min");
}
if ($seconds !== 0) {
$parts->push("" . _hx_string_rec($seconds, "") . "sec");
}
return _hx_string_or_null($this1->negative ? "-" : "") . "(" . _hx_string_or_null($parts->length === 0 ? "0sec" : $parts->join(", ")) . ")";
}
示例3: get_description
public function get_description()
{
$buf = new StringBuf();
$buf->add($this->value);
if ($this->expires !== null) {
if (ufront_web_HttpCookie::$tzOffset === null) {
ufront_web_HttpCookie::$tzOffset = intval(date('Z', $this->expires->__t));
}
$gmtExpires = Date::fromTime($this->expires->getTime() + ufront_web_HttpCookie::$tzOffset);
$zeroPad = array(new _hx_lambda(array(&$buf, &$gmtExpires), "ufront_web_HttpCookie_0"), 'execute');
$day = ufront_web_HttpCookie::$dayNames[$gmtExpires->getDay()];
$date = call_user_func_array($zeroPad, array($gmtExpires->getDate()));
$month = ufront_web_HttpCookie::$monthNames[$gmtExpires->getMonth()];
$year = $gmtExpires->getFullYear();
$hour = call_user_func_array($zeroPad, array($gmtExpires->getHours()));
$minute = call_user_func_array($zeroPad, array($gmtExpires->getMinutes()));
$second = call_user_func_array($zeroPad, array($gmtExpires->getSeconds()));
$dateStr = "" . _hx_string_or_null($day) . ", " . _hx_string_or_null($date) . "-" . _hx_string_or_null($month) . "-" . _hx_string_rec($year, "") . " " . _hx_string_or_null($hour) . ":" . _hx_string_or_null($minute) . ":" . _hx_string_or_null($second) . " GMT";
ufront_web_HttpCookie::addPair($buf, "expires", $dateStr, null);
}
ufront_web_HttpCookie::addPair($buf, "domain", $this->domain, null);
ufront_web_HttpCookie::addPair($buf, "path", $this->path, null);
if ($this->secure) {
ufront_web_HttpCookie::addPair($buf, "secure", null, true);
}
return $buf->b;
}
示例4: setup
public function setup()
{
$this->data1 = new _hx_array(array());
$this->data2 = new _hx_array(array());
$scale = 1000;
$cols = 5;
$this->data1[$scale - 1] = null;
$this->data2[$scale - 1] = null;
$_g = 0;
while ($_g < 2) {
$k = $_g++;
$_g1 = 0;
while ($_g1 < $scale) {
$i = $_g1++;
$row = new _hx_array(array());
$row[$cols - 1] = null;
$row[0] = "<supplier>";
$row[1] = "<product_code>";
$row[2] = "" . _hx_string_rec($i + $k * 7, "");
$row[3] = "" . _hx_string_rec(_hx_mod($i + $k * 7, 10), "");
$row[4] = "GBP";
if ($k === 1) {
$this->data1[$i] = $row;
} else {
$this->data2[$i] = $row;
}
unset($row, $i);
}
unset($_g1);
unset($k);
}
}
示例5: formatMessage
static function formatMessage($m)
{
$type = null;
$_g = $m->type;
switch ($_g->index) {
case 0:
$type = "log";
break;
case 1:
$type = "info";
break;
case 2:
$type = "warn";
break;
case 3:
$type = "error";
break;
}
$extras = null;
if (_hx_field($m, "pos") !== null && $m->pos->customParams !== null) {
$extras = ", " . _hx_string_or_null($m->pos->customParams->join(", "));
} else {
$extras = "";
}
$msg = "" . _hx_string_or_null($m->pos->className) . "." . _hx_string_or_null($m->pos->methodName) . "(" . _hx_string_rec($m->pos->lineNumber, "") . "): " . Std::string($m->msg) . _hx_string_or_null($extras);
return "console." . _hx_string_or_null($type) . "(decodeURIComponent(\"" . _hx_string_or_null(rawurlencode($msg)) . "\"))";
}
示例6: get_description
public function get_description()
{
$msg = "Class : " . _hx_string_or_null($this->__info->className) . " - > ";
$msg .= _hx_string_or_null($this->__info->methodName) . "()\nline ";
$msg .= _hx_string_rec($this->__info->lineNumber, "") . " : " . _hx_string_or_null($this->__description);
return $msg;
}
示例7: math2Img
public function math2Img($str, $prop)
{
$img = "<img";
$output = array();
$prop["centerbaseline"] = "false";
$prop["accessible"] = "true";
$prop["metrics"] = "true";
$src = $this->render->createImage($str, $prop, $output);
$img .= " src=\"" . $src . "\"";
$alt = com_wiris_system_PropertiesTools::getProperty($output, "alt", null);
$width = com_wiris_system_PropertiesTools::getProperty($output, "width", null);
$height = com_wiris_system_PropertiesTools::getProperty($output, "height", null);
$baseline = com_wiris_system_PropertiesTools::getProperty($output, "baseline", null);
$dpi = Std::parseFloat($this->plugin->getConfiguration()->getProperty(com_wiris_plugin_api_ConfigurationKeys::$WIRIS_DPI, "96"));
$mml = $this->plugin->getConfiguration()->getProperty(com_wiris_plugin_api_ConfigurationKeys::$FILTER_OUTPUT_MATHML, "false") === "true";
$f = 96 / $dpi;
$dwidth = $f * Std::parseFloat($width);
$dheight = $f * Std::parseFloat($height);
$dbaseline = $f * Std::parseFloat($baseline);
$alt = $this->html_entity_encode($alt);
$img .= " class=\"Wirisformula\"";
$img .= " alt=\"" . $alt . "\"";
$img .= " width=\"" . _hx_string_rec($dwidth, "") . "\"";
$img .= " height=\"" . _hx_string_rec($dheight, "") . "\"";
$d = $dbaseline - $dheight;
$img .= " style=\"vertical-align:" . _hx_string_rec($d, "") . "px\"";
if ($mml) {
$tag = $this->plugin->getConfiguration()->getProperty(com_wiris_plugin_api_ConfigurationKeys::$EDITOR_MATHML_ATTRIBUTE, "data-mathml");
$img .= " " . $tag . "=\"" . $this->save_xml_encode($str) . "\"";
}
$img .= "/>";
return $img;
}
示例8: string
static function string($s)
{
$GLOBALS['%s']->push("Std::string");
$__hx__spos = $GLOBALS['%s']->length;
$tmp = _hx_string_rec($s, "");
$GLOBALS['%s']->pop();
return $tmp;
$GLOBALS['%s']->pop();
}
示例9: connect
public function connect($host, $port)
{
$errs = null;
$errn = null;
$r = stream_socket_client($this->protocol . "://" . $host->hostName . ":" . _hx_string_rec($port, ""), $errn, $errs);
sys_net_Socket::checkError($r, $errn, $errs);
$this->__s = $r;
$this->assignHandler();
}
示例10: _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);
}
示例11: formatMsg
static function formatMsg($m)
{
$extras = null;
if (_hx_field($m, "pos") !== null && $m->pos->customParams !== null) {
$extras = ", " . _hx_string_or_null($m->pos->customParams->join(", "));
} else {
$extras = "";
}
$type = _hx_substr(Type::enumConstructor($m->type), 1, null);
return "" . _hx_string_or_null($type) . ": " . _hx_string_or_null($m->pos->className) . "." . _hx_string_or_null($m->pos->methodName) . "(" . _hx_string_rec($m->pos->lineNumber, "") . "): " . Std::string($m->msg) . _hx_string_or_null($extras);
}
示例12: toOutcome
static function toOutcome($option, $pos = null)
{
switch ($option->index) {
case 0:
$value = _hx_deref($option)->params[0];
return tink_core_Outcome::Success($value);
break;
case 1:
return tink_core_Outcome::Failure(new tink_core_TypedError(404, "Some value expected but none found in " . _hx_string_or_null($pos->fileName) . "@line " . _hx_string_rec($pos->lineNumber, ""), _hx_anonymous(array("fileName" => "Outcome.hx", "lineNumber" => 37, "className" => "tink.core.OutcomeTools", "methodName" => "toOutcome"))));
break;
}
}
示例13: remotingError
static function remotingError($error, $pos = null)
{
switch ($error->index) {
case 0:
$responseData = _hx_deref($error)->params[2];
$responseCode = _hx_deref($error)->params[1];
$remotingCallString = _hx_deref($error)->params[0];
return tink_core_TypedError::typed($responseCode, "HTTP " . _hx_string_rec($responseCode, "") . " Error during " . _hx_string_or_null($remotingCallString), $error, $pos);
break;
case 1:
$errorMessage = _hx_deref($error)->params[1];
$remotingCallString1 = _hx_deref($error)->params[0];
return tink_core_TypedError::typed(404, "Remoting API " . _hx_string_or_null($remotingCallString1) . " not found: " . _hx_string_or_null($errorMessage), $error, $pos);
break;
case 2:
$stack = _hx_deref($error)->params[2];
$e = _hx_deref($error)->params[1];
$remotingCallString2 = _hx_deref($error)->params[0];
$errorObj = Std::instance($e, _hx_qtype("tink.core.TypedError"));
if ($errorObj !== null) {
return tink_core_TypedError::typed($errorObj->code, $errorObj->message, $error, $pos);
} else {
return tink_core_TypedError::typed(500, "Internal Server Error while executing " . _hx_string_or_null($remotingCallString2), $error, $pos);
}
break;
case 3:
$e1 = _hx_deref($error)->params[1];
$remotingCallString3 = _hx_deref($error)->params[0];
return tink_core_TypedError::typed(500, "Error during callback after " . _hx_string_or_null($remotingCallString3) . ": " . Std::string($e1), $error, $pos);
break;
case 4:
$err = _hx_deref($error)->params[2];
$troubleLine = _hx_deref($error)->params[1];
$remotingCallString4 = _hx_deref($error)->params[0];
return tink_core_TypedError::typed(422, "Remoting serialization failed for call " . _hx_string_or_null($remotingCallString4) . ": could not process " . _hx_string_or_null($troubleLine), $error, $pos);
break;
case 5:
$responseData1 = _hx_deref($error)->params[1];
$remotingCallString5 = _hx_deref($error)->params[0];
return tink_core_TypedError::typed(500, "Error with response for " . _hx_string_or_null($remotingCallString5) . ": no remoting response found", $error, $pos);
break;
case 6:
$data = _hx_deref($error)->params[1];
$remotingCallString6 = _hx_deref($error)->params[0];
return tink_core_TypedError::typed(500, "Call to " . _hx_string_or_null($remotingCallString6) . " failed: " . Std::string($data), $error, $pos);
break;
case 7:
$e2 = _hx_deref($error)->params[0];
return tink_core_TypedError::typed(500, "Unknown exception during remoting call", $error, $pos);
break;
}
}
示例14: connect
static function connect($params)
{
$dsn = "mysql:";
if ($params->socket !== null) {
$dsn .= "unix_socket=" . _hx_string_or_null($params->socket) . ";";
} else {
$dsn .= "host=" . _hx_string_or_null($params->host) . ";";
if ($params->port !== null) {
$dsn .= "port=" . _hx_string_rec($params->port, "") . ";";
}
}
$dsn .= "dbname=" . _hx_string_or_null($params->database);
return php_db_PDO::open($dsn, $params->user, $params->pass, null);
}
示例15: toString
public function toString()
{
$s = "{";
$it = $this->keys();
$__hx__it = $it;
while ($__hx__it->hasNext()) {
unset($i);
$i = $__hx__it->next();
$s .= _hx_string_rec($i, "");
$s .= " => ";
$s .= Std::string($this->get($i));
if ($it->hasNext()) {
$s .= ", ";
}
}
return _hx_string_or_null($s) . "}";
}