当前位置: 首页>>代码示例>>PHP>>正文


PHP _hx_index_of函数代码示例

本文整理汇总了PHP中_hx_index_of函数的典型用法代码示例。如果您正苦于以下问题:PHP _hx_index_of函数的具体用法?PHP _hx_index_of怎么用?PHP _hx_index_of使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了_hx_index_of函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: decode_route

 public function decode_route()
 {
     $this->params = new _hx_array(array());
     if (system_base_Router::$regexp->match($this->query_string)) {
         throw new HException(new system_base_Http_exception("Illegal character(s) in URI: " . _hx_string_or_null($this->query_string), 400, _hx_anonymous(array("fileName" => "Router.hx", "lineNumber" => 119, "className" => "system.base.Router", "methodName" => "decode_route"))));
     }
     if (strlen($this->query_string) === 0) {
         $this->controller = system_base_Router::$FRONT_CONTROLLER;
         $s = strtolower($this->controller);
         $this->controller = _hx_string_or_null(strtoupper(_hx_substr($s, 0, 1))) . _hx_string_or_null(_hx_substr($s, 1, null));
         $this->method = strtolower(system_base_Router::$DEFAULT_METHOD);
         $this->query_string = _hx_string_or_null($this->controller) . "/" . _hx_string_or_null($this->method);
         return true;
     }
     if (_hx_index_of($this->query_string, "/", null) === -1) {
         $this->params->push(strtolower($this->query_string));
     } else {
         $this->params = _hx_explode("/", strtolower($this->query_string));
     }
     if ($this->params[0] !== null && strlen($this->params[0]) > 0) {
         $s1 = $this->params[0];
         $this->controller = _hx_string_or_null(strtoupper(_hx_substr($s1, 0, 1))) . _hx_string_or_null(_hx_substr($s1, 1, null));
     } else {
         $this->controller = system_base_Router::$FRONT_CONTROLLER;
     }
     if ($this->params[1] !== null && strlen($this->params[0]) > 0) {
         $this->method = $this->params[1];
     } else {
         $this->method = system_base_Router::$DEFAULT_METHOD;
     }
     if ($this->controller === "_load") {
         return false;
     }
     return true;
 }
开发者ID:marcdraco,项目名称:Webrathea,代码行数:35,代码来源:Router.class.php

示例2: getPublicAndProtectedVars

	static function getPublicAndProtectedVars($fileData) {
		$results = (new _hx_array(array()));
		$searchIndex = 0;
		while($searchIndex < strlen($fileData)) {
			$searchIndex = _hx_index_of($fileData, "public \$", $searchIndex);
			if($searchIndex === -1) {
				break;
			}
			$semiColonIndex = _hx_index_of($fileData, ";", $searchIndex);
			$varName = _hx_substring($fileData, $searchIndex + 8, $semiColonIndex);
			$results->push(_hx_anonymous(array("varName" => $varName, "isPublic" => true)));
			$searchIndex = $semiColonIndex;
			unset($varName,$semiColonIndex);
		}
		$searchIndex = 0;
		while($searchIndex < strlen($fileData)) {
			$searchIndex = _hx_index_of($fileData, "protected \$", $searchIndex);
			if($searchIndex === -1) {
				break;
			}
			$semiColonIndex1 = _hx_index_of($fileData, ";", $searchIndex);
			$varName1 = _hx_substring($fileData, $searchIndex + 11, $semiColonIndex1);
			$results->push(_hx_anonymous(array("varName" => $varName1, "isPublic" => false)));
			$searchIndex = $semiColonIndex1;
			unset($varName1,$semiColonIndex1);
		}
		return $results;
	}
开发者ID:ConfidantCommunications,项目名称:JoomlaHaxe,代码行数:28,代码来源:PHP.class.php

示例3: addStats

 public function addStats($url)
 {
     $saveMode = $this->getConfiguration()->getProperty(com_wiris_plugin_api_ConfigurationKeys::$SAVE_MODE, "xml");
     $version = null;
     try {
         $version = com_wiris_system_Storage::newResourceStorage("VERSION")->read();
     } catch (Exception $»e) {
         $_ex_ = $»e instanceof HException ? $»e->e : $»e;
         $ex = $_ex_;
         $version = "Missing version";
     }
     $tech = null;
     try {
         $tech = com_wiris_system_Storage::newResourceStorage("tech.txt")->read();
     } catch (Exception $»e) {
         $_ex_ = $»e instanceof HException ? $»e->e : $»e;
         $ex2 = $_ex_;
         $tech = "Missing tech";
     }
     if (_hx_index_of($url, "?", null) !== -1) {
         return $url . "&stats-mode=" . $saveMode . "&stats-version=" . $version . "&stats-scriptlang=" . $tech;
     } else {
         return $url . "?stats-mode=" . $saveMode . "&stats-version=" . $version . "&stats-scriptlang=" . $tech;
     }
 }
开发者ID:OctaveBabel,项目名称:moodle-itop,代码行数:25,代码来源:PluginBuilderImpl.class.php

示例4: quote

 public function quote($s)
 {
     if (_hx_index_of($s, "", null) >= 0) {
         return "x'" . $this->base16_encode($s) . "'";
     }
     return "'" . (sqlite_escape_string($s) . "'");
 }
开发者ID:marcdraco,项目名称:Webrathea,代码行数:7,代码来源:SqliteConnection.class.php

示例5: render

 public function render($format, $mml, $latex, $properties, $outProperties)
 {
     $servicesClass = Type::resolveClass("com.wiris.editor.services.PublicServices");
     $getInstance = Reflect::field($servicesClass, "getInstance");
     $publicServices = Reflect::callMethod($servicesClass, $getInstance, null);
     $args = new _hx_array(array());
     $args->push($mml);
     $args->push($latex);
     $args->push($properties);
     $args->push($outProperties);
     try {
         if (_hx_index_of($format, "png", null) !== -1) {
             $renderPngMethod = Reflect::field($publicServices, "renderPng");
             $pngObject = Reflect::callMethod($publicServices, $renderPngMethod, $args);
             $pngBytes = $pngObject;
             return haxe_io_Bytes::ofData($pngBytes);
         } else {
             if (_hx_index_of($format, "svg", null) !== -1) {
                 $renderSvgMethod = Reflect::field($publicServices, "renderSvg");
                 $svgObject = Reflect::callMethod($publicServices, $renderSvgMethod, $args);
                 $svgString = $svgObject;
                 return haxe_io_Bytes::ofString($svgString);
             } else {
                 throw new HException("Unexpected image format.");
             }
         }
     } catch (Exception $»e) {
         $_ex_ = $»e instanceof HException ? $»e->e : $»e;
         $e = $_ex_;
         throw new HException($e->getMessage());
     }
 }
开发者ID:komcdo,项目名称:winnow,代码行数:32,代码来源:RenderImplIntegratedServices.class.php

示例6: getMathML

 public function getMathML($digest, $latex)
 {
     if ($digest !== null) {
         $content = $this->plugin->getStorageAndCache()->decodeDigest($digest);
         if ($content !== null) {
             if (StringTools::startsWith($content, "<")) {
                 $breakline = null;
                 $breakline = _hx_index_of($content, "\n", 0);
                 return _hx_substr($content, 0, $breakline);
             } else {
                 $iniFile = com_wiris_util_sys_IniFile::newIniFileFromString($content);
                 $mathml = $iniFile->getProperties()->get("mml");
                 if ($mathml !== null) {
                     return $mathml;
                 } else {
                     return "Error: mathml not found.";
                 }
             }
         } else {
             return "Error: formula not found.";
         }
     } else {
         if ($latex !== null) {
             return $this->latex2mathml($latex);
         } else {
             return "Error: no digest or latex has been sent.";
         }
     }
 }
开发者ID:Raniratna,项目名称:new_elearning,代码行数:29,代码来源:TextServiceImpl.class.php

示例7: external_status

 public function external_status($param)
 {
     $status = $param->get("dispo");
     $url = "http://xpress.mein-dialer.com/agc/api.php?source=flyCRM&user=" . _hx_string_or_null($this->vicidialUser) . "&pass=" . _hx_string_or_null($this->vicidialPass) . "&function=external_status&value=" . _hx_string_or_null($status) . "&agent_user=" . _hx_string_or_null($param->get("agent_user"));
     haxe_Log::trace($url, _hx_anonymous(array("fileName" => "AgcApi.hx", "lineNumber" => 71, "className" => "model.AgcApi", "methodName" => "external_status")));
     $agcResponse = haxe_Http::requestUrl($url);
     return $this->json_response(_hx_index_of($agcResponse, "SUCCESS", null) === 0 ? "OK" : $agcResponse);
 }
开发者ID:axelhuizinga,项目名称:gem,代码行数:8,代码来源:AgcApi.class.php

示例8: appendElement2JavascriptArray

 public function appendElement2JavascriptArray($array, $value)
 {
     $arrayOpen = _hx_index_of($array, "[", null);
     $arrayClose = _hx_index_of($array, "]", null);
     if ($arrayOpen === -1 || $arrayClose === -1) {
         throw new HException("Array not valid");
     }
     return "[" . "'" . $value . "'" . com_wiris_plugin_impl_ConfigurationImpl_0($this, $array, $arrayClose, $arrayOpen, $value);
 }
开发者ID:komcdo,项目名称:winnow,代码行数:9,代码来源:ConfigurationImpl.class.php

示例9: systemName

 static function systemName()
 {
     $s = php_uname("s");
     $p = null;
     if (($p = _hx_index_of($s, " ", null)) >= 0) {
         return _hx_substr($s, 0, $p);
     } else {
         return $s;
     }
 }
开发者ID:marcdraco,项目名称:Webrathea,代码行数:10,代码来源:Sys.class.php

示例10: get_ROOT_URL

 static function get_ROOT_URL()
 {
     if (zcale_core_path_targets_ServerPath::$rootUrl === null) {
         $protocol = "http://";
         $localhost = sys_net_Host::localhost();
         $protocol = $_SERVER["SERVER_PROTOCOL"];
         $protocol = _hx_string_or_null(strtolower(_hx_substr($protocol, 0, _hx_index_of($protocol, "/", null)))) . "://";
         zcale_core_path_targets_ServerPath::$rootUrl = _hx_string_or_null($protocol) . _hx_string_or_null($localhost) . _hx_string_or_null(zcale_core_path_targets_ServerPath::get_FILE_DIR());
     }
     return zcale_core_path_targets_ServerPath::$rootUrl;
 }
开发者ID:adrianmm44,项目名称:zcale,代码行数:11,代码来源:ServerPath.class.php

示例11: searchString

 static function searchString($data, $s)
 {
     $_g = 0;
     while ($_g < $data->length) {
         $d = $data[$_g];
         ++$_g;
         if (_hx_index_of($s, $d->subString, null) >= 0) {
             return _hx_anonymous(array("app" => $d->identity, "versionString" => ufront_web_UserAgent_0($_g, $d, $data, $s)));
         }
         unset($d);
     }
     return null;
 }
开发者ID:kevinresol,项目名称:mvc-platform-test,代码行数:13,代码来源:UserAgent.class.php

示例12: insert_before

 public function insert_before($needle, $text)
 {
     $start = null;
     if (strlen($this->body) === 0) {
         return false;
     }
     $start = _hx_index_of($this->body, $needle, null);
     if ($start === -1) {
         return false;
     }
     $this->body = _hx_string_or_null(_hx_substr($this->body, 0, $start)) . _hx_string_or_null($text) . _hx_string_or_null(_hx_substr($this->body, $start, null));
     return true;
 }
开发者ID:marcdraco,项目名称:Webrathea,代码行数:13,代码来源:String_buffer.class.php

示例13: getValueForType

 public function getValueForType($type, $name = null)
 {
     $mapping = $this->findMappingForType($type, $name);
     if ($mapping !== null) {
         return $mapping->getValue($this);
     }
     $index = _hx_index_of($type, "<", null);
     if ($index > -1) {
         $mapping = $this->findMappingForType(_hx_substr($type, 0, $index), $name);
     }
     if ($mapping !== null) {
         return $mapping->getValue($this);
     }
     return null;
 }
开发者ID:kevinresol,项目名称:mvc-platform-test,代码行数:15,代码来源:Injector.class.php

示例14: loadPropertiesLine

 public function loadPropertiesLine($line, $count)
 {
     $line = trim($line);
     if (strlen($line) === 0) {
         return;
     }
     if (StringTools::startsWith($line, ";") || StringTools::startsWith($line, "#")) {
         return;
     }
     $equals = _hx_index_of($line, "=", null);
     if ($equals === -1) {
         throw new HException("Malformed INI file " . $this->filename . " in line " . _hx_string_rec($count, "") . " no equal sign found.");
     }
     $key = _hx_substr($line, 0, $equals);
     $key = trim($key);
     $value = _hx_substr($line, $equals + 1, null);
     $value = trim($value);
     if (StringTools::startsWith($value, "\"") && StringTools::endsWith($value, "\"")) {
         $value = _hx_substr($value, 1, strlen($value) - 2);
     }
     $backslash = 0;
     while (($backslash = _hx_index_of($value, "\\", $backslash)) !== -1) {
         if (strlen($value) <= $backslash + 1) {
             continue;
         }
         $letter = _hx_substr($value, $backslash + 1, 1);
         if ($letter === "n") {
             $letter = "\n";
         } else {
             if ($letter === "r") {
                 $letter = "\r";
             } else {
                 if ($letter === "t") {
                     $letter = "\t";
                 }
             }
         }
         $value = _hx_substr($value, 0, $backslash) . $letter . _hx_substr($value, $backslash + 2, null);
         $backslash++;
         unset($letter);
     }
     $this->props->set($key, $value);
 }
开发者ID:Raniratna,项目名称:new_elearning,代码行数:43,代码来源:IniFile.class.php

示例15: updateConfiguration

 public function updateConfiguration(&$configuration)
 {
     $configuration = $configuration;
     $confClass = com_wiris_system_PropertiesTools::getProperty($configuration, com_wiris_plugin_api_ConfigurationKeys::$CONFIGURATION_CLASS, null);
     if ($confClass !== null && _hx_index_of($confClass, "com.wiris.plugin.servlets.configuration.ParameterServletConfigurationUpdater", null) !== -1) {
         return;
     }
     if ($confClass !== null) {
         $cls = Type::resolveClass($confClass);
         if ($cls === null) {
             throw new HException("Class " . $confClass . " not found.");
         }
         $obj = Type::createInstance($cls, new _hx_array(array()));
         if ($obj === null) {
             throw new HException("Instance from " . Std::string($cls) . " cannot be created.");
         }
         $cu = $obj;
         $this->config->initialize($cu);
         $cu->updateConfiguration($configuration);
     }
 }
开发者ID:Raniratna,项目名称:new_elearning,代码行数:21,代码来源:CustomConfigurationUpdater.class.php


注:本文中的_hx_index_of函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。