Re: [cvsweb-php-public] cvsweb-php and PHP8
Brought to you by:
witharr
From: Tan S. Yi <ta...@ta...> - 2021-11-02 05:19:13
|
Hi, Just in case someone needs to use cvsweb-php under PHP 8, here is a diff patch you can apply against cvsweb-php.php. Hope this is useful. Regards, Tan Shao Yi --- cvsweb-php.php.20211029 2021-10-29 10:10:38.522804870 +0800 +++ cvsweb-php.php 2021-11-02 12:42:17.858692806 +0800 @@ -913,7 +913,9 @@ } } if (isset($revsym[$br]) && $revsym[$br] && !isset($nameprinted[$br])) { - foreach (explode(", ", $revsym{$br}) as $sym) { + # TANSY 2021-11-02 + #foreach (explode(", ", $revsym{$br}) as $sym) { + foreach (explode(", ", $revsym[$br]) as $sym) { echo '<a name="' . htmlentities($sym) . '"></a>'; } $nameprinted[$br] = 1; @@ -1320,7 +1322,38 @@ if ($revision !== '') $revision = '-r' . $revision; exec($RLOGCMD . ' ' . $revision . " $fullname", $tt, $t); - while (list($k,$l)=each($tt)) { +# TANSY 2021-10-29 +# while (list($k,$l)=each($tt)) { +# if ($symnames) { +# if (preg_match('/^\s+([^:]+):\s+([\d\.]+)/',$l,$match)) { +# $symrev[$match[1]] = $match[2]; +# continue; +# } +# else { +# $symnames = 0; +# } +# } +# if (preg_match('/^head:\s+([\d\.]+)/',$l,$match)) { +# $head = $match[1]; +# } +# elseif (preg_match('/^branch:\s+([\d\.]+)/',$l,$match)) { +# $curbranch = $match[1]; +# } +# elseif (preg_match('/^symbolic names/',$l)) { +# $symnames = 1; +# } +# elseif (preg_match('/^keyword substitution: (.+)$/',$l,$match)) { +# $keywordsubstitution = $match[1]; +# } +# elseif (preg_match('/^-----/',$l,$match)) { +# break; +# } +# } + + # TANSY 2021-11-02 + $k=key($tt); + $l=current($tt); + while(!is_null($k)){ if ($symnames) { if (preg_match('/^\s+([^:]+):\s+([\d\.]+)/',$l,$match)) { $symrev[$match[1]] = $match[2]; @@ -1345,7 +1378,11 @@ elseif (preg_match('/^-----/',$l,$match)) { break; } - } + + next($tt); + $k=key($tt); + $l=current($tt); + } if (!isset($curbranch)) { $curbranch = preg_replace('/\.\d+$/','',$head); @@ -1654,7 +1691,9 @@ $err = stream_get_contents($pipes[2]); $out = explode("\n",$out); - if (count($err) > 1) { + # TANSY 2021-11-02 + #if (count($err) > 1) { + if(strcmp('', $err)!=0){ fatal('500 Internal Error', 'Annotate failure: <code>%s</code>', $err); } From: Tan Shao Yi via cvsweb-php-public <cvs...@li...> Date: Friday, 29 October 2021 at 11:36 AM To: cvs...@li... <cvs...@li...> Subject: [cvsweb-php-public] cvsweb-php and PHP8 Hi, May I know if cvsweb-php will be updated for PHP8? Thank you. |