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


PHP _hx_explode函数代码示例

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


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

示例1: glob

 public function glob()
 {
     $reg = "^";
     $chars = _hx_explode("", $this->str);
     $ch = "";
     $wild = 0;
     $single = 0;
     $or = false;
     while (true) {
         switch ($ch) {
             case "*":
                 $wild++;
                 break;
             case "?":
                 $single++;
                 break;
             case "{":
                 $reg .= "(?:";
                 $or = true;
                 break;
             case ",":
                 if ($or) {
                     $reg .= "|";
                 } else {
                     $reg .= $ch;
                 }
                 break;
             case "}":
                 $reg .= ")";
                 $or = false;
                 break;
             default:
                 if ($single > 0) {
                     $reg .= "[^/]{" . $single . "}";
                     $single = 0;
                 } else {
                     if ($wild === 1) {
                         $reg .= "[^/]*";
                         $wild = 0;
                     } else {
                         if ($wild === 2) {
                             $reg .= ".*";
                             $wild = 0;
                         }
                     }
                 }
                 if ($ch !== null) {
                     $reg .= $ch;
                 }
                 break;
         }
         if ($ch === null) {
             break;
         }
         $ch = $chars->shift();
     }
     $reg .= "\$";
     haxe_Log::trace("(glob) From pattern: " . $this->str . " we created expression: " . $reg, _hx_anonymous(array("fileName" => "Route.hx", "lineNumber" => 211, "className" => "sinatra.RouteParser", "methodName" => "glob")));
     return new EReg($reg, "");
 }
开发者ID:slaskis,项目名称:hxsinatra,代码行数:60,代码来源:RouteParser.class.php

示例2: escapeArgument

 static function escapeArgument($arg)
 {
     $ok = true;
     $_g1 = 0;
     $_g = strlen($arg);
     while ($_g1 < $_g) {
         $i = $_g1++;
         switch (_hx_char_code_at($arg, $i)) {
             case 32:
             case 34:
                 $ok = false;
                 break;
             case 0:
             case 13:
             case 10:
                 $arg = _hx_substr($arg, 0, $i);
                 break;
         }
         unset($i);
     }
     if ($ok) {
         return $arg;
     }
     return "\"" . _hx_explode("\"", $arg)->join("\\\"") . "\"";
 }
开发者ID:marcdraco,项目名称:Webrathea,代码行数:25,代码来源:Sys.class.php

示例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);
         }
     }
 }
开发者ID:kevinresol,项目名称:mvc-platform-test,代码行数:30,代码来源:CompileTimeClassList.class.php

示例4: 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

示例5: doJoin

 public function doJoin($q, $sb, $phValues)
 {
     $fields = $q->get("fields");
     $sb->add("SELECT " . _hx_string_or_null($fields !== null ? $this->fieldFormat(_hx_explode(",", $fields)->map(array(new _hx_lambda(array(&$fields, &$phValues, &$q, &$sb), "model_Clients_0"), 'execute'))->join(",")) : "*"));
     $qTable = null;
     if (Util::any2bool($q->get("table"))) {
         $qTable = $q->get("table");
     } else {
         $qTable = $this->table;
     }
     $joinCond = null;
     if (Util::any2bool($q->get("joincond"))) {
         $joinCond = $q->get("joincond");
     } else {
         $joinCond = null;
     }
     $joinTable = null;
     if (Util::any2bool($q->get("jointable"))) {
         $joinTable = $q->get("jointable");
     } else {
         $joinTable = null;
     }
     $filterTables = "";
     if (Util::any2bool($q->get("filter"))) {
         $filterTables = _hx_explode(",", $q->get("filter_tables"))->map(array(new _hx_lambda(array(&$fields, &$filterTables, &$joinCond, &$joinTable, &$phValues, &$q, &$qTable, &$sb), "model_Clients_1"), 'execute'))->join(",");
         $sb->add(" FROM " . _hx_string_or_null($filterTables) . "," . _hx_string_or_null(S::$my->real_escape_string($qTable)));
     } else {
         $sb->add(" FROM " . _hx_string_or_null(S::$my->real_escape_string($qTable)));
     }
     if ($joinTable !== null) {
         $sb->add(" INNER JOIN " . _hx_string_or_null($joinTable));
     }
     if ($joinCond !== null) {
         $sb->add(" ON " . _hx_string_or_null($joinCond));
     }
     $where = $q->get("where");
     if ($where !== null) {
         $this->buildCond($where, $sb, $phValues, null);
     }
     if (Util::any2bool($q->get("filter"))) {
         $this->buildCond(_hx_explode(",", $q->get("filter"))->map(array(new _hx_lambda(array(&$fields, &$filterTables, &$joinCond, &$joinTable, &$phValues, &$q, &$qTable, &$sb, &$where), "model_Clients_2"), 'execute'))->join(","), $sb, $phValues, false);
         if ($joinTable === "vicidial_users") {
             $sb->add(" " . _hx_string_or_null(_hx_explode(",", $filterTables)->map(array(new _hx_lambda(array(&$fields, &$filterTables, &$joinCond, &$joinTable, &$phValues, &$q, &$qTable, &$sb, &$where), "model_Clients_3"), 'execute'))->join(" ")));
         } else {
             $sb->add(" " . _hx_string_or_null(_hx_explode(",", $filterTables)->map(array(new _hx_lambda(array(&$fields, &$filterTables, &$joinCond, &$joinTable, &$phValues, &$q, &$qTable, &$sb, &$where), "model_Clients_4"), 'execute'))->join(" ")));
         }
     }
     $groupParam = $q->get("group");
     if ($groupParam !== null) {
         $this->buildGroup($groupParam, $sb);
     }
     $order = $q->get("order");
     if ($order !== null) {
         $this->buildOrder($order, $sb);
     }
     $limit = $q->get("limit");
     $this->buildLimit($limit === null ? "15" : $limit, $sb);
     return $this->execute($sb->b, $phValues);
 }
开发者ID:axelhuizinga,项目名称:gem,代码行数:59,代码来源:Clients.class.php

示例6: errorStackItems

 static function errorStackItems($stack)
 {
     $arr = new _hx_array(array());
     $stack->pop();
     $stack = $stack->slice(2, null);
     $arr1 = _hx_explode("\n", haxe_CallStack::toString($stack));
     return $arr1;
 }
开发者ID:kevinresol,项目名称:mvc-platform-test,代码行数:8,代码来源:ErrorPageHandler.class.php

示例7: htmlEscape

 static function htmlEscape($s, $quotes = null)
 {
     $s = _hx_explode(">", _hx_explode("<", _hx_explode("&", $s)->join("&amp;"))->join("&lt;"))->join("&gt;");
     if ($quotes) {
         return _hx_explode("'", _hx_explode("\"", $s)->join("&quot;"))->join("&#039;");
     } else {
         return $s;
     }
 }
开发者ID:axelhuizinga,项目名称:gem,代码行数:9,代码来源:StringTools.class.php

示例8: hpOfString

 public function hpOfString($s)
 {
     $parts = _hx_explode(":", $s);
     if ($parts->length === 2) {
         return _hx_anonymous(array("host" => new sys_net_Host($parts[0]), "port" => Std::parseInt($parts[1])));
     } else {
         return _hx_anonymous(array("host" => new sys_net_Host(_hx_substr($parts[1], 2, null)), "port" => Std::parseInt($parts[2])));
     }
 }
开发者ID:Raniratna,项目名称:new_elearning,代码行数:9,代码来源:Socket.class.php

示例9: get_uriParts

 public function get_uriParts()
 {
     if ($this->uriParts === null) {
         $this->uriParts = _hx_explode("/", $this->httpContext->getRequestUri());
         if ($this->uriParts->length > 0 && $this->uriParts[0] === "") {
             $this->uriParts->shift();
         }
         if ($this->uriParts->length > 0 && $this->uriParts[$this->uriParts->length - 1] === "") {
             $this->uriParts->pop();
         }
     }
     return $this->uriParts;
 }
开发者ID:kevinresol,项目名称:mvc-platform-test,代码行数:13,代码来源:ActionContext.class.php

示例10: __construct

 public function __construct($r, $opt)
 {
     if (!php_Boot::$skip_constructor) {
         $this->pattern = $r;
         $a = _hx_explode("g", $opt);
         $this->hglobal = $a->length > 1;
         if ($this->hglobal) {
             $opt = $a->join("");
         }
         $this->options = $opt;
         $this->re = '"' . str_replace('"', '\\"', $r) . '"' . $opt;
     }
 }
开发者ID:Raniratna,项目名称:new_elearning,代码行数:13,代码来源:EReg.class.php

示例11: makeStack

 static function makeStack($s)
 {
     $a = $GLOBALS[$s];
     $m = new _hx_array(array());
     $_g1 = 0;
     $_g = $a->length - ($s == "%s" ? 2 : 0);
     while ($_g1 < $_g) {
         $i = $_g1++;
         $d = _hx_explode("::", $a[$i]);
         $m->unshift(haxe_StackItem::Method($d[0], $d[1]));
         unset($i, $d);
     }
     return $m;
 }
开发者ID:slaskis,项目名称:hxsinatra,代码行数:14,代码来源:Stack.class.php

示例12: __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);
     }
 }
开发者ID:axelhuizinga,项目名称:gem,代码行数:16,代码来源:Host.class.php

示例13: __construct

 public function __construct($directory)
 {
     if (!php_Boot::$skip_constructor) {
         if (StringTools::startsWith($directory, "/")) {
             $directory = _hx_substr($directory, 1, strlen($directory));
         }
         if (StringTools::endsWith($directory, "/")) {
             $directory = _hx_substr($directory, 0, strlen($directory) - 1);
         }
         $this->directory = $directory;
         if ($directory !== "") {
             $this->segments = _hx_explode("/", $directory);
         } else {
             $this->segments = new _hx_array(array());
         }
     }
 }
开发者ID:kevinresol,项目名称:mvc-platform-test,代码行数:17,代码来源:DirectoryUrlFilter.class.php

示例14: getAvailableCASLanguages

 public function getAvailableCASLanguages($languageString)
 {
     $elem = null;
     $langs = _hx_explode(",", $languageString);
     $availableLanguages = new _hx_array(array());
     $iter = $langs->iterator();
     while ($iter->hasNext()) {
         $elem = $iter->next();
         $elem = trim($elem);
         $availableLanguages->push($elem);
     }
     if ($availableLanguages->length === 0) {
         $availableLanguages = new _hx_array(array());
         $availableLanguages->push("");
     }
     return $availableLanguages;
 }
开发者ID:Raniratna,项目名称:new_elearning,代码行数:17,代码来源:CasImpl.class.php

示例15: addCorsHeaders

 public function addCorsHeaders($response, $origin)
 {
     $conf = $this->getConfiguration();
     if ($conf->getProperty("wiriscorsenabled", "false") === "true") {
         $confDir = $conf->getProperty(com_wiris_plugin_api_ConfigurationKeys::$CONFIGURATION_PATH, null);
         $corsConfFile = $confDir . "/corsservers.ini";
         $s = com_wiris_system_Storage::newStorage($corsConfFile);
         if ($s->exists()) {
             $dir = $s->read();
             $allowedHosts = _hx_explode("\n", $dir);
             if (com_wiris_system_ArrayEx::contains($allowedHosts, $origin)) {
                 $response->setHeader("Access-Control-Allow-Origin", $origin);
             }
         } else {
             $response->setHeader("Access-Control-Allow-Origin", "*");
         }
     }
 }
开发者ID:OctaveBabel,项目名称:moodle-itop,代码行数:18,代码来源:PluginBuilderImpl.class.php


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