[phpcvsview-cvs-updates] phpcvsview phpcvs.php,1.14,1.15
Status: Pre-Alpha
Brought to you by:
bcheesem
From: Brian C. <bch...@us...> - 2004-10-04 11:44:14
|
Update of /cvsroot/phpcvsview/phpcvsview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1319 Modified Files: phpcvs.php Log Message: Class modified to use explode rather than strtok where possible. Index: phpcvs.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/phpcvs.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** phpcvs.php 4 Oct 2004 01:06:30 -0000 1.14 --- phpcvs.php 4 Oct 2004 11:43:54 -0000 1.15 *************** *** 109,121 **** function processValidRequests($LineOfText) { ! // Start tokenising the list of Valid Requests. ! $Token = strtok($LineOfText, " "); ! // Skip the first token, as it is the response identifier. ! $Token = strtok(" "); ! while($Token !== false){ ! $this->ALLOWED_REQUESTS[$Token] = true; ! $Token = strtok(" "); ! } // while return true; } --- 109,121 ---- function processValidRequests($LineOfText) { ! // Convert string to array ! $Token = explode(" ", $LineOfText); // Skip the first token, as it is the response identifier. ! array_shift($Token); ! ! // set values for allowed responses ! for($i = 0; $i <= sizeof($Token)-1; $i++){ ! $this->ALLOWED_REQUESTS[$Token[$i]] = true; ! } return true; } *************** *** 419,425 **** while($KeepGoing){ $ResponseLine = $this->SOCKET->readLine(); ! $Response = strtok($ResponseLine, " "); ! if ($Response != "") { ! $Func = $this->ALLOWED_RESPONSES[$Response]; if (method_exists($this, $Func)) { $KeepGoing = $this->$Func($ResponseLine); --- 419,425 ---- while($KeepGoing){ $ResponseLine = $this->SOCKET->readLine(); ! $Response = explode(" ", $ResponseLine); ! if ($Response[0] != "") { ! $Func = $this->ALLOWED_RESPONSES[$Response[0]]; if (method_exists($this, $Func)) { $KeepGoing = $this->$Func($ResponseLine); *************** *** 1060,1063 **** --- 1060,1079 ---- return true; } + + function debug($foo, $var = ''){ + if($var == '' || $var == 'print_r'){ + echo '<pre>'; + echo '-- beg --<br />'; + echo print_r($foo); + echo '</pre>'; + } + else{ + echo '<pre>'; + echo var_dump($foo); + echo '-- end --<br />'; + echo '</pre>'; + } + } + } |