本文整理汇总了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");
}
示例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");
}