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


PHP Check::parseList方法代码示例

本文整理汇总了PHP中Check::parseList方法的典型用法代码示例。如果您正苦于以下问题:PHP Check::parseList方法的具体用法?PHP Check::parseList怎么用?PHP Check::parseList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Check的用法示例。


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

示例1: parse

 function parse()
 {
     $fp = fopen($this->filePath, "r") or die("Couldnot open file");
     $varListStr = "";
     $checkListStr = "";
     $stepListStr = "";
     $collectListStr = "";
     while (!feof($fp)) {
         $line = trim(fgets($fp, 1024));
         $flag = substr($line, 0, 1);
         $elementArray = explode('.', $line, 2);
         $element = $elementArray[0];
         switch ($flag) {
             case "\$":
                 $varListStr .= $line . '\\n';
                 break;
             case "{":
                 $stepListStr .= $line . '\\nflag';
                 $checkListStr .= $line . '\\nflag';
                 $collectListStr .= $line . '\\nflag';
                 break;
             case "}":
                 $stepListStr .= $line . '\\n';
                 $checkListStr .= $line . '\\n';
                 $collectListStr .= $line . '\\n';
                 break;
             case "#":
                 break;
             default:
                 switch ($element) {
                     case "step":
                         $stepListStr .= $line . '\\n';
                         break;
                     case "check":
                         $checkListStr .= $line . '\\n';
                         break;
                     case "collect":
                         $collectListStr .= $line . '\\n';
                         break;
                     default:
                         break;
                 }
                 break;
         }
     }
     fclose($fp);
     //echo "</br></br>".$varListStr."</br></br>";
     //echo $checkListStr."</br></br>";
     //echo $stepListStr."</br></br>";
     //echo $collectListStr."</br></br>";
     $this->varibles = Varible::parseList($varListStr);
     $this->checks = Check::parseList($checkListStr, "check");
     $this->steps = Step::parseList($stepListStr, "step");
     $this->collects = Collect::parseList($collectListStr, "collect");
 }
开发者ID:sleepyycat,项目名称:WebFramework,代码行数:55,代码来源:Config.class.php

示例2: parse

 function parse()
 {
     $fp = fopen($this->filePath, "r") or die("Couldnot open file");
     $confObj = array("var" => "", "check" => "", "step" => "", "collect" => "");
     $type = "";
     $num = 0;
     while (!feof($fp)) {
         $line = trim(fgets($fp, 1024));
         $head = substr($line, 0, 1);
         $elementArray = explode('.', $line, 2);
         $element = $elementArray[0];
         switch ($head) {
             case "\$":
                 $confObj["var"] .= $line . '\\nline_split';
                 break;
             case "{":
                 if ($type == "") {
                     $confObj["step"] .= '\\nmodule_split';
                     $confObj["check"] .= '\\nmodule_split';
                     $confObj["collect"] .= '\\nmodule_split';
                 } else {
                     if (array_key_exists($type, $confObj)) {
                         $confObj[$type] .= $line . '\\nline_split';
                         $num = $num + 1;
                     }
                 }
                 break;
             case "}":
                 if ($num == 0) {
                     $confObj["step"] .= '\\nline_split';
                     $confObj["check"] .= '\\nline_split';
                     $confObj["collect"] .= '\\nline_split';
                     $type = "";
                 } else {
                     if ($num > 0) {
                         $num = $num - 1;
                         $confObj[$type] .= $line . '\\nline_split';
                     }
                 }
                 break;
             case "#":
                 if (array_key_exists($type, $confObj)) {
                     $confObj[$type] .= $line . '\\nline_split';
                 }
                 break;
             default:
                 if (array_key_exists($type, $confObj)) {
                     $confObj[$type] .= $line . '\\nline_split';
                 } else {
                     if (array_key_exists($element, $confObj)) {
                         $confObj[$element] .= $line . '\\nline_split';
                         $type = $element;
                     }
                 }
                 break;
         }
     }
     fclose($fp);
     $this->varibles = Varible::parseList($confObj["var"]);
     $this->checks = Check::parseList($confObj["check"], "check");
     $this->steps = Step::parseList($confObj["step"], "step");
     //echo $confObj["step"];
     $this->collects = Collect::parseList($confObj["collect"], "collect");
 }
开发者ID:sleepyycat,项目名称:WebFramework,代码行数:64,代码来源:Config.class.php


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