當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Step::parseList方法代碼示例

本文整理匯總了PHP中Step::parseList方法的典型用法代碼示例。如果您正苦於以下問題:PHP Step::parseList方法的具體用法?PHP Step::parseList怎麽用?PHP Step::parseList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Step的用法示例。


在下文中一共展示了Step::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


注:本文中的Step::parseList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。