From: <var...@us...> - 2012-12-03 13:29:35
|
Revision: 8590 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8590&view=rev Author: vargenau Date: 2012-12-03 13:29:21 +0000 (Mon, 03 Dec 2012) Log Message: ----------- Update to fpdf 1.7 Modified Paths: -------------- trunk/lib/font/chinese.php trunk/lib/font/courier.php trunk/lib/font/helvetica.php trunk/lib/font/helveticab.php trunk/lib/font/helveticabi.php trunk/lib/font/helveticai.php trunk/lib/font/japanese.php trunk/lib/font/symbol.php trunk/lib/font/times.php trunk/lib/font/timesb.php trunk/lib/font/timesbi.php trunk/lib/font/timesi.php trunk/lib/font/zapfdingbats.php trunk/lib/fpdf.php Added Paths: ----------- trunk/lib/font/ trunk/lib/font/courierb.php trunk/lib/font/courierbi.php trunk/lib/font/courieri.php Removed Paths: ------------- trunk/lib/fpdf/ Modified: trunk/lib/font/chinese.php =================================================================== --- trunk/lib/fpdf/chinese.php 2012-12-03 12:43:20 UTC (rev 8589) +++ trunk/lib/font/chinese.php 2012-12-03 13:29:21 UTC (rev 8590) @@ -1,417 +1,456 @@ <?php // -*-php-*- +// $Id: chinese.php 7956 2011-03-03 17:08:31Z vargenau $ // PDF functions taken from FPDF http://www.fpdf.org -require 'lib/pdf.php'; +require('lib/pdf.php'); -$Big5_widths = array(' ' => 250, '!' => 250, '"' => 408, '#' => 668, '$' => 490, '%' => 875, '&' => 698, '\'' => 250, - '(' => 240, ')' => 240, '*' => 417, '+' => 667, ',' => 250, '-' => 313, '.' => 250, '/' => 520, '0' => 500, '1' => 500, - '2' => 500, '3' => 500, '4' => 500, '5' => 500, '6' => 500, '7' => 500, '8' => 500, '9' => 500, ':' => 250, ';' => 250, - '<' => 667, '=' => 667, '>' => 667, '?' => 396, '@' => 921, 'A' => 677, 'B' => 615, 'C' => 719, 'D' => 760, 'E' => 625, - 'F' => 552, 'G' => 771, 'H' => 802, 'I' => 354, 'J' => 354, 'K' => 781, 'L' => 604, 'M' => 927, 'N' => 750, 'O' => 823, - 'P' => 563, 'Q' => 823, 'R' => 729, 'S' => 542, 'T' => 698, 'U' => 771, 'V' => 729, 'W' => 948, 'X' => 771, 'Y' => 677, - 'Z' => 635, '[' => 344, '\\' => 520, ']' => 344, '^' => 469, '_' => 500, '`' => 250, 'a' => 469, 'b' => 521, 'c' => 427, - 'd' => 521, 'e' => 438, 'f' => 271, 'g' => 469, 'h' => 531, 'i' => 250, 'j' => 250, 'k' => 458, 'l' => 240, 'm' => 802, - 'n' => 531, 'o' => 500, 'p' => 521, 'q' => 521, 'r' => 365, 's' => 333, 't' => 292, 'u' => 521, 'v' => 458, 'w' => 677, - 'x' => 479, 'y' => 458, 'z' => 427, '{' => 480, '|' => 496, '}' => 480, '~' => 667); +$Big5_widths=array(' '=>250,'!'=>250,'"'=>408,'#'=>668,'$'=>490,'%'=>875,'&'=>698,'\''=>250, + '('=>240,')'=>240,'*'=>417,'+'=>667,','=>250,'-'=>313,'.'=>250,'/'=>520,'0'=>500,'1'=>500, + '2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>250,';'=>250, + '<'=>667,'='=>667,'>'=>667,'?'=>396,'@'=>921,'A'=>677,'B'=>615,'C'=>719,'D'=>760,'E'=>625, + 'F'=>552,'G'=>771,'H'=>802,'I'=>354,'J'=>354,'K'=>781,'L'=>604,'M'=>927,'N'=>750,'O'=>823, + 'P'=>563,'Q'=>823,'R'=>729,'S'=>542,'T'=>698,'U'=>771,'V'=>729,'W'=>948,'X'=>771,'Y'=>677, + 'Z'=>635,'['=>344,'\\'=>520,']'=>344,'^'=>469,'_'=>500,'`'=>250,'a'=>469,'b'=>521,'c'=>427, + 'd'=>521,'e'=>438,'f'=>271,'g'=>469,'h'=>531,'i'=>250,'j'=>250,'k'=>458,'l'=>240,'m'=>802, + 'n'=>531,'o'=>500,'p'=>521,'q'=>521,'r'=>365,'s'=>333,'t'=>292,'u'=>521,'v'=>458,'w'=>677, + 'x'=>479,'y'=>458,'z'=>427,'{'=>480,'|'=>496,'}'=>480,'~'=>667); -$GB_widths = array(' ' => 207, '!' => 270, '"' => 342, '#' => 467, '$' => 462, '%' => 797, '&' => 710, '\'' => 239, - '(' => 374, ')' => 374, '*' => 423, '+' => 605, ',' => 238, '-' => 375, '.' => 238, '/' => 334, '0' => 462, '1' => 462, - '2' => 462, '3' => 462, '4' => 462, '5' => 462, '6' => 462, '7' => 462, '8' => 462, '9' => 462, ':' => 238, ';' => 238, - '<' => 605, '=' => 605, '>' => 605, '?' => 344, '@' => 748, 'A' => 684, 'B' => 560, 'C' => 695, 'D' => 739, 'E' => 563, - 'F' => 511, 'G' => 729, 'H' => 793, 'I' => 318, 'J' => 312, 'K' => 666, 'L' => 526, 'M' => 896, 'N' => 758, 'O' => 772, - 'P' => 544, 'Q' => 772, 'R' => 628, 'S' => 465, 'T' => 607, 'U' => 753, 'V' => 711, 'W' => 972, 'X' => 647, 'Y' => 620, - 'Z' => 607, '[' => 374, '\\' => 333, ']' => 374, '^' => 606, '_' => 500, '`' => 239, 'a' => 417, 'b' => 503, 'c' => 427, - 'd' => 529, 'e' => 415, 'f' => 264, 'g' => 444, 'h' => 518, 'i' => 241, 'j' => 230, 'k' => 495, 'l' => 228, 'm' => 793, - 'n' => 527, 'o' => 524, 'p' => 524, 'q' => 504, 'r' => 338, 's' => 336, 't' => 277, 'u' => 517, 'v' => 450, 'w' => 652, - 'x' => 466, 'y' => 452, 'z' => 407, '{' => 370, '|' => 258, '}' => 370, '~' => 605); +$GB_widths=array(' '=>207,'!'=>270,'"'=>342,'#'=>467,'$'=>462,'%'=>797,'&'=>710,'\''=>239, + '('=>374,')'=>374,'*'=>423,'+'=>605,','=>238,'-'=>375,'.'=>238,'/'=>334,'0'=>462,'1'=>462, + '2'=>462,'3'=>462,'4'=>462,'5'=>462,'6'=>462,'7'=>462,'8'=>462,'9'=>462,':'=>238,';'=>238, + '<'=>605,'='=>605,'>'=>605,'?'=>344,'@'=>748,'A'=>684,'B'=>560,'C'=>695,'D'=>739,'E'=>563, + 'F'=>511,'G'=>729,'H'=>793,'I'=>318,'J'=>312,'K'=>666,'L'=>526,'M'=>896,'N'=>758,'O'=>772, + 'P'=>544,'Q'=>772,'R'=>628,'S'=>465,'T'=>607,'U'=>753,'V'=>711,'W'=>972,'X'=>647,'Y'=>620, + 'Z'=>607,'['=>374,'\\'=>333,']'=>374,'^'=>606,'_'=>500,'`'=>239,'a'=>417,'b'=>503,'c'=>427, + 'd'=>529,'e'=>415,'f'=>264,'g'=>444,'h'=>518,'i'=>241,'j'=>230,'k'=>495,'l'=>228,'m'=>793, + 'n'=>527,'o'=>524,'p'=>524,'q'=>504,'r'=>338,'s'=>336,'t'=>277,'u'=>517,'v'=>450,'w'=>652, + 'x'=>466,'y'=>452,'z'=>407,'{'=>370,'|'=>258,'}'=>370,'~'=>605); class PDF_Chinese extends PDF { - function AddCIDFont($family, $style, $name, $cw, $CMap, $registry) + function AddCIDFont($family,$style,$name,$cw,$CMap,$registry) { - $fontkey = strtolower($family) . strtoupper($style); - if (isset($this->fonts[$fontkey])) - $this->Error("Font already added: $family $style"); - $i = count($this->fonts) + 1; - $name = str_replace(' ', '', $name); - $this->fonts[$fontkey] = array('i' => $i, 'type' => 'Type0', 'name' => $name, 'up' => -130, 'ut' => 40, 'cw' => $cw, 'CMap' => $CMap, 'registry' => $registry); + $fontkey=strtolower($family).strtoupper($style); + if(isset($this->fonts[$fontkey])) + $this->Error("Font already added: $family $style"); + $i=count($this->fonts)+1; + $name=str_replace(' ','',$name); + $this->fonts[$fontkey]=array('i'=>$i,'type'=>'Type0','name'=>$name,'up'=>-130,'ut'=>40,'cw'=>$cw,'CMap'=>$CMap,'registry'=>$registry); } - function AddCIDFonts($family, $name, $cw, $CMap, $registry) + function AddCIDFonts($family,$name,$cw,$CMap,$registry) { - $this->AddCIDFont($family, '', $name, $cw, $CMap, $registry); - $this->AddCIDFont($family, 'B', $name . ',Bold', $cw, $CMap, $registry); - $this->AddCIDFont($family, 'I', $name . ',Italic', $cw, $CMap, $registry); - $this->AddCIDFont($family, 'BI', $name . ',BoldItalic', $cw, $CMap, $registry); + $this->AddCIDFont($family,'',$name,$cw,$CMap,$registry); + $this->AddCIDFont($family,'B',$name.',Bold',$cw,$CMap,$registry); + $this->AddCIDFont($family,'I',$name.',Italic',$cw,$CMap,$registry); + $this->AddCIDFont($family,'BI',$name.',BoldItalic',$cw,$CMap,$registry); } - function AddBig5Font($family = 'Big5', $name = 'MSungStd-Light-Acro') + function AddBig5Font($family='Big5',$name='MSungStd-Light-Acro') { - //Add Big5 font with proportional Latin - $cw = $GLOBALS['Big5_widths']; - $CMap = 'ETenms-B5-H'; - $registry = array('ordering' => 'CNS1', 'supplement' => 0); - $this->AddCIDFonts($family, $name, $cw, $CMap, $registry); + //Add Big5 font with proportional Latin + $cw=$GLOBALS['Big5_widths']; + $CMap='ETenms-B5-H'; + $registry=array('ordering'=>'CNS1','supplement'=>0); + $this->AddCIDFonts($family,$name,$cw,$CMap,$registry); } - function AddBig5hwFont($family = 'Big5-hw', $name = 'MSungStd-Light-Acro') + function AddBig5hwFont($family='Big5-hw',$name='MSungStd-Light-Acro') { - //Add Big5 font with half-witdh Latin - for ($i = 32; $i <= 126; $i++) - $cw[chr($i)] = 500; - $CMap = 'ETen-B5-H'; - $registry = array('ordering' => 'CNS1', 'supplement' => 0); - $this->AddCIDFonts($family, $name, $cw, $CMap, $registry); + //Add Big5 font with half-witdh Latin + for($i=32;$i<=126;$i++) + $cw[chr($i)]=500; + $CMap='ETen-B5-H'; + $registry=array('ordering'=>'CNS1','supplement'=>0); + $this->AddCIDFonts($family,$name,$cw,$CMap,$registry); } - function AddGBFont($family = 'GB', $name = 'STSongStd-Light-Acro') + function AddGBFont($family='GB',$name='STSongStd-Light-Acro') { - //Add GB font with proportional Latin - $cw = $GLOBALS['GB_widths']; - $CMap = 'GBKp-EUC-H'; - $registry = array('ordering' => 'GB1', 'supplement' => 2); - $this->AddCIDFonts($family, $name, $cw, $CMap, $registry); + //Add GB font with proportional Latin + $cw=$GLOBALS['GB_widths']; + $CMap='GBKp-EUC-H'; + $registry=array('ordering'=>'GB1','supplement'=>2); + $this->AddCIDFonts($family,$name,$cw,$CMap,$registry); } - function AddGBhwFont($family = 'GB-hw', $name = 'STSongStd-Light-Acro') + function AddGBhwFont($family='GB-hw',$name='STSongStd-Light-Acro') { - //Add GB font with half-width Latin - for ($i = 32; $i <= 126; $i++) - $cw[chr($i)] = 500; - $CMap = 'GBK-EUC-H'; - $registry = array('ordering' => 'GB1', 'supplement' => 2); - $this->AddCIDFonts($family, $name, $cw, $CMap, $registry); + //Add GB font with half-width Latin + for($i=32;$i<=126;$i++) + $cw[chr($i)]=500; + $CMap='GBK-EUC-H'; + $registry=array('ordering'=>'GB1','supplement'=>2); + $this->AddCIDFonts($family,$name,$cw,$CMap,$registry); } function GetStringWidth($s) { - if ($this->CurrentFont['type'] == 'Type0') - return $this->GetMBStringWidth($s); - else - return parent::GetStringWidth($s); + if ($this->CurrentFont['type']=='Type0') + return $this->GetMBStringWidth($s); + else + return parent::GetStringWidth($s); } function GetMBStringWidth($s) { - //Multi-byte version of GetStringWidth() - $l = 0; - $cw =& $this->CurrentFont['cw']; - $nb = strlen($s); - $i = 0; - while ($i < $nb) { - $c = $s[$i]; - if (ord($c) < 128) { - $l += $cw[$c]; - $i++; - } else { - $l += 1000; - $i += 2; - } + //Multi-byte version of GetStringWidth() + $l=0; + $cw=&$this->CurrentFont['cw']; + $nb=strlen($s); + $i=0; + while($i<$nb) + { + $c=$s[$i]; + if(ord($c)<128) + { + $l+=$cw[$c]; + $i++; } - return $l * $this->FontSize / 1000; + else + { + $l+=1000; + $i+=2; + } } + return $l*$this->FontSize/1000; + } - function MultiCell($w, $h, $txt, $border = 0, $align = 'L', $fill = 0) + function MultiCell($w,$h,$txt,$border=0,$align='L',$fill=0) { - if ($this->CurrentFont['type'] == 'Type0') - $this->MBMultiCell($w, $h, $txt, $border, $align, $fill); - else - parent::MultiCell($w, $h, $txt, $border, $align, $fill); + if($this->CurrentFont['type']=='Type0') + $this->MBMultiCell($w,$h,$txt,$border,$align,$fill); + else + parent::MultiCell($w,$h,$txt,$border,$align,$fill); } - function MBMultiCell($w, $h, $txt, $border = 0, $align = 'L', $fill = 0) + function MBMultiCell($w,$h,$txt,$border=0,$align='L',$fill=0) { - //Multi-byte version of MultiCell() - $cw =& $this->CurrentFont['cw']; - if ($w == 0) - $w = $this->w - $this->rMargin - $this->x; - $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->FontSize; - $s = str_replace("\r", '', $txt); - $nb = strlen($s); - if ($nb > 0 and $s[$nb - 1] == "\n") - $nb--; - $b = 0; - if ($border) { - if ($border == 1) { - $border = 'LTRB'; - $b = 'LRT'; - $b2 = 'LR'; - } else { - $b2 = ''; - if (is_int(strpos($border, 'L'))) - $b2 .= 'L'; - if (is_int(strpos($border, 'R'))) - $b2 .= 'R'; - $b = is_int(strpos($border, 'T')) ? $b2 . 'T' : $b2; - } + //Multi-byte version of MultiCell() + $cw=&$this->CurrentFont['cw']; + if($w==0) + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + $s=str_replace("\r",'',$txt); + $nb=strlen($s); + if($nb>0 and $s[$nb-1]=="\n") + $nb--; + $b=0; + if($border) + { + if($border==1) + { + $border='LTRB'; + $b='LRT'; + $b2='LR'; } - $sep = -1; - $i = 0; - $j = 0; - $l = 0; - $nl = 1; - while ($i < $nb) { - //Get next character - $c = $s[$i]; - //Check if ASCII or MB - $ascii = (ord($c) < 128); - if ($c == "\n") { - //Explicit line break - $this->Cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill); - $i++; - $sep = -1; - $j = $i; - $l = 0; - $nl++; - if ($border and $nl == 2) - $b = $b2; - continue; + else + { + $b2=''; + if(is_int(strpos($border,'L'))) + $b2.='L'; + if(is_int(strpos($border,'R'))) + $b2.='R'; + $b=is_int(strpos($border,'T')) ? $b2.'T' : $b2; + } + } + $sep=-1; + $i=0; + $j=0; + $l=0; + $nl=1; + while($i<$nb) + { + //Get next character + $c=$s[$i]; + //Check if ASCII or MB + $ascii=(ord($c)<128); + if($c=="\n") + { + //Explicit line break + $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); + $i++; + $sep=-1; + $j=$i; + $l=0; + $nl++; + if($border and $nl==2) + $b=$b2; + continue; + } + if(!$ascii) + { + $sep=$i; + $ls=$l; + } + elseif($c==' ') + { + $sep=$i; + $ls=$l; + } + $l+=$ascii ? $cw[$c] : 1000; + if($l>$wmax) + { + //Automatic line break + if($sep==-1 or $i==$j) + { + if($i==$j) + $i+=$ascii ? 1 : 2; + $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); } - if (!$ascii) { - $sep = $i; - $ls = $l; - } elseif ($c == ' ') { - $sep = $i; - $ls = $l; + else + { + $this->Cell($w,$h,substr($s,$j,$sep-$j),$b,2,$align,$fill); + $i=($s[$sep]==' ') ? $sep+1 : $sep; } - $l += $ascii ? $cw[$c] : 1000; - if ($l > $wmax) { - //Automatic line break - if ($sep == -1 or $i == $j) { - if ($i == $j) - $i += $ascii ? 1 : 2; - $this->Cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill); - } else { - $this->Cell($w, $h, substr($s, $j, $sep - $j), $b, 2, $align, $fill); - $i = ($s[$sep] == ' ') ? $sep + 1 : $sep; - } - $sep = -1; - $j = $i; - $l = 0; - $nl++; - if ($border and $nl == 2) - $b = $b2; - } else - $i += $ascii ? 1 : 2; + $sep=-1; + $j=$i; + $l=0; + $nl++; + if($border and $nl==2) + $b=$b2; } - //Last chunk - if ($border and is_int(strpos($border, 'B'))) - $b .= 'B'; - $this->Cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill); - $this->x = $this->lMargin; + else + $i+=$ascii ? 1 : 2; } + //Last chunk + if($border and is_int(strpos($border,'B'))) + $b.='B'; + $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); + $this->x=$this->lMargin; + } - function Write($h, $txt, $link = '') + function Write($h,$txt,$link='') { - if ($this->CurrentFont['type'] == 'Type0') - $this->MBWrite($h, $txt, $link); - else - parent::Write($h, $txt, $link); + if($this->CurrentFont['type']=='Type0') + $this->MBWrite($h,$txt,$link); + else + parent::Write($h,$txt,$link); } - function MBWrite($h, $txt, $link) + function MBWrite($h,$txt,$link) { - //Multi-byte version of Write() - $cw =& $this->CurrentFont['cw']; - $w = $this->w - $this->rMargin - $this->x; - $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->FontSize; - $s = str_replace("\r", '', $txt); - $nb = strlen($s); - $sep = -1; - $i = 0; - $j = 0; - $l = 0; - $nl = 1; - while ($i < $nb) { - //Get next character - $c = $s[$i]; - //Check if ASCII or MB - $ascii = (ord($c) < 128); - if ($c == "\n") { - //Explicit line break - $this->Cell($w, $h, substr($s, $j, $i - $j), 0, 2, '', 0, $link); - $i++; - $sep = -1; - $j = $i; - $l = 0; - if ($nl == 1) { - $this->x = $this->lMargin; - $w = $this->w - $this->rMargin - $this->x; - $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->FontSize; + //Multi-byte version of Write() + $cw=&$this->CurrentFont['cw']; + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + $s=str_replace("\r",'',$txt); + $nb=strlen($s); + $sep=-1; + $i=0; + $j=0; + $l=0; + $nl=1; + while($i<$nb) + { + //Get next character + $c=$s[$i]; + //Check if ASCII or MB + $ascii=(ord($c)<128); + if($c=="\n") + { + //Explicit line break + $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link); + $i++; + $sep=-1; + $j=$i; + $l=0; + if($nl==1) + { + $this->x=$this->lMargin; + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + } + $nl++; + continue; + } + if(!$ascii or $c==' ') + $sep=$i; + $l+=$ascii ? $cw[$c] : 1000; + if($l>$wmax) + { + //Automatic line break + if($sep==-1 or $i==$j) + { + if($this->x>$this->lMargin) + { + //Move to next line + $this->x=$this->lMargin; + $this->y+=$h; + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + $i++; + $nl++; + continue; } - $nl++; - continue; + if($i==$j) + $i+=$ascii ? 1 : 2; + $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link); } - if (!$ascii or $c == ' ') - $sep = $i; - $l += $ascii ? $cw[$c] : 1000; - if ($l > $wmax) { - //Automatic line break - if ($sep == -1 or $i == $j) { - if ($this->x > $this->lMargin) { - //Move to next line - $this->x = $this->lMargin; - $this->y += $h; - $w = $this->w - $this->rMargin - $this->x; - $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->FontSize; - $i++; - $nl++; - continue; - } - if ($i == $j) - $i += $ascii ? 1 : 2; - $this->Cell($w, $h, substr($s, $j, $i - $j), 0, 2, '', 0, $link); - } else { - $this->Cell($w, $h, substr($s, $j, $sep - $j), 0, 2, '', 0, $link); - $i = ($s[$sep] == ' ') ? $sep + 1 : $sep; - } - $sep = -1; - $j = $i; - $l = 0; - if ($nl == 1) { - $this->x = $this->lMargin; - $w = $this->w - $this->rMargin - $this->x; - $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->FontSize; - } - $nl++; - } else - $i += $ascii ? 1 : 2; + else + { + $this->Cell($w,$h,substr($s,$j,$sep-$j),0,2,'',0,$link); + $i=($s[$sep]==' ') ? $sep+1 : $sep; + } + $sep=-1; + $j=$i; + $l=0; + if($nl==1) + { + $this->x=$this->lMargin; + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + } + $nl++; } - //Last chunk - if ($i != $j) - $this->Cell($l / 1000 * $this->FontSize, $h, substr($s, $j, $i - $j), 0, 0, '', 0, $link); + else + $i+=$ascii ? 1 : 2; } + //Last chunk + if($i!=$j) + $this->Cell($l/1000*$this->FontSize,$h,substr($s,$j,$i-$j),0,0,'',0,$link); + } function _putfonts() { - $nf = $this->n; - foreach ($this->diffs as $diff) { - //Encodings - $this->_newobj(); - $this->_out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [' . $diff . ']>>'); - $this->_out('endobj'); - } + $nf=$this->n; + foreach($this->diffs as $diff) + { + //Encodings + $this->_newobj(); + $this->_out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.']>>'); + $this->_out('endobj'); + } - if (!check_php_version(5, 3)) { - $mqr = get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); - } - foreach ($this->FontFiles as $file => $info) { - //Font file embedding - $this->_newobj(); - $this->FontFiles[$file]['n'] = $this->n; - if (defined('FPDF_FONTPATH')) - $file = FPDF_FONTPATH . $file; - $size = filesize($file); - if (!$size) - $this->Error('Font file not found'); - $this->_out('<</Length ' . $size); - if (substr($file, -2) == '.z') - $this->_out('/Filter /FlateDecode'); - $this->_out('/Length1 ' . $info['length1']); - if (isset($info['length2'])) - $this->_out('/Length2 ' . $info['length2'] . ' /Length3 0'); + if (!check_php_version(5,3)) { + $mqr=get_magic_quotes_runtime(); + set_magic_quotes_runtime(0); + } + foreach($this->FontFiles as $file=>$info) + { + //Font file embedding + $this->_newobj(); + $this->FontFiles[$file]['n']=$this->n; + if(defined('FPDF_FONTPATH')) + $file=FPDF_FONTPATH.$file; + $size=filesize($file); + if(!$size) + $this->Error('Font file not found'); + $this->_out('<</Length '.$size); + if(substr($file,-2)=='.z') + $this->_out('/Filter /FlateDecode'); + $this->_out('/Length1 '.$info['length1']); + if(isset($info['length2'])) + $this->_out('/Length2 '.$info['length2'].' /Length3 0'); + $this->_out('>>'); + $f=fopen($file,'rb'); + $this->_putstream(fread($f,$size)); + fclose($f); + $this->_out('endobj'); + } + if (!check_php_version(5,3)) { + set_magic_quotes_runtime($mqr); + } + foreach($this->fonts as $k=>$font) + { + //Font objects + $this->_newobj(); + $this->fonts[$k]['n']=$this->n; + $this->_out('<</Type /Font'); + if($font['type']=='Type0') + $this->_putType0($font); + else + { + $name=$font['name']; + $this->_out('/BaseFont /'.$name); + if($font['type']=='core') + { + //Standard font + $this->_out('/Subtype /Type1'); + if($name!='Symbol' and $name!='ZapfDingbats') + $this->_out('/Encoding /WinAnsiEncoding'); + } + else + { + //Additional font + $this->_out('/Subtype /'.$font['type']); + $this->_out('/FirstChar 32'); + $this->_out('/LastChar 255'); + $this->_out('/Widths '.($this->n+1).' 0 R'); + $this->_out('/FontDescriptor '.($this->n+2).' 0 R'); + if($font['enc']) + { + if(isset($font['diff'])) + $this->_out('/Encoding '.($nf+$font['diff']).' 0 R'); + else + $this->_out('/Encoding /WinAnsiEncoding'); + } + } $this->_out('>>'); - $f = fopen($file, 'rb'); - $this->_putstream(fread($f, $size)); - fclose($f); $this->_out('endobj'); - } - if (!check_php_version(5, 3)) { - set_magic_quotes_runtime($mqr); - } - foreach ($this->fonts as $k => $font) { - //Font objects - $this->_newobj(); - $this->fonts[$k]['n'] = $this->n; - $this->_out('<</Type /Font'); - if ($font['type'] == 'Type0') - $this->_putType0($font); - else { - $name = $font['name']; - $this->_out('/BaseFont /' . $name); - if ($font['type'] == 'core') { - //Standard font - $this->_out('/Subtype /Type1'); - if ($name != 'Symbol' and $name != 'ZapfDingbats') - $this->_out('/Encoding /WinAnsiEncoding'); - } else { - //Additional font - $this->_out('/Subtype /' . $font['type']); - $this->_out('/FirstChar 32'); - $this->_out('/LastChar 255'); - $this->_out('/Widths ' . ($this->n + 1) . ' 0 R'); - $this->_out('/FontDescriptor ' . ($this->n + 2) . ' 0 R'); - if ($font['enc']) { - if (isset($font['diff'])) - $this->_out('/Encoding ' . ($nf + $font['diff']) . ' 0 R'); - else - $this->_out('/Encoding /WinAnsiEncoding'); - } - } - $this->_out('>>'); + if($font['type']!='core') + { + //Widths + $this->_newobj(); + $cw=&$font['cw']; + $s='['; + for($i=32;$i<=255;$i++) + $s.=$cw[chr($i)].' '; + $this->_out($s.']'); $this->_out('endobj'); - if ($font['type'] != 'core') { - //Widths - $this->_newobj(); - $cw =& $font['cw']; - $s = '['; - for ($i = 32; $i <= 255; $i++) - $s .= $cw[chr($i)] . ' '; - $this->_out($s . ']'); - $this->_out('endobj'); - //Descriptor - $this->_newobj(); - $s = '<</Type /FontDescriptor /FontName /' . $name; - foreach ($font['desc'] as $k => $v) - $s .= ' /' . $k . ' ' . $v; - $file = $font['file']; - if ($file) - $s .= ' /FontFile' . ($font['type'] == 'Type1' ? '' : '2') . ' ' . $this->FontFiles[$file]['n'] . ' 0 R'; - $this->_out($s . '>>'); - $this->_out('endobj'); - } + //Descriptor + $this->_newobj(); + $s='<</Type /FontDescriptor /FontName /'.$name; + foreach($font['desc'] as $k=>$v) + $s.=' /'.$k.' '.$v; + $file=$font['file']; + if($file) + $s.=' /FontFile'.($font['type']=='Type1' ? '' : '2').' '.$this->FontFiles[$file]['n'].' 0 R'; + $this->_out($s.'>>'); + $this->_out('endobj'); } } } + } function _putType0($font) { - //Type0 - $this->_out('/Subtype /Type0'); - $this->_out('/BaseFont /' . $font['name'] . '-' . $font['CMap']); - $this->_out('/Encoding /' . $font['CMap']); - $this->_out('/DescendantFonts [' . ($this->n + 1) . ' 0 R]'); - $this->_out('>>'); - $this->_out('endobj'); - //CIDFont - $this->_newobj(); - $this->_out('<</Type /Font'); - $this->_out('/Subtype /CIDFontType0'); - $this->_out('/BaseFont /' . $font['name']); - $this->_out('/CIDSystemInfo <</Registry ' . $this->_textstring('Adobe') . ' /Ordering ' . $this->_textstring($font['registry']['ordering']) . ' /Supplement ' . $font['registry']['supplement'] . '>>'); - $this->_out('/FontDescriptor ' . ($this->n + 1) . ' 0 R'); - if ($font['CMap'] == 'ETen-B5-H') - $W = '13648 13742 500'; - elseif ($font['CMap'] == 'GBK-EUC-H') - $W = '814 907 500 7716 [500]'; else - $W = '1 [' . implode(' ', $font['cw']) . ']'; - $this->_out('/W [' . $W . ']>>'); - $this->_out('endobj'); - //Font descriptor - $this->_newobj(); - $this->_out('<</Type /FontDescriptor'); - $this->_out('/FontName /' . $font['name']); - $this->_out('/Flags 6'); - $this->_out('/FontBBox [0 -200 1000 900]'); - $this->_out('/ItalicAngle 0'); - $this->_out('/Ascent 800'); - $this->_out('/Descent -200'); - $this->_out('/CapHeight 800'); - $this->_out('/StemV 50'); - $this->_out('>>'); - $this->_out('endobj'); + //Type0 + $this->_out('/Subtype /Type0'); + $this->_out('/BaseFont /'.$font['name'].'-'.$font['CMap']); + $this->_out('/Encoding /'.$font['CMap']); + $this->_out('/DescendantFonts ['.($this->n+1).' 0 R]'); + $this->_out('>>'); + $this->_out('endobj'); + //CIDFont + $this->_newobj(); + $this->_out('<</Type /Font'); + $this->_out('/Subtype /CIDFontType0'); + $this->_out('/BaseFont /'.$font['name']); + $this->_out('/CIDSystemInfo <</Registry '.$this->_textstring('Adobe').' /Ordering '.$this->_textstring($font['registry']['ordering']).' /Supplement '.$font['registry']['supplement'].'>>'); + $this->_out('/FontDescriptor '.($this->n+1).' 0 R'); + if($font['CMap']=='ETen-B5-H') + $W='13648 13742 500'; + elseif($font['CMap']=='GBK-EUC-H') + $W='814 907 500 7716 [500]'; + else + $W='1 ['.implode(' ',$font['cw']).']'; + $this->_out('/W ['.$W.']>>'); + $this->_out('endobj'); + //Font descriptor + $this->_newobj(); + $this->_out('<</Type /FontDescriptor'); + $this->_out('/FontName /'.$font['name']); + $this->_out('/Flags 6'); + $this->_out('/FontBBox [0 -200 1000 900]'); + $this->_out('/ItalicAngle 0'); + $this->_out('/Ascent 800'); + $this->_out('/Descent -200'); + $this->_out('/CapHeight 800'); + $this->_out('/StemV 50'); + $this->_out('>>'); + $this->_out('endobj'); } } @@ -422,3 +461,4 @@ // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: +?> Modified: trunk/lib/font/courier.php =================================================================== --- trunk/lib/fpdf/courier.php 2012-12-03 12:43:20 UTC (rev 8589) +++ trunk/lib/font/courier.php 2012-12-03 13:29:21 UTC (rev 8590) @@ -1,6 +1,8 @@ <?php -for ($i = 0; $i <= 255; $i++) - $fpdf_charwidths['courier'][chr($i)] = 600; -$fpdf_charwidths['courierB'] = $fpdf_charwidths['courier']; -$fpdf_charwidths['courierI'] = $fpdf_charwidths['courier']; -$fpdf_charwidths['courierBI'] = $fpdf_charwidths['courier']; +$type = 'Core'; +$name = 'Courier'; +$up = -100; +$ut = 50; +for($i=0;$i<=255;$i++) + $cw[chr($i)] = 600; +?> Added: trunk/lib/font/courierb.php =================================================================== --- trunk/lib/font/courierb.php (rev 0) +++ trunk/lib/font/courierb.php 2012-12-03 13:29:21 UTC (rev 8590) @@ -0,0 +1,8 @@ +<?php +$type = 'Core'; +$name = 'Courier-Bold'; +$up = -100; +$ut = 50; +for($i=0;$i<=255;$i++) + $cw[chr($i)] = 600; +?> Added: trunk/lib/font/courierbi.php =================================================================== --- trunk/lib/font/courierbi.php (rev 0) +++ trunk/lib/font/courierbi.php 2012-12-03 13:29:21 UTC (rev 8590) @@ -0,0 +1,8 @@ +<?php +$type = 'Core'; +$name = 'Courier-BoldOblique'; +$up = -100; +$ut = 50; +for($i=0;$i<=255;$i++) + $cw[chr($i)] = 600; +?> Added: trunk/lib/font/courieri.php =================================================================== --- trunk/lib/font/courieri.php (rev 0) +++ trunk/lib/font/courieri.php 2012-12-03 13:29:21 UTC (rev 8590) @@ -0,0 +1,8 @@ +<?php +$type = 'Core'; +$name = 'Courier-Oblique'; +$up = -100; +$ut = 50; +for($i=0;$i<=255;$i++) + $cw[chr($i)] = 600; +?> Modified: trunk/lib/font/helvetica.php =================================================================== --- trunk/lib/fpdf/helvetica.php 2012-12-03 12:43:20 UTC (rev 8589) +++ trunk/lib/font/helvetica.php 2012-12-03 13:29:21 UTC (rev 8590) @@ -1,14 +1,19 @@ <?php -$fpdf_charwidths['helvetica'] = array( - chr(0) => 278, chr(1) => 278, chr(2) => 278, chr(3) => 278, chr(4) => 278, chr(5) => 278, chr(6) => 278, chr(7) => 278, chr(8) => 278, chr(9) => 278, chr(10) => 278, chr(11) => 278, chr(12) => 278, chr(13) => 278, chr(14) => 278, chr(15) => 278, chr(16) => 278, chr(17) => 278, chr(18) => 278, chr(19) => 278, chr(20) => 278, chr(21) => 278, - chr(22) => 278, chr(23) => 278, chr(24) => 278, chr(25) => 278, chr(26) => 278, chr(27) => 278, chr(28) => 278, chr(29) => 278, chr(30) => 278, chr(31) => 278, ' ' => 278, '!' => 278, '"' => 355, '#' => 556, '$' => 556, '%' => 889, '&' => 667, '\'' => 191, '(' => 333, ')' => 333, '*' => 389, '+' => 584, - ',' => 278, '-' => 333, '.' => 278, '/' => 278, '0' => 556, '1' => 556, '2' => 556, '3' => 556, '4' => 556, '5' => 556, '6' => 556, '7' => 556, '8' => 556, '9' => 556, ':' => 278, ';' => 278, '<' => 584, '=' => 584, '>' => 584, '?' => 556, '@' => 1015, 'A' => 667, - 'B' => 667, 'C' => 722, 'D' => 722, 'E' => 667, 'F' => 611, 'G' => 778, 'H' => 722, 'I' => 278, 'J' => 500, 'K' => 667, 'L' => 556, 'M' => 833, 'N' => 722, 'O' => 778, 'P' => 667, 'Q' => 778, 'R' => 722, 'S' => 667, 'T' => 611, 'U' => 722, 'V' => 667, 'W' => 944, - 'X' => 667, 'Y' => 667, 'Z' => 611, '[' => 278, '\\' => 278, ']' => 278, '^' => 469, '_' => 556, '`' => 333, 'a' => 556, 'b' => 556, 'c' => 500, 'd' => 556, 'e' => 556, 'f' => 278, 'g' => 556, 'h' => 556, 'i' => 222, 'j' => 222, 'k' => 500, 'l' => 222, 'm' => 833, - 'n' => 556, 'o' => 556, 'p' => 556, 'q' => 556, 'r' => 333, 's' => 500, 't' => 278, 'u' => 556, 'v' => 500, 'w' => 722, 'x' => 500, 'y' => 500, 'z' => 500, '{' => 334, '|' => 260, '}' => 334, '~' => 584, chr(127) => 350, chr(128) => 556, chr(129) => 350, chr(130) => 222, chr(131) => 556, - chr(132) => 333, chr(133) => 1000, chr(134) => 556, chr(135) => 556, chr(136) => 333, chr(137) => 1000, chr(138) => 667, chr(139) => 333, chr(140) => 1000, chr(141) => 350, chr(142) => 611, chr(143) => 350, chr(144) => 350, chr(145) => 222, chr(146) => 222, chr(147) => 333, chr(148) => 333, chr(149) => 350, chr(150) => 556, chr(151) => 1000, chr(152) => 333, chr(153) => 1000, - chr(154) => 500, chr(155) => 333, chr(156) => 944, chr(157) => 350, chr(158) => 500, chr(159) => 667, chr(160) => 278, chr(161) => 333, chr(162) => 556, chr(163) => 556, chr(164) => 556, chr(165) => 556, chr(166) => 260, chr(167) => 556, chr(168) => 333, chr(169) => 737, chr(170) => 370, chr(171) => 556, chr(172) => 584, chr(173) => 333, chr(174) => 737, chr(175) => 333, - chr(176) => 400, chr(177) => 584, chr(178) => 333, chr(179) => 333, chr(180) => 333, chr(181) => 556, chr(182) => 537, chr(183) => 278, chr(184) => 333, chr(185) => 333, chr(186) => 365, chr(187) => 556, chr(188) => 834, chr(189) => 834, chr(190) => 834, chr(191) => 611, chr(192) => 667, chr(193) => 667, chr(194) => 667, chr(195) => 667, chr(196) => 667, chr(197) => 667, - chr(198) => 1000, chr(199) => 722, chr(200) => 667, chr(201) => 667, chr(202) => 667, chr(203) => 667, chr(204) => 278, chr(205) => 278, chr(206) => 278, chr(207) => 278, chr(208) => 722, chr(209) => 722, chr(210) => 778, chr(211) => 778, chr(212) => 778, chr(213) => 778, chr(214) => 778, chr(215) => 584, chr(216) => 778, chr(217) => 722, chr(218) => 722, chr(219) => 722, - chr(220) => 722, chr(221) => 667, chr(222) => 667, chr(223) => 611, chr(224) => 556, chr(225) => 556, chr(226) => 556, chr(227) => 556, chr(228) => 556, chr(229) => 556, chr(230) => 889, chr(231) => 500, chr(232) => 556, chr(233) => 556, chr(234) => 556, chr(235) => 556, chr(236) => 278, chr(237) => 278, chr(238) => 278, chr(239) => 278, chr(240) => 556, chr(241) => 556, - chr(242) => 556, chr(243) => 556, chr(244) => 556, chr(245) => 556, chr(246) => 556, chr(247) => 584, chr(248) => 611, chr(249) => 556, chr(250) => 556, chr(251) => 556, chr(252) => 556, chr(253) => 500, chr(254) => 556, chr(255) => 500); +$type = 'Core'; +$name = 'Helvetica'; +$up = -100; +$ut = 50; +$cw = array( + chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667, + 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833, + 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556, + chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556, + chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500); +?> Modified: trunk/lib/font/helveticab.php =================================================================== --- trunk/lib/fpdf/helveticab.php 2012-12-03 12:43:20 UTC (rev 8589) +++ trunk/lib/font/helveticab.php 2012-12-03 13:29:21 UTC (rev 8590) @@ -1,14 +1,19 @@ <?php -$fpdf_charwidths['helveticaB'] = array( - chr(0) => 278, chr(1) => 278, chr(2) => 278, chr(3) => 278, chr(4) => 278, chr(5) => 278, chr(6) => 278, chr(7) => 278, chr(8) => 278, chr(9) => 278, chr(10) => 278, chr(11) => 278, chr(12) => 278, chr(13) => 278, chr(14) => 278, chr(15) => 278, chr(16) => 278, chr(17) => 278, chr(18) => 278, chr(19) => 278, chr(20) => 278, chr(21) => 278, - chr(22) => 278, chr(23) => 278, chr(24) => 278, chr(25) => 278, chr(26) => 278, chr(27) => 278, chr(28) => 278, chr(29) => 278, chr(30) => 278, chr(31) => 278, ' ' => 278, '!' => 333, '"' => 474, '#' => 556, '$' => 556, '%' => 889, '&' => 722, '\'' => 238, '(' => 333, ')' => 333, '*' => 389, '+' => 584, - ',' => 278, '-' => 333, '.' => 278, '/' => 278, '0' => 556, '1' => 556, '2' => 556, '3' => 556, '4' => 556, '5' => 556, '6' => 556, '7' => 556, '8' => 556, '9' => 556, ':' => 333, ';' => 333, '<' => 584, '=' => 584, '>' => 584, '?' => 611, '@' => 975, 'A' => 722, - 'B' => 722, 'C' => 722, 'D' => 722, 'E' => 667, 'F' => 611, 'G' => 778, 'H' => 722, 'I' => 278, 'J' => 556, 'K' => 722, 'L' => 611, 'M' => 833, 'N' => 722, 'O' => 778, 'P' => 667, 'Q' => 778, 'R' => 722, 'S' => 667, 'T' => 611, 'U' => 722, 'V' => 667, 'W' => 944, - 'X' => 667, 'Y' => 667, 'Z' => 611, '[' => 333, '\\' => 278, ']' => 333, '^' => 584, '_' => 556, '`' => 333, 'a' => 556, 'b' => 611, 'c' => 556, 'd' => 611, 'e' => 556, 'f' => 333, 'g' => 611, 'h' => 611, 'i' => 278, 'j' => 278, 'k' => 556, 'l' => 278, 'm' => 889, - 'n' => 611, 'o' => 611, 'p' => 611, 'q' => 611, 'r' => 389, 's' => 556, 't' => 333, 'u' => 611, 'v' => 556, 'w' => 778, 'x' => 556, 'y' => 556, 'z' => 500, '{' => 389, '|' => 280, '}' => 389, '~' => 584, chr(127) => 350, chr(128) => 556, chr(129) => 350, chr(130) => 278, chr(131) => 556, - chr(132) => 500, chr(133) => 1000, chr(134) => 556, chr(135) => 556, chr(136) => 333, chr(137) => 1000, chr(138) => 667, chr(139) => 333, chr(140) => 1000, chr(141) => 350, chr(142) => 611, chr(143) => 350, chr(144) => 350, chr(145) => 278, chr(146) => 278, chr(147) => 500, chr(148) => 500, chr(149) => 350, chr(150) => 556, chr(151) => 1000, chr(152) => 333, chr(153) => 1000, - chr(154) => 556, chr(155) => 333, chr(156) => 944, chr(157) => 350, chr(158) => 500, chr(159) => 667, chr(160) => 278, chr(161) => 333, chr(162) => 556, chr(163) => 556, chr(164) => 556, chr(165) => 556, chr(166) => 280, chr(167) => 556, chr(168) => 333, chr(169) => 737, chr(170) => 370, chr(171) => 556, chr(172) => 584, chr(173) => 333, chr(174) => 737, chr(175) => 333, - chr(176) => 400, chr(177) => 584, chr(178) => 333, chr(179) => 333, chr(180) => 333, chr(181) => 611, chr(182) => 556, chr(183) => 278, chr(184) => 333, chr(185) => 333, chr(186) => 365, chr(187) => 556, chr(188) => 834, chr(189) => 834, chr(190) => 834, chr(191) => 611, chr(192) => 722, chr(193) => 722, chr(194) => 722, chr(195) => 722, chr(196) => 722, chr(197) => 722, - chr(198) => 1000, chr(199) => 722, chr(200) => 667, chr(201) => 667, chr(202) => 667, chr(203) => 667, chr(204) => 278, chr(205) => 278, chr(206) => 278, chr(207) => 278, chr(208) => 722, chr(209) => 722, chr(210) => 778, chr(211) => 778, chr(212) => 778, chr(213) => 778, chr(214) => 778, chr(215) => 584, chr(216) => 778, chr(217) => 722, chr(218) => 722, chr(219) => 722, - chr(220) => 722, chr(221) => 667, chr(222) => 667, chr(223) => 611, chr(224) => 556, chr(225) => 556, chr(226) => 556, chr(227) => 556, chr(228) => 556, chr(229) => 556, chr(230) => 889, chr(231) => 556, chr(232) => 556, chr(233) => 556, chr(234) => 556, chr(235) => 556, chr(236) => 278, chr(237) => 278, chr(238) => 278, chr(239) => 278, chr(240) => 611, chr(241) => 611, - chr(242) => 611, chr(243) => 611, chr(244) => 611, chr(245) => 611, chr(246) => 611, chr(247) => 584, chr(248) => 611, chr(249) => 611, chr(250) => 611, chr(251) => 611, chr(252) => 611, chr(253) => 556, chr(254) => 611, chr(255) => 556); +$type = 'Core'; +$name = 'Helvetica-Bold'; +$up = -100; +$ut = 50; +$cw = array( + chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722, + 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889, + 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556, + chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611, + chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556); +?> Modified: trunk/lib/font/helveticabi.php =================================================================== --- trunk/lib/fpdf/helveticabi.php 2012-12-03 12:43:20 UTC (rev 8589) +++ trunk/lib/font/helveticabi.php 2012-12-03 13:29:21 UTC (rev 8590) @@ -1,14 +1,19 @@ <?php -$fpdf_charwidths['helveticaBI'] = array( - chr(0) => 278, chr(1) => 278, chr(2) => 278, chr(3) => 278, chr(4) => 278, chr(5) => 278, chr(6) => 278, chr(7) => 278, chr(8) => 278, chr(9) => 278, chr(10) => 278, chr(11) => 278, chr(12) => 278, chr(13) => 278, chr(14) => 278, chr(15) => 278, chr(16) => 278, chr(17) => 278, chr(18) => 278, chr(19) => 278, chr(20) => 278, chr(21) => 278, - chr(22) => 278, chr(23) => 278, chr(24) => 278, chr(25) => 278, chr(26) => 278, chr(27) => 278, chr(28) => 278, chr(29) => 278, chr(30) => 278, chr(31) => 278, ' ' => 278, '!' => 333, '"' => 474, '#' => 556, '$' => 556, '%' => 889, '&' => 722, '\'' => 238, '(' => 333, ')' => 333, '*' => 389, '+' => 584, - ',' => 278, '-' => 333, '.' => 278, '/' => 278, '0' => 556, '1' => 556, '2' => 556, '3' => 556, '4' => 556, '5' => 556, '6' => 556, '7' => 556, '8' => 556, '9' => 556, ':' => 333, ';' => 333, '<' => 584, '=' => 584, '>' => 584, '?' => 611, '@' => 975, 'A' => 722, - 'B' => 722, 'C' => 722, 'D' => 722, 'E' => 667, 'F' => 611, 'G' => 778, 'H' => 722, 'I' => 278, 'J' => 556, 'K' => 722, 'L' => 611, 'M' => 833, 'N' => 722, 'O' => 778, 'P' => 667, 'Q' => 778, 'R' => 722, 'S' => 667, 'T' => 611, 'U' => 722, 'V' => 667, 'W' => 944, - 'X' => 667, 'Y' => 667, 'Z' => 611, '[' => 333, '\\' => 278, ']' => 333, '^' => 584, '_' => 556, '`' => 333, 'a' => 556, 'b' => 611, 'c' => 556, 'd' => 611, 'e' => 556, 'f' => 333, 'g' => 611, 'h' => 611, 'i' => 278, 'j' => 278, 'k' => 556, 'l' => 278, 'm' => 889, - 'n' => 611, 'o' => 611, 'p' => 611, 'q' => 611, 'r' => 389, 's' => 556, 't' => 333, 'u' => 611, 'v' => 556, 'w' => 778, 'x' => 556, 'y' => 556, 'z' => 500, '{' => 389, '|' => 280, '}' => 389, '~' => 584, chr(127) => 350, chr(128) => 556, chr(129) => 350, chr(130) => 278, chr(131) => 556, - chr(132) => 500, chr(133) => 1000, chr(134) => 556, chr(135) => 556, chr(136) => 333, chr(137) => 1000, chr(138) => 667, chr(139) => 333, chr(140) => 1000, chr(141) => 350, chr(142) => 611, chr(143) => 350, chr(144) => 350, chr(145) => 278, chr(146) => 278, chr(147) => 500, chr(148) => 500, chr(149) => 350, chr(150) => 556, chr(151) => 1000, chr(152) => 333, chr(153) => 1000, - chr(154) => 556, chr(155) => 333, chr(156) => 944, chr(157) => 350, chr(158) => 500, chr(159) => 667, chr(160) => 278, chr(161) => 333, chr(162) => 556, chr(163) => 556, chr(164) => 556, chr(165) => 556, chr(166) => 280, chr(167) => 556, chr(168) => 333, chr(169) => 737, chr(170) => 370, chr(171) => 556, chr(172) => 584, chr(173) => 333, chr(174) => 737, chr(175) => 333, - chr(176) => 400, chr(177) => 584, chr(178) => 333, chr(179) => 333, chr(180) => 333, chr(181) => 611, chr(182) => 556, chr(183) => 278, chr(184) => 333, chr(185) => 333, chr(186) => 365, chr(187) => 556, chr(188) => 834, chr(189) => 834, chr(190) => 834, chr(191) => 611, chr(192) => 722, chr(193) => 722, chr(194) => 722, chr(195) => 722, chr(196) => 722, chr(197) => 722, - chr(198) => 1000, chr(199) => 722, chr(200) => 667, chr(201) => 667, chr(202) => 667, chr(203) => 667, chr(204) => 278, chr(205) => 278, chr(206) => 278, chr(207) => 278, chr(208) => 722, chr(209) => 722, chr(210) => 778, chr(211) => 778, chr(212) => 778, chr(213) => 778, chr(214) => 778, chr(215) => 584, chr(216) => 778, chr(217) => 722, chr(218) => 722, chr(219) => 722, - chr(220) => 722, chr(221) => 667, chr(222) => 667, chr(223) => 611, chr(224) => 556, chr(225) => 556, chr(226) => 556, chr(227) => 556, chr(228) => 556, chr(229) => 556, chr(230) => 889, chr(231) => 556, chr(232) => 556, chr(233) => 556, chr(234) => 556, chr(235) => 556, chr(236) => 278, chr(237) => 278, chr(238) => 278, chr(239) => 278, chr(240) => 611, chr(241) => 611, - chr(242) => 611, chr(243) => 611, chr(244) => 611, chr(245) => 611, chr(246) => 611, chr(247) => 584, chr(248) => 611, chr(249) => 611, chr(250) => 611, chr(251) => 611, chr(252) => 611, chr(253) => 556, chr(254) => 611, chr(255) => 556); +$type = 'Core'; +$name = 'Helvetica-BoldOblique'; +$up = -100; +$ut = 50; +$cw = array( + chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722, + 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889, + 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556, + chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611, + chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556); +?> Modified: trunk/lib/font/helveticai.php =================================================================== --- trunk/lib/fpdf/helveticai.php 2012-12-03 12:43:20 UTC (rev 8589) +++ trunk/lib/font/helveticai.php 2012-12-03 13:29:21 UTC (rev 8590) @@ -1,14 +1,19 @@ <?php -$fpdf_charwidths['helveticaI'] = array( - chr(0) => 278, chr(1) => 278, chr(2) => 278, chr(3) => 278, chr(4) => 278, chr(5) => 278, chr(6) => 278, chr(7) => 278, chr(8) => 278, chr(9) => 278, chr(10) => 278, chr(11) => 278, chr(12) => 278, chr(13) => 278, chr(14) => 278, chr(15) => 278, chr(16) => 278, chr(17) => 278, chr(18) => 278, chr(19) => 278, chr(20) => 278, chr(21) => 278, - chr(22) => 278, chr(23) => 278, chr(24) => 278, chr(25) => 278, chr(26) => 278, chr(27) => 278, chr(28) => 278, chr(29) => 278, chr(30) => 278, chr(31) => 278, ' ' => 278, '!' => 278, '"' => 355, '#' => 556, '$' => 556, '%' => 889, '&' => 667, '\'' => 191, '(' => 333, ')' => 333, '*' => 389, '+' => 584, - ',' => 278, '-' => 333, '.' => 278, '/' => 278, '0' => 556, '1' => 556, '2' => 556, '3' => 556, '4' => 556, '5' => 556, '6' => 556, '7' => 556, '8' => 556, '9' => 556, ':' => 278, ';' => 278, '<' => 584, '=' => 584, '>' => 584, '?' => 556, '@' => 1015, 'A' => 667, - 'B' => 667, 'C' => 722, 'D' => 722, 'E' => 667, 'F' => 611, 'G' => 778, 'H' => 722, 'I' => 278, 'J' => 500, 'K' => 667, 'L' => 556, 'M' => 833, 'N' => 722, 'O' => 778, 'P' => 667, 'Q' => 778, 'R' => 722, 'S' => 667, 'T' => 611, 'U' => 722, 'V' => 667, 'W' => 944, - 'X' => 667, 'Y' => 667, 'Z' => 611, '[' => 278, '\\' => 278, ']' => 278, '^' => 469, '_' => 556, '`' => 333, 'a' => 556, 'b' => 556, 'c' => 500, 'd' => 556, 'e' => 556, 'f' => 278, 'g' => 556, 'h' => 556, 'i' => 222, 'j' => 222, 'k' => 500, 'l' => 222, 'm' => 833, - 'n' => 556, 'o' => 556, 'p' => 556, 'q' => 556, 'r' => 333, 's' => 500, 't' => 278, 'u' => 556, 'v' => 500, 'w' => 722, 'x' => 500, 'y' => 500, 'z' => 500, '{' => 334, '|' => 260, '}' => 334, '~' => 584, chr(127) => 350, chr(128) => 556, chr(129) => 350, chr(130) => 222, chr(131) => 556, - chr(132) => 333, chr(133) => 1000, chr(134) => 556, chr(135) => 556, chr(136) => 333, chr(137) => 1000, chr(138) => 667, chr(139) => 333, chr(140) => 1000, chr(141) => 350, chr(142) => 611, chr(143) => 350, chr(144) => 350, chr(145) => 222, chr(146) => 222, chr(147) => 333, chr(148) => 333, chr(149) => 350, chr(150) => 556, chr(151) => 1000, chr(152) => 333, chr(153) => 1000, - chr(154) => 500, chr(155) => 333, chr(156) => 944, chr(157) => 350, chr(158) => 500, chr(159) => 667, chr(160) => 278, chr(161) => 333, chr(162) => 556, chr(163) => 556, chr(164) => 556, chr(165) => 556, chr(166) => 260, chr(167) => 556, chr(168) => 333, chr(169) => 737, chr(170) => 370, chr(171) => 556, chr(172) => 584, chr(173) => 333, chr(174) => 737, chr(175) => 333, - chr(176) => 400, chr(177) => 584, chr(178) => 333, chr(179) => 333, chr(180) => 333, chr(181) => 556, chr(182) => 537, chr(183) => 278, chr(184) => 333, chr(185) => 333, chr(186) => 365, chr(187) => 556, chr(188) => 834, chr(189) => 834, chr(190) => 834, chr(191) => 611, chr(192) => 667, chr(193) => 667, chr(194) => 667, chr(195) => 667, chr(196) => 667, chr(197) => 667, - chr(198) => 1000, chr(199) => 722, chr(200) => 667, chr(201) => 667, chr(202) => 667, chr(203) => 667, chr(204) => 278, chr(205) => 278, chr(206) => 278, chr(207) => 278, chr(208) => 722, chr(209) => 722, chr(210) => 778, chr(211) => 778, chr(212) => 778, chr(213) => 778, chr(214) => 778, chr(215) => 584, chr(216) => 778, chr(217) => 722, chr(218) => 722, chr(219) => 722, - chr(220) => 722, chr(221) => 667, chr(222) => 667, chr(223) => 611, chr(224) => 556, chr(225) => 556, chr(226) => 556, chr(227) => 556, chr(228) => 556, chr(229) => 556, chr(230) => 889, chr(231) => 500, chr(232) => 556, chr(233) => 556, chr(234) => 556, chr(235) => 556, chr(236) => 278, chr(237) => 278, chr(238) => 278, chr(239) => 278, chr(240) => 556, chr(241) => 556, - chr(242)... [truncated message content] |
From: <var...@us...> - 2012-12-04 13:03:28
|
Revision: 8596 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8596&view=rev Author: vargenau Date: 2012-12-04 13:03:14 +0000 (Tue, 04 Dec 2012) Log Message: ----------- Use smart quotes Modified Paths: -------------- trunk/lib/AccessLog.php trunk/lib/ArchiveCleaner.php trunk/lib/DbSession.php trunk/lib/IniConfig.php trunk/lib/InlineParser.php trunk/lib/PageType.php trunk/lib/Request.php trunk/lib/WikiDB.php trunk/lib/WikiGroup.php trunk/lib/WikiPlugin.php trunk/lib/WikiPluginCached.php trunk/lib/WikiTheme.php trunk/lib/WikiUser.php trunk/lib/WikiUserNew.php trunk/lib/XmlElement.php trunk/lib/editpage.php trunk/lib/loadsave.php trunk/lib/main.php trunk/lib/purgepage.php trunk/lib/removepage.php trunk/lib/stdlib.php trunk/lib/ziplib.php Modified: trunk/lib/AccessLog.php =================================================================== --- trunk/lib/AccessLog.php 2012-12-04 12:49:42 UTC (rev 8595) +++ trunk/lib/AccessLog.php 2012-12-04 13:03:14 UTC (rev 8596) @@ -47,7 +47,7 @@ (sprintf(_("%s is not writable."), _("The PhpWiki access log file")) . "\n" . sprintf(_("Please ensure that %s is writable, or redefine %s in config/config.ini."), - sprintf(_("the file '%s'"), ACCESS_LOG), + sprintf(_("the file “%s”"), ACCESS_LOG), 'ACCESS_LOG') , E_USER_NOTICE); } Modified: trunk/lib/ArchiveCleaner.php =================================================================== --- trunk/lib/ArchiveCleaner.php 2012-12-04 12:49:42 UTC (rev 8595) +++ trunk/lib/ArchiveCleaner.php 2012-12-04 13:03:14 UTC (rev 8596) @@ -136,7 +136,7 @@ if (!$supplanted) { // Every revision but the most recent should have a supplanted time. // However, if it doesn't... - trigger_error(sprintf("Warning: Page '%s', version '%d' has no '_supplanted' timestamp", + trigger_error(sprintf("Warning: Page “%s”, version '%d' has no '_supplanted' timestamp", $revision->getPageName(), $revision->getVersion()), E_USER_NOTICE); Modified: trunk/lib/DbSession.php =================================================================== --- trunk/lib/DbSession.php 2012-12-04 12:49:42 UTC (rev 8595) +++ trunk/lib/DbSession.php 2012-12-04 13:03:14 UTC (rev 8596) @@ -39,7 +39,7 @@ } } //Fixme: E_USER_WARNING ignored! - trigger_error(sprintf(_("Your WikiDB DB backend '%s' cannot be used for DbSession.") . " " . + trigger_error(sprintf(_("Your WikiDB DB backend “%s” cannot be used for DbSession.") . " " . _("Set USE_DB_SESSION to false."), $db_type), E_USER_WARNING); return false; Modified: trunk/lib/IniConfig.php =================================================================== --- trunk/lib/IniConfig.php 2012-12-04 12:49:42 UTC (rev 8595) +++ trunk/lib/IniConfig.php 2012-12-04 13:03:14 UTC (rev 8596) @@ -327,7 +327,7 @@ // try to load it dynamically (unix only) if (!loadPhpExtension("pdo")) { echo $GLOBALS['php_errormsg'], "<br>\n"; - trigger_error(sprintf("dl() problem: Required extension '%s' could not be loaded!", + trigger_error(sprintf("dl() problem: Required extension “%s” could not be loaded!", "pdo"), E_USER_ERROR); } Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2012-12-04 12:49:42 UTC (rev 8595) +++ trunk/lib/InlineParser.php 2012-12-04 13:03:14 UTC (rev 8596) @@ -412,7 +412,7 @@ // Check illegal characters in page names: <>[]{}|" if (preg_match("/[<\[\{\|\"\}\]>]/", $rawlink, $matches) > 0) { return HTML::span(array('class' => 'error'), - sprintf(_("Illegal character '%s' in page name."), + sprintf(_("Illegal character “%s” in page name."), $matches[0])); } $link = UnWikiEscape($rawlink); Modified: trunk/lib/PageType.php =================================================================== --- trunk/lib/PageType.php 2012-12-04 12:49:42 UTC (rev 8595) +++ trunk/lib/PageType.php 2012-12-04 13:03:14 UTC (rev 8596) @@ -84,7 +84,7 @@ $class = "PageType_" . (string)$name; if (class_exists($class)) return new $class; - trigger_error(sprintf("PageType '%s' unknown", (string)$name), + trigger_error(sprintf("PageType “%s” unknown", (string)$name), E_USER_WARNING); return new PageType_wikitext; } Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2012-12-04 12:49:42 UTC (rev 8595) +++ trunk/lib/Request.php 2012-12-04 13:03:14 UTC (rev 8596) @@ -876,7 +876,7 @@ (sprintf(_("%s is not writable."), _("The PhpWiki access log file")) . "\n" . sprintf(_("Please ensure that %s is writable, or redefine %s in config/config.ini."), - sprintf(_("the file '%s'"), ACCESS_LOG), + sprintf(_("the file “%s”"), ACCESS_LOG), 'ACCESS_LOG') , E_USER_NOTICE); } Modified: trunk/lib/WikiDB.php =================================================================== --- trunk/lib/WikiDB.php 2012-12-04 12:49:42 UTC (rev 8595) +++ trunk/lib/WikiDB.php 2012-12-04 13:03:14 UTC (rev 8596) @@ -836,7 +836,7 @@ $latestversion = $cache->get_latest_version($pagename); if ($latestversion && ($version == $latestversion)) { $backend->unlock(array('page', 'version')); - trigger_error(sprintf("Attempt to delete most recent revision of '%s'", + trigger_error(sprintf("Attempt to delete most recent revision of “%s”", $pagename), E_USER_ERROR); return; } @@ -890,7 +890,7 @@ $latestversion = $cache->get_latest_version($pagename); if ($latestversion && $version == $latestversion) { $backend->unlock(array('version')); - trigger_error(sprintf("Attempt to merge most recent revision of '%s'", + trigger_error(sprintf("Attempt to merge most recent revision of “%s”", $pagename), E_USER_ERROR); return; } Modified: trunk/lib/WikiGroup.php =================================================================== --- trunk/lib/WikiGroup.php 2012-12-04 12:49:42 UTC (rev 8595) +++ trunk/lib/WikiGroup.php 2012-12-04 13:03:14 UTC (rev 8596) @@ -195,7 +195,7 @@ if ($this->specialGroup($group)) { return $this->isSpecialMember($group); } else { - trigger_error(__sprintf("Method '%s' not implemented in this GROUP_METHOD %s", + trigger_error(__sprintf("Method “%s” not implemented in this GROUP_METHOD %s", 'isMember', GROUP_METHOD), E_USER_WARNING); } @@ -244,7 +244,7 @@ */ function getAllGroupsIn() { - trigger_error(__sprintf("Method '%s' not implemented in this GROUP_METHOD %s", + trigger_error(__sprintf("Method “%s” not implemented in this GROUP_METHOD %s", 'getAllGroupsIn', GROUP_METHOD), E_USER_WARNING); return array(); @@ -328,7 +328,7 @@ if ($this->specialGroup($group)) { return $this->getSpecialMembersOf($group); } - trigger_error(__sprintf("Method '%s' not implemented in this GROUP_METHOD %s", + trigger_error(__sprintf("Method “%s” not implemented in this GROUP_METHOD %s", 'getMembersOf', GROUP_METHOD), E_USER_WARNING); return array(); @@ -373,7 +373,7 @@ // this could get complex so just return an empty array return false; default: - trigger_error(__sprintf("Unknown special group '%s'", $group), + trigger_error(__sprintf("Unknown special group “%s”", $group), E_USER_WARNING); } } @@ -389,7 +389,7 @@ */ function setMemberOf($group, $user = false) { - trigger_error(__sprintf("Method '%s' not implemented in this GROUP_METHOD %s", + trigger_error(__sprintf("Method “%s” not implemented in this GROUP_METHOD %s", 'setMemberOf', GROUP_METHOD), E_USER_WARNING); return false; @@ -406,7 +406,7 @@ */ function removeMemberOf($group, $user = false) { - trigger_error(__sprintf("Method '%s' not implemented in this GROUP_METHOD %s", + trigger_error(__sprintf("Method “%s” not implemented in this GROUP_METHOD %s", 'removeMemberOf', GROUP_METHOD), E_USER_WARNING); return false; @@ -543,7 +543,7 @@ $group_revision = $group_page->getCurrentRevision(); if ($group_revision->hasDefaultContents()) { $group = $group_page->getName(); - if ($strict) trigger_error(sprintf(_("Group page '%s' does not exist"), $group), + if ($strict) trigger_error(sprintf(_("Group page “%s” does not exist"), $group), E_USER_WARNING); return false; } Modified: trunk/lib/WikiPlugin.php =================================================================== --- trunk/lib/WikiPlugin.php 2012-12-04 12:49:42 UTC (rev 8595) +++ trunk/lib/WikiPlugin.php 2012-12-04 13:03:14 UTC (rev 8596) @@ -231,7 +231,7 @@ /* A plugin can override this function to define how any remaining text is handled */ function handle_plugin_args_cruft($argstr, $args) { - trigger_error(sprintf(_("trailing cruft in plugin args: '%s'"), + trigger_error(sprintf(_("trailing cruft in plugin args: “%s”"), $argstr), E_USER_NOTICE); } @@ -240,7 +240,7 @@ */ function allow_undeclared_arg($name, $value) { - trigger_error(sprintf(_("Argument '%s' not declared by plugin."), + trigger_error(sprintf(_("Argument “%s” not declared by plugin."), $name), E_USER_NOTICE); return false; } @@ -502,7 +502,7 @@ global $AllAllowedPlugins; if (in_array($plugin_name, $AllAllowedPlugins) === false) { - return $this->_error(sprintf(_("Plugin '%s' does not exist."), + return $this->_error(sprintf(_("Plugin “%s” does not exist."), $plugin_name)); } @@ -519,7 +519,7 @@ if (!class_exists($plugin_class)) { if ($include_failed) { - return $this->_error(sprintf(_("Plugin '%s' does not exist."), + return $this->_error(sprintf(_("Plugin “%s” does not exist."), $plugin_name)); } return $this->_error(sprintf(_("%s: no such class"), $plugin_class)); Modified: trunk/lib/WikiPluginCached.php =================================================================== --- trunk/lib/WikiPluginCached.php 2012-12-04 12:49:42 UTC (rev 8595) +++ trunk/lib/WikiPluginCached.php 2012-12-04 13:03:14 UTC (rev 8596) @@ -700,7 +700,7 @@ // I think this is the only error which may occur // without having written bad code. So gettextify it. $errortext = sprintf( - gettext("There is no image creation data available to id '%s'. Please reload referring page."), + gettext("There is no image creation data available to id “%s”. Please reload referring page."), $id); $this->printError($errorformat, $errortext); return false; Modified: trunk/lib/WikiTheme.php =================================================================== --- trunk/lib/WikiTheme.php 2012-12-04 12:49:42 UTC (rev 8595) +++ trunk/lib/WikiTheme.php 2012-12-04 13:03:14 UTC (rev 8596) @@ -698,7 +698,7 @@ if (isa($wikiword, 'WikiPageName')) $message = $wikiword->getWarnings(); else - $message = sprintf(_("'%s': Bad page name"), $wikiword); + $message = sprintf(_("“%s”: Bad page name"), $wikiword); $ErrorManager->warning($message); return HTML::span(array('class' => 'badwikiword'), $text); Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2012-12-04 12:49:42 UTC (rev 8595) +++ trunk/lib/WikiUser.php 2012-12-04 13:03:14 UTC (rev 8596) @@ -552,7 +552,7 @@ function changePassword($newpasswd, $passwd2 = false) { if (!$this->mayChangePass()) { - trigger_error(sprintf("Attempt to change an external password for '%s'. Not allowed!", + trigger_error(sprintf("Attempt to change an external password for “%s”. Not allowed!", $this->_userid), E_USER_ERROR); return false; } Modified: trunk/lib/WikiUserNew.php =================================================================== --- trunk/lib/WikiUserNew.php 2012-12-04 12:49:42 UTC (rev 8595) +++ trunk/lib/WikiUserNew.php 2012-12-04 13:03:14 UTC (rev 8596) @@ -1878,11 +1878,11 @@ if (!preg_match($rfc822re, $email)) { $result[0] = false; - $result[1] = sprintf(_("E-mail address '%s' is not properly formatted"), $email); + $result[1] = sprintf(_("E-mail address “%s” is not properly formatted"), $email); return $result; } if ($noconnect) - return array(true, sprintf(_("E-mail address '%s' is properly formatted"), $email)); + return array(true, sprintf(_("E-mail address “%s” is properly formatted"), $email)); list ($Username, $Domain) = explode("@", $email); //Todo: getmxrr workaround on Windows or manual input field to verify it manually Modified: trunk/lib/XmlElement.php =================================================================== --- trunk/lib/XmlElement.php 2012-12-04 12:49:42 UTC (rev 8595) +++ trunk/lib/XmlElement.php 2012-12-04 13:03:14 UTC (rev 8596) @@ -513,8 +513,8 @@ if (preg_match('/(?<!%)%[- ]?\d*[^- \d$]/x', $this->_fs)) // $fmt // literal variable name substitution only to keep locale // strings uncluttered - trigger_error(sprintf(_("Can't mix '%s' with '%s' type format strings"), - '%1\$s', '%s'), E_USER_WARNING); + trigger_error(sprintf(_("Can't mix “%s” with “%s” type format strings"), + '%1\$s', “%s”), E_USER_WARNING); $this->_fs = preg_replace('/(?<!%)%\d+\$/x', '%', $this->_fs); Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2012-12-04 12:49:42 UTC (rev 8595) +++ trunk/lib/editpage.php 2012-12-04 13:03:14 UTC (rev 8596) @@ -589,7 +589,7 @@ //$re_edit_link = Button('edit', _("Edit the new version"), $this->page); if ($unresolved) - $message = HTML::p(fmt("Some of the changes could not automatically be combined. Please look for sections beginning with '%s', and ending with '%s'. You will need to edit those sections by hand before you click Save.", + $message = HTML::p(fmt("Some of the changes could not automatically be combined. Please look for sections beginning with “%s”, and ending with “%s”. You will need to edit those sections by hand before you click Save.", "<<<<<<< " . _("Your version"), ">>>>>>> " . _("Other version"))); else @@ -953,7 +953,7 @@ function getConflictMessage($unresolved = false) { - $message = HTML(HTML::p(fmt("Some of the changes could not automatically be combined. Please look for sections beginning with '%s', and ending with '%s'. You will need to edit those sections by hand before you click Save.", + $message = HTML(HTML::p(fmt("Some of the changes could not automatically be combined. Please look for sections beginning with “%s”, and ending with “%s”. You will need to edit those sections by hand before you click Save.", "<<<<<<<", "======="), HTML::p(_("Please check it through before saving.")))); Modified: trunk/lib/loadsave.php =================================================================== --- trunk/lib/loadsave.php 2012-12-04 12:49:42 UTC (rev 8595) +++ trunk/lib/loadsave.php 2012-12-04 13:03:14 UTC (rev 8596) @@ -326,12 +326,12 @@ // see if we can access the directory the user wants us to use if (!file_exists($directory)) { if (!mkdir($directory, 0755)) - $request->finish(fmt("Cannot create directory '%s'", $directory)); + $request->finish(fmt("Cannot create directory “%s”", $directory)); else - $html = HTML::p(fmt("Created directory '%s' for the page dump...", + $html = HTML::p(fmt("Created directory “%s” for the page dump...", $directory)); } else { - $html = HTML::p(fmt("Using directory '%s'", $directory)); + $html = HTML::p(fmt("Using directory “%s”", $directory)); } StartLoadDump($request, _("Dumping Pages"), $html); @@ -388,7 +388,7 @@ $data = MailifyPage($page); if (!($fd = fopen($directory . "/" . $filename, "wb"))) { - $msg->pushContent(HTML::strong(fmt("couldn't open file '%s' for writing", + $msg->pushContent(HTML::strong(fmt("couldn't open file “%s” for writing", "$directory/$filename"))); $request->finish($msg); } @@ -459,12 +459,12 @@ // See if we can access the directory the user wants us to use if (!file_exists($directory)) { if (!mkdir($directory, 0755)) - $request->finish(fmt("Cannot create directory '%s'", $directory)); + $request->finish(fmt("Cannot create directory “%s”", $directory)); else - $html = HTML::p(fmt("Created directory '%s' for the page dump...", + $html = HTML::p(fmt("Created directory “%s” for the page dump...", $directory)); } else { - $html = HTML::p(fmt("Using directory '%s'", $directory)); + $html = HTML::p(fmt("Using directory “%s”", $directory)); } StartLoadDump($request, _("Dumping Pages"), $html); $thispage = $request->getArg('pagename'); // for "Return to ..." @@ -707,7 +707,7 @@ if ($directory) { $outfile = $directory . "/" . $filename; if (!($fd = fopen($outfile, "wb"))) { - $msg->pushContent(HTML::strong(fmt("couldn't open file '%s' for writing", + $msg->pushContent(HTML::strong(fmt("couldn't open file “%s” for writing", $outfile))); $request->finish($msg); } @@ -912,7 +912,7 @@ // remove invalid backend specific chars. utf8 issues mostly $pagename_check = new WikiPagename($pageinfo['pagename']); if (!$pagename_check->isValid()) { - PrintXML(HTML::p(HTML::strong(sprintf(_("'%s': Bad page name"), $pageinfo['pagename'])))); + PrintXML(HTML::p(HTML::strong(sprintf(_("“%s”: Bad page name"), $pageinfo['pagename'])))); return; } $pagename = $pagename_check->getName(); @@ -1479,7 +1479,7 @@ $finder = new FileFinder; $source = $finder->slashifyPath($source); StartLoadDump($request, - sprintf(_("Loading '%s'"), $source)); + sprintf(_("Loading “%s”"), $source)); LoadAny($request, $source); EndLoadDump($request); } Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2012-12-04 12:49:42 UTC (rev 8595) +++ trunk/lib/main.php 2012-12-04 13:03:14 UTC (rev 8596) @@ -212,7 +212,7 @@ } if (empty($WikiTheme) and $user_theme) { if (strcspn($user_theme, "./\x00]") != strlen($user_theme)) { - trigger_error(sprintf("invalid theme '%s': Invalid characters detected", + trigger_error(sprintf("invalid theme “%s”: Invalid characters detected", $user_theme), E_USER_WARNING); $user_theme = "default"; @@ -532,7 +532,7 @@ if (class_exists('PagePermission')) { $user =& $this->_user; $status = $user->isAuthenticated() ? _("authenticated") : _("not authenticated"); - $msg = fmt("%s %s %s is disallowed on this wiki for %s user '%s' (level: %s).", + $msg = fmt("%s %s %s is disallowed on this wiki for %s user “%s” (level: %s).", _("Missing PagePermission:"), action2access($this->getArg('action')), $this->getArg('pagename'), @@ -798,7 +798,7 @@ if (preg_match("/[<\[\{\|\"\}\]>]/", $pagename, $matches) > 0) { $CONTENT = HTML::div( array('class' => 'error'), - sprintf(_("Illegal character '%s' in page name."), + sprintf(_("Illegal character “%s” in page name."), $matches[0])); GeneratePage($CONTENT, $pagename); $this->finish(); @@ -1376,11 +1376,11 @@ _("The session.save_path directory")) . "\n" . sprintf(_("Please ensure that %s is writable, or redefine %s in config/config.ini."), - sprintf(_("the session.save_path directory '%s'"), + sprintf(_("the session.save_path directory “%s”"), ini_get('session.save_path')), 'SESSION_SAVE_PATH') . "\n" - . sprintf(_("Attempting to use the directory '%s' instead."), + . sprintf(_("Attempting to use the directory “%s” instead."), $tmpdir) , E_USER_NOTICE); if (!is_writeable($tmpdir)) { Modified: trunk/lib/purgepage.php =================================================================== --- trunk/lib/purgepage.php 2012-12-04 12:49:42 UTC (rev 8595) +++ trunk/lib/purgepage.php 2012-12-04 13:03:14 UTC (rev 8596) @@ -25,7 +25,7 @@ $cancelB = Button('submit:cancel', _("Cancel"), 'button'); // use generic wiki button look $fieldset = HTML::fieldset(HTML::legend(_('Confirm purge')), - HTML::p(fmt("You are about to purge '%s'!", $pagelink)), + HTML::p(fmt("You are about to purge “%s”!", $pagelink)), HTML::form(array('method' => 'post', 'action' => $request->getPostURL()), HiddenInputs(array('currentversion' => $version, @@ -51,7 +51,7 @@ $dbi = $request->getDbh(); $dbi->purgePage($pagename); $dbi->touch(); - $html = HTML::p(array('class' => 'feedback'), fmt("Purged page '%s' successfully.", $pagename)); + $html = HTML::p(array('class' => 'feedback'), fmt("Purged page “%s” successfully.", $pagename)); } GeneratePage($html, _("Purge Page")); Modified: trunk/lib/removepage.php =================================================================== --- trunk/lib/removepage.php 2012-12-04 12:49:42 UTC (rev 8595) +++ trunk/lib/removepage.php 2012-12-04 13:03:14 UTC (rev 8596) @@ -25,7 +25,7 @@ $cancelB = Button('submit:cancel', _("Cancel"), 'button'); // use generic wiki button look $fieldset = HTML::fieldset(HTML::legend(_('Confirm removal')), - HTML::p(fmt("You are about to remove '%s'!", $pagelink)), + HTML::p(fmt("You are about to remove “%s”!", $pagelink)), HTML::form(array('method' => 'post', 'action' => $request->getPostURL()), HiddenInputs(array('currentversion' => $version, @@ -51,7 +51,7 @@ $dbi = $request->getDbh(); $dbi->deletePage($pagename); $dbi->touch(); - $html = HTML::p(array('class' => 'feedback'), fmt("Removed page '%s' successfully.", $pagename)); + $html = HTML::p(array('class' => 'feedback'), fmt("Removed page “%s” successfully.", $pagename)); } GeneratePage($html, _("Remove Page")); Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2012-12-04 12:49:42 UTC (rev 8595) +++ trunk/lib/stdlib.php 2012-12-04 13:03:14 UTC (rev 8596) @@ -911,7 +911,7 @@ if (!$warnings) return false; - return sprintf(_("'%s': Bad page name: %s"), + return sprintf(_("“%s”: Bad page name: %s"), $this->shortName, join(', ', $warnings)); } @@ -924,7 +924,7 @@ return $page->name; // '0' or e.g. '1984' should be allowed though if (!is_string($page) and !is_integer($page)) { - trigger_error(sprintf("Non-string pagename '%s' (%s)(%s)", + trigger_error(sprintf("Non-string pagename “%s” (%s)(%s)", $page, gettype($page), get_class($page)), E_USER_NOTICE); } @@ -1542,8 +1542,8 @@ if (preg_match('/(?<!%)%[- ]?\d*[^- \d$]/x', $fmt)) // literal variable name substitution only to keep locale // strings uncluttered - trigger_error(sprintf(_("Can't mix '%s' with '%s' type format strings"), - '%1\$s', '%s'), E_USER_WARNING); //php+locale error + trigger_error(sprintf(_("Can't mix “%s” with “%s” type format strings"), + '%1\$s', “%s”), E_USER_WARNING); //php+locale error $fmt = preg_replace('/(?<!%)%\d+\$/x', '%', $fmt); $newargs = array(); @@ -1644,7 +1644,7 @@ @ $dir_handle = opendir($dir = $directory); if (empty($dir_handle)) { - trigger_error(sprintf(_("Unable to open directory '%s' for reading"), + trigger_error(sprintf(_("Unable to open directory “%s” for reading"), $dir), E_USER_NOTICE); return; // early return } Modified: trunk/lib/ziplib.php =================================================================== --- trunk/lib/ziplib.php 2012-12-04 12:49:42 UTC (rev 8595) +++ trunk/lib/ziplib.php 2012-12-04 13:03:14 UTC (rev 8596) @@ -413,7 +413,7 @@ if ($zipfile) { $this->zipfile = $zipfile; if (!($this->fp = fopen($zipfile, "rb"))) { - trigger_error(sprintf(_("Can't open zip file '%s' for reading"), + trigger_error(sprintf(_("Can't open zip file “%s” for reading"), $zipfile), E_USER_ERROR); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-12-05 19:01:39
|
Revision: 8607 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8607&view=rev Author: vargenau Date: 2012-12-05 19:01:32 +0000 (Wed, 05 Dec 2012) Log Message: ----------- (defined('FUSIONFORGE') and FUSIONFORGE) Modified Paths: -------------- trunk/lib/EditToolbar.php trunk/lib/IniConfig.php trunk/lib/MailNotify.php trunk/lib/PageList.php trunk/lib/PagePerm.php trunk/lib/WikiTheme.php trunk/lib/WikiUserNew.php trunk/lib/loadsave.php trunk/lib/main.php Modified: trunk/lib/EditToolbar.php =================================================================== --- trunk/lib/EditToolbar.php 2012-12-05 18:19:12 UTC (rev 8606) +++ trunk/lib/EditToolbar.php 2012-12-05 19:01:32 UTC (rev 8607) @@ -117,7 +117,7 @@ if (ENABLE_EDIT_TOOLBAR) { $username = $request->_user->UserName(); - if (FUSIONFORGE or DISABLE_MARKUP_WIKIWORD or (!isWikiWord($username))) { + if ((defined('FUSIONFORGE') and FUSIONFORGE) or DISABLE_MARKUP_WIKIWORD or (!isWikiWord($username))) { $username = '[[' . $username . ']]'; } $signature = " ––" . $username . " " . CTime(); @@ -305,7 +305,7 @@ $categories = array(); while ($p = $pages->next()) { $page = $p->getName(); - if (FUSIONFORGE) { + if ((defined('FUSIONFORGE') and FUSIONFORGE)) { $categories[] = "['$page', '%0A----%0A%5B%5B" . $page . "%5D%5D']"; } elseif (DISABLE_MARKUP_WIKIWORD or (!isWikiWord($page))) { $categories[] = "['$page', '%0A%5B" . $page . "%5D']"; Modified: trunk/lib/IniConfig.php =================================================================== --- trunk/lib/IniConfig.php 2012-12-05 18:19:12 UTC (rev 8606) +++ trunk/lib/IniConfig.php 2012-12-05 19:01:32 UTC (rev 8607) @@ -635,7 +635,7 @@ . 'WantedPages:WatchPage:WhoIsOnline:WikiAdminSelect'); // The FUSIONFORGE theme omits them - if (!FUSIONFORGE) { + if (!(defined('FUSIONFORGE') and FUSIONFORGE)) { // Add some some action pages depending on configuration if (DEBUG) { $ActionPages[] = 'DebugInfo'; @@ -726,7 +726,7 @@ $AllAllowedPlugins[] = 'YouTube'; // The FUSIONFORGE theme omits them - if (!FUSIONFORGE) { + if (!(defined('FUSIONFORGE') and FUSIONFORGE)) { $AllAllowedPlugins[] = 'AnalyseAccessLogSql'; $AllAllowedPlugins[] = '_AuthInfo'; $AllAllowedPlugins[] = '_BackendInfo'; @@ -790,7 +790,7 @@ $AllActionPages[] = 'UserContribs'; // The FUSIONFORGE theme omits them - if (!FUSIONFORGE) { + if (!(defined('FUSIONFORGE') and FUSIONFORGE)) { // Add some some action pages depending on configuration if (DEBUG) { $AllActionPages[] = 'PhpWikiAdministration/Chmod'; @@ -798,7 +798,7 @@ $AllActionPages[] = 'PhpWikiAdministration/Markup'; } - if (FUSIONFORGE) { + if ((defined('FUSIONFORGE') and FUSIONFORGE)) { if (ENABLE_EXTERNAL_PAGES) { $AllAllowedPlugins[] = 'WikiAdminSetExternal'; $AllActionPages[] = 'PhpWikiAdministration/SetExternal'; @@ -937,7 +937,7 @@ define('DEFAULT_LANGUAGE', ''); // detect from client // FusionForge hack - if (!FUSIONFORGE) { + if (!(defined('FUSIONFORGE') and FUSIONFORGE)) { // Disable update_locale because Zend Debugger crash if (!extension_loaded('Zend Debugger')) { update_locale(isset($LANG) ? $LANG : DEFAULT_LANGUAGE); Modified: trunk/lib/MailNotify.php =================================================================== --- trunk/lib/MailNotify.php 2012-12-05 18:19:12 UTC (rev 8606) +++ trunk/lib/MailNotify.php 2012-12-05 19:01:32 UTC (rev 8607) @@ -66,7 +66,7 @@ function fromId() { global $request; - if (FUSIONFORGE) { + if (defined('FUSIONFORGE') and FUSIONFORGE) { return $request->_user->getId(); } else { return $request->_user->getId() . '@' . $request->get('REMOTE_HOST'); @@ -84,7 +84,7 @@ global $request; // Disable verification of emails for corporate env. - if (FUSIONFORGE) { + if (defined('FUSIONFORGE') and FUSIONFORGE) { $doverify = false; } @@ -193,7 +193,7 @@ $encoded_subject = $this->subject_encode($subject); $emails = $this->emails; // Do not send if modification is from FusionForge admin - if (FUSIONFORGE and ($this->fromId() == ADMIN_USER)) { + if ((defined('FUSIONFORGE') and FUSIONFORGE) and ($this->fromId() == ADMIN_USER)) { return true; } if (!$notice) { Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2012-12-05 18:19:12 UTC (rev 8606) +++ trunk/lib/PageList.php 2012-12-05 19:01:32 UTC (rev 8607) @@ -1368,7 +1368,7 @@ trigger_error(sprintf("%s: Bad column", $column), E_USER_NOTICE); return false; } - if (!FUSIONFORGE) { + if (!(defined('FUSIONFORGE') and FUSIONFORGE)) { // FIXME: anon users might rate and see ratings also. // Defer this logic to the plugin. if ($column == 'rating' and !$GLOBALS['request']->_user->isSignedIn()) { Modified: trunk/lib/PagePerm.php =================================================================== --- trunk/lib/PagePerm.php 2012-12-05 18:19:12 UTC (rev 8606) +++ trunk/lib/PagePerm.php 2012-12-05 19:01:32 UTC (rev 8607) @@ -239,7 +239,7 @@ $page = $request->getPage($pagename); // Exceptions: - if (FUSIONFORGE) { + if (defined('FUSIONFORGE') and FUSIONFORGE) { if ($pagename != '.' && isset($request->_user->_is_external) && $request->_user->_is_external && !$page->get('external')) { $permcache[$pagename][$access] = 0; return 0; Modified: trunk/lib/WikiTheme.php =================================================================== --- trunk/lib/WikiTheme.php 2012-12-05 18:19:12 UTC (rev 8606) +++ trunk/lib/WikiTheme.php 2012-12-05 19:01:32 UTC (rev 8607) @@ -215,7 +215,7 @@ return; } $this->addMoreHeaders(JavaScript('', array('src' => $this->_findData("wikicommon.js")))); - if (!FUSIONFORGE) { + if (!(defined('FUSIONFORGE') and FUSIONFORGE)) { // FusionForge already loads this $this->addMoreHeaders(JavaScript('', array('src' => $this->_findData("sortable.js")))); } Modified: trunk/lib/WikiUserNew.php =================================================================== --- trunk/lib/WikiUserNew.php 2012-12-05 18:19:12 UTC (rev 8606) +++ trunk/lib/WikiUserNew.php 2012-12-05 19:01:32 UTC (rev 8607) @@ -595,7 +595,7 @@ { if (!$userid) $userid = $this->_userid; if (!$userid) return false; - if (FUSIONFORGE) { + if (defined('FUSIONFORGE') and FUSIONFORGE) { return true; } return preg_match("/^[\-\w\.@ ]+$/U", $userid) and strlen($userid) < 32; @@ -1764,7 +1764,7 @@ function get($name) { // get e-mail address from FusionForge - if (FUSIONFORGE && session_loggedin()) { + if ((defined('FUSIONFORGE') and FUSIONFORGE) && session_loggedin()) { $user = session_get_user(); return $user->getEmail(); } else { @@ -1775,7 +1775,7 @@ function sanify($value) { // e-mail address is already checked by FusionForge - if (FUSIONFORGE) { + if (defined('FUSIONFORGE') and FUSIONFORGE) { return $value; } // check for valid email address @@ -1802,7 +1802,7 @@ function update($value) { // e-mail address is already checked by FusionForge - if (FUSIONFORGE) { + if (defined('FUSIONFORGE') and FUSIONFORGE) { return; } if (!empty($this->_init)) { @@ -1985,7 +1985,7 @@ // This should be probably be done with $customUserPreferenceColumns // For now, we use FUSIONFORGE define - if (FUSIONFORGE) { + if (defined('FUSIONFORGE') and FUSIONFORGE) { $fusionforgeprefs = array( 'pageTrail' => new _UserPreference_bool(), 'diffMenuItem' => new _UserPreference_bool(), @@ -2177,7 +2177,7 @@ } } - if (FUSIONFORGE) { + if (defined('FUSIONFORGE') and FUSIONFORGE) { // Merge current notifyPages with notifyPagesAll // notifyPages are pages to notify in the current project // while $notifyPagesAll is used to store all the monitored pages. @@ -2227,7 +2227,7 @@ } } - if (FUSIONFORGE) { + if (defined('FUSIONFORGE') and FUSIONFORGE) { // Restore notifyPages from notifyPagesAll // notifyPages are pages to notify in the current project // while $notifyPagesAll is used to store all the monitored pages. Modified: trunk/lib/loadsave.php =================================================================== --- trunk/lib/loadsave.php 2012-12-05 18:19:12 UTC (rev 8606) +++ trunk/lib/loadsave.php 2012-12-05 19:01:32 UTC (rev 8607) @@ -1527,7 +1527,7 @@ // Ensure that all mandatory pages are loaded $finder = new FileFinder; - if (!FUSIONFORGE) { + if (!(defined('FUSIONFORGE') and FUSIONFORGE)) { $mandatory = explode(':', 'SandBox:Template/Category:Template/Talk:SpecialPages:CategoryCategory:CategoryActionPage:Help/OldTextFormattingRules:Help/TextFormattingRules:PhpWikiAdministration'); } elseif (WIKI_NAME == "help") { $mandatory = explode(':', 'SandBox:Template/Category:Template/Talk:SpecialPages:CategoryCategory:CategoryActionPage:Help/TextFormattingRules:PhpWikiAdministration'); Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2012-12-05 18:19:12 UTC (rev 8606) +++ trunk/lib/main.php 2012-12-05 19:01:32 UTC (rev 8607) @@ -1482,7 +1482,7 @@ $request->finish(); } -if ((!FUSIONFORGE) || (forge_get_config('installation_environment') != 'production')) { +if ((!(defined('FUSIONFORGE') and FUSIONFORGE)) || (forge_get_config('installation_environment') != 'production')) { if (defined('E_STRICT') and (E_ALL & E_STRICT)) // strict php5? error_reporting(E_ALL & ~E_STRICT); // exclude E_STRICT else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-12-06 18:05:32
|
Revision: 8617 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8617&view=rev Author: vargenau Date: 2012-12-06 17:54:15 +0000 (Thu, 06 Dec 2012) Log Message: ----------- Fix return Modified Paths: -------------- trunk/lib/WikiPlugin.php trunk/lib/WikiPluginCached.php trunk/lib/WikiTheme.php Modified: trunk/lib/WikiPlugin.php =================================================================== --- trunk/lib/WikiPlugin.php 2012-12-06 17:52:46 UTC (rev 8616) +++ trunk/lib/WikiPlugin.php 2012-12-06 17:54:15 UTC (rev 8617) @@ -471,6 +471,7 @@ case 'plugin-form': return $plugin->makeForm($plugin_args, $request); } + return false; } function getWikiPageLinks($pi, $basepage) @@ -514,7 +515,7 @@ $plugin_class = "WikiPlugin_$plugin_name"; if (!class_exists($plugin_class)) { // $include_failed = !@include_once("lib/plugin/$plugin_name.php"); - $include_failed = !include_once("lib/plugin/$plugin_name.php"); + $include_failed = !include_once($plugin_source); $ErrorManager->popErrorHandler(); if (!class_exists($plugin_class)) { Modified: trunk/lib/WikiPluginCached.php =================================================================== --- trunk/lib/WikiPluginCached.php 2012-12-06 17:52:46 UTC (rev 8616) +++ trunk/lib/WikiPluginCached.php 2012-12-06 17:54:15 UTC (rev 8617) @@ -1090,10 +1090,11 @@ fclose($pipes[2]); // It is important that you close any pipes before calling // proc_close in order to avoid a deadlock - $return_value = proc_close($process); + proc_close($process); if (empty($buf)) printXML($this->error($stderr)); return $buf; } + return ''; } // run "echo $source | $commandLine" and return result Modified: trunk/lib/WikiTheme.php =================================================================== --- trunk/lib/WikiTheme.php 2012-12-06 17:52:46 UTC (rev 8616) +++ trunk/lib/WikiTheme.php 2012-12-06 17:54:15 UTC (rev 8617) @@ -68,7 +68,6 @@ $page = $page_or_rev->getPage(); $pagename = $page->getName(); $wikipage = $pagename; - $exists = true; } elseif (isa($page_or_rev, 'WikiDB_Page')) { $page = $page_or_rev; $pagename = $page->getName(); @@ -269,7 +268,9 @@ } elseif (!$missing_okay) { trigger_error("$this->_theme/$file: not found", E_USER_NOTICE); if (DEBUG & _DEBUG_TRACE) { - echo "<pre>", printSimpleTrace(debug_backtrace()), "</pre>\n"; + echo "<pre>"; + printSimpleTrace(debug_backtrace()); + echo "</pre>\n"; } } return false; @@ -526,6 +527,7 @@ else return fmt("Owner: %s", '"' . $owner . '"'); } + return ''; } /* New behaviour: (by Matt Brown) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-12-11 14:02:36
|
Revision: 8642 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8642&view=rev Author: vargenau Date: 2012-12-11 14:02:25 +0000 (Tue, 11 Dec 2012) Log Message: ----------- Remove unused function get_host Modified Paths: -------------- trunk/lib/AccessLog.php trunk/lib/Request.php Modified: trunk/lib/AccessLog.php =================================================================== --- trunk/lib/AccessLog.php 2012-12-11 14:01:42 UTC (rev 8641) +++ trunk/lib/AccessLog.php 2012-12-11 14:02:25 UTC (rev 8642) @@ -141,34 +141,6 @@ } /** - * Return iterator of matching host items reverse sorted (latest first). - */ - function get_host($host, $since_minutes = 20) - { - if ($this->logtable) { - // mysql specific only: - return $this->read_sql("request_host=" . $this->_dbi->quote($host) - . " AND time_stamp > " . (time() - $since_minutes * 60) - . " ORDER BY time_stamp DESC"); - } else { - $iter = new WikiDB_Array_generic_iter(); - $logs =& $iter->_array; - $logentry = new Request_AccessLogEntry($this); - while ($logentry->read_file()) { - if (!empty($logentry->referer)) { - $iter->_array[] = $logentry; - if ($limit and count($logs) > $limit) - array_shift($logs); - $logentry = new Request_AccessLogEntry($this); - } - } - $logs = array_reverse($logs); - $logs = array_slice($logs, 0, min($limit, count($logs))); - return $iter; - } - } - - /** * Read sequentially backwards all previous entries from log file. * FIXME! */ Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2012-12-11 14:01:42 UTC (rev 8641) +++ trunk/lib/Request.php 2012-12-11 14:02:25 UTC (rev 8642) @@ -971,33 +971,6 @@ } /** - * Return iterator of matching host items reverse sorted (latest first). - */ - function get_host($host, $since_minutes = 20) - { - if ($this->logtable) { - // mysql specific only: - return $this->read_sql("request_host=" . $this->_dbi->quote($host) . " AND time_stamp > " . (time() - $since_minutes * 60) - . " ORDER BY time_stamp DESC"); - } else { - $iter = new WikiDB_Array_generic_iter(); - $logs =& $iter->_array; - $logentry = new Request_AccessLogEntry($this); - while ($logentry->read_file()) { - if (!empty($logentry->referer)) { - $iter->_array[] = $logentry; - if ($limit and count($logs) > $limit) - array_shift($logs); - $logentry = new Request_AccessLogEntry($this); - } - } - $logs = array_reverse($logs); - $logs = array_slice($logs, 0, min($limit, count($logs))); - return $iter; - } - } - - /** * Read sequentially all previous entries from log file. */ function read_file() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-12-11 14:30:49
|
Revision: 8643 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8643&view=rev Author: vargenau Date: 2012-12-11 14:30:38 +0000 (Tue, 11 Dec 2012) Log Message: ----------- Remove unreachable statements Modified Paths: -------------- trunk/lib/WikiUserNew.php trunk/lib/upgrade.php Modified: trunk/lib/WikiUserNew.php =================================================================== --- trunk/lib/WikiUserNew.php 2012-12-11 14:02:25 UTC (rev 8642) +++ trunk/lib/WikiUserNew.php 2012-12-11 14:30:38 UTC (rev 8643) @@ -287,13 +287,7 @@ return $_AnonUser; return $ForbiddenUser; // User must sign in to browse pages. } - return $ForbiddenUser; // User must sign in with a password. } - /* - trigger_error("DEBUG: Note: End of function reached in WikiUser." . " " - . "Unexpectedly, an appropriate user class could not be determined."); - return $ForbiddenUser; // Failsafe. - */ } /** @@ -867,14 +861,6 @@ function checkPass($submitted_password) { return false; - // this might happen on a old-style signin button. - - // By definition, the _AnonUser does not HAVE a password - // (compared to _BogoUser, who has an EMPTY password). - trigger_error("DEBUG: Warning: _AnonUser unexpectedly asked to checkPass()." . " " - . "Check isa(\$user, '_PassUser'), or: isa(\$user, '_AdminUser') etc. first." . " " - . "New subclasses of _WikiUser must override this function."); - return false; } } Modified: trunk/lib/upgrade.php =================================================================== --- trunk/lib/upgrade.php 2012-12-11 14:02:25 UTC (rev 8642) +++ trunk/lib/upgrade.php 2012-12-11 14:30:38 UTC (rev 8643) @@ -919,8 +919,6 @@ function CheckPluginUpdate() { - return; - echo "<h2>", sprintf(_("Check for necessary %s updates"), _("plugin argument")), "</h2>\n"; @@ -1297,16 +1295,19 @@ $upgrade = new Upgrade($request); //if (!$request->getArg('noindex')) // CheckOldIndexUpdate($request); // index.php => config.ini to upgrade from < 1.3.10 - if (!$request->getArg('nodb')) + if (!$request->getArg('nodb')) { $upgrade->CheckDatabaseUpdate($request); // first check cached_html and friends + } if (!$request->getArg('nopgsrc')) { $upgrade->CheckPgsrcUpdate($request); $upgrade->CheckActionPageUpdate($request); } - if (!$request->getArg('noplugin')) - $upgrade->CheckPluginUpdate($request); - if (!$request->getArg('noconfig')) + // if (!$request->getArg('noplugin')) { + // $upgrade->CheckPluginUpdate($request); + // } + if (!$request->getArg('noconfig')) { $upgrade->CheckConfigUpdate($request); + } // This is optional and should be linked. In EndLoadDump or PhpWikiAdministration? //if ($request->getArg('theme')) // $upgrade->CheckThemeUpdate($request); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-12-11 17:08:50
|
Revision: 8654 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8654&view=rev Author: vargenau Date: 2012-12-11 17:08:39 +0000 (Tue, 11 Dec 2012) Log Message: ----------- Less messages Modified Paths: -------------- trunk/lib/loadsave.php trunk/lib/plugin/WikiAdminChown.php trunk/lib/upgrade.php Modified: trunk/lib/loadsave.php =================================================================== --- trunk/lib/loadsave.php 2012-12-11 16:50:09 UTC (rev 8653) +++ trunk/lib/loadsave.php 2012-12-11 17:08:39 UTC (rev 8654) @@ -86,7 +86,7 @@ break; case 'dumphtml': case 'ziphtml': - $label = _("Dump pages as XHTML"); + $label = _("Dump Pages as XHTML"); break; } if ($label) $label = str_replace(" ", "_", $label); Modified: trunk/lib/plugin/WikiAdminChown.php =================================================================== --- trunk/lib/plugin/WikiAdminChown.php 2012-12-11 16:50:09 UTC (rev 8653) +++ trunk/lib/plugin/WikiAdminChown.php 2012-12-11 17:08:39 UTC (rev 8654) @@ -181,7 +181,7 @@ _("Are you sure you want to change the owner of the selected pages?")))); $header = $this->chownForm($header, $post_args); } else { - $button_label = _("Change owner of selected pages"); + $button_label = _("Change owner of selected pages."); $header->pushContent(HTML::legend(_("Select the pages to change the owner"))); $header = $this->chownForm($header, $post_args); } Modified: trunk/lib/upgrade.php =================================================================== --- trunk/lib/upgrade.php 2012-12-11 16:50:09 UTC (rev 8653) +++ trunk/lib/upgrade.php 2012-12-11 17:08:39 UTC (rev 8654) @@ -390,7 +390,7 @@ if ($this->isSQL) { $this->_db_init(); if (isset($dbadmin['cancel'])) { - echo _("CANCEL"), " <br />\n"; + echo _("Cancel"), " <br />\n"; return; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2013-03-20 21:10:11
|
Revision: 8735 http://sourceforge.net/p/phpwiki/code/8735 Author: vargenau Date: 2013-03-20 21:10:08 +0000 (Wed, 20 Mar 2013) Log Message: ----------- Remove unused variables Modified Paths: -------------- trunk/lib/editpage.php trunk/lib/plugin/CreatePage.php trunk/lib/plugin/Diff.php trunk/lib/plugin/HtmlConverter.php trunk/lib/plugin/PreferenceApp.php trunk/lib/plugin/RecentChanges.php trunk/lib/plugin/SemanticSearch.php trunk/lib/plugin/SemanticSearchAdvanced.php trunk/lib/plugin/SiteMap.php trunk/lib/plugin/SyncWiki.php trunk/lib/plugin/UserPreferences.php trunk/lib/plugin/VisualWiki.php trunk/lib/plugin/WikiAdminDeleteAcl.php trunk/lib/plugin/WikiAdminSelect.php trunk/lib/plugin/WikiAdminSetExternal.php trunk/lib/plugin/WikiFormRich.php Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2013-03-20 20:53:15 UTC (rev 8734) +++ trunk/lib/editpage.php 2013-03-20 21:10:08 UTC (rev 8735) @@ -69,7 +69,6 @@ function editPage() { - global $WikiTheme; $saveFailed = false; $tokens = &$this->tokens; $tokens['PAGE_LOCKED_MESSAGE'] = ''; Modified: trunk/lib/plugin/CreatePage.php =================================================================== --- trunk/lib/plugin/CreatePage.php 2013-03-20 20:53:15 UTC (rev 8734) +++ trunk/lib/plugin/CreatePage.php 2013-03-20 21:10:08 UTC (rev 8735) @@ -78,7 +78,6 @@ $msg = _("Do you really want to create the page “%s”?"); } if (isSubPage($s)) { - $main = subPageSlice(0); if (!$dbi->isWikiPage(subPageSlice(0))) { $msg .= "\n" . _("The new page you want to create will be a subpage.") . "\n" . _("Subpages cannot be created unless the parent page exists."); Modified: trunk/lib/plugin/Diff.php =================================================================== --- trunk/lib/plugin/Diff.php 2013-03-20 20:53:15 UTC (rev 8734) +++ trunk/lib/plugin/Diff.php 2013-03-20 21:10:08 UTC (rev 8735) @@ -128,7 +128,6 @@ $others = array('major', 'minor'); break; case 'minor': - $previous = 'minor'; $old = $page->getRevisionBefore($new); $old_version = _("previous revision"); $others = array('major', 'author'); Modified: trunk/lib/plugin/HtmlConverter.php =================================================================== --- trunk/lib/plugin/HtmlConverter.php 2013-03-20 20:53:15 UTC (rev 8734) +++ trunk/lib/plugin/HtmlConverter.php 2013-03-20 21:10:08 UTC (rev 8735) @@ -138,9 +138,6 @@ $file = file_get_contents($file_name); $file = html_entity_decode($file); - $ascii = '[\x00-\x7F]'; - $euc = '[\xA1-\xFE][\xA1-\xFE]'; - $this->_processA($file); $this->_processIMG($file); $this->_processUL($file); Modified: trunk/lib/plugin/PreferenceApp.php =================================================================== --- trunk/lib/plugin/PreferenceApp.php 2013-03-20 20:53:15 UTC (rev 8734) +++ trunk/lib/plugin/PreferenceApp.php 2013-03-20 21:10:08 UTC (rev 8735) @@ -93,7 +93,6 @@ $NEUTRAL_RATING = (int)$neutralRating; $active_user = $request->getUser(); - $active_userid = $active_user->_userid; $html = HTML(); $html->pushContent(""); Modified: trunk/lib/plugin/RecentChanges.php =================================================================== --- trunk/lib/plugin/RecentChanges.php 2013-03-20 20:53:15 UTC (rev 8734) +++ trunk/lib/plugin/RecentChanges.php 2013-03-20 21:10:08 UTC (rev 8735) @@ -620,7 +620,6 @@ function format_revision($rev) { - $args = &$this->_args; $class = 'rc-' . $this->importance($rev); $time = $this->time($rev); if (!$rev->get('is_minor_edit')) Modified: trunk/lib/plugin/SemanticSearch.php =================================================================== --- trunk/lib/plugin/SemanticSearch.php 2013-03-20 20:53:15 UTC (rev 8734) +++ trunk/lib/plugin/SemanticSearch.php 2013-03-20 21:10:08 UTC (rev 8735) @@ -446,8 +446,6 @@ function _getValue(&$page, $revision_handle) { - if (is_object($page)) $text = $page->getName(); - else $text = $page; $link = $this->_pagelist->_links[$this->current_row]; return WikiLink($link['linkname'], 'if_known'); } @@ -458,8 +456,6 @@ { function _getValue(&$page, $revision_handle) { - if (is_object($page)) $text = $page->getName(); - else $text = $page; $link = $this->_pagelist->_links[$this->current_row]; if ($this->_field != 'value') return WikiLink($link['linkvalue'], 'if_known'); Modified: trunk/lib/plugin/SemanticSearchAdvanced.php =================================================================== --- trunk/lib/plugin/SemanticSearchAdvanced.php 2013-03-20 20:53:15 UTC (rev 8734) +++ trunk/lib/plugin/SemanticSearchAdvanced.php 2013-03-20 21:10:08 UTC (rev 8735) @@ -85,7 +85,6 @@ function showForm(&$dbi, &$request, $args, $allrelations) { - global $WikiTheme; $action = $request->getPostURL(); $hiddenfield = HiddenInputs($request->getArgs(), '', array('action', 'page', 's')); @@ -132,8 +131,6 @@ function run($dbi, $argstr, &$request, $basepage) { - global $WikiTheme; - $this->_supported_operators = array(':=', '<', '<=', '>', '>=', '!=', '==', '=~'); $args = $this->getArgs($argstr, $request); $posted = $request->getArg('semsearch'); Modified: trunk/lib/plugin/SiteMap.php =================================================================== --- trunk/lib/plugin/SiteMap.php 2013-03-20 20:53:15 UTC (rev 8734) +++ trunk/lib/plugin/SiteMap.php 2013-03-20 21:10:08 UTC (rev 8735) @@ -167,7 +167,6 @@ $limit = '***'; } //Fixme: override given arg - $description = $this->getDescription(); if (!$noheader) { $out = $this->getDescription() . " " . sprintf(_("(max. recursion level: %d)"), $reclimit) . ":\n\n"; Modified: trunk/lib/plugin/SyncWiki.php =================================================================== --- trunk/lib/plugin/SyncWiki.php 2013-03-20 20:53:15 UTC (rev 8734) +++ trunk/lib/plugin/SyncWiki.php 2013-03-20 21:10:08 UTC (rev 8735) @@ -94,7 +94,6 @@ if (!function_exists('wiki_xmlrpc_post')) { include_once 'lib/XmlRpcClient.php'; } - $userid = $request->_user->_userid; $dbh = $request->getDbh(); $merge_point = $dbh->get('mergepoint'); if (empty($merge_point)) { Modified: trunk/lib/plugin/UserPreferences.php =================================================================== --- trunk/lib/plugin/UserPreferences.php 2013-03-20 20:53:15 UTC (rev 8734) +++ trunk/lib/plugin/UserPreferences.php 2013-03-20 21:10:08 UTC (rev 8735) @@ -48,7 +48,6 @@ function getDefaultArguments() { global $request; - $pagename = $request->getArg('pagename'); $user = $request->getUser(); if (isset($user->_prefs) and isset($user->_prefs->_prefs) and Modified: trunk/lib/plugin/VisualWiki.php =================================================================== --- trunk/lib/plugin/VisualWiki.php 2013-03-20 20:53:15 UTC (rev 8734) +++ trunk/lib/plugin/VisualWiki.php 2013-03-20 21:10:08 UTC (rev 8735) @@ -367,8 +367,6 @@ unset($allpages); $this->names = array_keys($pages); - $countpages = count($pages); - // now select each page matching to given parameters $all_selected = array_unique(array_merge( $this->findbest($recent_nb, 'age', true), @@ -388,8 +386,6 @@ unset($newpages); unset($all_selected); - $countpages = count($pages); - // remove dead links and collect links reset($pages); while (list($name, $page) = each($pages)) { @@ -438,7 +434,6 @@ $fillstring = ($fillnodes == 'on') ? 'style=filled,' : ''; - $ok = true; $names = &$this->names; $pages = &$this->pages; if ($names) Modified: trunk/lib/plugin/WikiAdminDeleteAcl.php =================================================================== --- trunk/lib/plugin/WikiAdminDeleteAcl.php 2013-03-20 20:53:15 UTC (rev 8734) +++ trunk/lib/plugin/WikiAdminDeleteAcl.php 2013-03-20 21:10:08 UTC (rev 8735) @@ -55,7 +55,6 @@ foreach ($pages as $pagename) { // check if unchanged? we need a deep array_equal $page = $dbi->getPage($pagename); - $oldperm = getPagePermissions($page); setPagePermissions($page, $perm); $result->setAttr('class', 'feedback'); $result->pushContent(HTML::p(fmt("ACL deleted for page “%s”", $pagename))); Modified: trunk/lib/plugin/WikiAdminSelect.php =================================================================== --- trunk/lib/plugin/WikiAdminSelect.php 2013-03-20 20:53:15 UTC (rev 8734) +++ trunk/lib/plugin/WikiAdminSelect.php 2013-03-20 21:10:08 UTC (rev 8735) @@ -125,11 +125,6 @@ $info = $args['info']; - // array_multisort($this->_list, SORT_NUMERIC, SORT_DESC); - $pagename = $request->getArg('pagename'); - // GetUrlToSelf() with all given params - //$uri = $GLOBALS['HTTP_SERVER_VARS']['REQUEST_URI']; // without s would be better. - //$uri = $request->getURLtoSelf();//false, array('verify')); $form = HTML::form(array('action' => $request->getPostURL(), 'method' => 'post')); if ($request->getArg('WikiAdminSelect') == _("Go")) $p = false; Modified: trunk/lib/plugin/WikiAdminSetExternal.php =================================================================== --- trunk/lib/plugin/WikiAdminSetExternal.php 2013-03-20 20:53:15 UTC (rev 8734) +++ trunk/lib/plugin/WikiAdminSetExternal.php 2013-03-20 21:10:08 UTC (rev 8735) @@ -70,7 +70,6 @@ $result->pushContent(HTML::p(fmt("Access denied to change page “%s”.", WikiLink($name)))); } else { - $version = $current->getVersion(); $page->set('external', (bool)1); $ul->pushContent(HTML::li(fmt("change page “%s” to external.", WikiLink($name)))); $count++; Modified: trunk/lib/plugin/WikiFormRich.php =================================================================== --- trunk/lib/plugin/WikiFormRich.php 2013-03-20 20:53:15 UTC (rev 8734) +++ trunk/lib/plugin/WikiFormRich.php 2013-03-20 21:10:08 UTC (rev 8735) @@ -127,7 +127,6 @@ // no editbox[] = array(...) allowed (space) $arg_array = preg_split("/\n/", $argstr); // for security we should check this better - $arg = ''; for ($i = 0; $i < count($arg_array); $i++) { //TODO: we require an name=value pair here, but submit may go without also. if (preg_match("/^\s*(" . join("|", $allowed) . ")\[\](.*)$/", $arg_array[$i], $m)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2013-05-29 07:32:10
|
Revision: 8789 http://sourceforge.net/p/phpwiki/code/8789 Author: vargenau Date: 2013-05-29 07:32:07 +0000 (Wed, 29 May 2013) Log Message: ----------- var --> public Modified Paths: -------------- trunk/lib/AtomParser.php trunk/lib/BlockParser.php trunk/lib/DbSession/ADODB.php trunk/lib/DbSession/PDO.php trunk/lib/DbSession/SQL.php trunk/lib/DbSession/dba.php trunk/lib/ErrorManager.php trunk/lib/ExternalReferrer.php trunk/lib/FileFinder.php trunk/lib/Google.php trunk/lib/HtmlParser.php trunk/lib/HttpClient.php trunk/lib/InlineParser.php trunk/lib/PageList.php trunk/lib/PagePerm.php trunk/lib/PageType.php trunk/lib/Request.php trunk/lib/RssParser.php trunk/lib/SemanticWeb.php trunk/lib/TextSearchQuery.php trunk/lib/WikiDB/backend/ADODB_oci8po.php trunk/lib/WikiDB/backend/PearDB.php trunk/lib/WikiDB/backend/cvs.php trunk/lib/WikiDB/backend/file.php trunk/lib/WikiDB/cvs.php trunk/lib/WikiDB.php trunk/lib/WikiGroup.php trunk/lib/WikiPlugin.php trunk/lib/WikiPluginCached.php trunk/lib/WikiTheme.php trunk/lib/WikiUser/AdoDb.php trunk/lib/WikiUser/BogoLogin.php trunk/lib/WikiUser/Db.php trunk/lib/WikiUser/File.php trunk/lib/WikiUser/FusionForge.php trunk/lib/WikiUser/PdoDb.php trunk/lib/WikiUser/PearDb.php trunk/lib/WikiUser/PersonalPage.php trunk/lib/WikiUser.php trunk/lib/WikiUserNew.php trunk/lib/WysiwygEdit.php trunk/lib/XmlParser.php trunk/lib/diff3.php trunk/lib/difflib.php trunk/lib/main.php trunk/lib/plugin/PageDump.php trunk/lib/plugin/PageTrail.php trunk/lib/plugin/RateIt.php trunk/lib/plugin/RecentChanges.php trunk/lib/plugin/SiteMap.php trunk/lib/plugin/SqlResult.php trunk/lib/plugin/TeX2png.php trunk/lib/plugin/UpLoad.php trunk/lib/plugin/UserPreferences.php trunk/lib/plugin/WikiPoll.php trunk/lib/stdlib.php trunk/lib/upgrade.php trunk/lib/wikilens/CustomPrefs.php trunk/lib/wikilens/PageListColumns.php trunk/lib/wikilens/RatingsUser.php Modified: trunk/lib/AtomParser.php =================================================================== --- trunk/lib/AtomParser.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/AtomParser.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -31,41 +31,41 @@ extends XmlParser { // Feed - var $feed = array(); - var $feed_title = ''; - var $feed_links = array(); - var $feed_subtitle = ''; - var $feed_id = ''; - var $feed_updated = ''; - var $feed_authors = array(); - var $feed_contributors = array(); - var $generator = ''; - var $icon = ''; - var $rights = ''; - var $logo = ''; + public $feed = array(); + public $feed_title = ''; + public $feed_links = array(); + public $feed_subtitle = ''; + public $feed_id = ''; + public $feed_updated = ''; + public $feed_authors = array(); + public $feed_contributors = array(); + public $generator = ''; + public $icon = ''; + public $rights = ''; + public $logo = ''; - var $categories = array(); + public $categories = array(); - var $authors = array(); - var $contributors = array(); + public $authors = array(); + public $contributors = array(); // Author, Contributor - var $name = ''; - var $email = ''; - var $uri = ''; + public $name = ''; + public $email = ''; + public $uri = ''; // Entries - var $entries = array(); - var $inside_entry = false; - var $title = ''; - var $updated = ''; - var $published = ''; - var $id = ''; - var $links = array(); - var $summary = ''; + public $entries = array(); + public $inside_entry = false; + public $title = ''; + public $updated = ''; + public $published = ''; + public $id = ''; + public $links = array(); + public $summary = ''; - var $inside_content = false; - var $content = ''; + public $inside_content = false; + public $content = ''; function tag_open($parser, $name, $attrs = '') { Modified: trunk/lib/BlockParser.php =================================================================== --- trunk/lib/BlockParser.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/BlockParser.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -54,17 +54,17 @@ /** * The matched text. */ - var $match; + public $match; /** * The text following the matched text. */ - var $postmatch; + public $postmatch; /** * Index of the regular expression which matched. */ - var $regexp_ind; + public $regexp_ind; } /** @@ -504,7 +504,7 @@ class BlockMarkup { - var $_re; + public $_re; function _match(&$input, $match) { @@ -528,8 +528,8 @@ class Block_blockquote extends BlockMarkup { - var $_depth; - var $_re = '\ +(?=\S)'; + public $_depth; + public $_re = '\ +(?=\S)'; function _match(&$input, $m) { @@ -555,15 +555,15 @@ class Block_list extends BlockMarkup { - //var $_tag = 'ol' or 'ul'; - var $_re = '\ {0,4} + //public $_tag = 'ol' or 'ul'; + public $_re = '\ {0,4} (?: \+ | \\#\ (?!\[.*\]) | -(?!-) | [o](?=\ ) | [*]\ (?!(?=\S)[^*]*(?<=\S)[*](?:\\s|[-)}>"\'\\/:.,;!?_*=]) ) )\ *(?=\S)'; - var $_content = array(); + public $_content = array(); function _match(&$input, $m) { @@ -610,7 +610,7 @@ class Block_dl extends Block_list { - var $_tag = 'dl'; + public $_tag = 'dl'; function Block_dl() { @@ -663,8 +663,8 @@ class Block_table_dl_defn extends XmlContent { - var $nrows; - var $ncols; + public $nrows; + public $ncols; function Block_table_dl_defn($term, $defn) { @@ -816,7 +816,7 @@ class Block_table_dl extends Block_dl { - var $_tag = 'dl-table'; // phony. + public $_tag = 'dl-table'; // phony. function Block_table_dl() { @@ -860,8 +860,8 @@ class Block_oldlists extends Block_list { - //var $_tag = 'ol', 'ul', or 'dl'; - var $_re = '(?: [*]\ (?!(?=\S)[^*]*(?<=\S)[*](?:\\s|[-)}>"\'\\/:.,;!?_*=])) + //public $_tag = 'ol', 'ul', or 'dl'; + public $_re = '(?: [*]\ (?!(?=\S)[^*]*(?<=\S)[*](?:\\s|[-)}>"\'\\/:.,;!?_*=])) | [#]\ (?! \[ .*? \] ) | ; .*? : ) .*? (?=\S)'; @@ -915,7 +915,7 @@ class Block_pre extends BlockMarkup { - var $_re = '<(?:pre|verbatim|nowiki|noinclude)>'; + public $_re = '<(?:pre|verbatim|nowiki|noinclude)>'; function _match(&$input, $m) { @@ -960,7 +960,7 @@ // <<<placeholder>>> class Block_placeholder extends BlockMarkup { - var $_re = '<<<'; + public $_re = '<<<'; function _match(&$input, $m) { @@ -987,7 +987,7 @@ class Block_nowiki_wikicreole extends BlockMarkup { - var $_re = '{{{'; + public $_re = '{{{'; function _match(&$input, $m) { @@ -1013,7 +1013,7 @@ class Block_plugin extends Block_pre { - var $_re = '<\?plugin(?:-form)?(?!\S)'; + public $_re = '<\?plugin(?:-form)?(?!\S)'; // FIXME: /* <?plugin Backlinks @@ -1043,8 +1043,8 @@ class Block_plugin_wikicreole extends Block_pre { - // var $_re = '<<(?!\S)'; - var $_re = '<<'; + // public $_re = '<<(?!\S)'; + public $_re = '<<'; function _match(&$input, $m) { @@ -1072,7 +1072,7 @@ class Block_table_wikicreole extends Block_pre { - var $_re = '\s*\|'; + public $_re = '\s*\|'; function _match(&$input, $m) { @@ -1113,7 +1113,7 @@ */ class Block_table_mediawiki extends Block_pre { - var $_re = '{\|'; + public $_re = '{\|'; function _match(&$input, $m) { @@ -1148,7 +1148,7 @@ */ class Block_template_plugin extends Block_pre { - var $_re = '{{'; + public $_re = '{{'; function _match(&$input, $m) { @@ -1226,8 +1226,8 @@ class Block_email_blockquote extends BlockMarkup { - var $_attr = array('class' => 'mail-style-quote'); - var $_re = '>\ ?'; + public $_attr = array('class' => 'mail-style-quote'); + public $_re = '>\ ?'; function _match(&$input, $m) { @@ -1241,8 +1241,8 @@ class Block_wikicreole_indented extends BlockMarkup { - var $_attr = array('style' => 'margin-left:2em'); - var $_re = ':\ ?'; + public $_attr = array('style' => 'margin-left:2em'); + public $_re = ':\ ?'; function _match(&$input, $m) { @@ -1255,7 +1255,7 @@ class Block_hr extends BlockMarkup { - var $_re = '-{4,}\s*$'; + public $_re = '-{4,}\s*$'; function _match(&$input, $m) { @@ -1267,7 +1267,7 @@ class Block_heading extends BlockMarkup { - var $_re = '!{1,3}'; + public $_re = '!{1,3}'; function _match(&$input, $m) { @@ -1283,7 +1283,7 @@ class Block_heading_wikicreole extends BlockMarkup { - var $_re = '={2,6}'; + public $_re = '={2,6}'; function _match(&$input, $m) { @@ -1303,9 +1303,9 @@ class Block_p extends BlockMarkup { - var $_tag = 'p'; - var $_re = '\S.*'; - var $_text = ''; + public $_tag = 'p'; + public $_re = '\S.*'; + public $_text = ''; function _match(&$input, $m) { @@ -1342,7 +1342,7 @@ class Block_divspan extends BlockMarkup { - var $_re = '<(?im)(?: div|span)(?:[^>]*)?>'; + public $_re = '<(?im)(?: div|span)(?:[^>]*)?>'; function _match(&$input, $m) { Modified: trunk/lib/DbSession/ADODB.php =================================================================== --- trunk/lib/DbSession/ADODB.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/DbSession/ADODB.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -27,7 +27,7 @@ class DbSession_ADODB extends DbSession { - var $_backend_type = "ADODB"; + public $_backend_type = "ADODB"; function DbSession_ADODB($dbh, $table) { Modified: trunk/lib/DbSession/PDO.php =================================================================== --- trunk/lib/DbSession/PDO.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/DbSession/PDO.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -8,7 +8,7 @@ class DbSession_PDO extends DbSession { - var $_backend_type = "PDO"; + public $_backend_type = "PDO"; function DbSession_PDO($dbh, $table) { Modified: trunk/lib/DbSession/SQL.php =================================================================== --- trunk/lib/DbSession/SQL.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/DbSession/SQL.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -13,7 +13,7 @@ class DbSession_SQL extends DbSession { - var $_backend_type = "SQL"; + public $_backend_type = "SQL"; function DbSession_SQL(&$dbh, $table) { Modified: trunk/lib/DbSession/dba.php =================================================================== --- trunk/lib/DbSession/dba.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/DbSession/dba.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -13,7 +13,7 @@ class DbSession_dba extends DbSession { - var $_backend_type = "dba"; + public $_backend_type = "dba"; function DbSession_dba(&$dbh, $table) { Modified: trunk/lib/ErrorManager.php =================================================================== --- trunk/lib/ErrorManager.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/ErrorManager.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -412,22 +412,22 @@ /** * The PHP errno */ - //var $errno; + public $errno; /** * The PHP error message. */ - //var $errstr; + public $errstr; /** * The source file where the error occurred. */ - //var $errfile; + public $errfile; /** * The line number (in $this->errfile) where the error occured. */ - //var $errline; + public $errline; /** * Construct a new PhpError. Modified: trunk/lib/ExternalReferrer.php =================================================================== --- trunk/lib/ExternalReferrer.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/ExternalReferrer.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -24,7 +24,7 @@ class SearchEngines { - var $searchEngines = + public $searchEngines = array( "search.sli.sympatico.ca/" => array("engine" => "Sympatico", "query1" => "query=", "query2" => "", "url" => "http://www1.sympatico.ca/"), "www.search123.com/cgi-bin/" => array("engine" => "Search123", "query1" => "query=", "query2" => "", "url" => "http://www.search123.com/"), Modified: trunk/lib/FileFinder.php =================================================================== --- trunk/lib/FileFinder.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/FileFinder.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -13,7 +13,7 @@ */ class FileFinder { - //var $_pathsep, $_path; + public $_pathsep, $_path; /** * Constructor. Modified: trunk/lib/Google.php =================================================================== --- trunk/lib/Google.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/Google.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -86,8 +86,8 @@ class GoogleSearchResults { - var $_fields = "documentFiltering,searchComments,estimatedTotalResultsCount,estimateIsExact,searchQuery,startIndex,endIndex,searchTips,directoryCategories,searchTime,resultElements"; - var $resultElements, $results; + public $_fields = "documentFiltering,searchComments,estimatedTotalResultsCount,estimateIsExact,searchQuery,startIndex,endIndex,searchTips,directoryCategories,searchTime,resultElements"; + public $resultElements, $results; function GoogleSearchResults($result) { @@ -145,7 +145,7 @@ */ class GoogleSearchResult { - var $_fields = "summary,URL,snippet,title,cachedSize,relatedInformationPresent,hostName,directoryCategory,directoryTitle"; + public $_fields = "summary,URL,snippet,title,cachedSize,relatedInformationPresent,hostName,directoryCategory,directoryTitle"; function GoogleSearchResult($result) { Modified: trunk/lib/HtmlParser.php =================================================================== --- trunk/lib/HtmlParser.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/HtmlParser.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -43,7 +43,7 @@ class HtmlParser extends XmlParser { - var $dialect, $_handlers, $root; + public $dialect, $_handlers, $root; /** * dialect: "PhpWiki2", "PhpWiki" Modified: trunk/lib/HttpClient.php =================================================================== --- trunk/lib/HttpClient.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/HttpClient.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -14,40 +14,40 @@ class HttpClient { // Request vars - var $host; - var $port; - var $path; - var $method; - var $postdata = ''; - var $cookies = array(); - var $referer; - var $accept = 'text/xml,application/xml,application/xhtml+xml,text/html,text/plain,image/png,image/jpeg,image/gif,*/*'; - var $accept_encoding = 'gzip'; - var $accept_language = 'en-us'; - var $user_agent = 'Incutio HttpClient v1.0'; - var $boundary = "xYzZY"; // FIXME: check if this string doesn't occur in the data + public $host; + public $port; + public $path; + public $method; + public $postdata = ''; + public $cookies = array(); + public $referer; + public $accept = 'text/xml,application/xml,application/xhtml+xml,text/html,text/plain,image/png,image/jpeg,image/gif,*/*'; + public $accept_encoding = 'gzip'; + public $accept_language = 'en-us'; + public $user_agent = 'Incutio HttpClient v1.0'; + public $boundary = "xYzZY"; // FIXME: check if this string doesn't occur in the data // Options - var $timeout = 10; - var $use_gzip = true; - var $persist_cookies = true; // If true, received cookies are placed in the $this->cookies array ready for the next request + public $timeout = 10; + public $use_gzip = true; + public $persist_cookies = true; // If true, received cookies are placed in the $this->cookies array ready for the next request // Note: This currently ignores the cookie path (and time) completely. Time is not important, // but path could possibly lead to security problems. - var $persist_referers = true; // For each request, sends path of last request as referer - var $debug = false; - var $handle_redirects = true; // Auaomtically redirect if Location or URI header is found - var $max_redirects = 5; - var $headers_only = false; // If true, stops receiving once headers have been read. + public $persist_referers = true; // For each request, sends path of last request as referer + public $debug = false; + public $handle_redirects = true; // Auaomtically redirect if Location or URI header is found + public $max_redirects = 5; + public $headers_only = false; // If true, stops receiving once headers have been read. // Basic authorization variables - var $username; - var $password; + public $username; + public $password; // Response vars - var $status; - var $headers = array(); - var $content = ''; - var $errormsg; + public $status; + public $headers = array(); + public $content = ''; + public $errormsg; // Tracker variables - var $redirect_count = 0; - var $cookie_host = ''; + public $redirect_count = 0; + public $cookie_host = ''; function HttpClient($host = 'localhost', $port = 80) { Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/InlineParser.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -57,19 +57,19 @@ /** * The text leading up the the next match. */ - var $prematch; + public $prematch; /** * The matched text. */ - var $match; + public $match; /** * The text following the matched text. */ - var $postmatch; + public $postmatch; /** * Index of the regular expression which matched. */ - var $regexp_ind; + public $regexp_ind; } /** @@ -237,7 +237,7 @@ */ class SimpleMarkup { - var $_match_regexp; + public $_match_regexp; /** Get regexp. * @@ -268,7 +268,7 @@ */ class BalancedMarkup { - var $_start_regexp; + public $_start_regexp; /** Get the starting regexp for this rule. * @@ -521,7 +521,7 @@ class Markup_wikicreolebracketlink extends SimpleMarkup { - var $_match_regexp = "\\#? \\[\\[ .*? [^]\\s] .*? \\]\\]"; + public $_match_regexp = "\\#? \\[\\[ .*? [^]\\s] .*? \\]\\]"; function markup($match) { @@ -533,7 +533,7 @@ class Markup_bracketlink extends SimpleMarkup { - var $_match_regexp = "\\#? \\[ .*? [^]\\s] .*? \\]"; + public $_match_regexp = "\\#? \\[ .*? [^]\\s] .*? \\]"; function markup($match) { @@ -621,7 +621,7 @@ // For :: (relations) only words, no comma, // but for := (attributes) comma and dots are allowed. Units with groupsep. // Ending dots or comma are not part of the link. - var $_match_regexp = "(?: \w+:=\S+(?<![\.,]))|(?: \w+::[\w\.]+(?<!\.))"; + public $_match_regexp = "(?: \w+:=\S+(?<![\.,]))|(?: \w+::[\w\.]+(?<!\.))"; function markup($match) { @@ -670,7 +670,7 @@ class Markup_linebreak extends SimpleMarkup { - var $_match_regexp = "(?: (?<! %) %%% (?! %) | \\\\\\\\ | <\s*(?:br|BR)\s*> | <\s*(?:br|BR)\s*\/\s*> )"; + public $_match_regexp = "(?: (?<! %) %%% (?! %) | \\\\\\\\ | <\s*(?:br|BR)\s*> | <\s*(?:br|BR)\s*\/\s*> )"; function markup($match) { @@ -680,7 +680,7 @@ class Markup_wikicreole_italics extends BalancedMarkup { - var $_start_regexp = "\\/\\/"; + public $_start_regexp = "\\/\\/"; function getEndRegexp($match) { @@ -696,7 +696,7 @@ class Markup_wikicreole_bold extends BalancedMarkup { - var $_start_regexp = "\\*\\*"; + public $_start_regexp = "\\*\\*"; function getEndRegexp($match) { @@ -712,7 +712,7 @@ class Markup_wikicreole_monospace extends BalancedMarkup { - var $_start_regexp = "\\#\\#"; + public $_start_regexp = "\\#\\#"; function getEndRegexp($match) { @@ -727,7 +727,7 @@ class Markup_wikicreole_underline extends BalancedMarkup { - var $_start_regexp = "\\_\\_"; + public $_start_regexp = "\\_\\_"; function getEndRegexp($match) { @@ -743,7 +743,7 @@ class Markup_wikicreole_superscript extends BalancedMarkup { - var $_start_regexp = "\\^\\^"; + public $_start_regexp = "\\^\\^"; function getEndRegexp($match) { @@ -759,7 +759,7 @@ class Markup_wikicreole_subscript extends BalancedMarkup { - var $_start_regexp = ",,"; + public $_start_regexp = ",,"; function getEndRegexp($match) { @@ -775,7 +775,7 @@ class Markup_old_emphasis extends BalancedMarkup { - var $_start_regexp = "''"; + public $_start_regexp = "''"; function getEndRegexp($match) { @@ -850,7 +850,7 @@ class Markup_html_emphasis extends BalancedMarkup { - var $_start_regexp = + public $_start_regexp = "<(?: b|big|i|small|tt|em|strong|cite|code|dfn|kbd|samp|s|strike|del|var|sup|sub )>"; function getEndRegexp($match) @@ -867,7 +867,7 @@ class Markup_html_divspan extends BalancedMarkup { - var $_start_regexp = + public $_start_regexp = "<(?: div|span )(?: \s[^>]*)?>"; function getEndRegexp($match) @@ -899,7 +899,7 @@ { //rurban: abbr|acronym need an optional title tag. //sf.net bug #728595 - var $_start_regexp = "<(?: abbr|acronym )(?: [^>]*)?>"; + public $_start_regexp = "<(?: abbr|acronym )(?: [^>]*)?>"; function getEndRegexp($match) { @@ -936,8 +936,8 @@ class Markup_color extends BalancedMarkup { // %color=blue% blue text %% and back to normal - var $_start_regexp = "%color=(?: [^%]*)%"; - var $_end_regexp = "%%"; + public $_start_regexp = "%color=(?: [^%]*)%"; + public $_end_regexp = "%%"; function markup($match, $body) { @@ -984,7 +984,7 @@ // <<<placeholder>>> class Markup_placeholder extends SimpleMarkup { - var $_match_regexp = '<<<.*?>>>'; + public $_match_regexp = '<<<.*?>>>'; function markup($match) { @@ -996,7 +996,7 @@ // <!-- This is a comment --> class Markup_html_comment extends SimpleMarkup { - var $_match_regexp = '<!--.*?-->'; + public $_match_regexp = '<!--.*?-->'; function markup($match) { @@ -1008,7 +1008,7 @@ // like: '<small>< ?plugin PopularNearby ? ></small>' class Markup_plugin extends SimpleMarkup { - var $_match_regexp = '<\?plugin(?:-form)?\s[^\n]+?\?>'; + public $_match_regexp = '<\?plugin(?:-form)?\s[^\n]+?\?>'; function markup($match) { @@ -1019,7 +1019,7 @@ // Special version for single-line Wikicreole plugins formatting. class Markup_plugin_wikicreole extends SimpleMarkup { - var $_match_regexp = '<<[^\n]+?>>'; + public $_match_regexp = '<<[^\n]+?>>'; function markup($match) { @@ -1034,7 +1034,7 @@ // PLUGIN_MARKUP_MAP = "html:RawHtml dot:GraphViz toc:CreateToc amath:AsciiMath richtable:RichTable include:IncludePage tex:TexToPng" class Markup_xml_plugin extends BalancedMarkup { - //var $_start_regexp = "<(?: ".join('|',PLUGIN_MARKUP_MAP)." )(?: \s[^>]*)>"; + //public $_start_regexp = "<(?: ".join('|',PLUGIN_MARKUP_MAP)." )(?: \s[^>]*)>"; function getStartRegexp() { @@ -1076,7 +1076,7 @@ */ class Markup_nowiki extends SimpleMarkup { - var $_match_regexp = '<nowiki>.*?<\/nowiki>'; + public $_match_regexp = '<nowiki>.*?<\/nowiki>'; function markup($match) { @@ -1092,7 +1092,7 @@ */ class Markup_wikicreole_preformatted extends SimpleMarkup { - var $_match_regexp = '\{\{\{.*?\}\}\}'; + public $_match_regexp = '\{\{\{.*?\}\}\}'; function markup($match) { @@ -1116,7 +1116,7 @@ class Markup_template_plugin extends SimpleMarkup { // patch #1732793: allow \n, mult. {{ }} in one line, and single letters - var $_match_regexp = '\{\{.*?\}\}'; + public $_match_regexp = '\{\{.*?\}\}'; function markup($match) { @@ -1213,7 +1213,7 @@ class Markup_html_entities extends SimpleMarkup { - //var $_match_regexp = '(: \.\.\.|\-\-|\-\-\-|\(C\) )'; + //public $_match_regexp = '(: \.\.\.|\-\-|\-\-\-|\(C\) )'; function Markup_html_entities() { @@ -1238,7 +1238,7 @@ class Markup_isonumchars extends SimpleMarkup { - var $_match_regexp = '\&\#\d{2,5};'; + public $_match_regexp = '\&\#\d{2,5};'; function markup($match) { @@ -1249,7 +1249,7 @@ class Markup_isohexchars extends SimpleMarkup { // hexnums, like ¤ <=> ¤ - var $_match_regexp = '\&\#x[0-9a-fA-F]{2,4};'; + public $_match_regexp = '\&\#x[0-9a-fA-F]{2,4};'; function markup($match) { @@ -1261,8 +1261,8 @@ class InlineTransformer { - var $_regexps = array(); - var $_markup = array(); + public $_regexps = array(); + public $_markup = array(); function InlineTransformer($markup_types = false) { Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/PageList.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -50,7 +50,7 @@ */ class _PageList_Column_base { - var $_tdattr = array(); + public $_tdattr = array(); function _PageList_Column_base($default_heading, $align = false) { @@ -532,7 +532,7 @@ class _PageList_Column_pagename extends _PageList_Column_base { - var $_field = 'pagename'; + public $_field = 'pagename'; function _PageList_Column_pagename() { @@ -598,18 +598,18 @@ class PageList { - var $_group_rows = 3; - var $_columns = array(); - var $_columnsMap = array(); // Maps column name to column number. - var $_excluded_pages = array(); - var $_pages = array(); - var $_caption = ""; - var $_pagename_seen = false; - var $_types = array(); - var $_options = array(); - var $_selected = array(); - var $_sortby = array(); - var $_maxlen = 0; + public $_group_rows = 3; + public $_columns = array(); + public $_columnsMap = array(); // Maps column name to column number. + public $_excluded_pages = array(); + public $_pages = array(); + public $_caption = ""; + public $_pagename_seen = false; + public $_types = array(); + public $_options = array(); + public $_selected = array(); + public $_sortby = array(); + public $_maxlen = 0; function PageList($columns = false, $exclude = false, $options = false) { Modified: trunk/lib/PagePerm.php =================================================================== --- trunk/lib/PagePerm.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/PagePerm.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -353,7 +353,7 @@ */ class PagePermission { - var $perm; + public $perm; function PagePermission($hash = array()) { Modified: trunk/lib/PageType.php =================================================================== --- trunk/lib/PageType.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/PageType.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -465,7 +465,7 @@ // abstract base class class PageFormatter_attach extends PageFormatter { - var $type, $prefix; + public $type, $prefix; // Display templated contents for wikiblog, comment and wikiforum function format($text) @@ -491,17 +491,17 @@ class PageFormatter_wikiblog extends PageFormatter_attach { - var $type = 'wikiblog', $prefix = "BLOG"; + public $type = 'wikiblog', $prefix = "BLOG"; } class PageFormatter_comment extends PageFormatter_attach { - var $type = 'comment', $prefix = "COMMENT"; + public $type = 'comment', $prefix = "COMMENT"; } class PageFormatter_wikiforum extends PageFormatter_attach { - var $type = 'wikiforum', $prefix = "FORUM"; + public $type = 'wikiforum', $prefix = "FORUM"; } /** wikiabuse for htmlarea editing. not yet used. Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/Request.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -22,7 +22,7 @@ class Request { - var $args = array(); + public $args = array(); function Request() { Modified: trunk/lib/RssParser.php =================================================================== --- trunk/lib/RssParser.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/RssParser.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -45,18 +45,18 @@ extends XmlParser { - var $title = ""; - var $author = ""; - var $pubDate = ""; - var $link = ""; - var $description = ""; - var $inside_item = false; - var $list_items = false; - var $item = array(); - var $items; - var $channel; - var $divers = ""; - var $date = ""; + public $title = ""; + public $author = ""; + public $pubDate = ""; + public $link = ""; + public $description = ""; + public $inside_item = false; + public $list_items = false; + public $item = array(); + public $items; + public $channel; + public $divers = ""; + public $date = ""; function tag_open($parser, $name, $attrs = '') { Modified: trunk/lib/SemanticWeb.php =================================================================== --- trunk/lib/SemanticWeb.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/SemanticWeb.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -286,7 +286,7 @@ extends NumericSearchQuery { /* - var $base_units = array('m' => explode(',','km,miles,cm,dm,mm,ft,inch,inches,meter'), + public $base_units = array('m' => explode(',','km,miles,cm,dm,mm,ft,inch,inches,meter'), 'm^2' => explode(',','km^2,ha,cm^2,mi^2'), 'm^3' => explode(',','km^3,lit,cm^3,dm^3,gallons'), ); Modified: trunk/lib/TextSearchQuery.php =================================================================== --- trunk/lib/TextSearchQuery.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/TextSearchQuery.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -670,8 +670,8 @@ */ class TextSearchQuery_node { - var $op = 'VOID'; - var $_op = 0; + public $op = 'VOID'; + public $_op = 0; /** * Optimize this node. @@ -718,8 +718,8 @@ class TextSearchQuery_node_word extends TextSearchQuery_node { - var $op = "WORD"; - var $_op = TSQ_TOK_WORD; + public $op = "WORD"; + public $_op = TSQ_TOK_WORD; function TextSearchQuery_node_word($word) { @@ -745,8 +745,8 @@ class TextSearchQuery_node_all extends TextSearchQuery_node { - var $op = "ALL"; - var $_op = TSQ_TOK_ALL; + public $op = "ALL"; + public $_op = TSQ_TOK_ALL; function regexp() { @@ -762,8 +762,8 @@ class TextSearchQuery_node_starts_with extends TextSearchQuery_node_word { - var $op = "STARTS_WITH"; - var $_op = TSQ_TOK_STARTS_WITH; + public $op = "STARTS_WITH"; + public $_op = TSQ_TOK_STARTS_WITH; function regexp() { @@ -789,8 +789,8 @@ class TextSearchQuery_node_ends_with extends TextSearchQuery_node_word { - var $op = "ENDS_WITH"; - var $_op = TSQ_TOK_ENDS_WITH; + public $op = "ENDS_WITH"; + public $_op = TSQ_TOK_ENDS_WITH; function regexp() { @@ -816,8 +816,8 @@ class TextSearchQuery_node_exact extends TextSearchQuery_node_word { - var $op = "EXACT"; - var $_op = TSQ_TOK_EXACT; + public $op = "EXACT"; + public $_op = TSQ_TOK_EXACT; function regexp() { @@ -833,8 +833,8 @@ class TextSearchQuery_node_regex // posix regex. FIXME! extends TextSearchQuery_node_word { - var $op = "REGEX"; // using REGEXP or ~ extension - var $_op = TSQ_TOK_REGEX; + public $op = "REGEX"; // using REGEXP or ~ extension + public $_op = TSQ_TOK_REGEX; function regexp() { @@ -850,8 +850,8 @@ class TextSearchQuery_node_regex_glob extends TextSearchQuery_node_regex { - var $op = "REGEX_GLOB"; - var $_op = TSQ_TOK_REGEX_GLOB; + public $op = "REGEX_GLOB"; + public $_op = TSQ_TOK_REGEX_GLOB; function regexp() { @@ -862,8 +862,8 @@ class TextSearchQuery_node_regex_pcre // how to handle pcre modifiers? /i extends TextSearchQuery_node_regex { - var $op = "REGEX_PCRE"; - var $_op = TSQ_TOK_REGEX_PCRE; + public $op = "REGEX_PCRE"; + public $_op = TSQ_TOK_REGEX_PCRE; function regexp() { @@ -874,8 +874,8 @@ class TextSearchQuery_node_regex_sql extends TextSearchQuery_node_regex { - var $op = "REGEX_SQL"; // using LIKE - var $_op = TSQ_TOK_REGEX_SQL; + public $op = "REGEX_SQL"; // using LIKE + public $_op = TSQ_TOK_REGEX_SQL; function regexp() { @@ -894,8 +894,8 @@ class TextSearchQuery_node_not extends TextSearchQuery_node { - var $op = "NOT"; - var $_op = TSQ_TOK_NOT; + public $op = "NOT"; + public $_op = TSQ_TOK_NOT; function TextSearchQuery_node_not($leaf) { @@ -929,7 +929,7 @@ class TextSearchQuery_node_binop extends TextSearchQuery_node { - var $_op = TSQ_TOK_BINOP; + public $_op = TSQ_TOK_BINOP; function TextSearchQuery_node_binop($leaves) { @@ -976,7 +976,7 @@ class TextSearchQuery_node_and extends TextSearchQuery_node_binop { - var $op = "AND"; + public $op = "AND"; function optimize() { @@ -1028,7 +1028,7 @@ class TextSearchQuery_node_or extends TextSearchQuery_node_binop { - var $op = "OR"; + public $op = "OR"; function regexp() { Modified: trunk/lib/WikiDB/backend/ADODB_oci8po.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_oci8po.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/WikiDB/backend/ADODB_oci8po.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -10,7 +10,7 @@ class WikiDB_backend_ADODB_oci8po extends WikiDB_backend_ADODB { - var $_prefix; + public $_prefix; /** * Constructor. Modified: trunk/lib/WikiDB/backend/PearDB.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/WikiDB/backend/PearDB.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -5,7 +5,7 @@ class WikiDB_backend_PearDB extends WikiDB_backend { - var $_dbh; + public $_dbh; function WikiDB_backend_PearDB($dbparams) { Modified: trunk/lib/WikiDB/backend/cvs.php =================================================================== --- trunk/lib/WikiDB/backend/cvs.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/WikiDB/backend/cvs.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -39,10 +39,10 @@ class WikiDB_backend_cvs extends WikiDB_backend { - var $_docDir; - var $_repository; - var $_module_name; - var $_debug_file; + public $_docDir; + public $_repository; + public $_module_name; + public $_debug_file; /** * In the following parameters should be defined in dbparam: @@ -924,7 +924,7 @@ class Cvs_Backend_Array_Iterator extends WikiDB_backend_iterator { - var $_array; + public $_array; function Cvs_Backend_Iterator($arrayValue = Array()) { @@ -953,8 +953,8 @@ class Cvs_Backend_Full_Search_Iterator extends Cvs_Backend_Array_Iterator { - var $_searchString = ''; - var $_docDir = ""; + public $_searchString = ''; + public $_docDir = ""; function Cvs_Backend_Title_Search_Iterator($arrayValue = Array(), $searchString = "", @@ -1000,7 +1000,7 @@ class Cvs_Backend_Title_Search_Iterator extends Cvs_Backend_Array_Iterator { - var $_searchString = ''; + public $_searchString = ''; function Cvs_Backend_Title_Search_Iterator($arrayValue = Array(), $searchString = "") Modified: trunk/lib/WikiDB/backend/file.php =================================================================== --- trunk/lib/WikiDB/backend/file.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/WikiDB/backend/file.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -46,12 +46,12 @@ class WikiDB_backend_file extends WikiDB_backend { - var $data_dir; - var $_dir_names; + public $data_dir; + public $_dir_names; - var $_page_data; // temporarily stores the pagedata (via _loadPageData) - var $_page_version_data; // temporarily stores the versiondata (via _loadVersionData) - var $_latest_versions; // temporarily stores the latest version-numbers (for every pagename) + public $_page_data; // temporarily stores the pagedata (via _loadPageData) + public $_page_version_data; // temporarily stores the versiondata (via _loadVersionData) + public $_latest_versions; // temporarily stores the latest version-numbers (for every pagename) function WikiDB_backend_file($dbparam) { Modified: trunk/lib/WikiDB/cvs.php =================================================================== --- trunk/lib/WikiDB/cvs.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/WikiDB/cvs.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -15,7 +15,7 @@ class WikiDB_cvs extends WikiDB { - var $_backend; + public $_backend; /** * Constructor requires the DB parameters. Modified: trunk/lib/WikiDB.php =================================================================== --- trunk/lib/WikiDB.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/WikiDB.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -1548,7 +1548,7 @@ */ class WikiDB_PageRevision { - //var $_transformedContent = false; // set by WikiDB_Page::save() + public $_transformedContent = false; // set by WikiDB_Page::save() function WikiDB_PageRevision(&$wikidb, $pagename, $version, $versiondata = false) Modified: trunk/lib/WikiGroup.php =================================================================== --- trunk/lib/WikiGroup.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/WikiGroup.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -59,15 +59,15 @@ class WikiGroup { /** User name */ - var $username = ''; + public $username = ''; /** User object if different from current user */ - var $user; + public $user; /** The global WikiRequest object */ - //var $request; + //public $request; /** Array of groups $username is confirmed to belong to */ - var $membership; + public $membership; /** boolean if not the current user */ - var $not_current = false; + public $not_current = false; /** * Initializes a WikiGroup object which should never happen. Use: @@ -629,7 +629,7 @@ class GroupDb extends WikiGroup { - var $_is_member, $_group_members, $_user_groups; + public $_is_member, $_group_members, $_user_groups; /** * Constructor Modified: trunk/lib/WikiPlugin.php =================================================================== --- trunk/lib/WikiPlugin.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/WikiPlugin.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -433,7 +433,7 @@ class WikiPluginLoader { - var $_errors; + public $_errors; function expandPI($pi, &$request, &$markup, $basepage = false) { Modified: trunk/lib/WikiPluginCached.php =================================================================== --- trunk/lib/WikiPluginCached.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/WikiPluginCached.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -58,7 +58,7 @@ */ class WikiPluginCached extends WikiPlugin { - var $_static; + public $_static; /** * Produces URL and id number from plugin arguments which later on, Modified: trunk/lib/WikiTheme.php =================================================================== --- trunk/lib/WikiTheme.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/WikiTheme.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -179,8 +179,8 @@ class WikiTheme { - var $HTML_DUMP_SUFFIX = ''; - var $DUMP_MODE = false, $dumped_images, $dumped_css; + public $HTML_DUMP_SUFFIX = ''; + public $DUMP_MODE = false, $dumped_images, $dumped_css; /** * noinit: Do not initialize unnecessary items in default_theme fallback twice. @@ -316,10 +316,10 @@ // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_strftime.2c_.wcsftime.asp // As a result, we have to use %d, and strip out leading zeros ourselves. - var $_dateFormat = "%B %d, %Y"; - var $_timeFormat = "%I:%M %p"; + public $_dateFormat = "%B %d, %Y"; + public $_timeFormat = "%I:%M %p"; - var $_showModTime = true; + public $_showModTime = true; /** * Set format string used for dates. @@ -566,7 +566,7 @@ // //////////////////////////////////////////////////////////////// - var $_autosplitWikiWords = false; + public $_autosplitWikiWords = false; function setAutosplitWikiWords($autosplit = true) { @@ -581,7 +581,7 @@ return $wikiword; } - var $_anonEditUnknownLinks = true; + public $_anonEditUnknownLinks = true; function setAnonEditUnknownLinks($anonedit = true) { @@ -707,7 +707,7 @@ // Images and Icons // //////////////////////////////////////////////////////////////// - var $_imageAliases = array(); + public $_imageAliases = array(); /** * @@ -772,7 +772,7 @@ return false; } - var $_linkIcon = 'front'; // or 'after' or 'no'. + public $_linkIcon = 'front'; // or 'after' or 'no'. // maybe also 'spanall': there is a scheme currently in effect with front, which // spans the icon only to the first, to let the next words wrap on line breaks // see stdlib.php:PossiblyGlueIconToText() @@ -1076,7 +1076,7 @@ } //---------------------------------------------------------------- - var $_buttonSeparator = "\n | "; + public $_buttonSeparator = "\n | "; function setButtonSeparator($separator) { @@ -1834,7 +1834,7 @@ class PluginSidebarBox extends SidebarBox { - var $_plugin, $_args = false, $_basepage = false; + public $_plugin, $_args = false, $_basepage = false; function PluginSidebarBox($name, $args = false, $basepage = false) { Modified: trunk/lib/WikiUser/AdoDb.php =================================================================== --- trunk/lib/WikiUser/AdoDb.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/WikiUser/AdoDb.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -36,7 +36,7 @@ * @tables: user */ { - var $_authmethod = 'AdoDb'; + public $_authmethod = 'AdoDb'; function _AdoDbPassUser($UserName = '', $prefs = false) { Modified: trunk/lib/WikiUser/BogoLogin.php =================================================================== --- trunk/lib/WikiUser/BogoLogin.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/WikiUser/BogoLogin.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -26,7 +26,7 @@ class _BogoLoginPassUser extends _PassUser { - var $_authmethod = 'BogoLogin'; + public $_authmethod = 'BogoLogin'; function userExists() { Modified: trunk/lib/WikiUser/Db.php =================================================================== --- trunk/lib/WikiUser/Db.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/WikiUser/Db.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -45,7 +45,7 @@ class _DbPassUser extends _PassUser { - var $_authselect, $_authupdate, $_authcreate; + public $_authselect, $_authupdate, $_authcreate; // This can only be called from _PassUser, because the parent class // sets the auth_dbi and pref methods, before this class is initialized. Modified: trunk/lib/WikiUser/File.php =================================================================== --- trunk/lib/WikiUser/File.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/WikiUser/File.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -29,7 +29,7 @@ * Preferences are handled in _PassUser */ { - var $_file, $_may_change; + public $_file, $_may_change; // This can only be called from _PassUser, because the parent class // sets the pref methods, before this class is initialized. Modified: trunk/lib/WikiUser/FusionForge.php =================================================================== --- trunk/lib/WikiUser/FusionForge.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/WikiUser/FusionForge.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -26,7 +26,7 @@ class _FusionForgePassUser extends _PassUser { - var $_is_external = 0; + public $_is_external = 0; function _FusionForgePassUser($UserName = '', $prefs = false) { Modified: trunk/lib/WikiUser/PdoDb.php =================================================================== --- trunk/lib/WikiUser/PdoDb.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/WikiUser/PdoDb.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -33,7 +33,7 @@ * @tables: pref */ { - var $_authmethod = 'PDODb'; + public $_authmethod = 'PDODb'; function _PdoDbPassUser($UserName = '', $prefs = false) { Modified: trunk/lib/WikiUser/PearDb.php =================================================================== --- trunk/lib/WikiUser/PearDb.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/WikiUser/PearDb.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -31,7 +31,7 @@ * @tables: pref */ { - var $_authmethod = 'PearDb'; + public $_authmethod = 'PearDb'; function _PearDbPassUser($UserName = '', $prefs = false) { Modified: trunk/lib/WikiUser/PersonalPage.php =================================================================== --- trunk/lib/WikiUser/PersonalPage.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/WikiUser/PersonalPage.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -27,7 +27,7 @@ class _PersonalPagePassUser extends _PassUser { - var $_authmethod = 'PersonalPage'; + public $_authmethod = 'PersonalPage'; /* Very loose checking, since we properly quote the PageName. Just trim spaces, ... See lib/stdlib.php Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/WikiUser.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -66,10 +66,10 @@ */ class WikiUser { - var $_userid = false; - var $_level = false; - var $_request, $_dbi, $_authdbi, $_homepage; - var $_authmethod = '', $_authhow = ''; + public $_userid = false; + public $_level = false; + public $_request, $_dbi, $_authdbi, $_homepage; + public $_authmethod = '', $_authhow = ''; /** * Constructor. Modified: trunk/lib/WikiUserNew.php =================================================================== --- trunk/lib/WikiUserNew.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/WikiUserNew.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -367,10 +367,10 @@ */ class _WikiUser { - var $_userid = ''; - var $_level = WIKIAUTH_ANON; - var $_prefs = false; - var $_HomePagehandle = false; + public $_userid = ''; + public $_level = WIKIAUTH_ANON; + public $_prefs = false; + public $_HomePagehandle = false; // constructor function _WikiUser($UserName = '', $prefs = false) @@ -721,7 +721,7 @@ class _AnonUser extends _WikiUser { - var $_level = WIKIAUTH_ANON; // var in php-5.0.0RC1 deprecated + public $_level = WIKIAUTH_ANON; /** Anon only gets to load and save prefs in a cookie, that's it. */ @@ -870,7 +870,7 @@ class _ForbiddenUser extends _AnonUser { - var $_level = WIKIAUTH_FORBIDDEN; + public $_level = WIKIAUTH_FORBIDDEN; function checkPass($submitted_password) { @@ -931,8 +931,8 @@ * @tables: pref */ { - var $_auth_dbi, $_prefs; - var $_current_method, $_current_index; + public $_auth_dbi, $_prefs; + public $_current_method, $_current_index; // check and prepare the auth and pref methods only once function _PassUser($UserName = '', $prefs = false) @@ -1483,7 +1483,7 @@ class _UserPreference { - var $default_value; + public $default_value; function _UserPreference($default_value) { @@ -1928,7 +1928,7 @@ */ class UserPreferences { - var $notifyPagesAll; + public $notifyPagesAll; function UserPreferences($saved_prefs = false) { Modified: trunk/lib/WysiwygEdit.php =================================================================== --- trunk/lib/WysiwygEdit.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/WysiwygEdit.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -102,7 +102,7 @@ class Markup_html_p extends BalancedMarkup { - var $_start_regexp = "<(?:p|P)( class=\".*\")?>"; + public $_start_regexp = "<(?:p|P)( class=\".*\")?>"; function getEndRegexp($match) { @@ -118,7 +118,7 @@ //'<SPAN style="FONT-WEIGHT: bold">text</SPAN>' => '*text*' class Markup_html_spanbold extends BalancedMarkup { - var $_start_regexp = "<(?:span|SPAN) style=\"FONT-WEIGHT: bold\">"; + public $_start_regexp = "<(?:span|SPAN) style=\"FONT-WEIGHT: bold\">"; function getEndRegexp($match) { Modified: trunk/lib/XmlParser.php =================================================================== --- trunk/lib/XmlParser.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/XmlParser.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -50,7 +50,7 @@ class XmlParser { - var $_parser, $root, $current, $previous, $parent; + public $_parser, $root, $current, $previous, $parent; function XmlParser($encoding = '') { // "ISO-8859-1" Modified: trunk/lib/diff3.php =================================================================== --- trunk/lib/diff3.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/diff3.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -12,7 +12,7 @@ class _Diff3_Block { - var $type = 'diff3'; + public $type = 'diff3'; function _Diff3_Block($orig = false, $final1 = false, $final2 = false) { @@ -42,7 +42,7 @@ class _Diff3_CopyBlock extends _Diff3_Block { - var $type = 'copy'; + public $type = 'copy'; function _Diff3_CopyBlock($lines = false) { Modified: trunk/lib/difflib.php =================================================================== --- trunk/lib/difflib.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/difflib.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -10,9 +10,9 @@ class _DiffOp { - var $type; - var $orig; - var $final; + public $type; + public $orig; + public $final; function reverse() { @@ -32,7 +32,7 @@ class _DiffOp_Copy extends _DiffOp { - var $type = 'copy'; + public $type = 'copy'; function _DiffOp_Copy($orig, $final = false) { @@ -50,7 +50,7 @@ class _DiffOp_Delete extends _DiffOp { - var $type = 'delete'; + public $type = 'delete'; function _DiffOp_Delete($lines) { @@ -66,7 +66,7 @@ class _DiffOp_Add extends _DiffOp { - var $type = 'add'; + public $type = 'add'; function _DiffOp_Add($lines) { @@ -82,7 +82,7 @@ class _DiffOp_Change extends _DiffOp { - var $type = 'change'; + public $type = 'change'; function _DiffOp_Change($orig, $final) { @@ -505,7 +505,7 @@ */ class Diff { - var $edits; + public $edits; /** * Constructor. @@ -713,7 +713,7 @@ * This should be left at zero for this class, but subclasses * may want to set this to other values. */ - var $leading_context_lines = 0; + public $leading_context_lines = 0; /** * Number of trailing context "lines" to preserve. @@ -721,7 +721,7 @@ * This should be left at zero for this class, but subclasses * may want to set this to other values. */ - var $trailing_context_lines = 0; + public $trailing_context_lines = 0; /** * Format a diff. Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/main.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -50,7 +50,7 @@ class WikiRequest extends Request { - var $_dbi; + public $_dbi; function WikiRequest() { Modified: trunk/lib/plugin/PageDump.php =================================================================== --- trunk/lib/plugin/PageDump.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/plugin/PageDump.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -50,7 +50,7 @@ class WikiPlugin_PageDump extends WikiPlugin { - var $MessageId; + public $MessageId; function getName() { Modified: trunk/lib/plugin/PageTrail.php =================================================================== --- trunk/lib/plugin/PageTrail.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/plugin/PageTrail.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -38,7 +38,7 @@ class WikiPlugin_PageTrail extends WikiPlugin { - var $def_numberlinks = 5; + public $def_numberlinks = 5; function getName() { Modified: trunk/lib/plugin/RateIt.php =================================================================== --- trunk/lib/plugin/RateIt.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/plugin/RateIt.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -85,7 +85,7 @@ extends WikiPlugin { static $toBeUniq = 1; - var $idTop = ''; + public $idTop = ''; function getName() { Modified: trunk/lib/plugin/RecentChanges.php =================================================================== --- trunk/lib/plugin/RecentChanges.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/plugin/RecentChanges.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -25,8 +25,8 @@ class _RecentChanges_Formatter { - var $_absurls = false; - var $action = "RecentChanges"; + public $_absurls = false; + public $action = "RecentChanges"; function _RecentChanges_Formatter($rc_args) { @@ -817,7 +817,7 @@ class _RecentChanges_RssFormatter extends _RecentChanges_Formatter { - var $_absurls = true; + public $_absurls = true; function time($rev) { Modified: trunk/lib/plugin/SiteMap.php =================================================================== --- trunk/lib/plugin/SiteMap.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/plugin/SiteMap.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -45,7 +45,7 @@ class WikiPlugin_SiteMap extends WikiPlugin { - var $_pagename; + public $_pagename; function getName() { Modified: trunk/lib/plugin/SqlResult.php =================================================================== --- trunk/lib/plugin/SqlResult.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/plugin/SqlResult.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -61,7 +61,7 @@ class WikiPlugin_SqlResult extends WikiPlugin { - var $_args; + public $_args; function getName() { Modified: trunk/lib/plugin/TeX2png.php =================================================================== --- trunk/lib/plugin/TeX2png.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/plugin/TeX2png.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -36,10 +36,10 @@ class WikiPlugin_TeX2png extends WikiPlugin { - var $imagepath = 'images/tex'; - var $latexbin = '/usr/bin/latex'; - var $dvipsbin = '/usr/bin/dvips'; - var $pstoimgbin = '/usr/bin/pstoimg'; + public $imagepath = 'images/tex'; + public $latexbin = '/usr/bin/latex'; + public $dvipsbin = '/usr/bin/dvips'; + public $pstoimgbin = '/usr/bin/pstoimg'; function getName() { Modified: trunk/lib/plugin/UpLoad.php =================================================================== --- trunk/lib/plugin/UpLoad.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/plugin/UpLoad.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -36,9 +36,9 @@ class WikiPlugin_UpLoad extends WikiPlugin { - var $disallowed_extensions; + public $disallowed_extensions; // TODO: use PagePerms instead - var $only_authenticated = true; // allow only authenticated users may upload. + public $only_authenticated = true; // allow only authenticated users may upload. function getName() { Modified: trunk/lib/plugin/UserPreferences.php =================================================================== --- trunk/lib/plugin/UserPreferences.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/plugin/UserPreferences.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -33,7 +33,7 @@ class WikiPlugin_UserPreferences extends WikiPlugin { - var $bool_args; + public $bool_args; function getName() { Modified: trunk/lib/plugin/WikiPoll.php =================================================================== --- trunk/lib/plugin/WikiPoll.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/plugin/WikiPoll.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -54,7 +54,7 @@ class WikiPlugin_WikiPoll extends WikiPlugin { - var $_args; + public $_args; function getName() { Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/stdlib.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -682,8 +682,6 @@ class Stack { - - // var in php5 deprecated function Stack() { $this->items = array(); @@ -808,19 +806,19 @@ * This is the value of $name passed to the constructor. * (For use, e.g. as a default label for links to the page.) */ - //var $shortName; + public $shortName; /** The full page name. * * This is the full name of the page (without anchor). */ - //var $name; + public $name; /** The anchor. * * This is the referenced anchor within the page, or the empty string. */ - //var $anchor; + public $anchor; /** Constructor * @@ -1667,7 +1665,7 @@ // expands a list containing regex's to its matching entries class ListRegexExpand { - //var $match, $list, $index, $case_sensitive; + public $match, $list, $index, $case_sensitive; function ListRegexExpand(&$list, $match, $case_sensitive = true) { $this->match = $match; Modified: trunk/lib/upgrade.php =================================================================== --- trunk/lib/upgrade.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/upgrade.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -1200,7 +1200,7 @@ /** * check all pages for a plugin match */ - var $silent_skip = 1; + public $silent_skip = 1; function default_method(&$args) { Modified: trunk/lib/wikilens/CustomPrefs.php =================================================================== --- trunk/lib/wikilens/CustomPrefs.php 2013-05-29 07:28:23 UTC (rev 8788) +++ trunk/lib/wikilens/CustomPrefs.php 2013-05-29 07:32:07 UTC (rev 8789) @@ -13,8 +13,8 @@ class _UserPreference_recengine // recommendation engine method extends _UserPreference { - var $valid_values = array('php', 'mysuggest', 'mymovielens', 'mycluto'); - var $default_value = 'php'; + public $valid_values = array('php', 'mysuggest', 'mymovielens', 'mycluto'); + public $default_value = 'php'; function sanify($value) { @@ -26,14 +26,14 @@ class _UserPreference_recalgo // recommendation engine algorithm extends _UserPreference { - var $valid_values = array + public $valid_values = array ( 'itemCos', // Item-based Top-N recommendation algorithm with cosine-based similarity function 'itemProb', // Item-based Top-N recommendation algorithm with probability-based similarity function. // This algorithms tends to outperform the rest. 'userCos', // User-based Top-N recommendation algorithm with cosine-based similarity function. 'bayes'); // Naïve Bayesian Classifier - var $default_value = 'itemProb'; + public $default_value = 'itemProb'; function sanify($value) { Modified: trunk/lib/wikilens/PageListColumns.php =================================================================== ---... [truncated message content] |
From: <var...@us...> - 2013-09-03 09:39:57
|
Revision: 8836 http://sourceforge.net/p/phpwiki/code/8836 Author: vargenau Date: 2013-09-03 09:39:54 +0000 (Tue, 03 Sep 2013) Log Message: ----------- Remove IMDB stuff Modified Paths: -------------- trunk/lib/IniConfig.php trunk/lib/plugin/WikiTranslation.php Removed Paths: ------------- trunk/lib/imdb.php trunk/lib/plugin/Imdb.php Modified: trunk/lib/IniConfig.php =================================================================== --- trunk/lib/IniConfig.php 2013-09-03 09:39:16 UTC (rev 8835) +++ trunk/lib/IniConfig.php 2013-09-03 09:39:54 UTC (rev 8836) @@ -713,7 +713,6 @@ $AllAllowedPlugins[] = 'GraphViz'; $AllAllowedPlugins[] = 'DebugGroupInfo'; $AllAllowedPlugins[] = 'HtmlConverter'; - $AllAllowedPlugins[] = 'Imdb'; $AllAllowedPlugins[] = 'JabberPresence'; $AllAllowedPlugins[] = 'ListPages'; $AllAllowedPlugins[] = 'PhpWeather'; Deleted: trunk/lib/imdb.php =================================================================== --- trunk/lib/imdb.php 2013-09-03 09:39:16 UTC (rev 8835) +++ trunk/lib/imdb.php 2013-09-03 09:39:54 UTC (rev 8836) @@ -1,450 +0,0 @@ -<?php -/** - * Copyright 2004 Reini Urban - * - * This file is (not yet) part of PhpWiki. - * - * PhpWiki is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * PhpWiki is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with PhpWiki; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - * Accessors for a local imdb database. - * Import it via amdbfront. - * Get the dsn alias from lib/plugin/SqlResult.ini - */ -class imdb -{ - - function imdb() - { - global $DBParams; - $ini = parse_ini_file(FindFile("config/SqlResult.ini")); - $dsn = $ini['imdb']; - if ($DBParams['dbtype'] == 'SQL') { - $this->_dbh = DB::connect($dsn); - $this->_dbtype = "PearDB"; - } else { - if ($DBParams['dbtype'] != 'ADODB') { - // require_once('lib/WikiDB/adodb/adodb-errorhandler.inc.php'); - require_once 'lib/WikiDB/adodb/adodb-pear.inc.php'; - } - $parsed = parseDSN($dsn); - $this->_dbh = &ADONewConnection($parsed['phptype']); - $conn = $this->_dbh->Connect($parsed['hostspec'], $parsed['username'], - $parsed['password'], $parsed['database']); - $this->_dbtype = "ADODB"; - } - $this->_title_1_1 = array - ("business", "moviebudgets", "colorinfo", "mpaaratingsreasons"); - $this->_title_1_n = array - ("akatitles", "alternateversions", - "miscellaneouscompanies", "moviecountries", - "certificates", "completecast", "completecrew", "crazycredits", - "genres", "goofs", "keywords", "movielinks", "plot", "quotes", "ratings", "soundtracks", - "specialeffectscompanies", - "taglines", "trivia", "distributors", "language", "laserdisc", "literature", - "locations", "miscellaneouscompanies", - "productioncompanies", "releasedates", "runningtimes", "soundmix", "technical" - ); - } - - /* key accessors. return a hash */ - function title($title_id) - { - $result = $this->_dbh->genericSqlIter("SELECT m.title, m.date FROM movies as m WHERE m.title_id = '$title_id'"); - return $result->next(); - } - - function name($name_id) - { - $result = $this->_dbh->genericSqlIter - ("SELECT n.name, b.* " - . " FROM name AS n" - . " LEFT JOIN biographies AS b USING (name_id)" - . " WHERE n.name_id = '$name_id' "); - return $result->next(); - } - - /* main movie information, with just the top names */ - /* 1:1 title info: moviebudgets, colorinfo, business? */ - function movie($title_id) - { - $result = $this->_dbh->genericSqlIter("SELECT m.title, m.date" - . " FROM movies as m" - . " WHERE m.title_id = '$title_id'"); - $movie = $result->next(); - $movie['title_id'] = $title_id; - /* add the individual results to hash */ - foreach (array_merge($this->_title_1_1, $this->_title_1_n) as $accessor) { - if (method_exists($this, $accessor)) - $iter = $this->$accessor($title_id); - else - $iter = $this->_titleQuery($accessor, $accessor, $title_id); - while ($row = $iter->next()) { - $movie[$accessor][] = $row; - } - } - // add the names also? - return $movie; - } - - function movie_main($title_id) - { - return movie($title_id); - } - - /* full movie information, with full cast and crew */ - function movie_full($title_id) - { - $movie = $this->movie($title_id); - /* add the individual results to hash */ - foreach (array_merge($this->_cast, $this->_crew) as $accessor) { - if (method_exists($this, $accessor)) - $iter = $this->$accessor($title_id); - else - $iter = $this->_titleQuery($accessor, $accessor, $title_id); - while ($row = $iter->next()) { - $movie[$accessor][] = $row; - } - } - return $movie; - } - - /* combined movie information */ - function movie_combined($title_id) - { - $movie = $this->movie($title_id); - /* add the individual results to hash */ - foreach (array_merge($this->_combined) as $accessor) { - if (method_exists($this, $accessor)) - $iter = $this->$accessor($title_id); - else - $iter = $this->_titleQuery($accessor, $accessor, $title_id); - while ($row = $iter->next()) { - $movie[$accessor][] = $row; - } - } - return $movie; - } - - /* movie company_credits information */ - function movie_company_credits($title_id) - { - $movie = $this->movie($title_id); - /* add the individual results to hash */ - foreach (array_merge($this->_company_credits) as $accessor) { - if (method_exists($this, $accessor)) - $iter = $this->$accessor($title_id); - else - $iter = $this->_titleQuery($accessor, $accessor, $title_id); - while ($row = $iter->next()) { - $movie[$accessor][] = $row; - } - } - return $movie; - } - - /* 1:n title subselects: possibly multiple rows per title */ - /* accessors with same field and tablename are not needed */ - function _titleQuery($field, $table, $title_id) - { - return $this->_dbh->genericSqlIter - ("SELECT $field FROM $table WHERE title_id = '$title_id'"); - } - - function akatitles($title_id) - { - return $this->_titleQuery("akatitle", "akatitles", $title_id); - } - - function business($title_id) - { - return $this->_titleQuery("*", "business", $title_id); - } - - function moviebudgets($title_id) - { - return $this->_titleQuery("b.currency, b.budget, b.info", "moviebudgets as b", $title_id); - } - - function completecast($title_id) - { - return $this->_titleQuery("cast", "completecast", $title_id); - } - - function completecrew($title_id) - { - return $this->_titleQuery("crew", "completecrew", $title_id); - } - - function genres($title_id) - { - return $this->_titleQuery("genre", "genres", $title_id); - } - - /* how many rows? */ - function goofs($title_id) - { - return $this->_titleQuery("text", "goofs", $title_id); - } - - /* how many rows? */ - function keywords($title_id) - { - return $this->_titleQuery("keyword", "keywords", $title_id); - } - - // (ml_id, description) values (1, 'followed by'); - function movielinks($title_id) - { - return $this->_dbh->genericSqlIter - ("SELECT m.title,ml.description, mref.title AS title_ref" - . " FROM movielinks AS l, ml, movies as m, movies AS mref" - . " WHERE l.title_ref = mref.title_id AND l.title_id = mref.title_id" - . " AND l.ml_id = ml.ml_id AND l.title_id = '$title_id'"); - } - - /* how many rows? */ - function plot($title_id) - { - return $this->_titleQuery("*", "plot", $title_id); - } - - /* how many rows? */ - function quotes($title_id) - { - return $this->_titleQuery("*", "quotes", $title_id); - } - - /* TODO: how? */ - function ratings($title_id) - { - return $this->_titleQuery("*", "ratings", $title_id); - } - - function soundtracks($title_id) - { - return $this->_titleQuery("*", "soundtracks", $title_id); - } - - function specialeffectscompanies($title_id) - { - return $this->_titleQuery("*", "specialeffectscompanies", $title_id); - } - - /* how many rows? */ - function taglines($title_id) - { - return $this->_titleQuery("content", "taglines", $title_id); - } - - /* how many rows? */ - function trivia($title_id) - { - return $this->_titleQuery("content", "trivia", $title_id); - } - - function distributors($title_id) - { - return $this->_titleQuery("distributor", "distributors", $title_id); - } - - function language($title_id) - { - return $this->_titleQuery("language", "language", $title_id); - } - - function laserdisc($title_id) - { - return $this->_titleQuery("content", "laserdisc", $title_id); - } - - function literature($title_id) - { - return $this->_titleQuery("literature", "literature", $title_id); - } - - function locations($title_id) - { - return $this->_titleQuery("location", "locations", $title_id); - } - - function miscellaneouscompanies($title_id) - { - return $this->_titleQuery("company", "miscellaneouscompanies", $title_id); - } - - function mpaaratingsreasons($title_id) - { - return $this->_titleQuery("mpaarating", "mpaaratingsreasons", $title_id); - } - - function productioncompanies($title_id) - { - return $this->_titleQuery("company", "productioncompanies", $title_id); - } - - function soundmix($title_id) - { - return $this->_titleQuery("soundmix", "soundmix", $title_id); - } - - function technical($title_id) - { - return $this->_titleQuery("technical", "technical", $title_id); - } - - function releasedates($title_id) - { - return $this->_dbh->genericSqlIter - ("SELECT c.country,r.releasedate,r.info" - . " FROM country as c, releasedates AS r" - . " WHERE c.country_id = r.country_id AND r.title_id = '$title_id'"); - } - - function runningtimes($title_id) - { - return $this->_dbh->genericSqlIter - ("SELECT c.country,r.time,,r.info" - . " FROM country as c, runningtimes AS r" - . " WHERE c.country_id = r.country_id AND r.title_id = '$title_id'"); - } - - function moviecountries($title_id) - { - return $this->_dbh->genericSqlIter - ("SELECT c.country FROM country AS c, moviecountries AS m" - . " WHERE c.country_id = m.country_id AND m.title_id = '$title_id'"); - } - - function certificates($title_id) - { - return $this->_dbh->genericSqlIter - ("SELECT co.country, c.certificate, c.info" - . " FROM country as co, certificates as c" - . " WHERE co.country_id = c.country_id AND c.title_id = '$title_id'" - . " GROUP BY c.country_id"); - } - - /* 1:n name subselects: possibly multiple rows per name */ - /* -create table akanames (name_id integer unsigned not null, akaname varchar(255) not null); -create table biographies (name_id integer unsigned not null, RN text, NK text, DB text, DD text, HT text, BG text, BO text, BT text, PI text, OW text, TR text, QU text, SA text, WN text, SP text, TM text, IT text, AT text, PT text, CV text, AG text, primary key (name_id)); -create table guestappearances (name_id integer unsigned not null, title_id integer unsigned not null, role varchar(255)); -create table characters (name_id integer unsigned not null, title_id integer unsigned not null, role varchar(255), position integer unsigned, job_id tinyint unsigned not null); - */ - function akanames($name_id) - { - return $this->_dbh->genericSqlIter - ("SELECT akanames FROM akanames WHERE name_id = '$name_id'"); - } - - function guestappearances($name_id) - { - return $this->_dbh->genericSqlIter - ("SELECT g.role, m.movie, m.date" - . " FROM guestappearances as g" - . " WHERE g.name_id = '$name_id' AND g.title_id = m.title_id"); - } - - function biographies($name_id) - { - return $this->_dbh->genericSqlIter - ("SELECT n.name, b.*" - . " FROM name as n" - . " LEFT JOIN biographies as b USING (name_id)" - . " WHERE n.name_id = '$name_id' "); - } - - /* Search functions */ - function searchTitle($title) - { - return $this->_search($title, '_sql_title_clause', - "SELECT m.title_id, m.title, m.date" . - " FROM movies as m" . - " WHERE ", - "ORDER BY m.date DESC"); - } - - function searchName($name) - { - return $this->_search($name, '_sql_name_clause', - "SELECT n.name_id, n.name, j.description, c.role, m.title_id, m.title" . - " FROM names as n, jobs as j, characters as c, movies as m" . - " WHERE n.name_id = c.name_id" . - " AND m.title_id = c.title_id" . - " AND c.job_id = j.job_id" . - " AND ", - "GROUP BY m.title_id ORDER BY j.description"); - } - - /* Search helpers */ - // quote the LIKE argument and construct the WHERE clause - function _sql_match_clause($field, $word) - { - //not sure if we need this. ADODB may do it for us - $word = preg_replace('/(?=[%_\\\\])/', "\\", $word); - // (we need it for at least % and _ --- they're the wildcard characters - // for the LIKE operator, and we need to quote them if we're searching - // for literal '%'s or '_'s. --- I'm not sure about \, but it seems to - // work as is. - $word = $this->_dbh->qstr("%" . strtolower($word) . "%"); - return "LOWER($field) LIKE $word"; - } - - function _sql_title_clause($word) - { - return $this->_sql_match_clause("title", $word); - } - - function _sql_name_clause($word) - { - return $this->_sql_match_clause("name", $word); - } - - function _search($what, $callback_fn, $query, $order = '') - { - include_once 'lib/TextSearchQuery.php'; - // $dbh = $GLOBALS['request']->getDbh(); - //TODO: check if the db is mysql resp. capable of google like search. - // postgresql tsearch2 for example - // See TextSearchQuery.php - $search = new TextSearchQuery($what); - $callback = new WikiMethodCb($this, $callback_fn); - $search_clause = $search->makeSqlClause($callback); - $result = $this->_dbh->genericSqlIter($query . " " . $search_clause . " " . $order); - } - - /* -// all movies with actor: -SELECT m.title, m.date, n.name, c.role - FROM movies as m, names as n, jobs as j, characters as c - WHERE n.name LIKE "%%where%%" - AND m.title_id = c.title_id - AND n.name_id = c.name_id - AND c.job_id = j.job_id - AND j.description = 'Actor' - ORDER BY m.date DESC - */ - -} - -// Local Variables: -// mode: php -// tab-width: 8 -// c-basic-offset: 4 -// c-hanging-comment-ender-p: nil -// indent-tabs-mode: nil -// End: Deleted: trunk/lib/plugin/Imdb.php =================================================================== --- trunk/lib/plugin/Imdb.php 2013-09-03 09:39:16 UTC (rev 8835) +++ trunk/lib/plugin/Imdb.php 2013-09-03 09:39:54 UTC (rev 8836) @@ -1,113 +0,0 @@ -<?php - -/* - * Copyright 2004 $ThePhpWikiProgrammingTeam - * - * This file is (not yet) part of PhpWiki. - * - * PhpWiki is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * PhpWiki is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with PhpWiki; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - * Query results from a local imdb copy. - * see amdbfront for the conversion. - * "imdb = mysql://user:pass@localhost/imdb" in lib/plugin/SqlResult.ini - * - * Queries: - * <<Imdb query=movie_main title||="Sample Movie (2002)" >> - * <<Imdb query=movie_combined title||="Sample Movie (2002)" >> - * <<Imdb query=movie_full title||="Sample Movie (2002)" >> - * <<Imdb query=movie_company_credits title||="Sample Movie (2002)" >> - * <<Imdb query=name name||="Lastname, Firstname (I)" >> - * More title queries: - * business, moviebudgets, colorinfo, mpaaratingsreasons, - * akatitles, alternateversions, miscellaneouscompanies, moviecountries, - * certificates, completecast, completecrew, crazycredits, genres, goofs, - * keywords, movielinks, plot, quotes, ratings, soundtracks, specialeffectscompanies, - * taglines, trivia, distributors, language, laserdisc, literature, locations, - * miscellaneouscompanies, productioncompanies, releasedates, runningtimes, soundmix, - * technical - * More name queries: - * akanames, guestappearances, biographies - * job.descriptions - * - * @author: ReiniUrban - */ - -include_once 'lib/plugin/SqlResult.php'; - -class WikiPlugin_Imdb - extends WikiPlugin_SqlResult -{ - function getDescription() - { - return _("Query a local imdb database."); - } - - function getDefaultArguments() - { - return array( - 'query' => false, // what - 'template' => false, // TODO: use a custom <theme>/template.tmpl for the result - 'where' => false, // custom filter for the query - 'title' => false, // custom filter for the query - 'name' => false, // custom filter for the query - 'sortby' => false, // for paging, default none - 'limit' => false, // for paging, default: only the first 50 - ); - } - - function run($dbi, $argstr, &$request, $basepage) - { - $args = $this->getArgs($argstr, $request); - extract($args); - include_once 'lib/imdb.php'; - $imdb = new imdb(); - - if (method_exists($imdb, $query)) { - $SqlResult = $imdb->$query($title ? $title : $name); - } else { - $SqlResult = array(); - } - - // if ($limit) ; // TODO: fill paging vars (see PageList) - if ($ordered) { - $html = HTML::ol(array('class' => 'sqlresult')); - foreach ($SqlResult as $row) { - $html->pushContent(HTML::li(array('class' => $i++ % 2 ? 'evenrow' : 'oddrow'), $row[0])); - } - } else { - $html = HTML::table(array('class' => 'sqlresult')); - $i = 0; - foreach ($SqlResult as $row) { - $tr = HTML::tr(array('class' => $i++ % 2 ? 'evenrow' : 'oddrow')); - foreach ($row as $col) { - $tr->pushContent(HTML::td($col)); - } - $html->pushContent($tr); - } - } - // if ($limit) ; // do paging via pagelink template - return $html; - } -} - -// Local Variables: -// mode: php -// tab-width: 8 -// c-basic-offset: 4 -// c-hanging-comment-ender-p: nil -// indent-tabs-mode: nil -// End: Modified: trunk/lib/plugin/WikiTranslation.php =================================================================== --- trunk/lib/plugin/WikiTranslation.php 2013-09-03 09:39:16 UTC (rev 8835) +++ trunk/lib/plugin/WikiTranslation.php 2013-09-03 09:39:54 UTC (rev 8836) @@ -109,7 +109,6 @@ _("HelloWorldPlugin") . ',' . _("HomePageAlias") . ',' . _("HtmlConverter") . ',' . - _("Imdb") . ',' . _("IncludePage") . ',' . _("IncludePagePlugin") . ',' . _("IncludePages") . ',' . This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2013-09-03 09:55:51
|
Revision: 8837 http://sourceforge.net/p/phpwiki/code/8837 Author: vargenau Date: 2013-09-03 09:55:48 +0000 (Tue, 03 Sep 2013) Log Message: ----------- use And by default; cleanup Modified Paths: -------------- trunk/lib/SemanticWeb.php trunk/lib/TextSearchQuery.php trunk/lib/WikiDB/backend.php Modified: trunk/lib/SemanticWeb.php =================================================================== --- trunk/lib/SemanticWeb.php 2013-09-03 09:39:54 UTC (rev 8836) +++ trunk/lib/SemanticWeb.php 2013-09-03 09:55:48 UTC (rev 8837) @@ -318,7 +318,7 @@ { $ori_value = $value; $value = preg_replace("/,/", "", $value); - $this->_bound[] = array('linkname' => $x, + $this->bound[] = array('linkname' => $x, 'linkvalue' => $value); // We must ensure that the same baseunits are matched against. // We cannot compare m^2 to m or '' @@ -329,20 +329,20 @@ ; } else { // non-matching units are silently ignored - $this->_workquery = ''; + $this->workquery = ''; return ''; } } $value = $val_base; if (!is_numeric($value)) { - $this->_workquery = ''; //must return false + $this->workquery = ''; //must return false trigger_error("Cannot match against non-numeric attribute value $x := $ori_value", E_USER_NOTICE); return ''; } - $this->_workquery = preg_replace("/\b" . preg_quote($x, "/") . "\b/", $value, $this->_workquery); - return $this->_workquery; + $this->workquery = preg_replace("/\b" . preg_quote($x, "/") . "\b/", $value, $this->workquery); + return $this->workquery; } } Modified: trunk/lib/TextSearchQuery.php =================================================================== --- trunk/lib/TextSearchQuery.php 2013-09-03 09:39:54 UTC (rev 8836) +++ trunk/lib/TextSearchQuery.php 2013-09-03 09:55:48 UTC (rev 8837) @@ -80,23 +80,11 @@ // all bits from word to the last. define ('TSQ_ALLWORDS', (4096 * 2) - 1 - (16 - 1)); -/* -define ('TSQ_NODE_ALL', 0); -define ('TSQ_NODE_EXACT', 1); -define ('TSQ_NODE_NOT', 2); -define ('TSQ_NODE_WORD', 3); -define ('TSQ_NODE_STARTS_WITH', 4); -define ('TSQ_NODE_ENDS_WITH', 5); -define ('TSQ_NODE_REGEX', 6); -define ('TSQ_NODE_REGEX_GLOB', 7); -define ('TSQ_NODE_REGEX_PCRE', 8); -define ('TSQ_NODE_REGEX_SQL', 9); -define ('TSQ_NODE_AND', 10); -define ('TSQ_NODE_OR', 11); -*/ - class TextSearchQuery { + private $sql_clause_cb; + private $word; + /** * Create a new query. * @@ -120,7 +108,7 @@ if ($regex != 'pcre') { $parser = new TextSearchQuery_Parser; $this->_tree = $parser->parse($search_query, $case_exact, $this->_regex); - $this->_optimize(); // broken under certain circumstances: "word -word -word" + $this->optimize(); // broken under certain circumstances: "word -word -word" if (defined("FULLTEXTSEARCH_STOPLIST")) $this->_stoplist = FULLTEXTSEARCH_STOPLIST; else // default stoplist, localizable. @@ -139,7 +127,7 @@ return 'text'; } - function _optimize() + private function optimize() { $this->_tree = $this->_tree->optimize(); } @@ -213,88 +201,31 @@ return $this->_hilight_regexp; } - /** - * Make an SQL clause which matches the query. - * Deprecated, use makeSqlClauseObj instead. - * - * @param $make_sql_clause_cb WikiCallback - * A callback which takes a single word as an argument and - * returns an SQL clause which will match exactly those records - * containing the word. The word passed to the callback will always - * be in all lower case. - * - * Support db-specific extensions, like MATCH AGAINST or REGEX - * mysql => 4.0.1 can also do Google: MATCH AGAINST IN BOOLEAN MODE - * by using makeSqlClauseObj - * - * Old example usage: - * <pre> - * function sql_title_match($word) { - * return sprintf("LOWER(title) like '%s'", - * addslashes($word)); - * } - * - * ... - * - * $query = new TextSearchQuery("wiki -page"); - * $cb = new WikiFunctionCb('sql_title_match'); - * $sql_clause = $query->makeSqlClause($cb); - * </pre> - * This will result in $sql_clause containing something like - * "(LOWER(title) like 'wiki') AND NOT (LOWER(title) like 'page')". - * - * @return string The SQL clause. - */ - function makeSqlClause($sql_clause_cb) - { - $this->_sql_clause_cb = $sql_clause_cb; - return $this->_sql_clause($this->_tree); - } - - // deprecated: use _sql_clause_obj now. - function _sql_clause($node) - { - switch ($node->_op) { - case TSQ_TOK_WORD: // word => %word% - return $this->_sql_clause_cb->call($node->word); - case TSQ_TOK_NOT: - return "NOT (" . $this->_sql_clause($node->leaves[0]) . ")"; - case TSQ_TOK_BINOP: - $subclauses = array(); - foreach ($node->leaves as $leaf) - $subclauses[] = "(" . $this->_sql_clause($leaf) . ")"; - return join(" $node->op ", $subclauses); - default: - assert($node->_op == TSQ_TOK_VOID); - return '1=1'; - } - } - /** Get away with the callback and use a db-specific search class instead. * @see WikiDB_backend_PearDB_search */ function makeSqlClauseObj(&$sql_search_cb) { - $this->_sql_clause_cb = $sql_search_cb; - return $this->_sql_clause_obj($this->_tree); + $this->sql_clause_cb = $sql_search_cb; + return $this->sql_clause_obj($this->_tree); } - function _sql_clause_obj($node) + private function sql_clause_obj($node) { switch ($node->_op) { case TSQ_TOK_NOT: - return "NOT (" . $this->_sql_clause_cb->call($node->leaves[0]) . ")"; + return "NOT (" . $this->sql_clause_cb->call($node->leaves[0]) . ")"; case TSQ_TOK_BINOP: $subclauses = array(); foreach ($node->leaves as $leaf) - $subclauses[] = "(" . $this->_sql_clause_obj($leaf) . ")"; + $subclauses[] = "(" . $this->sql_clause_obj($leaf) . ")"; return join(" $node->op ", $subclauses); case TSQ_TOK_VOID: return '0=1'; case TSQ_TOK_ALL: return '1=1'; default: - return $this->_sql_clause_cb->call($node); + return $this->sql_clause_cb->call($node); } } @@ -303,11 +234,11 @@ */ function makeTsearch2SqlClauseObj(&$sql_search_cb) { - $this->_sql_clause_cb = $sql_search_cb; - return $this->_Tsearch2Sql_clause_obj($this->_tree); + $this->sql_clause_cb = $sql_search_cb; + return $this->Tsearch2Sql_clause_obj($this->_tree); } - function _Tsearch2Sql_clause_obj($node) + private function Tsearch2Sql_clause_obj($node) { // TODO: "such a phrase" switch ($node->_op) { @@ -316,14 +247,14 @@ case TSQ_TOK_BINOP: $subclauses = array(); foreach ($node->leaves as $leaf) - $subclauses[] = $this->_Tsearch2Sql_clause_obj($leaf); - return join($node->_op == 'AND' ? "&" : "|", $subclauses); + $subclauses[] = $this->Tsearch2Sql_clause_obj($leaf); + return join($node->_op == 'OR' ? "|" : "&", $subclauses); case TSQ_TOK_VOID: return ''; case TSQ_TOK_ALL: return '1'; default: - return $this->_sql_clause_cb->call($node); + return $this->sql_clause_cb->call($node); } } @@ -340,10 +271,10 @@ */ function asString() { - return $this->_as_string($this->_tree); + return $this->as_string($this->_tree); } - function _as_string($node, $indent = '') + private function as_string($node, $indent = '') { switch ($node->_op) { case TSQ_TOK_WORD: @@ -356,7 +287,7 @@ $lines = array($indent . $node->op . ":"); $indent .= " "; foreach ($node->leaves as $leaf) - $lines[] = $this->_as_string($leaf, $indent); + $lines[] = $this->as_string($leaf, $indent); return join("\n", $lines); } } @@ -391,11 +322,6 @@ return ""; } - function makeSqlClause($make_sql_clause_cb) - { - return "(1 = 0)"; - } - function asString() { return "NullTextSearchQuery"; @@ -420,6 +346,9 @@ */ class NumericSearchQuery { + protected $bound; + protected $workquery; + /** * Create a new query. * NumericSearchQuery("population > 20000 or population < 200", "population") @@ -541,10 +470,10 @@ * Check the bound, numeric-only query against unwanted functions and sideeffects. * "4560000 < 20000 and 1456022 > 1000000" */ - function _live_check() + private function live_check() { // TODO: check $this->_workquery again? - return !empty($this->_workquery); + return !empty($this->workquery); } /** @@ -567,23 +496,23 @@ * @param $x string The variable name to be replaced in the query. * @return string */ - function _bind($value, $x) + private function bind($value, $x) { // TODO: check is_number, is_float, is_integer and do casting - $this->_bound[] = array('linkname' => $x, + $this->bound[] = array('linkname' => $x, 'linkvalue' => $value); $value = preg_replace("/[^-+0123456789.,]/", "", $value); //$c = "/\b".preg_quote($x,"/")."\b/"; - $this->_workquery = preg_replace("/\b" . preg_quote($x, "/") . "\b/", $value, $this->_workquery); + $this->workquery = preg_replace("/\b" . preg_quote($x, "/") . "\b/", $value, $this->workquery); // FIXME: do again a final check. now only numbers and some operators are allowed. - return $this->_workquery; + return $this->workquery; } /* array of successfully bound vars, and in case of success, the resulting vars */ - function _bound() + private function bound() { - return $this->_bound; + return $this->bound; } /** @@ -591,7 +520,7 @@ * Purpose: Be silent about missing vars, just return false. `* * @access public - * @param $variable string or hash of name => value The keys must satisfy all placeholders in the definition. + * @param string $variables string or hash of name => value The keys must satisfy all placeholders in the definition. * We want the full hash and not just the keys because a hash check is faster than the array of keys check. * @return boolean */ @@ -625,25 +554,25 @@ function match(&$variable) { $p =& $this->_placeholders; - $this->_workquery = $this->_query; + $this->workquery = $this->_query; if (!is_array($p)) { if (is_array($variable)) { // which var to match? we cannot decide this here if (!isset($variable[$p])) - trigger_error("Required NumericSearchQuery->match variable $x not defined.", E_USER_ERROR); - $this->_bind($variable[$p], $p); + trigger_error("Required NumericSearchQuery->match variable $p not defined.", E_USER_ERROR); + $this->bind($variable[$p], $p); } else { - $this->_bind($variable, $p); + $this->bind($variable, $p); } } else { foreach ($p as $x) { if (!isset($variable[$x])) trigger_error("Required NumericSearchQuery->match variable $x not defined.", E_USER_ERROR); - $this->_bind($variable[$x], $x); + $this->bind($variable[$x], $x); } } - if (!$this->_live_check()) // check returned an error + if (!$this->live_check()) // check returned an error return false; - $search = $this->_workquery; + $search = $this->workquery; $result = false; //if (DEBUG & _DEBUG_VERBOSE) // trigger_error("\$result = (boolean)($search);", E_USER_NOTICE); @@ -652,7 +581,7 @@ // php-5.1.2 cgi true, 4.2.2 cgi true eval("\$result = (boolean)($search);"); if ($result and is_array($p)) { - return $this->_bound(); + return $this->bound(); } return $result; } @@ -672,6 +601,7 @@ { public $op = 'VOID'; public $_op = 0; + public $word; /** * Optimize this node. @@ -683,7 +613,7 @@ } /** - * @return regexp matching this node. + * @return string regexp matching this node. */ function regexp() { @@ -691,7 +621,7 @@ } /** - * @param bool True if this node has been negated (higher in the parse tree.) + * @param bool $negated True if this node has been negated (higher in the parse tree.) * @return array A list of all non-negated words contained by this node. */ function highlight_words($negated = false) @@ -704,7 +634,7 @@ return $this->word; } - function _sql_quote() + protected function sql_quote() { global $request; $word = preg_replace('/(?=[%_\\\\])/', "\\", $this->word); @@ -738,7 +668,7 @@ function sql() { - return '%' . $this->_sql_quote($this->word) . '%'; + return '%' . $this->sql_quote($this->word) . '%'; } } @@ -772,7 +702,7 @@ function sql() { - return $this->_sql_quote($this->word) . '%'; + return $this->sql_quote($this->word) . '%'; } } @@ -799,7 +729,7 @@ function sql() { - return '%' . $this->_sql_quote($this->word); + return '%' . $this->sql_quote($this->word); } } @@ -843,7 +773,7 @@ function sql() { - return $this->_sql_quote($this->word); + return $this->sql_quote($this->word); } } @@ -936,7 +866,7 @@ $this->leaves = $leaves; } - function _flatten() + protected function flatten() { // This flattens e.g. (AND (AND a b) (OR c d) e) // to (AND a b e (OR c d)) @@ -953,7 +883,7 @@ function optimize() { - $this->_flatten(); + $this->flatten(); assert(!empty($this->leaves)); if (count($this->leaves) == 1) return $this->leaves[0]; // (AND x) -> x @@ -980,7 +910,7 @@ function optimize() { - $this->_flatten(); + $this->flatten(); // Convert (AND (NOT a) (NOT b) c d) into (AND (NOT (OR a b)) c d). // Since OR's are more efficient for regexp matching: @@ -1047,12 +977,12 @@ if ($words) array_unshift($regexps, - '(?=.*' . $this->_join($words) . ')'); + '(?=.*' . $this->join($words) . ')'); - return $this->_join($regexps); + return $this->join($regexps); } - function _join($regexps) + private function join($regexps) { assert(count($regexps) > 0); @@ -1110,10 +1040,13 @@ * * ALL */ + public $lexer; + private $regex; + function parse($search_expr, $case_exact = false, $regex = TSQ_REGEX_AUTO) { $this->lexer = new TextSearchQuery_Lexer($search_expr, $case_exact, $regex); - $this->_regex = $regex; + $this->regex = $regex; $tree = $this->get_list('toplevel'); // Assert failure when using the following URL in debug mode. // /TitleSearch?action=FullTextSearch&s=WFXSSProbe'")/>&case_exact=1®ex=sql Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2013-09-03 09:39:54 UTC (rev 8836) +++ trunk/lib/WikiDB/backend.php 2013-09-03 09:55:48 UTC (rev 8837) @@ -851,7 +851,7 @@ { function _pagename_match_clause($node) { - // word already quoted by TextSearchQuery_node_word::_sql_quote() + // word already quoted by TextSearchQuery_node_word::sql_quote() $word = $node->sql(); if ($word == '%') // ALL shortcut return "1=1"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-01-28 17:09:54
|
Revision: 8849 http://sourceforge.net/p/phpwiki/code/8849 Author: vargenau Date: 2014-01-28 17:09:51 +0000 (Tue, 28 Jan 2014) Log Message: ----------- Remove unused variables Modified Paths: -------------- trunk/lib/CachedMarkup.php trunk/lib/Google.php trunk/lib/editpage.php Modified: trunk/lib/CachedMarkup.php =================================================================== --- trunk/lib/CachedMarkup.php 2014-01-13 12:37:29 UTC (rev 8848) +++ trunk/lib/CachedMarkup.php 2014-01-28 17:09:51 UTC (rev 8849) @@ -122,7 +122,6 @@ */ function getLinkInfo() { - $link = array(); foreach ($this->_content as $link) { if (!isa($link, 'Cached_Link')) continue; Modified: trunk/lib/Google.php =================================================================== --- trunk/lib/Google.php 2014-01-13 12:37:29 UTC (rev 8848) +++ trunk/lib/Google.php 2014-01-28 17:09:51 UTC (rev 8849) @@ -95,9 +95,7 @@ foreach ($this->fields as $f) { $this->{$f} = $result[$f]; } - $i = 0; $this->results = array(); - //$this->resultElements = $result['resultElements']; foreach ($this->resultElements as $r) { $this->results[] = new GoogleSearchResult($r); } @@ -272,7 +270,7 @@ /** * Get spelling suggestions from Google * - * @param string phrase word or phrase to spell-check + * @param string $phrase word or phrase to spell-check * @return string text of any suggested replacement, or None */ function doSpellingSuggestion($phrase) Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2014-01-13 12:37:29 UTC (rev 8848) +++ trunk/lib/editpage.php 2014-01-28 17:09:51 UTC (rev 8849) @@ -903,10 +903,8 @@ $current = &$this->current; if ($selected && $selected->getVersion() != $current->getVersion()) { - $rev = $selected; $pagelink = WikiLink($selected); } else { - $rev = $current; $pagelink = WikiLink($this->page); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-01-28 17:10:39
|
Revision: 8850 http://sourceforge.net/p/phpwiki/code/8850 Author: vargenau Date: 2014-01-28 17:10:36 +0000 (Tue, 28 Jan 2014) Log Message: ----------- Update PHP Doc Modified Paths: -------------- trunk/lib/PageList.php trunk/lib/WikiDB.php trunk/lib/WikiPluginCached.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2014-01-28 17:09:51 UTC (rev 8849) +++ trunk/lib/PageList.php 2014-01-28 17:10:36 UTC (rev 8850) @@ -1326,7 +1326,7 @@ * column will only be added the first time, and ignored the succeeding times. * If you wish to add multiple columns of the same type, use addColumnObject(). * - * @param string column name + * @param string $column column name * @return bool true if column is added, false otherwise */ function _addColumn($column) Modified: trunk/lib/WikiDB.php =================================================================== --- trunk/lib/WikiDB.php 2014-01-28 17:09:51 UTC (rev 8849) +++ trunk/lib/WikiDB.php 2014-01-28 17:10:36 UTC (rev 8850) @@ -273,15 +273,15 @@ * * @access public * - * @param boolean $include_empty Optional. Normally pages whose most + * @param bool $include_empty Optional. Normally pages whose most * recent revision has empty content are considered to be * non-existant. Unless $include_defaulted is set to true, those * pages will not be returned. - * @param string or false $sortby Optional. "+-column,+-column2". + * @param string $sortby Optional. "+-column,+-column2". * If false the result is faster in natural order. - * @param string or false $limit Optional. Encoded as "$offset,$count". + * @param string $limit Optional. Encoded as "$offset,$count". * $offset defaults to 0. - * @param string $exclude: Optional comma-separated list of pagenames. + * @param string $exclude Optional comma-separated list of pagenames. * * @return WikiDB_PageIterator A WikiDB_PageIterator which contains all pages * in the WikiDB which have non-default contents. @@ -332,11 +332,11 @@ * * @access public * @param TextSearchQuery $search A TextSearchQuery object - * @param string or false $sortby Optional. "+-column,+-column2". + * @param string $sortby Optional. "+-column,+-column2". * If false the result is faster in natural order. - * @param string or false $limit Optional. Encoded as "$offset,$count". + * @param string $limit Optional. Encoded as "$offset,$count". * $offset defaults to 0. - * @param string $exclude: Optional comma-separated list of pagenames. + * @param string $exclude Optional comma-separated list of pagenames. * @return WikiDB_PageIterator A WikiDB_PageIterator containing the matching pages. * @see TextSearchQuery */ @@ -363,11 +363,11 @@ * @access public * * @param TextSearchQuery $search A TextSearchQuery object. - * @param string or false $sortby Optional. "+-column,+-column2". + * @param string $sortby Optional. "+-column,+-column2". * If false the result is faster in natural order. - * @param string or false $limit Optional. Encoded as "$offset,$count". + * @param string $limit Optional. Encoded as "$offset,$count". * $offset defaults to 0. - * @param string $exclude: Optional comma-separated list of pagenames. + * @param string $exclude Optional comma-separated list of pagenames. * @return WikiDB_PageIterator A WikiDB_PageIterator containing the matching pages. * @see TextSearchQuery */ @@ -388,10 +388,10 @@ * * @access public * - * @param integer $limit The maximum number of pages to return. + * @param int $limit The maximum number of pages to return. * Set $limit to zero to return all pages. If $limit < 0, pages will * be sorted in decreasing order of popularity. - * @param string or false $sortby Optional. "+-column,+-column2". + * @param string $sortby Optional. "+-column,+-column2". * If false the result is faster in natural order. * * @return WikiDB_PageIterator A WikiDB_PageIterator containing the matching @@ -441,9 +441,9 @@ /** * @access public * - * @param string or false $sortby Optional. "+-column,+-column2". + * @param string $sortby Optional. "+-column,+-column2". * If false the result is faster in natural order. - * @param string or false $limit Optional. Encoded as "$offset,$count". + * @param string $limit Optional. Encoded as "$offset,$count". * $offset defaults to 0. * @return Iterator A generic iterator containing rows of * (duplicate) pagename, wantedfrom. @@ -1460,7 +1460,7 @@ /** * @access private - * @param integer_or_object $version_or_pagerevision + * @param int|object $version_or_pagerevision * Takes either the version number (and int) or a WikiDB_PageRevision * object. * @return integer The version number. Modified: trunk/lib/WikiPluginCached.php =================================================================== --- trunk/lib/WikiPluginCached.php 2014-01-28 17:09:51 UTC (rev 8849) +++ trunk/lib/WikiPluginCached.php 2014-01-28 17:10:36 UTC (rev 8850) @@ -126,11 +126,11 @@ * however. </b> * * @access protected - * @param dbi WikiDB database abstraction class - * @param argstr string plugin arguments in the call from PhpWiki - * @param request Request ??? - * @param string basepage Pagename to use to interpret links [/relative] page names. - * @return string HTML output to be printed to browser + * @param WikiDB $dbi database abstraction class + * @param string $argstr plugin arguments in the call from PhpWiki + * @param Request $request + * @param string $basepage Pagename to use to interpret links [/relative] page names. + * @return string HTML output to be printed to browser * * @see #getHtml * @see #getImage This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-05-26 14:34:57
|
Revision: 8856 http://sourceforge.net/p/phpwiki/code/8856 Author: vargenau Date: 2014-05-26 14:34:55 +0000 (Mon, 26 May 2014) Log Message: ----------- Prepare for PHP 5.5: use preg_replace_callback instead of preg_replace/e Modified Paths: -------------- trunk/lib/WikiPlugin.php trunk/lib/stdlib.php Modified: trunk/lib/WikiPlugin.php =================================================================== --- trunk/lib/WikiPlugin.php 2014-05-06 14:21:05 UTC (rev 8855) +++ trunk/lib/WikiPlugin.php 2014-05-26 14:34:55 UTC (rev 8856) @@ -153,10 +153,12 @@ // Expand [arg] to $request->getArg("arg") unless preceded by ~ function expandArg($argval, &$request) { - // return preg_replace('/\[(\w[\w\d]*)\]/e', '$request->getArg("$1")', // Replace the arg unless it is preceded by a ~ - $ret = preg_replace('/([^~]|^)\[(\w[\w\d]*)\]/e', - '"$1" . $request->getArg("$2")', + $ret = preg_replace_callback('/([^~]|^)\[(\w[\w\d]*)\]/', + function ($m) { + global $request; + return "$m[1]" . $request->getArg("$m[2]"); + }, $argval); // Ditch the ~ so later versions can be expanded if desired return preg_replace('/~(\[\w[\w\d]*\])/', '$1', $ret); Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2014-05-06 14:21:05 UTC (rev 8855) +++ trunk/lib/stdlib.php 2014-05-26 14:34:55 UTC (rev 8856) @@ -138,9 +138,11 @@ if (!$str) { return 'empty.'; } - - return preg_replace('/[^-_:A-Za-z0-9]|(?<=^)[^A-Za-z]/e', - "'.' . sprintf('%02x', ord('\\0'))", + return preg_replace_callback( + '/[^-_:A-Za-z0-9]|(?<=^)[^A-Za-z]/', + function ($m) { + return '.' . sprintf('%02x', ord('$m')); + }, $str); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-05-28 14:16:35
|
Revision: 8858 http://sourceforge.net/p/phpwiki/code/8858 Author: vargenau Date: 2014-05-28 14:16:32 +0000 (Wed, 28 May 2014) Log Message: ----------- Remove commented code Modified Paths: -------------- trunk/lib/RssWriter.php trunk/lib/RssWriter2.php Modified: trunk/lib/RssWriter.php =================================================================== --- trunk/lib/RssWriter.php 2014-05-27 09:10:11 UTC (rev 8857) +++ trunk/lib/RssWriter.php 2014-05-28 14:16:32 UTC (rev 8858) @@ -122,7 +122,6 @@ { header("Content-Type: application/xml; charset=" . RSS_ENCODING); echo('<' . '?xml version="1.0" encoding="' . RSS_ENCODING . '"?' . ">\n"); - //printf("<!-- generator=\"PhpWiki-%s\" -->\n", PHPWIKI_VERSION); $this->printXML(); } @@ -220,7 +219,6 @@ { header("Content-Type: application/atom+xml; charset=" . RSS_ENCODING); echo('<' . '?xml version="1.0" encoding="' . RSS_ENCODING . '"?' . ">\n"); - //printf("<!-- generator=\"PhpWiki-%s\" -->\n", PHPWIKI_VERSION); $this->printXML(); } Modified: trunk/lib/RssWriter2.php =================================================================== --- trunk/lib/RssWriter2.php 2014-05-27 09:10:11 UTC (rev 8857) +++ trunk/lib/RssWriter2.php 2014-05-28 14:16:32 UTC (rev 8858) @@ -69,7 +69,6 @@ { header("Content-Type: application/rss+xml; charset=" . RSS_ENCODING); echo('<' . '?xml version="1.0" encoding="' . RSS_ENCODING . '"?' . ">\n"); - //printf("<!-- generator=\"PhpWiki-%s\" -->\n", PHPWIKI_VERSION); //RSS2 really is 0.92 echo '<!DOCTYPE rss SYSTEM "http://my.netscape.com/publish/formats/rss-0.92.dtd">', "\n"; echo "<!DOCTYPE rss [<!ENTITY % HTMLlat1 PUBLIC \"-//W3C//ENTITIES Latin 1 for XHTML//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent\">\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-06-10 16:38:19
|
Revision: 8882 http://sourceforge.net/p/phpwiki/code/8882 Author: vargenau Date: 2014-06-10 16:38:14 +0000 (Tue, 10 Jun 2014) Log Message: ----------- Update PHP Doc Modified Paths: -------------- trunk/lib/AccessLog.php trunk/lib/DbSession.php trunk/lib/ErrorManager.php trunk/lib/ExternalReferrer.php trunk/lib/FileFinder.php trunk/lib/Google.php trunk/lib/HtmlElement.php trunk/lib/PageType.php trunk/lib/RSSWriter091.php trunk/lib/Request.php trunk/lib/SemanticWeb.php trunk/lib/WikiDB.php trunk/lib/WikiGroup.php trunk/lib/WikiPluginCached.php trunk/lib/WikiTheme.php trunk/lib/WikiUser.php trunk/lib/loadsave.php trunk/lib/prepend.php trunk/lib/stdlib.php trunk/lib/upgrade.php Modified: trunk/lib/AccessLog.php =================================================================== --- trunk/lib/AccessLog.php 2014-06-06 16:02:08 UTC (rev 8881) +++ trunk/lib/AccessLog.php 2014-06-10 16:38:14 UTC (rev 8882) @@ -35,7 +35,8 @@ class Request_AccessLog { /** - * @param $logfile string Log file name. + * @param string $logfile Log file name. + * @param bool $do_sql */ function Request_AccessLog($logfile, $do_sql = false) { @@ -297,7 +298,7 @@ * * This is a static member function. * - * @param $time integer Unix timestamp (defaults to current time). + * @param int|bool $time Unix timestamp (defaults to current time). * @return string Zone offset, e.g. "-0800" for PST. */ function _zone_offset($time = false) @@ -320,7 +321,7 @@ * * This is a static member function. * - * @param $time integer Unix timestamp (defaults to current time). + * @param int|bool $time Unix timestamp (defaults to current time). * @return string Formatted date & time. */ function _ncsa_time($time = false) Modified: trunk/lib/DbSession.php =================================================================== --- trunk/lib/DbSession.php 2014-06-06 16:02:08 UTC (rev 8881) +++ trunk/lib/DbSession.php 2014-06-10 16:38:14 UTC (rev 8882) @@ -22,6 +22,7 @@ * be extracted. * * @param string $table + * @return bool|DbSession * Name of SQL table containing session data. */ function DbSession(&$dbh, $table = 'session') Modified: trunk/lib/ErrorManager.php =================================================================== --- trunk/lib/ErrorManager.php 2014-06-06 16:02:08 UTC (rev 8881) +++ trunk/lib/ErrorManager.php 2014-06-10 16:38:14 UTC (rev 8882) @@ -431,10 +431,10 @@ /** * Construct a new PhpError. - * @param $errno int - * @param $errstr string - * @param $errfile string - * @param $errline int + * @param int $errno + * @param string $errstr + * @param string $errfile + * @param int $errline */ function PhpError($errno, $errstr, $errfile, $errline) { @@ -587,8 +587,10 @@ { /** * Construct a new PhpError. - * @param $errno int - * @param $errstr string + * @param int $errno + * @param string $errstr + * @param string $errfile + * @param int $errline */ function PhpWikiError($errno, $errstr, $errfile, $errline) { Modified: trunk/lib/ExternalReferrer.php =================================================================== --- trunk/lib/ExternalReferrer.php 2014-06-06 16:02:08 UTC (rev 8881) +++ trunk/lib/ExternalReferrer.php 2014-06-10 16:38:14 UTC (rev 8882) @@ -74,6 +74,7 @@ * the method determines the name of the search engine, it's URL, and the search keywords * used in the search. This information is returned in an associative array with the following * keys: + * @param string $url * @returns array engine, engine_url, query * @public */ Modified: trunk/lib/FileFinder.php =================================================================== --- trunk/lib/FileFinder.php 2014-06-06 16:02:08 UTC (rev 8881) +++ trunk/lib/FileFinder.php 2014-06-10 16:38:14 UTC (rev 8882) @@ -20,7 +20,7 @@ * * @param $path array A list of directories in which to search for files. */ - function FileFinder($path = false) + function FileFinder($path = array()) { $this->_pathsep = $this->_get_syspath_separator(); if (!isset($this->_path) and $path === false) @@ -32,6 +32,7 @@ * Find file. * * @param $file string File to search for. + * @param bool $missing_okay * @return string The filename (including path), if found, otherwise false. */ function findFile($file, $missing_okay = false) @@ -139,6 +140,7 @@ * So if there's any '\' in the path, either fix them to '/' (not in Win95 or FAT?) * or use '\' for ours. * + * @param string $path * @access private * @return string path_separator. */ Modified: trunk/lib/Google.php =================================================================== --- trunk/lib/Google.php 2014-06-06 16:02:08 UTC (rev 8881) +++ trunk/lib/Google.php 2014-06-10 16:38:14 UTC (rev 8882) @@ -254,7 +254,7 @@ * * The return type for cached pages is base64 encoded text. * - * @params string url - full URL to the page to retrieve + * @param string $url - full URL to the page to retrieve * @return string full text of the cached page */ function doGetCachedPage($url) Modified: trunk/lib/HtmlElement.php =================================================================== --- trunk/lib/HtmlElement.php 2014-06-06 16:02:08 UTC (rev 8881) +++ trunk/lib/HtmlElement.php 2014-06-10 16:38:14 UTC (rev 8882) @@ -68,9 +68,10 @@ /** Add a "tooltip" to an element. * - * @param $tooltip_text string The tooltip text. + * @param string $tooltip_text The tooltip text. + * @param string $accesskey. */ - function addTooltip($tooltip_text, $accesskey = null) + function addTooltip($tooltip_text, $accesskey = '') { $this->setAttr('title', $tooltip_text); if ($accesskey) $this->setAccesskey($accesskey); @@ -580,7 +581,7 @@ /** * Generate hidden form input fields. * - * @param $query_args hash A hash mapping names to values for the hidden inputs. + * @param array $query_args A hash mapping names to values for the hidden inputs. * Values in the hash can themselves be hashes. The will result in hidden inputs * which will reconstruct the nested structure in the resulting query args as * processed by PHP. @@ -597,6 +598,8 @@ * <input type="hidden" name="y[a]" value = "aval" /> * <input type="hidden" name="y[b]" value = "bval" /> * + * @param bool $pfx + * @param array $exclude * @return object An XmlContent object containing the inputs. */ function HiddenInputs($query_args, $pfx = false, $exclude = array()) @@ -619,11 +622,11 @@ /** Generate a <script> tag containing javascript. * * @param string $js The javascript. - * @param string $script_args (optional) hash of script tags options + * @param array $script_args (optional) hash of script tags options * e.g. to provide another version or the defer attr * @return HtmlElement A <script> element. */ -function JavaScript($js, $script_args = false) +function JavaScript($js, $script_args = array()) { $default_script_args = array( //'version' => 'JavaScript', // not xhtml conformant 'type' => 'text/javascript'); Modified: trunk/lib/PageType.php =================================================================== --- trunk/lib/PageType.php 2014-06-06 16:02:08 UTC (rev 8881) +++ trunk/lib/PageType.php 2014-06-10 16:38:14 UTC (rev 8882) @@ -30,11 +30,11 @@ * * @param WikiDB_Page $page * @param string $text The packed page revision content. - * @param hash $meta The version meta-data. + * @param array $meta The version meta-data. * @param string $type_override For markup of page using a different * pagetype than that specified in its version meta-data. */ - function TransformedText($page, $text, $meta, $type_override = false) + function TransformedText($page, $text, $meta, $type_override = '') { $pagetype = false; if ($type_override) @@ -74,10 +74,10 @@ * * This is a static member function. * - * @param string $pagetype Name of the page type. + * @param string $name Name of the page type. * @return PageType An object which is a subclass of PageType. */ - function GetPageType($name = false) + function GetPageType($name = '') { if (!$name) $name = 'wikitext'; @@ -106,7 +106,7 @@ * * @param WikiDB_Page $page * @param string $text - * @param hash $meta Version meta-data + * @param array $meta Version meta-data * @return XmlContent The transformed page text. */ function transform(&$page, &$text, $meta) Modified: trunk/lib/RSSWriter091.php =================================================================== --- trunk/lib/RSSWriter091.php 2014-06-06 16:02:08 UTC (rev 8881) +++ trunk/lib/RSSWriter091.php 2014-06-10 16:38:14 UTC (rev 8882) @@ -104,7 +104,7 @@ { global $request; - $rc_url = WikiURL($request->getArg('pagename'), false, 'absurl'); + $rc_url = WikiURL($request->getArg('pagename'), array(), 'absurl'); return array('title' => WIKI_NAME, 'description' => _("RecentChanges"), Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2014-06-06 16:02:08 UTC (rev 8881) +++ trunk/lib/Request.php 2014-06-10 16:38:14 UTC (rev 8882) @@ -22,7 +22,7 @@ class Request { - public $args = array(); + public $args = array(); function Request() { @@ -866,6 +866,7 @@ { /** * @param $logfile string Log file name. + * @param bool $do_sql */ function Request_AccessLog($logfile, $do_sql = false) { @@ -1123,10 +1124,10 @@ * * This is a static member function. * - * @param $time integer Unix timestamp (defaults to current time). + * @param int $time Unix timestamp (defaults to current time). * @return string Zone offset, e.g. "-0800" for PST. */ - function _zone_offset($time = false) + function _zone_offset($time = 0) { if (!$time) $time = time(); @@ -1146,10 +1147,10 @@ * * This is a static member function. * - * @param $time integer Unix timestamp (defaults to current time). + * @param int $time Unix timestamp (defaults to current time). * @return string Formatted date & time. */ - function _ncsa_time($time = false) + function _ncsa_time($time = 0) { if (!$time) $time = time(); Modified: trunk/lib/SemanticWeb.php =================================================================== --- trunk/lib/SemanticWeb.php 2014-06-06 16:02:08 UTC (rev 8881) +++ trunk/lib/SemanticWeb.php 2014-06-10 16:38:14 UTC (rev 8882) @@ -132,7 +132,7 @@ $this->_uris_seen = array(); $this->_items = array(); - $this->wiki_xmlns_xml = WikiURL(_("UriResolver") . "?", false, true); + $this->wiki_xmlns_xml = WikiURL(_("UriResolver") . "?", array(), true); $this->wiki_xmlns_url = PHPWIKI_BASE_URL; $this->pre_ns_buffer = Modified: trunk/lib/WikiDB.php =================================================================== --- trunk/lib/WikiDB.php 2014-06-06 16:02:08 UTC (rev 8881) +++ trunk/lib/WikiDB.php 2014-06-10 16:38:14 UTC (rev 8882) @@ -217,6 +217,7 @@ * @access public * @param string $pagename Name of page to delete. * @see purgePage + * @return mixed */ function deletePage($pagename) { @@ -410,7 +411,7 @@ * * @access public * - * @param hash $params This hash is used to specify various optional + * @param array $params This hash is used to specify various optional * parameters: * <dl> * <dt> limit @@ -432,7 +433,7 @@ * @return WikiDB_PageRevisionIterator A WikiDB_PageRevisionIterator * containing the matching revisions. */ - function mostRecent($params = false) + function mostRecent($params = array()) { $result = $this->_backend->most_recent($params); return new WikiDB_PageRevisionIterator($this, $result); @@ -441,6 +442,8 @@ /** * @access public * + * @param string $exclude_from + * @param string $exclude * @param string $sortby Optional. "+-column,+-column2". * If false the result is faster in natural order. * @param string $limit Optional. Encoded as "$offset,$count". @@ -451,7 +454,6 @@ function wantedPages($exclude_from = '', $exclude = '', $sortby = '', $limit = '') { return $this->_backend->wanted_pages($exclude_from, $exclude, $sortby, $limit); - //return new WikiDB_PageIterator($this, $result); } /** @@ -460,8 +462,8 @@ * * @access public * - * @param $pages object A TextSearchQuery object. - * @param $search object A TextSearchQuery object. + * @param object $pages A TextSearchQuery object. + * @param object $search A TextSearchQuery object. * @param string $linktype One of "linkto", "linkfrom", "relation", "attribute". * linktype parameter: * <dl> @@ -474,7 +476,7 @@ * <dt> "attribute" * <dd> the first part in a <>:=<> link * </dl> - * @param $relation object An optional TextSearchQuery to match the + * @param mixed $relation An optional TextSearchQuery to match the * relation name. Ignored on simple in-out links. * * @return Iterator A generic iterator containing links to pages or values. @@ -490,7 +492,9 @@ * for the SemanticSearch autocompletion. * * @access public - * + * @param bool $also_attributes + * @param bool $only_attributes + * @param bool $sorted * @return array of strings */ function listRelations($also_attributes = false, $only_attributes = false, $sorted = true) @@ -1027,7 +1031,11 @@ * (You can defeat this check by setting $version to * {@link WIKIDB_FORCE_CREATE} --- not usually recommended.) * - * @param hash $meta Meta-data for new revision. + * @param array $meta Meta-data for new revision. + * + * @param mixed $formatted + * + * @return mixed */ function save($wikitext, $version, $meta, $formatted = null) { @@ -1100,7 +1108,7 @@ * Get the most recent revision of a page. * * @access public - * + * @param bool $need_content * @return WikiDB_PageRevision The current WikiDB_PageRevision object. */ function getCurrentRevision($need_content = true) @@ -1129,8 +1137,8 @@ * * @access public * - * @param integer $version Which revision to get. - * + * @param int $version Which revision to get. + * @param bool $need_content * @return WikiDB_PageRevision The requested WikiDB_PageRevision object, or * false if the requested revision does not exist in the {@link WikiDB}. * Note that version zero of any page always exists. @@ -1161,9 +1169,11 @@ * * @access public * - * @param integer $version Find most recent revision before this version. + * @param bool|int $version Find most recent revision before this version. * You can also use a WikiDB_PageRevision object to specify the $version. * + * @param bool $need_content + * * @return WikiDB_PageRevision The requested WikiDB_PageRevision object, or false if the * requested revision does not exist in the {@link WikiDB}. Note that * unless $version is greater than zero, a revision (perhaps version zero, @@ -1213,8 +1223,13 @@ * * @access public * - * @param boolean $reversed Which links to find: true for backlinks (default). - * + * @param bool $reversed Which links to find: true for backlinks (default). + * @param bool $include_empty + * @param string $sortby + * @param string $limit + * @param string $sortby + * @param string $exclude + * @param bool $want_relations * @return WikiDB_PageIterator A WikiDB_PageIterator containing * all matching pages. */ @@ -1656,8 +1671,7 @@ /** * Get the transformed content of a page. * - * @param string $pagetype Override the page-type of the revision. - * + * @param bool $pagetype_override * @return object An XmlContent-like object containing the page transformed * contents. */ Modified: trunk/lib/WikiGroup.php =================================================================== --- trunk/lib/WikiGroup.php 2014-06-06 16:02:08 UTC (rev 8881) +++ trunk/lib/WikiGroup.php 2014-06-10 16:38:14 UTC (rev 8882) @@ -72,7 +72,7 @@ /** * Initializes a WikiGroup object which should never happen. Use: * $group = &WikiGroup::getGroup(); - * @param object $request The global WikiRequest object -- ignored. + * @param bool $not_current */ function WikiGroup($not_current = false) { @@ -103,7 +103,7 @@ /** * Static method to return the WikiGroup subclass used in this wiki. Controlled * by the constant GROUP_METHOD. - * @param object $request The global WikiRequest object. + * @param bool $not_current The global WikiRequest object. * @return object Subclass of WikiGroup selected via GROUP_METHOD. */ function getGroup($not_current = false) @@ -387,7 +387,7 @@ * @param string $user Username to add to the group (default = current user). * @return bool On true user was added, false if not. */ - function setMemberOf($group, $user = false) + function setMemberOf($group, $user = '') { trigger_error(__sprintf("Method “%s” not implemented in this GROUP_METHOD %s", 'setMemberOf', GROUP_METHOD), @@ -404,7 +404,7 @@ * @param string $user Username to remove from the group (default = current user). * @return bool On true user was removed, false if not. */ - function removeMemberOf($group, $user = false) + function removeMemberOf($group, $user = '') { trigger_error(__sprintf("Method “%s” not implemented in this GROUP_METHOD %s", 'removeMemberOf', GROUP_METHOD), @@ -425,13 +425,9 @@ /** * Constructor - * - * Ignores the parameter provided. - * @param object $request The global WikiRequest object - ignored. */ function GroupNone() { - //$this->request = &$GLOBALS['request']; return; } @@ -455,7 +451,6 @@ * Determines all of the groups of which the current user is a member. * * The group is ignored and an empty array (a member of no groups) is returned. - * @param string $group Name of the group to check for membership (ignored). * @return array Array of groups to which the user belongs (always empty). */ function getAllGroupsIn() @@ -492,7 +487,6 @@ * Constructor * * Initializes the three superclass instance variables - * @param object $request The global WikiRequest object. */ function GroupWikiPage() { @@ -535,6 +529,7 @@ * Private method to take a WikiDB_Page and parse to determine if the * current_user is a member of the group. * @param object $group_page WikiDB_Page object for the group's page + * @param bool $strict * @return boolean True if user is a member, else false. * @access private */ @@ -562,7 +557,6 @@ * * Checks the root Group page ('CategoryGroup') for the list of all groups, * then checks each group to see if the current user is a member. - * @param string $group Name of the group to check for membership. * @return array Array of groups to which the user belongs. */ function getAllGroupsIn() @@ -633,8 +627,6 @@ /** * Constructor - * - * @param object $request The global WikiRequest object. ignored */ function GroupDb() { @@ -711,7 +703,6 @@ * Determines all of the groups of which the current user is a member. * * then checks each group to see if the current user is a member. - * @param string $group Name of the group to check for membership. * @return array Array of groups to which the user belongs. */ function getAllGroupsIn() @@ -804,7 +795,6 @@ * Determines all of the groups of which the current user is a member. * then checks each group to see if the current user is a member. * - * @param string $group Name of the group to check for membership. * @return array Array of groups to which the user belongs. */ function getAllGroupsIn() @@ -868,8 +858,6 @@ /** * Constructor - * - * @param object $request The global WikiRequest object. */ function GroupFile() { @@ -929,7 +917,6 @@ * Determines all of the groups of which the current user is a member. * * then checks each group to see if the current user is a member. - * @param string $group Name of the group to check for membership. * @return array Array of groups to which the user belongs. */ function getAllGroupsIn() @@ -987,8 +974,6 @@ /** * Constructor - * - * @param object $request The global WikiRequest object. */ function GroupLdap() { @@ -999,7 +984,7 @@ if (!defined("LDAP_AUTH_HOST")) { trigger_error(sprintf(_("%s not defined"), "LDAP_AUTH_HOST"), E_USER_WARNING); - return false; + return; } // We should ignore multithreaded environments, not generally windows. // CGI does work. @@ -1008,7 +993,7 @@ dl("ldap" . defined('PHP_SHLIB_SUFFIX') ? PHP_SHLIB_SUFFIX : DLL_EXT); if (!function_exists('ldap_connect')) { trigger_error(_("No LDAP in this PHP version"), E_USER_WARNING); - return false; + return; } } if (!defined("LDAP_BASE_DN")) @@ -1051,13 +1036,10 @@ /** * Determines all of the groups of which the current user is a member. * - * @param string $group Name of the group to check for membership. * @return array Array of groups to which the user belongs. */ function getAllGroupsIn() { - //$request = &$this->request; - //$username = $this->_getUserName(); $membership = array(); $specialgroups = $this->specialGroups(); Modified: trunk/lib/WikiPluginCached.php =================================================================== --- trunk/lib/WikiPluginCached.php 2014-06-06 16:02:08 UTC (rev 8881) +++ trunk/lib/WikiPluginCached.php 2014-06-10 16:38:14 UTC (rev 8882) @@ -65,8 +65,8 @@ * will allow to find a cached image or to reconstruct the complete * plugin call to recreate the image. * - * @param cache object the cache object used to store the images - * @param argarray array all parameters (including those set to + * @param object $cache the cache object used to store the images + * @param array $argarray all parameters (including those set to * default values) of the plugin call to be * prepared * @access private @@ -285,12 +285,12 @@ * PLUGIN_CACHED_IMG_INLINE or PLUGIN_CACHED_IMG_ONDEMAND. * * @access protected pure virtual - * @param dbi WikiDB database abstraction class - * @param argarray array complete (!) arguments to produce + * @param WikiDB $dbi database abstraction class + * @param array $argarray complete (!) arguments to produce * image. It is not necessary to call * WikiPlugin->getArgs anymore. - * @param request Request ??? - * @return imagehandle image handle if successful + * @param Request $request + * @return mixed imagehandle image handle if successful * false if an error occured */ function getImage($dbi, $argarray, $request) @@ -309,11 +309,11 @@ * is determined by the last "touch" of the entry. * * @access protected virtual - * @param dbi WikiDB database abstraction class - * @param argarray array complete (!) arguments. It is + * @param WikiDB $dbi database abstraction class + * @param array $argarray complete (!) arguments. It is * not necessary to call * WikiPlugin->getArgs anymore. - * @param request Request ??? + * @param Request $request * @return string format: '+seconds' * '0' never expires */ @@ -327,11 +327,11 @@ * Always used unless plugin type is PLUGIN_CACHED_HTML. * * @access protected virtual - * @param dbi WikiDB database abstraction class - * @param argarray array complete (!) arguments. It is + * @param WikiDB $dbi database abstraction class + * @param array $argarray complete (!) arguments. It is * not necessary to call * WikiPlugin->getArgs anymore. - * @param request Request ??? + * @param Request $request * @return string 'png', 'jpeg' or 'gif' */ function getImageType(&$dbi, $argarray, &$request) @@ -347,11 +347,11 @@ * <code> <img src=... alt="getAlt(...)"> </code> * * @access protected virtual - * @param dbi WikiDB database abstraction class - * @param argarray array complete (!) arguments. It is + * @param WikiDB $dbi database abstraction class + * @param array $argarray complete (!) arguments. It is * not necessary to call * WikiPlugin->getArgs anymore. - * @param request Request ??? + * @param Request $request * @return string "alt" description of the image */ function getAlt($dbi, $argarray, $request) @@ -365,11 +365,11 @@ * PLUGIN_CACHED_HTML. * * @access protected pure virtual - * @param dbi WikiDB database abstraction class - * @param argarray array complete (!) arguments to produce + * @param WikiDB $dbi database abstraction class + * @param array $argarray complete (!) arguments to produce * image. It is not necessary to call * WikiPlugin->getArgs anymore. - * @param request Request ??? + * @param Request $request * @param string $basepage Pagename to use to interpret links [/relative] page names. * @return string html to be printed in place of the plugin command * false if an error occured @@ -386,11 +386,11 @@ * PLUGIN_CACHED_HTML. * * @access protected pure virtual - * @param dbi WikiDB database abstraction class - * @param argarray array complete (!) arguments to produce + * @param WikiDB $dbi database abstraction class + * @param array $argarray complete (!) arguments to produce * image. It is not necessary to call * WikiPlugin->getArgs anymore. - * @param request Request ??? + * @param Request $request * @return array(html,handle) html for the map interior (to be specific, * only <area;> tags defining hot spots) * handle is an imagehandle to the corresponding @@ -410,15 +410,15 @@ * by url and containing the hotspots given by map. * * @access private - * @param id string unique id for the plugin call - * @param url string url pointing to the image part of the map - * @param map string <area> tags defining active + * @param $id string unique id for the plugin call + * @param $url string url pointing to the image part of the map + * @param $map string <area> tags defining active * regions in the map - * @param dbi WikiDB database abstraction class - * @param argarray array complete (!) arguments to produce + * @param $dbi WikiDB database abstraction class + * @param $argarray array complete (!) arguments to produce * image. It is not necessary to call * WikiPlugin->getArgs anymore. - * @param request Request ??? + * @param $request Request * @return string html output */ function embedMap($id, $url, $map, &$dbi, $argarray, &$request) @@ -439,14 +439,12 @@ * browsers. * * @access private - * @param url string url pointing to the image part of the map - * @param map string <area> tags defining active - * regions in the map - * @param dbi WikiDB database abstraction class - * @param argarray array complete (!) arguments to produce - * image. It is not necessary to call - * WikiPlugin->getArgs anymore. - * @param request Request ??? + * @param string $url url pointing to the image part of the map + * @param WikiDB $dbi database abstraction class + * @param array $argarray complete (!) arguments to produce + * image. It is not necessary to call + * WikiPlugin->getArgs anymore. + * @param Request $request * @return string html output */ function embedImg($url, $dbi, $argarray, $request) @@ -527,8 +525,8 @@ * Determines whether a needed image type may is available * from the GD library and gives an alternative otherwise. * - * @access public static - * @param wish string one of 'png', 'gif', 'jpeg', 'jpg' + * @access public static + * @param string $wish one of 'png', 'gif', 'jpeg', 'jpg' * @return string the image type to be used ('png', 'gif', 'jpeg') * 'html' in case of an error */ @@ -578,13 +576,13 @@ * be written. * * @access public static - * @param imgtype string 'png', 'gif' or 'jpeg' - * @param imghandle string image handle containing the image - * @param imgfile string file name of the image to be produced + * @param string $imgtype 'png', 'gif' or 'jpeg' + * @param string $imghandle image handle containing the image + * @param string $imgfile file name of the image to be produced * @return void * @see decideImageType */ - function writeImage($imgtype, $imghandle, $imgfile = false) + function writeImage($imgtype, $imghandle, $imgfile = '') { if ($imgtype != 'html') { $func = "Image" . strtoupper($imgtype); @@ -601,7 +599,7 @@ * There is no parameter check. * * @access public static - * @param doctype string 'gif', 'png', 'jpeg', 'html' + * @param string $doctype 'gif', 'png', 'jpeg', 'html' * @return void */ function writeHeader($doctype) @@ -626,7 +624,7 @@ * the quoting of arguments is not safe, yet. * * @access public static - * @param argarray array contains all arguments to be converted + * @param array $argarray contains all arguments to be converted * @return string concated arguments */ function glueArgs($argarray) @@ -650,15 +648,15 @@ * parameters if available. * * @access private static - * @param id string return value. Image is stored under this id. - * @param plugincall string return value. Only returned if present in url. + * @param string $id return value. Image is stored under this id. + * @param string $plugincall return value. Only returned if present in url. * Contains all parameters to reconstruct * plugin call. - * @param cache Cache PEAR Cache object - * @param request Request ??? - * @param errorformat string format which should be used to + * @param Cache $cache PEAR Cache object + * @param Request $request + * @param string $errorformat format which should be used to * output errors ('html', 'png', 'gif', 'jpeg') - * @return boolean false if an error occurs, true otherwise. + * @return bool false if an error occurs, true otherwise. * Param id and param plugincall are * also return values. */ @@ -685,10 +683,10 @@ * call needed to produce the requested image. * * @access static private - * @param plugincall string reference to serialized array containing both + * @param $plugincall string reference to serialized array containing both * name and parameters of the plugin call - * @param request Request ??? - * @return boolean false if an error occurs, true otherwise. + * @param $request Request ??? + * @return bool false if an error occurs, true otherwise. * */ function checkCall2(&$plugincall, $request) @@ -713,14 +711,14 @@ /** * Creates an image or image map depending on the plugin type. * @access static private - * @param content array reference to created array which overwrite the keys + * @param $content array reference to created array which overwrite the keys * 'image', 'imagetype' and possibly 'html' - * @param plugin WikiPluginCached plugin which is called to create image or map - * @param dbi WikiDB handle to database - * @param argarray array Contains all arguments needed by plugin - * @param request Request ???? - * @param errorformat string outputs errors in 'png', 'gif', 'jpg' or 'html' - * @return boolean error status; true=ok; false=error + * @param $plugin WikiPluginCached plugin which is called to create image or map + * @param $dbi WikiDB handle to database + * @param $argarray array Contains all arguments needed by plugin + * @param $request Request ???? + * @param $errorformat string outputs errors in 'png', 'gif', 'jpg' or 'html' + * @return bool error status; true=ok; false=error */ function produceImage(&$content, $plugin, $dbi, $argarray, $request, $errorformat) { @@ -824,9 +822,10 @@ * from parameters sent by url or session vars. * * @access static public - * @param dbi WikiDB handle to database - * @param request Request ??? - * @param errorformat string outputs errors in 'png', 'gif', 'jpeg' or 'html' + * @param WikiDB $dbi handle to database + * @param Request $request ??? + * @param string $errorformat outputs errors in 'png', 'gif', 'jpeg' or 'html' + * @return bool */ function fetchImageFromCache($dbi, $request, $errorformat = 'png') { @@ -922,8 +921,8 @@ * that occur during data (html,image,map) creation. * * @access protected - * @param addtext string errormessage to be printed (separate - * multiple lines with '\n') + * @param string $addtext errormessage to be printed (separate + * multiple lines with '\n') * @return void */ function complain($addtext) @@ -936,8 +935,8 @@ * if wished or html header has already been sent. * * @access static protected - * @param imgtype string 'png', 'gif', 'jpeg' or 'html' - * @param errortext string guess what? + * @param string $imgtype 'png', 'gif', 'jpeg' or 'html' + * @param string $errortext guess what? * @return void */ function printError($imgtype, $errortext) @@ -973,11 +972,11 @@ * is further restriction to 600 pixel in width and 350 in height. * * @access static public - * @param txt string multi line text to be converted - * @param fontnr integer number (1-5) telling gd which internal font to use; + * @param $txt string multi line text to be converted + * @param $fontnr integer number (1-5) telling gd which internal font to use; * I recommend font 2 for errors and 4 for help texts. - * @param textcol array text color as a list of the rgb components; array(red,green,blue) - * @param bgcol array background color; array(red,green,blue) + * @param $textcol array text color as a list of the rgb components; array(red,green,blue) + * @param $bgcol array background color; array(red,green,blue) * @return string image handle for gd routines */ function text2img($txt, $fontnr, $textcol, $bgcol) @@ -1106,11 +1105,11 @@ /** * Execute system command and wait until the outfile $until exists. * - * @param cmd string command to be invoked - * @param until string expected output filename - * @return boolean error status; true=ok; false=error + * @param string $cmd command to be invoked + * @param string $until expected output filename + * @return bool error status; true=ok; false=error */ - function execute($cmd, $until = false) + function execute($cmd, $until = '') { // cmd must redirect stderr to stdout though! $errstr = exec($cmd); //, $outarr, $returnval); // normally 127 Modified: trunk/lib/WikiTheme.php =================================================================== --- trunk/lib/WikiTheme.php 2014-06-06 16:02:08 UTC (rev 8881) +++ trunk/lib/WikiTheme.php 2014-06-10 16:38:14 UTC (rev 8882) @@ -143,7 +143,7 @@ * * This is a convenience function. * - * @param $action string + * @param string $action * One of <dl> * <dt>[action]</dt><dd>Perform action (e.g. 'edit') on the selected page.</dd> * <dt>[ActionPage]</dt><dd>Run the actionpage (e.g. 'BackLinks') on the selected page.</dd> @@ -154,11 +154,11 @@ * </pre></dd> * </dl> * - * @param $label string + * @param string $label * A label for the button. If ommited, a suitable default (based on the valued of $action) * will be picked. * - * @param $page_or_rev mixed + * @param mixed $page_or_rev * Which page (& version) to perform the action on. * Can be one of:<dl> * <dt>A string</dt><dd>The pagename.</dd> @@ -166,8 +166,12 @@ * <dt>A WikiDB_PageRevision object</dt><dd>A specific version of the page.</dd> * </dl> * ($Page_or_rev is ignored for submit buttons.) + * + * @param array $options + * + * @return object */ -function Button($action, $label = false, $page_or_rev = false, $options = false) +function Button($action, $label = '', $page_or_rev = false, $options = array()) { global $WikiTheme; @@ -432,9 +436,9 @@ /** * Format the "last modified" message for a page revision. * - * @param $revision object A WikiDB_PageRevision object. + * @param object $revision A WikiDB_PageRevision object. * - * @param $show_version bool Should the page version number + * @param string $show_version Should the page version number * be included in the message. (If this argument is omitted, * then the version number will be shown only iff the revision * is not the current one. @@ -934,10 +938,12 @@ * designated page, otherwise the button links to the most recent * version of the page. * + * @param array $options + * * @return object A Button object. */ - function makeActionButton($action, $label = false, - $page_or_rev = false, $options = false) + function makeActionButton($action, $label = '', + $page_or_rev = false, $options = array()) { extract($this->_get_name_and_rev($page_or_rev)); @@ -1002,16 +1008,20 @@ * * Use linkExistingWikiWord, or LinkWikiWord for normal links. * - * @param $page_or_rev mixed The page to link to. This can be + * @param mixed $page_or_rev The page to link to. This can be * given as a string (the page name), a WikiDB_Page object, or as * WikiDB_PageRevision object. If given as a WikiDB_PageRevision * object, the button will link to a specific version of the * designated page, otherwise the button links to the most recent * version of the page. * + * @param string $label + * + * @param string $action + * * @return object A Button object. */ - function makeLinkButton($page_or_rev, $label = false, $action = false) + function makeLinkButton($page_or_rev, $label = '', $action = '') { extract($this->_get_name_and_rev($page_or_rev)); @@ -1516,7 +1526,7 @@ $this->addMoreAttr('body', 'LiveSearch', HTML::Raw(" onload=\"liveSearchInit()")); $this->addMoreHeaders(JavaScript('var liveSearchURI="' - . WikiURL(_("TitleSearch"), false, true) . '";')); + . WikiURL(_("TitleSearch"), array(), true) . '";')); $this->addMoreHeaders(JavaScript('', array ('src' => $this->_findData('livesearch.js')))); $already = 1; @@ -1678,12 +1688,12 @@ { /** Constructor * - * @param $text string The text for the button. - * @param $url string The url (href) for the button. - * @param $class string The CSS class for the button. - * @param $options array Additional attributes for the <input> tag. + * @param string $text The text for the button. + * @param string $url The url (href) for the button. + * @param string $class The CSS class for the button. + * @param array $options Additional attributes for the <input> tag. */ - function Button($text, $url, $class = false, $options = false) + function Button($text, $url, $class = '', $options = array()) { global $request; $this->_init('a', array('href' => $url)); @@ -1718,7 +1728,7 @@ * @param $img_url string URL for button's image. * @param $img_attr array Additional attributes for the <img> tag. */ - function ImageButton($text, $url, $class, $img_url, $img_attr = false) + function ImageButton($text, $url, $class, $img_url, $img_attr = array()) { $this->__construct('a', array('href' => $url)); if ($class) @@ -1750,7 +1760,7 @@ * @param $class string The CSS class for the button. * @param $options array Additional attributes for the <input> tag. */ - function SubmitButton($text, $name = false, $class = false, $options = false) + function SubmitButton($text, $name = '', $class = '', $options = array()) { $this->__construct('input', array('type' => 'submit', 'value' => $text)); @@ -1779,7 +1789,7 @@ * @param $img_url string URL for button's image. * @param $img_attr array Additional attributes for the <img> tag. */ - function SubmitImageButton($text, $name = false, $class = false, $img_url, $img_attr = false) + function SubmitImageButton($text, $name = '', $class = '', $img_url, $img_attr = array()) { $this->__construct('input', array('type' => 'image', 'src' => $img_url, Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2014-06-06 16:02:08 UTC (rev 8881) +++ trunk/lib/WikiUser.php 2014-06-10 16:38:14 UTC (rev 8882) @@ -76,8 +76,9 @@ * * Populates the instance variables and calls $this->_ok() * to ensure that the parameters are valid. + * @param Request $request * @param mixed $userid String of username or WikiUser object. - * @param integer $authlevel Authorization level. + * @param int|bool $authlevel Authorization level. */ function WikiUser(&$request, $userid = false, $authlevel = false) { Modified: trunk/lib/loadsave.php =================================================================== --- trunk/lib/loadsave.php 2014-06-06 16:02:08 UTC (rev 8881) +++ trunk/lib/loadsave.php 2014-06-10 16:38:14 UTC (rev 8882) @@ -217,10 +217,11 @@ * dirs are allowed for zipdump and htmldump, not for dumpserial * * - * @param $pagename string Pagename. + * @param string $pagename Pagename. + * @param string $action. * @return string Filename for page. */ -function FilenameForPage($pagename, $action = false) +function FilenameForPage($pagename, $action = '') { $enc = rawurlencode($pagename); if (!$action) { Modified: trunk/lib/prepend.php =================================================================== --- trunk/lib/prepend.php 2014-06-06 16:02:08 UTC (rev 8881) +++ trunk/lib/prepend.php 2014-06-10 16:38:14 UTC (rev 8882) @@ -87,6 +87,7 @@ /** * @param string $which One of 'real', 'utime', 'stime', 'cutime', 'sutime' + * @param bool $now * @return float Seconds. */ function getTime($which = 'real', $now = false) Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2014-06-06 16:02:08 UTC (rev 8881) +++ trunk/lib/stdlib.php 2014-06-10 16:38:14 UTC (rev 8882) @@ -163,10 +163,10 @@ * If a WikiDB_Page object function will extract the name to link to. * If a WikiDB_PageRevision object function will extract the name to link to. * @param array $args - * @param boolean $get_abs_url Default value is false. + * @param bool $get_abs_url Default value is false. * @return string The absolute URL to the page passed as $pagename. */ -function WikiURL($pagename, $args = '', $get_abs_url = false) +function WikiURL($pagename, $args = array(), $get_abs_url = false) { global $request, $WikiTheme; $anchor = false; @@ -308,7 +308,7 @@ * - 'front' display at left * - 'after' display at right * - * @param string $protocol_or_url Protocol or URL. Used to determine the + * @param string $proto_or_url Protocol or URL. Used to determine the * proper icon. * @param string $text The text. * @return XmlContent. @@ -819,10 +819,10 @@ * This can be a relative subpage name (like '/SubPage'), * or can be the empty string to refer to the $basename. * - * @param string $anchor For links to anchors in page. - * * @param mixed $basename Page name from which to interpret * relative or other non-fully-specified page names. + * + * @param mixed $anchor For links to anchors in page. */ function WikiPageName($name, $basename = false, $anchor = false) { @@ -1091,13 +1091,13 @@ /** * Get time offset for local time zone. * - * @param $time time_t Get offset for this time. Default: now. - * @param $no_colon boolean Don't put colon between hours and minutes. + * @param int $time Get offset for this time. Default: now. + * @param bool $no_colon Don't put colon between hours and minutes. * @return string Offset as a string in the format +HH:MM. */ -function TimezoneOffset($time = false, $no_colon = false) +function TimezoneOffset($time = 0, $no_colon = false) { - if ($time === false) + if ($time == 0) $time = time(); $secs = date('Z', $time); @@ -1116,12 +1116,12 @@ /** * Format time in ISO-8601 format. * - * @param $time time_t Time. Default: now. + * @param int $time Time. Default: now. * @return string Date and time in ISO-8601 format. */ -function Iso8601DateTime($time = false) +function Iso8601DateTime($time = 0) { - if ($time === false) + if ($time == 0) $time = time(); $tzoff = TimezoneOffset($time); $date = date('Y-m-d', $time); @@ -1132,12 +1132,12 @@ /** * Format time in RFC-2822 format. * - * @param $time time_t Time. Default: now. + * @param int $time Time. Default: now. * @return string Date and time in RFC-2822 format. */ -function Rfc2822DateTime($time = false) +function Rfc2822DateTime($time = 0) { - if ($time === false) + if ($time == 0) $time = time(); return date('D, j M Y H:i:s ', $time) . TimezoneOffset($time, 'no colon'); } @@ -1145,12 +1145,12 @@ /** * Format time in RFC-1123 format. * - * @param $time time_t Time. Default: now. + * @param int $time Time. Default: now. * @return string Date and time in RFC-1123 format. */ -function Rfc1123DateTime($time = false) +function Rfc1123DateTime($time = 0) { - if ($time === false) + if ($time == 0) $time = time(); return gmdate('D, d M Y H:i:s \G\M\T', $time); } @@ -1200,12 +1200,12 @@ /** * Format time to standard 'ctime' format. * - * @param $time time_t Time. Default: now. + * @param int $time Time. Default: now. * @return string Date and time. */ -function CTime($time = false) +function CTime($time = 0) { - if ($time === false) + if ($time == 0) $time = time(); return date("D M j H:i:s Y", $time); } @@ -1217,7 +1217,7 @@ * * @param $bytes int. Default: 0. * @param $longformat bool. Default: false. - * @return class FormattedText (XmlElement.php). + * @return FormattedText (XmlElement.php). */ function ByteFormatter($bytes = 0, $longformat = false) { @@ -1726,17 +1726,13 @@ { /** Constructor * - * @param object $request * @param mixed $head Header ("title") for alert box. * @param mixed $body The text in the alert box. - * @param hash $buttons An array mapping button labels to URLs. + * @param array $buttons An array mapping button labels to URLs. * The default is a single "Okay" button pointing to $request->getURLtoSelf(). */ - function Alert($head, $body, $buttons = false) + function Alert($head, $body, $buttons = array()) { - if ($buttons === false) - $buttons = array(); - if (is_array($body)) { $html = HTML::ol(); foreach ($body as $li) { Modified: trunk/lib/upgrade.php =================================================================== --- trunk/lib/upgrade.php 2014-06-06 16:02:08 UTC (rev 8881) +++ trunk/lib/upgrade.php 2014-06-10 16:38:14 UTC (rev 8882) @@ -1052,14 +1052,8 @@ /** * Add an upgrade item to be checked. * - * @param $parent object The parent Upgrade class to inherit the version properties - * @param $key string A short unique key to store success in the WikiDB - * @param $fixed_with double @see phpwiki_version() number - * @param $header string Optional header to be printed always even if not applicable - * @param $applicable WikiCallback Optional callback boolean applicable() - * @param $notice string Description of the check - * @param $method WikiCallback Optional callback array method(array) - * //param All other args are passed to $method + * @param object $parent The parent Upgrade class to inherit the version properties + * @param array $params */ function UpgradeEntry(&$parent, $params) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-06-12 15:44:03
|
Revision: 8896 http://sourceforge.net/p/phpwiki/code/8896 Author: vargenau Date: 2014-06-12 15:43:56 +0000 (Thu, 12 Jun 2014) Log Message: ----------- Use CSS Modified Paths: -------------- trunk/lib/diff.php trunk/lib/plugin/Diff.php Modified: trunk/lib/diff.php =================================================================== --- trunk/lib/diff.php 2014-06-12 15:39:51 UTC (rev 8895) +++ trunk/lib/diff.php 2014-06-12 15:43:56 UTC (rev 8896) @@ -203,7 +203,7 @@ { global $WikiTheme; - $row = HTML::tr(HTML::td(array('align' => 'right'), $label)); + $row = HTML::tr(HTML::td(array('class' => 'align-right'), $label)); if ($rev) { $author = $rev->get('author'); $dbi = $request->getDbh(); Modified: trunk/lib/plugin/Diff.php =================================================================== --- trunk/lib/plugin/Diff.php 2014-06-12 15:39:51 UTC (rev 8895) +++ trunk/lib/plugin/Diff.php 2014-06-12 15:43:56 UTC (rev 8896) @@ -54,7 +54,7 @@ global $WikiTheme; - $row = HTML::tr(HTML::td(array('align' => 'right'), $label)); + $row = HTML::tr(HTML::td(array('class' => 'align-right'), $label)); if ($rev) { $author = $rev->get('author'); $dbi = $request->getDbh(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-06-23 13:16:39
|
Revision: 8930 http://sourceforge.net/p/phpwiki/code/8930 Author: vargenau Date: 2014-06-23 13:16:31 +0000 (Mon, 23 Jun 2014) Log Message: ----------- _sql_quote --> sql_quote Modified Paths: -------------- trunk/lib/TextSearchQuery.php trunk/lib/WikiDB/backend/ADODB_oci8po.php trunk/lib/WikiDB/backend/PearDB_oci8.php trunk/lib/WikiDB/backend.php Modified: trunk/lib/TextSearchQuery.php =================================================================== --- trunk/lib/TextSearchQuery.php 2014-06-23 10:10:40 UTC (rev 8929) +++ trunk/lib/TextSearchQuery.php 2014-06-23 13:16:31 UTC (rev 8930) @@ -260,7 +260,7 @@ function sql() { - return '%' . $this->_sql_quote($this->word) . '%'; + return '%' . $this->sql_quote($this->word) . '%'; } /** @@ -634,7 +634,7 @@ return $this->word; } - protected function sql_quote() + function sql_quote() { global $request; $word = preg_replace('/(?=[%_\\\\])/', "\\", $this->word); Modified: trunk/lib/WikiDB/backend/ADODB_oci8po.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_oci8po.php 2014-06-23 10:10:40 UTC (rev 8929) +++ trunk/lib/WikiDB/backend/ADODB_oci8po.php 2014-06-23 13:16:31 UTC (rev 8930) @@ -166,7 +166,7 @@ if ($this->isStoplisted($node)) return "1=1"; $page = $node->sql(); - $exactword = $node->_sql_quote($node->word); + $exactword = $node->sql_quote($node->word); return ($this->_case_exact ? "pagename LIKE '$page' OR DBMS_LOB.INSTR(content, '$exactword') > 0" : "LOWER(pagename) LIKE '$page' OR DBMS_LOB.INSTR(content, '$exactword') > 0"); Modified: trunk/lib/WikiDB/backend/PearDB_oci8.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_oci8.php 2014-06-23 10:10:40 UTC (rev 8929) +++ trunk/lib/WikiDB/backend/PearDB_oci8.php 2014-06-23 13:16:31 UTC (rev 8930) @@ -118,7 +118,7 @@ if ($this->isStoplisted($node)) return "1=1"; $page = $node->sql(); - $exactword = $node->_sql_quote($node->word); + $exactword = $node->sql_quote($node->word); return ($this->_case_exact ? "pagename LIKE '$page' OR DBMS_LOB.INSTR(content, '$exactword') > 0" : "LOWER(pagename) LIKE '$page' OR DBMS_LOB.INSTR(content, '$exactword') > 0"); Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2014-06-23 10:10:40 UTC (rev 8929) +++ trunk/lib/WikiDB/backend.php 2014-06-23 13:16:31 UTC (rev 8930) @@ -864,7 +864,7 @@ function _fulltext_match_clause($node) { // force word-style %word% for fulltext search - $word = '%' . $node->_sql_quote($node->word) . '%'; + $word = '%' . $node->sql_quote($node->word) . '%'; // eliminate stoplist words if ($this->isStoplisted($node)) return "1=1"; // and (pagename or 1) => and 1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-07-09 08:39:19
|
Revision: 8959 http://sourceforge.net/p/phpwiki/code/8959 Author: vargenau Date: 2014-07-09 08:39:11 +0000 (Wed, 09 Jul 2014) Log Message: ----------- fetchSingle was renamed to fetchColumn Modified Paths: -------------- trunk/lib/DbSession/PDO.php trunk/lib/WikiDB/backend/PDO.php trunk/lib/WikiUser/PdoDb.php Modified: trunk/lib/DbSession/PDO.php =================================================================== --- trunk/lib/DbSession/PDO.php 2014-07-07 16:18:21 UTC (rev 8958) +++ trunk/lib/DbSession/PDO.php 2014-07-09 08:39:11 UTC (rev 8959) @@ -100,7 +100,7 @@ $table = $this->_table; $sth = $dbh->prepare("SELECT sess_data FROM $table WHERE sess_id=?"); $sth->bindParam(1, $id, PDO_PARAM_STR, 32); - if ($sth->execute()) $res = $sth->fetchSingle(); + if ($sth->execute()) $res = $sth->fetchColumn(); else $res = ''; $this->_disconnect(); if (!empty($res) and isa($dbh, 'ADODB_postgres64')) Modified: trunk/lib/WikiDB/backend/PDO.php =================================================================== --- trunk/lib/WikiDB/backend/PDO.php 2014-07-07 16:18:21 UTC (rev 8958) +++ trunk/lib/WikiDB/backend/PDO.php 2014-07-09 08:39:11 UTC (rev 8959) @@ -129,7 +129,7 @@ } $sth = $this->_dbh->prepare("SELECT version()"); $sth->execute(); - $this->_serverinfo['version'] = $sth->fetchSingle(); + $this->_serverinfo['version'] = $sth->fetchColumn(); $this->commit(); // required to match the try catch block above! $prefix = isset($dbparams['prefix']) ? $dbparams['prefix'] : ''; @@ -225,7 +225,7 @@ . " AND pagename=?"); $sth->bindParam(1, $pagename, PDO_PARAM_STR, 100); if ($sth->execute()) - return $sth->fetchSingle(); + return $sth->fetchColumn(); else return false; } @@ -248,7 +248,7 @@ $sth = $dbh->exec("SELECT count(*)" . " FROM $nonempty_tbl, $page_tbl" . " WHERE $nonempty_tbl.id=$page_tbl.id"); - return $sth->fetchSingle(); + return $sth->fetchColumn(); } function increaseHitCount($pagename) @@ -342,7 +342,7 @@ $sth = $dbh->prepare("SELECT cached_html FROM $page_tbl WHERE pagename=? LIMIT 1"); $sth->bindParam(1, $pagename, PDO_PARAM_STR, 100); $sth->execute(); - return $sth->fetchSingle(PDO_FETCH_NUM); + return $sth->fetchColumn(PDO_FETCH_NUM); } function set_cached_html($pagename, $data) @@ -377,7 +377,7 @@ $page_tbl = $this->_table_names['page_tbl']; $sth = $dbh->prepare("SELECT id FROM $page_tbl WHERE pagename=? LIMIT 1"); $sth->bindParam(1, $pagename, PDO_PARAM_STR, 100); - $id = $sth->fetchSingle(); + $id = $sth->fetchColumn(); if (!$create_if_missing) { return $id; } @@ -395,7 +395,7 @@ $this->beginTransaction(); $sth = $dbh->prepare("SELECT MAX(id) FROM $page_tbl"); $sth->execute(); - $id = $sth->fetchSingle(); + $id = $sth->fetchColumn(); $sth = $dbh->prepare("INSERT INTO $page_tbl" . " (id,pagename,hits)" . " VALUES (?,?,0)"); @@ -423,7 +423,7 @@ . " LIMIT 1"); $sth->bindParam(1, $pagename, PDO_PARAM_STR, 100); $sth->execute(); - return $sth->fetchSingle(); + return $sth->fetchColumn(); } function get_previous_version($pagename, $version) @@ -440,7 +440,7 @@ $sth->bindParam(1, $pagename, PDO_PARAM_STR, 100); $sth->bindParam(2, $version, PDO_PARAM_INT); $sth->execute(); - return $sth->fetchSingle(); + return $sth->fetchColumn(); } /** @@ -674,7 +674,7 @@ $this->set_links($pagename, false); $sth = $dbh->prepare("SELECT COUNT(*) FROM $link_tbl WHERE linkto=$id"); $sth->execute(); - if ($sth->fetchSingle()) { + if ($sth->fetchColumn()) { // We're still in the link table (dangling link) so we can't delete this // altogether. $dbh->query("UPDATE $page_tbl SET hits=0, pagedata='' WHERE id=$id"); @@ -732,7 +732,7 @@ . " WHERE ISNULL($nonempty_tbl.id) AND" . " ISNULL($version_tbl.id) AND $page_tbl.id=$id"); $sth1->execute(); - if ($sth1->fetchSingle()) { + if ($sth1->fetchColumn()) { $dbh->query("DELETE FROM $page_tbl WHERE id=$id"); // this purges the link $dbh->query("DELETE FROM $recent_tbl WHERE id=$id"); // may fail } @@ -805,7 +805,7 @@ $sth->bindParam(1, $pagename, PDO_PARAM_STR, 100); $sth->bindParam(2, $link, PDO_PARAM_STR, 100); $sth->execute(); - return $sth->fetchSingle(); + return $sth->fetchColumn(); } function get_all_pages($include_empty = false, $sortby = '', $limit = '', $exclude = '') Modified: trunk/lib/WikiUser/PdoDb.php =================================================================== --- trunk/lib/WikiUser/PdoDb.php 2014-07-07 16:18:21 UTC (rev 8958) +++ trunk/lib/WikiUser/PdoDb.php 2014-07-09 08:39:11 UTC (rev 8959) @@ -144,7 +144,7 @@ trigger_error("SQL Error: " . $e->getMessage(), E_USER_WARNING); return false; } - if ($this->_authselect->fetchSingle()) + if ($this->_authselect->fetchColumn()) return true; } else { if (!$dbi->getAuthParam('auth_user_exists')) @@ -153,7 +153,7 @@ $this->_authcheck = $dbh->prepare($dbi->getAuthParam('auth_check')); $this->_authcheck->bindParam("userid", $this->_userid, PDO_PARAM_STR, 48); $this->_authcheck->execute(); - if ($this->_authcheck->fetchSingle()) + if ($this->_authcheck->fetchColumn()) return true; } // User does not exist yet. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-07-17 09:02:38
|
Revision: 8969 http://sourceforge.net/p/phpwiki/code/8969 Author: vargenau Date: 2014-07-17 09:02:29 +0000 (Thu, 17 Jul 2014) Log Message: ----------- PDO_FETCH_NUM --> PDO::FETCH_NUM; PDO uses class constants since PHP 5.1. Prior releases use global constants in the form PDO_PARAM_BOOL Modified Paths: -------------- trunk/lib/WikiDB/PDO.php trunk/lib/WikiDB/backend/PDO.php trunk/lib/WikiDB/backend/PDO_mysql.php trunk/lib/WikiDB/backend/PDO_oci8.php trunk/lib/WikiUser/PdoDb.php Modified: trunk/lib/WikiDB/PDO.php =================================================================== --- trunk/lib/WikiDB/PDO.php 2014-07-17 08:38:53 UTC (rev 8968) +++ trunk/lib/WikiDB/PDO.php 2014-07-17 09:02:29 UTC (rev 8969) @@ -83,7 +83,7 @@ // SQL result: for simple select or create/update queries // returns the database specific resource type - function genericSqlQuery($sql, $args = false) + function genericSqlQuery($sql, $args = array()) { try { $sth = $this->_backend->_dbh->prepare($sql); @@ -93,7 +93,7 @@ } } if ($sth->execute()) - $result = $sth->fetch(PDO_FETCH_BOTH); + $result = $sth->fetch(PDO::FETCH_BOTH); else return false; } catch (PDOException $e) { Modified: trunk/lib/WikiDB/backend/PDO.php =================================================================== --- trunk/lib/WikiDB/backend/PDO.php 2014-07-17 08:38:53 UTC (rev 8968) +++ trunk/lib/WikiDB/backend/PDO.php 2014-07-17 09:02:29 UTC (rev 8969) @@ -95,9 +95,9 @@ $this->_dbh = new PDO($dbparams['dsn'], $this->_parsedDSN['username'], $this->_parsedDSN['password'], - array(PDO_ATTR_AUTOCOMMIT => true, - PDO_ATTR_TIMEOUT => DATABASE_TIMEOUT, - PDO_ATTR_PERSISTENT => !empty($parsed['persistent']) + array(PDO::ATTR_AUTOCOMMIT => true, + PDO::ATTR_TIMEOUT => DATABASE_TIMEOUT, + PDO::ATTR_PERSISTENT => !empty($parsed['persistent']) or DATABASE_PERSISTENT )); } catch (PDOException $e) { @@ -118,7 +118,7 @@ } $this->_dsn = $dbparams['dsn']; $this->_dbh->databaseType = $driver; - $this->_dbh->setAttribute(PDO_ATTR_CASE, PDO_CASE_NATURAL); + $this->_dbh->setAttribute(PDO::ATTR_CASE, PDO::CASE_NATURAL); // Use the faster FETCH_NUM, with some special ASSOC based exceptions. $this->_hasTransactions = true; @@ -190,7 +190,7 @@ { $sth = $this->_dbh->prepare($sql); if ($sth->execute()) - return $sth->fetch(PDO_FETCH_BOTH); + return $sth->fetch(PDO::FETCH_BOTH); else return false; } @@ -223,7 +223,7 @@ . " FROM $nonempty_tbl, $page_tbl" . " WHERE $nonempty_tbl.id=$page_tbl.id" . " AND pagename=?"); - $sth->bindParam(1, $pagename, PDO_PARAM_STR, 100); + $sth->bindParam(1, $pagename, PDO::PARAM_STR, 100); if ($sth->execute()) return $sth->fetchColumn(); else @@ -238,7 +238,7 @@ . " FROM $nonempty_tbl, $page_tbl" . " WHERE $nonempty_tbl.id=$page_tbl.id" . " LIMIT 1"); - return $sth->fetchAll(PDO_FETCH_NUM); + return $sth->fetchAll(PDO::FETCH_NUM); } function numPages($filter = false, $exclude = '') @@ -258,7 +258,7 @@ $sth = $dbh->prepare("UPDATE $page_tbl SET hits=hits+1" . " WHERE pagename=?" . " LIMIT 1"); - $sth->bindParam(1, $pagename, PDO_PARAM_STR, 100); + $sth->bindParam(1, $pagename, PDO::PARAM_STR, 100); $sth->execute(); } @@ -271,9 +271,9 @@ $page_tbl = $this->_table_names['page_tbl']; $sth = $dbh->prepare("SELECT id,pagename,hits,pagedata FROM $page_tbl" . " WHERE pagename=? LIMIT 1"); - $sth->bindParam(1, $pagename, PDO_PARAM_STR, 100); + $sth->bindParam(1, $pagename, PDO::PARAM_STR, 100); $sth->execute(); - $row = $sth->fetch(PDO_FETCH_NUM); + $row = $sth->fetch(PDO::FETCH_NUM); return $row ? $this->_extract_page_data($row[3], $row[2]) : false; } @@ -296,8 +296,8 @@ // have a record in the page table. Since it's just the // hit count, who cares? $sth = $dbh->prepare("UPDATE $page_tbl SET hits=? WHERE pagename=? LIMIT 1"); - $sth->bindParam(1, $newdata['hits'], PDO_PARAM_INT); - $sth->bindParam(2, $pagename, PDO_PARAM_STR, 100); + $sth->bindParam(1, $newdata['hits'], PDO::PARAM_INT); + $sth->bindParam(2, $pagename, PDO::PARAM_STR, 100); $sth->execute(); return; } @@ -323,9 +323,9 @@ . " SET hits=?, pagedata=?" . " WHERE pagename=?" . " LIMIT 1"); - $sth->bindParam(1, $hits, PDO_PARAM_INT); - $sth->bindParam(2, $this->_serialize($data), PDO_PARAM_LOB); - $sth->bindParam(3, $pagename, PDO_PARAM_STR, 100); + $sth->bindParam(1, $hits, PDO::PARAM_INT); + $sth->bindParam(2, $this->_serialize($data), PDO::PARAM_LOB); + $sth->bindParam(3, $pagename, PDO::PARAM_STR, 100); if ($sth->execute()) { $this->commit(); return true; @@ -340,9 +340,9 @@ $dbh = &$this->_dbh; $page_tbl = $this->_table_names['page_tbl']; $sth = $dbh->prepare("SELECT cached_html FROM $page_tbl WHERE pagename=? LIMIT 1"); - $sth->bindParam(1, $pagename, PDO_PARAM_STR, 100); + $sth->bindParam(1, $pagename, PDO::PARAM_STR, 100); $sth->execute(); - return $sth->fetchColumn(PDO_FETCH_NUM); + return $sth->fetchColumn(PDO::FETCH_NUM); } function set_cached_html($pagename, $data) @@ -354,8 +354,8 @@ . " SET cached_html=?" . " WHERE pagename=?" . " LIMIT 1"); - $sth->bindParam(1, $data, PDO_PARAM_STR); - $sth->bindParam(2, $pagename, PDO_PARAM_STR, 100); + $sth->bindParam(1, $data, PDO::PARAM_STR); + $sth->bindParam(2, $pagename, PDO::PARAM_STR, 100); $sth->execute(); } @@ -376,7 +376,7 @@ $dbh = &$this->_dbh; $page_tbl = $this->_table_names['page_tbl']; $sth = $dbh->prepare("SELECT id FROM $page_tbl WHERE pagename=? LIMIT 1"); - $sth->bindParam(1, $pagename, PDO_PARAM_STR, 100); + $sth->bindParam(1, $pagename, PDO::PARAM_STR, 100); $id = $sth->fetchColumn(); if (!$create_if_missing) { return $id; @@ -388,7 +388,7 @@ $sth = $dbh->prepare("INSERT INTO $page_tbl" . " (id,pagename)" . " VALUES (NULL,?)"); - $sth->bindParam(1, $pagename, PDO_PARAM_STR, 100); + $sth->bindParam(1, $pagename, PDO::PARAM_STR, 100); $sth->execute(); $id = $dbh->lastInsertId(); } else { @@ -400,8 +400,8 @@ . " (id,pagename,hits)" . " VALUES (?,?,0)"); $id++; - $sth->bindParam(1, $id, PDO_PARAM_INT); - $sth->bindParam(2, $pagename, PDO_PARAM_STR, 100); + $sth->bindParam(1, $id, PDO::PARAM_INT); + $sth->bindParam(2, $pagename, PDO::PARAM_STR, 100); if ($sth->execute()) $this->commit(); else @@ -421,7 +421,7 @@ . " WHERE $page_tbl.id=$recent_tbl.id" . " AND pagename=?" . " LIMIT 1"); - $sth->bindParam(1, $pagename, PDO_PARAM_STR, 100); + $sth->bindParam(1, $pagename, PDO::PARAM_STR, 100); $sth->execute(); return $sth->fetchColumn(); } @@ -437,8 +437,8 @@ . " AND version < ?" . " ORDER BY version DESC" . " LIMIT 1"); - $sth->bindParam(1, $pagename, PDO_PARAM_STR, 100); - $sth->bindParam(2, $version, PDO_PARAM_INT); + $sth->bindParam(1, $pagename, PDO::PARAM_STR, 100); + $sth->bindParam(2, $version, PDO::PARAM_INT); $sth->execute(); return $sth->fetchColumn(); } @@ -476,10 +476,10 @@ . " AND pagename=?" . " AND version=?" . " LIMIT 1"); - $sth->bindParam(1, $pagename, PDO_PARAM_STR, 100); - $sth->bindParam(2, $version, PDO_PARAM_INT); + $sth->bindParam(1, $pagename, PDO::PARAM_STR, 100); + $sth->bindParam(2, $version, PDO::PARAM_INT); $sth->execute(); - $row = $sth->fetch(PDO_FETCH_NUM); + $row = $sth->fetch(PDO::FETCH_NUM); return $row ? $this->_extract_version_data_num($row, $want_content) : false; } @@ -552,28 +552,28 @@ $sth = $dbh->prepare("REPLACE INTO $version_tbl" . " (id,version,mtime,minor_edit,content,versiondata)" . " VALUES(?,?,?,?,?,?)"); - $sth->bindParam(1, $id, PDO_PARAM_INT); - $sth->bindParam(2, $version, PDO_PARAM_INT); - $sth->bindParam(3, $mtime, PDO_PARAM_INT); - $sth->bindParam(4, $minor_edit, PDO_PARAM_INT); - $sth->bindParam(5, $content, PDO_PARAM_STR, 100); - $sth->bindParam(6, $this->_serialize($data), PDO_PARAM_STR, 100); + $sth->bindParam(1, $id, PDO::PARAM_INT); + $sth->bindParam(2, $version, PDO::PARAM_INT); + $sth->bindParam(3, $mtime, PDO::PARAM_INT); + $sth->bindParam(4, $minor_edit, PDO::PARAM_INT); + $sth->bindParam(5, $content, PDO::PARAM_STR, 100); + $sth->bindParam(6, $this->_serialize($data), PDO::PARAM_STR, 100); $rs = $sth->execute(); } else { $sth = $dbh->prepare("DELETE FROM $version_tbl" . " WHERE id=? AND version=?"); - $sth->bindParam(1, $id, PDO_PARAM_INT); - $sth->bindParam(2, $version, PDO_PARAM_INT); + $sth->bindParam(1, $id, PDO::PARAM_INT); + $sth->bindParam(2, $version, PDO::PARAM_INT); $sth->execute(); $sth = $dbh->prepare("INSERT INTO $version_tbl" . " (id,version,mtime,minor_edit,content,versiondata)" . " VALUES(?,?,?,?,?,?)"); - $sth->bindParam(1, $id, PDO_PARAM_INT); - $sth->bindParam(2, $version, PDO_PARAM_INT); - $sth->bindParam(3, $mtime, PDO_PARAM_INT); - $sth->bindParam(4, $minor_edit, PDO_PARAM_INT); - $sth->bindParam(5, $content, PDO_PARAM_STR, 100); - $sth->bindParam(6, $this->_serialize($data), PDO_PARAM_STR, 100); + $sth->bindParam(1, $id, PDO::PARAM_INT); + $sth->bindParam(2, $version, PDO::PARAM_INT); + $sth->bindParam(3, $mtime, PDO::PARAM_INT); + $sth->bindParam(4, $minor_edit, PDO::PARAM_INT); + $sth->bindParam(5, $content, PDO::PARAM_STR, 100); + $sth->bindParam(6, $this->_serialize($data), PDO::PARAM_STR, 100); $rs = $sth->execute(); } $this->_update_recent_table($id); @@ -636,12 +636,12 @@ $insert = $dbh->prepare("INSERT INTO $version_tbl" . " (id,version,mtime,minor_edit,content,versiondata)" . " VALUES(?,?,?,?,?,?)"); - $insert->bindParam(1, $id, PDO_PARAM_INT); - $insert->bindParam(2, $version + 1, PDO_PARAM_INT); - $insert->bindParam(3, $mtime, PDO_PARAM_INT); - $insert->bindParam(4, 0, PDO_PARAM_INT); - $insert->bindParam(5, '', PDO_PARAM_STR, 100); - $insert->bindParam(6, $this->_serialize($meta), PDO_PARAM_STR, 100); + $insert->bindParam(1, $id, PDO::PARAM_INT); + $insert->bindParam(2, $version + 1, PDO::PARAM_INT); + $insert->bindParam(3, $mtime, PDO::PARAM_INT); + $insert->bindParam(4, 0, PDO::PARAM_INT); + $insert->bindParam(5, '', PDO::PARAM_STR, 100); + $insert->bindParam(6, $this->_serialize($meta), PDO::PARAM_STR, 100); if ($insert->execute() and $dbh->query("DELETE FROM $nonempty_tbl WHERE id=$id") and $this->set_links($pagename, false) @@ -724,7 +724,7 @@ $sth = $dbh->prepare("SELECT $link_tbl.linkto as id FROM $link_tbl" . " WHERE linkfrom=$pageid"); $sth->execute(); - foreach ($sth->fetchAll(PDO_FETCH_NUM) as $id) { + foreach ($sth->fetchAll(PDO::FETCH_NUM) as $id) { // ...check if the page is empty and has no version $sth1 = $dbh->prepare("SELECT $page_tbl.id FROM $page_tbl" . " LEFT JOIN $nonempty_tbl USING (id) " @@ -779,9 +779,9 @@ . $exclude . $orderby . $limit); - $sth->bindParam(1, $pagename, PDO_PARAM_STR, 100); + $sth->bindParam(1, $pagename, PDO::PARAM_STR, 100); $sth->execute(); - $result = $sth->fetch(PDO_FETCH_BOTH); + $result = $sth->fetch(PDO::FETCH_BOTH); return new WikiDB_backend_PDO_iter($this, $result, $this->page_tbl_field_list); } @@ -802,8 +802,8 @@ . " WHERE linkfrom=linker.id AND linkto=linkee.id" . " AND $have.pagename=?" . " AND $want.pagename=?"); - $sth->bindParam(1, $pagename, PDO_PARAM_STR, 100); - $sth->bindParam(2, $link, PDO_PARAM_STR, 100); + $sth->bindParam(1, $pagename, PDO::PARAM_STR, 100); + $sth->bindParam(2, $link, PDO::PARAM_STR, 100); $sth->execute(); return $sth->fetchColumn(); } @@ -857,7 +857,7 @@ } $sth = $dbh->prepare($sql . $limit); $sth->execute(); - $result = $sth->fetch(PDO_FETCH_BOTH); + $result = $sth->fetch(PDO::FETCH_BOTH); return new WikiDB_backend_PDO_iter($this, $result, $this->page_tbl_field_list); } @@ -899,7 +899,7 @@ . $orderby . $limit); $sth->execute(); - $result = $sth->fetch(PDO_FETCH_NUM); + $result = $sth->fetch(PDO::FETCH_NUM); $iter = new WikiDB_backend_PDO_iter($this, $result, $field_list); $iter->stoplisted = $searchobj->stoplisted; return $iter; @@ -952,7 +952,7 @@ $sth = $dbh->prepare($sql); } $sth->execute(); - $result = $sth->fetch(PDO_FETCH_NUM); + $result = $sth->fetch(PDO::FETCH_NUM); return new WikiDB_backend_PDO_iter($this, $result, $this->page_tbl_field_list); } @@ -1023,7 +1023,7 @@ $sth = $dbh->prepare($sql); } $sth->execute(); - $result = $sth->fetch(PDO_FETCH_NUM); + $result = $sth->fetch(PDO::FETCH_NUM); return new WikiDB_backend_PDO_iter($this, $result, array_merge($this->page_tbl_field_list, $this->version_tbl_field_list)); } @@ -1066,7 +1066,7 @@ $sth = $dbh->prepare($sql); } $sth->execute(); - $result = $sth->fetch(PDO_FETCH_NUM); + $result = $sth->fetch(PDO::FETCH_NUM); return new WikiDB_backend_PDO_iter($this, $result, array('pagename', 'wantedfrom')); } @@ -1093,8 +1093,8 @@ $dbh->query("UPDATE $link_tbl SET linkto=$id WHERE linkto=$new"); } $sth = $dbh->prepare("UPDATE $page_tbl SET pagename=? WHERE id=?"); - $sth->bindParam(1, $to, PDO_PARAM_STR, 100); - $sth->bindParam(2, $id, PDO_PARAM_INT); + $sth->bindParam(1, $to, PDO::PARAM_STR, 100); + $sth->bindParam(2, $id, PDO::PARAM_INT); $sth->execute(); } $this->unlock(array('page')); @@ -1309,20 +1309,20 @@ . "request_file,request_uri,request_time,status,bytes_sent,referer,agent,request_duration)" . " VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)"); // Either use unixtime as %d (long), or the native timestamp format. - $sth->bindParam(1, $entry->time, PDO_PARAM_INT); - $sth->bindParam(2, $entry->host, PDO_PARAM_STR, 100); - $sth->bindParam(3, $entry->user, PDO_PARAM_STR, 50); - $sth->bindParam(4, $entry->request_method, PDO_PARAM_STR, 10); - $sth->bindParam(5, $entry->request, PDO_PARAM_STR, 255); - $sth->bindParam(6, $entry->request_args, PDO_PARAM_STR, 255); - $sth->bindParam(7, $entry->request_uri, PDO_PARAM_STR, 255); - $sth->bindParam(8, $entry->_ncsa_time($entry->time), PDO_PARAM_STR, 28); - $sth->bindParam(9, $entry->time, PDO_PARAM_INT); - $sth->bindParam(10, $entry->status, PDO_PARAM_INT); - $sth->bindParam(11, $entry->size, PDO_PARAM_INT); - $sth->bindParam(12, $entry->referer, PDO_PARAM_STR, 255); - $sth->bindParam(13, $entry->user_agent, PDO_PARAM_STR, 255); - $sth->bindParam(14, $entry->duration, PDO_PARAM_FLOAT); + $sth->bindParam(1, $entry->time, PDO::PARAM_INT); + $sth->bindParam(2, $entry->host, PDO::PARAM_STR, 100); + $sth->bindParam(3, $entry->user, PDO::PARAM_STR, 50); + $sth->bindParam(4, $entry->request_method, PDO::PARAM_STR, 10); + $sth->bindParam(5, $entry->request, PDO::PARAM_STR, 255); + $sth->bindParam(6, $entry->request_args, PDO::PARAM_STR, 255); + $sth->bindParam(7, $entry->request_uri, PDO::PARAM_STR, 255); + $sth->bindParam(8, $entry->_ncsa_time($entry->time), PDO::PARAM_STR, 28); + $sth->bindParam(9, $entry->time, PDO::PARAM_INT); + $sth->bindParam(10, $entry->status, PDO::PARAM_INT); + $sth->bindParam(11, $entry->size, PDO::PARAM_INT); + $sth->bindParam(12, $entry->referer, PDO::PARAM_STR, 255); + $sth->bindParam(13, $entry->user_agent, PDO::PARAM_STR, 255); + $sth->bindParam(14, $entry->duration, PDO::PARAM_FLOAT); $sth->execute(); } } @@ -1352,7 +1352,7 @@ if (!is_object($result)) { return false; } - return $result->fetch(PDO_FETCH_BOTH); + return $result->fetch(PDO::FETCH_BOTH); } function free() @@ -1373,7 +1373,7 @@ return false; } $this->_backend = &$backend; - $rec = $result->fetch(PDO_FETCH_ASSOC); + $rec = $result->fetch(PDO::FETCH_ASSOC); if (isset($rec['pagedata'])) $rec['pagedata'] = $backend->_extract_page_data($rec['pagedata'], $rec['hits']); Modified: trunk/lib/WikiDB/backend/PDO_mysql.php =================================================================== --- trunk/lib/WikiDB/backend/PDO_mysql.php 2014-07-17 08:38:53 UTC (rev 8968) +++ trunk/lib/WikiDB/backend/PDO_mysql.php 2014-07-17 09:02:29 UTC (rev 8969) @@ -61,7 +61,7 @@ if (empty($this->_dbparams['timeout'])) return; $sth = $this->_dbh->prepare("SHOW processlist"); if ($sth->execute()) - while ($row = $sth->fetch(PDO_FETCH_ASSOC)) { + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) { if ($row["db"] == $this->_dsn['database'] and $row["User"] == $this->_dsn['username'] and $row["Time"] > $this->_dbparams['timeout'] @@ -90,7 +90,7 @@ $sth = $this->_dbh->prepare("SHOW TABLES"); $sth->execute(); $tables = array(); - while ($row = $sth->fetch(PDO_FETCH_NUM)) { + while ($row = $sth->fetch(PDO::FETCH_NUM)) { $tables[] = $row[0]; } return $tables; @@ -118,7 +118,7 @@ $sth = $conn->prepare("SHOW COLUMNS FROM $table"); $sth->execute(); $field_list = array(); - while ($row = $sth->fetch(PDO_FETCH_NUM)) { + while ($row = $sth->fetch(PDO::FETCH_NUM)) { $field_list[] = $row[0]; } if ($database != $old_db) { Modified: trunk/lib/WikiDB/backend/PDO_oci8.php =================================================================== --- trunk/lib/WikiDB/backend/PDO_oci8.php 2014-07-17 08:38:53 UTC (rev 8968) +++ trunk/lib/WikiDB/backend/PDO_oci8.php 2014-07-17 09:02:29 UTC (rev 8969) @@ -73,19 +73,19 @@ . " VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)"); // Either use unixtime as %d (long), or the native timestamp format. $sth->bindParam(1, date('d-M-Y H:i:s', $entry->time)); - $sth->bindParam(2, $entry->host, PDO_PARAM_STR, 100); - $sth->bindParam(3, $entry->user, PDO_PARAM_STR, 50); - $sth->bindParam(4, $entry->request_method, PDO_PARAM_STR, 10); - $sth->bindParam(5, $entry->request, PDO_PARAM_STR, 255); - $sth->bindParam(6, $entry->request_args, PDO_PARAM_STR, 255); - $sth->bindParam(7, $entry->request_uri, PDO_PARAM_STR, 255); - $sth->bindParam(8, $entry->_ncsa_time($entry->time), PDO_PARAM_STR, 28); - $sth->bindParam(9, $entry->time, PDO_PARAM_INT); - $sth->bindParam(10, $entry->status, PDO_PARAM_INT); - $sth->bindParam(11, $entry->size, PDO_PARAM_INT); - $sth->bindParam(12, $entry->referer, PDO_PARAM_STR, 255); - $sth->bindParam(13, $entry->user_agent, PDO_PARAM_STR, 255); - $sth->bindParam(14, $entry->duration, PDO_PARAM_FLOAT); + $sth->bindParam(2, $entry->host, PDO::PARAM_STR, 100); + $sth->bindParam(3, $entry->user, PDO::PARAM_STR, 50); + $sth->bindParam(4, $entry->request_method, PDO::PARAM_STR, 10); + $sth->bindParam(5, $entry->request, PDO::PARAM_STR, 255); + $sth->bindParam(6, $entry->request_args, PDO::PARAM_STR, 255); + $sth->bindParam(7, $entry->request_uri, PDO::PARAM_STR, 255); + $sth->bindParam(8, $entry->_ncsa_time($entry->time), PDO::PARAM_STR, 28); + $sth->bindParam(9, $entry->time, PDO::PARAM_INT); + $sth->bindParam(10, $entry->status, PDO::PARAM_INT); + $sth->bindParam(11, $entry->size, PDO::PARAM_INT); + $sth->bindParam(12, $entry->referer, PDO::PARAM_STR, 255); + $sth->bindParam(13, $entry->user_agent, PDO::PARAM_STR, 255); + $sth->bindParam(14, $entry->duration, PDO::PARAM_FLOAT); $sth->execute(); } } Modified: trunk/lib/WikiUser/PdoDb.php =================================================================== --- trunk/lib/WikiUser/PdoDb.php 2014-07-17 08:38:53 UTC (rev 8968) +++ trunk/lib/WikiUser/PdoDb.php 2014-07-17 09:02:29 UTC (rev 8969) @@ -64,7 +64,7 @@ $dbh =& $this->_auth_dbi; $db_result = $dbh->query(sprintf($this->_prefs->_select, $dbh->quote($this->_userid))); // patched by fre...@pa... - $prefs = $db_result->fetch(PDO_FETCH_BOTH); + $prefs = $db_result->fetch(PDO::FETCH_BOTH); $prefs_blob = @$prefs["prefs"]; if ($restored_from_db = $this->_prefs->retrieve($prefs_blob)) { $this->_prefs->updatePrefs($restored_from_db); @@ -138,7 +138,7 @@ and $this->_authselect ) { try { - $this->_authselect->bindParam("userid", $this->_userid, PDO_PARAM_STR, 48); + $this->_authselect->bindParam("userid", $this->_userid, PDO::PARAM_STR, 48); $this->_authselect->execute(); } catch (PDOException $e) { trigger_error("SQL Error: " . $e->getMessage(), E_USER_WARNING); @@ -151,7 +151,7 @@ trigger_error(fmt("%s is missing", 'DBAUTH_AUTH_USER_EXISTS'), E_USER_WARNING); $this->_authcheck = $dbh->prepare($dbi->getAuthParam('auth_check')); - $this->_authcheck->bindParam("userid", $this->_userid, PDO_PARAM_STR, 48); + $this->_authcheck->bindParam("userid", $this->_userid, PDO::PARAM_STR, 48); $this->_authcheck->execute(); if ($this->_authcheck->fetchColumn()) return true; @@ -174,8 +174,8 @@ ) { $passwd = $GLOBALS['HTTP_POST_VARS']['auth']['passwd']; try { - $this->_authcreate->bindParam("userid", $this->_userid, PDO_PARAM_STR, 48); - $this->_authcreate->bindParam("password", $passwd, PDO_PARAM_STR, 48); + $this->_authcreate->bindParam("userid", $this->_userid, PDO::PARAM_STR, 48); + $this->_authcreate->bindParam("password", $passwd, PDO::PARAM_STR, 48); $rs = $this->_authselect->execute(); } catch (PDOException $e) { trigger_error("SQL Error: " . $e->getMessage(), E_USER_WARNING); @@ -210,9 +210,9 @@ //NOTE: for auth_crypt_method='crypt' defined('ENCRYPTED_PASSWD',true) must be set if ($this->_auth_crypt_method == 'crypt') { try { - $this->_authselect->bindParam("userid", $this->_userid, PDO_PARAM_STR, 48); + $this->_authselect->bindParam("userid", $this->_userid, PDO::PARAM_STR, 48); $this->_authselect->execute(); - $rs = $this->_authselect->fetch(PDO_FETCH_BOTH); + $rs = $this->_authselect->fetch(PDO::FETCH_BOTH); } catch (PDOException $e) { trigger_error("SQL Error: " . $e->getMessage(), E_USER_WARNING); return false; @@ -221,10 +221,10 @@ $result = $this->_checkPass($submitted_password, $stored_password); } else { try { - $this->_authselect->bindParam("password", $submitted_password, PDO_PARAM_STR, 48); - $this->_authselect->bindParam("userid", $this->_userid, PDO_PARAM_STR, 48); + $this->_authselect->bindParam("password", $submitted_password, PDO::PARAM_STR, 48); + $this->_authselect->bindParam("userid", $this->_userid, PDO::PARAM_STR, 48); $this->_authselect->execute(); - $rs = $this->_authselect->fetch(PDO_FETCH_BOTH); + $rs = $this->_authselect->fetch(PDO::FETCH_BOTH); } catch (PDOException $e) { trigger_error("SQL Error: " . $e->getMessage(), E_USER_WARNING); return false; @@ -277,8 +277,8 @@ $submitted_password = crypt($submitted_password); } try { - $this->_authupdate->bindParam("password", $submitted_password, PDO_PARAM_STR, 48); - $this->_authupdate->bindParam("userid", $this->_userid, PDO_PARAM_STR, 48); + $this->_authupdate->bindParam("password", $submitted_password, PDO::PARAM_STR, 48); + $this->_authupdate->bindParam("userid", $this->_userid, PDO::PARAM_STR, 48); $this->_authupdate->execute(); } catch (PDOException $e) { trigger_error("SQL Error: " . $e->getMessage(), E_USER_WARNING); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-07-17 14:14:40
|
Revision: 8974 http://sourceforge.net/p/phpwiki/code/8974 Author: vargenau Date: 2014-07-17 14:14:29 +0000 (Thu, 17 Jul 2014) Log Message: ----------- Add public/protected/private Modified Paths: -------------- trunk/lib/DbSession/ADODB.php trunk/lib/DbSession/PDO.php trunk/lib/DbSession/SQL.php trunk/lib/ErrorManager.php trunk/lib/FileFinder.php trunk/lib/HtmlElement.php trunk/lib/SemanticWeb.php trunk/lib/Template.php trunk/lib/TextSearchQuery.php trunk/lib/WikiCallback.php trunk/lib/WikiDB/adodb/adodb.inc.php trunk/lib/WikiDB/backend/ADODB.php trunk/lib/WikiDB/backend/PDO.php trunk/lib/WikiDB/backend/PearDB.php trunk/lib/WikiDB/backend/dbaBase.php trunk/lib/WikiDB/backend/dumb/AllRevisionsIter.php trunk/lib/WikiDB/backend/file.php trunk/lib/WikiDB/backend.php trunk/lib/WikiDB.php trunk/lib/WikiGroup.php trunk/lib/WikiPluginCached.php trunk/lib/WikiUser/LDAP.php trunk/lib/main.php trunk/lib/plugin/PopularNearby.php trunk/lib/plugin/Transclude.php trunk/lib/plugin/VisualWiki.php trunk/lib/upgrade.php trunk/lib/wikilens/RatingsDb.php Modified: trunk/lib/DbSession/ADODB.php =================================================================== --- trunk/lib/DbSession/ADODB.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/DbSession/ADODB.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -85,9 +85,8 @@ * @param string $session_name a name of the concrete file * @return boolean true just a variable to notify PHP that everything * is good. - * @access private */ - function open($save_path, $session_name) + private function open($save_path, $session_name) { //$this->log("_open($save_path, $session_name)"); return true; @@ -100,9 +99,8 @@ * * @return boolean true just a variable to notify PHP that everything * is good. - * @access private */ - function close() + private function close() { //$this->log("_close()"); return true; @@ -113,9 +111,8 @@ * * @param string $id an id of current session * @return string - * @access private */ - function read($id) + private function read($id) { //$this->log("_read($id)"); $dbh = $this->_connect(); @@ -152,9 +149,8 @@ * @param string $sess_data * @return boolean true if data saved successfully and false * otherwise. - * @access private */ - function write($id, $sess_data) + private function write($id, $sess_data) { if (defined("WIKI_XMLRPC") or defined("WIKI_SOAP")) return false; @@ -202,9 +198,8 @@ * * @param string $id * @return boolean true - * @access private */ - function destroy($id) + private function destroy($id) { $dbh = $this->_connect(); $table = $this->_table; @@ -221,9 +216,8 @@ * * @param int $maxlifetime session's time to live. * @return boolean true - * @access private */ - function gc($maxlifetime) + private function gc($maxlifetime) { $dbh = $this->_connect(); $table = $this->_table; Modified: trunk/lib/DbSession/PDO.php =================================================================== --- trunk/lib/DbSession/PDO.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/DbSession/PDO.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -63,9 +63,8 @@ * @param string $session_name a name of the concrete file * @return boolean true just a variable to notify PHP that everything * is good. - * @access private */ - function open($save_path, $session_name) + private function open($save_path, $session_name) { //$this->log("_open($save_path, $session_name)"); return true; @@ -78,9 +77,8 @@ * * @return boolean true just a variable to notify PHP that everything * is good. - * @access private */ - function close() + private function close() { //$this->log("_close()"); return true; @@ -91,9 +89,8 @@ * * @param string $id an id of current session * @return string - * @access private */ - function read($id) + private function read($id) { //$this->log("_read($id)"); $dbh = $this->_connect(); @@ -135,9 +132,8 @@ * @param string $sess_data * @return boolean true if data saved successfully and false * otherwise. - * @access private */ - function write($id, $sess_data) + private function write($id, $sess_data) { if (defined("WIKI_XMLRPC") or defined("WIKI_SOAP")) return false; @@ -199,9 +195,8 @@ * * @param string $id * @return boolean true - * @access private */ - function destroy($id) + private function destroy($id) { $table = $this->_table; $dbh = $this->_connect(); @@ -217,9 +212,8 @@ * * @param int $maxlifetime session's time to live. * @return boolean true - * @access private */ - function gc($maxlifetime) + private function gc($maxlifetime) { $table = $this->_table; $threshold = time() - $maxlifetime; Modified: trunk/lib/DbSession/SQL.php =================================================================== --- trunk/lib/DbSession/SQL.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/DbSession/SQL.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -70,9 +70,8 @@ * @param string $session_name a name of the concrete file * @return boolean true just a variable to notify PHP that everything * is good. - * @access private */ - function open($save_path, $session_name) + private function open($save_path, $session_name) { //$this->log("_open($save_path, $session_name)"); return true; @@ -85,9 +84,8 @@ * * @return boolean true just a variable to notify PHP that everything * is good. - * @access private */ - function close() + private function close() { //$this->log("_close()"); return true; @@ -98,9 +96,8 @@ * * @param string $id an id of current session * @return string - * @access private */ - function read($id) + private function read($id) { //$this->log("_read($id)"); $dbh = $this->_connect(); @@ -138,9 +135,8 @@ * @param string $sess_data * @return boolean true if data saved successfully and false * otherwise. - * @access private */ - function write($id, $sess_data) + private function write($id, $sess_data) { if (defined("WIKI_XMLRPC") or defined("WIKI_SOAP")) return false; @@ -189,9 +185,8 @@ * * @param string $id * @return boolean true - * @access private */ - function destroy($id) + private function destroy($id) { $dbh = $this->_connect(); $table = $this->_table; @@ -208,9 +203,8 @@ * * @param int $maxlifetime session's time to live. * @return boolean true - * @access private */ - function gc($maxlifetime) + private function gc($maxlifetime) { $dbh = $this->_connect(); $table = $this->_table; Modified: trunk/lib/ErrorManager.php =================================================================== --- trunk/lib/ErrorManager.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/ErrorManager.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -48,9 +48,8 @@ * Constructor. * * As this is a singleton class, you should never call this. - * @access private */ - function ErrorManager() + private function ErrorManager() { $this->_handlers = array(); $this->_fatal_handler = false; @@ -62,10 +61,9 @@ /** * Get mask indicating which errors are currently being postponed. - * @access public * @return int The current postponed error mask. */ - function getPostponedErrorMask() + public function getPostponedErrorMask() { return $this->_postpone_mask; } @@ -78,10 +76,9 @@ * When you set this mask, any queue errors which do not match the new * mask are reported. * - * @access public * @param $newmask int The new value for the mask. */ - function setPostponedErrorMask($newmask) + public function setPostponedErrorMask($newmask) { $this->_postpone_mask = $newmask; if (function_exists('PrintXML')) @@ -93,9 +90,8 @@ /** * Report any queued error messages. - * @access public */ - function flushPostponedErrors() + public function flushPostponedErrors() { if (function_exists('PrintXML')) PrintXML($this->_flush_errors()); @@ -106,9 +102,8 @@ /** * Get rid of all pending error messages in case of all non-html * - pdf or image - output. - * @access public */ - function destroyPostponedErrors() + public function destroyPostponedErrors() { $this->_postponed_errors = array(); } @@ -181,19 +176,17 @@ * handler. This allows the handler to * "adjust" the error message. * </dl> - * @access public * @param $handler WikiCallback Handler to call. */ - function pushErrorHandler($handler) + public function pushErrorHandler($handler) { array_unshift($this->_handlers, $handler); } /** * Pop an error handler off the handler stack. - * @access public */ - function popErrorHandler() + public function popErrorHandler() { return array_shift($this->_handlers); } @@ -205,10 +198,9 @@ * gets passed one argument: a PhpError object describing the * fatal error. * - * @access public * @param $handler WikiCallback Callback to call on fatal errors. */ - function setFatalHandler($handler) + public function setFatalHandler($handler) { $this->_fatal_handler = $handler; } @@ -219,10 +211,9 @@ * The error is passed through any registered error handlers, and * then either reported or postponed. * - * @access public * @param $error object A PhpError object. */ - function handleError($error) + public function handleError($error) { static $in_handler; @@ -317,10 +308,7 @@ $this->handleError(new PhpWikiError($errno, $msg, '?', '?')); } - /** - * @access private - */ - function _die($error) + private function _die($error) { global $WikiTheme; //echo "\n\n<html><body>"; @@ -333,10 +321,7 @@ } } - /** - * @access private - */ - function _flush_errors($keep_mask = 0) + private function _flush_errors($keep_mask = 0) { $errors = &$this->_postponed_errors; if (empty($errors)) return ''; Modified: trunk/lib/FileFinder.php =================================================================== --- trunk/lib/FileFinder.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/FileFinder.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -119,10 +119,9 @@ * Windows95: \ * Mac: : * - * @access private * @return string path_separator. */ - function _get_syspath_separator() + private function _get_syspath_separator() { if (!empty($this->_pathsep)) return $this->_pathsep; elseif (isWindowsNT()) return "/"; // we can safely use '/' @@ -141,10 +140,9 @@ * or use '\' for ours. * * @param string $path - * @access private * @return string path_separator. */ - function _use_path_separator($path) + private function _use_path_separator($path) { if (isWindows95()) { if (empty($path)) return "\\"; @@ -157,11 +155,10 @@ /** * Determine if path is absolute. * - * @access private * @param $path string Path. * @return bool True if path is absolute. */ - function _is_abs($path) + private function _is_abs($path) { if (substr($path, 0, 1) == '/') { return true; @@ -177,11 +174,10 @@ /** * Strip ending '/' or '\' from path. * - * @access private * @param $path string Path. * @return bool New path (destructive) */ - function _strip_last_pathchar(&$path) + private function _strip_last_pathchar(&$path) { if (substr($path, -1) == '/' or substr($path, -1) == "\\") $path = substr($path, 0, -1); @@ -191,11 +187,10 @@ /** * Report a "file not found" error. * - * @access private * @param $file string Name of missing file. * @return bool false. */ - function _not_found($file) + private function _not_found($file) { trigger_error(sprintf(_("%s: file not found"), $file), E_USER_ERROR); return false; @@ -204,12 +199,11 @@ /** * Search our path for a file. * - * @access private * @param $file string File to find. * @return string Directory which contains $file, or false. * [5x,44ms] */ - function _search_path($file) + private function _search_path($file) { foreach ($this->_path as $dir) { // ensure we use the same pathsep @@ -230,10 +224,9 @@ * Fixme: * On Mac it cannot be : because this is the seperator there! * - * @access private * @return string path_separator. */ - function _get_ini_separator() + private function _get_ini_separator() { return isWindows() ? ';' : ':'; // return preg_match('/^Windows/', php_uname()) @@ -242,10 +235,9 @@ /** * Get the value of PHP's include_path. * - * @access private * @return array Include path. */ - function _get_include_path() + private function _get_include_path() { if (defined("INCLUDE_PATH")) $path = INCLUDE_PATH; @@ -264,10 +256,9 @@ * The directory is appended only if it is not already listed in * the include_path. * - * @access private * @param $dir string Directory to add. */ - function _append_to_include_path($dir) + private function _append_to_include_path($dir) { $dir = $this->slashifyPath($dir); if (!in_array($dir, $this->_path)) { @@ -293,10 +284,9 @@ * * The directory is prepended, and removed from the tail if already existing. * - * @access private * @param $dir string Directory to add. */ - function _prepend_to_include_path($dir) + private function _prepend_to_include_path($dir) { $dir = $this->slashifyPath($dir); // remove duplicates @@ -326,10 +316,9 @@ /** * Try to figure out the appropriate value for $LANG. * - * @access private * @return string The value of $LANG. */ - function _get_lang() + private function _get_lang() { if (!empty($GLOBALS['LANG'])) return $GLOBALS['LANG']; Modified: trunk/lib/HtmlElement.php =================================================================== --- trunk/lib/HtmlElement.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/HtmlElement.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -44,10 +44,9 @@ } /** - * @access protected * This is used by the static factory methods is class HTML. */ - function _init2($args) + protected function _init2($args) { if ($args) { if (is_array($args[0])) Modified: trunk/lib/SemanticWeb.php =================================================================== --- trunk/lib/SemanticWeb.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/SemanticWeb.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -309,12 +309,11 @@ * This version unifies the attribute values from the database to a * numeric basevalue before comparison. (area:=963.6km^2 => 9.366e+08 m^2) * - * @access private * @param $value number A numerical value: integer, float or string. * @param $x string The variable name to be replaced in the query. * @return string */ - function _bind($value, $x) + private function _bind($value, $x) { $ori_value = $value; $value = preg_replace("/,/", "", $value); Modified: trunk/lib/Template.php =================================================================== --- trunk/lib/Template.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/Template.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -118,7 +118,6 @@ * Substitute HTML replacement text for tokens in template. * * Constructs a new WikiTemplate based upon the named template. - * @access public * @param string $varname Name of token to substitute for. * @param string $value Replacement HTML text. */ Modified: trunk/lib/TextSearchQuery.php =================================================================== --- trunk/lib/TextSearchQuery.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/TextSearchQuery.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -363,12 +363,11 @@ * So always when the placeholder is an array, the names of the target struct must match * and all vars be defined. Use the method can_match($struct) therefore. * - * @access public * @param $search_query string A numerical query with placeholders as variable. * @param $placeholders array or string All placeholders in the query must be defined * here, and will be replaced by the matcher. */ - function NumericSearchQuery($search_query, $placeholders) + public function NumericSearchQuery($search_query, $placeholders) { // added some basic security checks against user input $this->_query = $search_query; @@ -492,7 +491,6 @@ * Strip non-numeric chars from the variable (as the groupseperator) and replace * it in the symbolic query for evaluation. * - * @access private * @param $value number A numerical value: integer, float or string. * @param $x string The variable name to be replaced in the query. * @return string @@ -520,12 +518,11 @@ * With an array of placeholders we need a hash to check against, if all required names are given. * Purpose: Be silent about missing vars, just return false. `* - * @access public * @param string $variables string or hash of name => value The keys must satisfy all placeholders in the definition. * We want the full hash and not just the keys because a hash check is faster than the array of keys check. * @return boolean */ - function can_match(&$variables) + public function can_match(&$variables) { if (empty($this->_query)) return false; @@ -548,11 +545,10 @@ * With one placeholder we need just a number. * With an array of placeholders we need a hash. * - * @access public * @param $variable number or array of name => value The keys must satisfy all placeholders in the definition. * @return boolean */ - function match(&$variable) + public function match(&$variable) { $p =& $this->_placeholders; $this->workquery = $this->_query; Modified: trunk/lib/WikiCallback.php =================================================================== --- trunk/lib/WikiCallback.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiCallback.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -24,9 +24,8 @@ * the first element should contain (a reference to) the object, the second * element should be a string containing the name of the method to be invoked. * @return object Returns the appropriate subclass of WikiCallback. - * @access public */ - function callback($pearCb) + public function callback($pearCb) { if (is_string($pearCb)) return new WikiFunctionCb($pearCb); @@ -43,9 +42,8 @@ * @param ? mixed This method takes a variable number of arguments (zero or more). * The callback function is called with the specified arguments. * @return mixed The return value of the callback. - * @access public */ - function call() + public function call() { return $this->call_array(func_get_args()); } @@ -56,9 +54,8 @@ * @param $args array Contains the arguments to be passed to the callback. * @return mixed The return value of the callback. * @see call_user_func_array. - * @access public */ - function call_array($args) + public function call_array($args) { trigger_error('pure virtual', E_USER_ERROR); } @@ -69,9 +66,8 @@ * @return string The name of the callback function. * (This value is suitable for passing as the callback parameter * to a number of different Pear functions and methods.) - * @access public */ - function toPearCb() + public function toPearCb() { trigger_error('pure virtual', E_USER_ERROR); } @@ -87,9 +83,8 @@ * Constructor * * @param $functionName string Name of global function to call. - * @access public */ - function WikiFunctionCb($functionName) + public function WikiFunctionCb($functionName) { $this->functionName = $functionName; } @@ -116,9 +111,8 @@ * * @param $object object Object on which to invoke method. * @param $methodName string Name of method to call. - * @access public */ - function WikiMethodCb(&$object, $methodName) + public function WikiMethodCb(&$object, $methodName) { $this->object = &$object; $this->methodName = $methodName; @@ -148,9 +142,8 @@ * @param $args string Argument declarations * @param $code string Function body * @see create_function(). - * @access public */ - function WikiAnonymousCb($args, $code) + public function WikiAnonymousCb($args, $code) { $this->function = create_function($args, $code); } Modified: trunk/lib/WikiDB/adodb/adodb.inc.php =================================================================== --- trunk/lib/WikiDB/adodb/adodb.inc.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiDB/adodb/adodb.inc.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -2142,10 +2142,9 @@ * @param mixed $primkeyArr * @param array $extra Query extras: limit, offset... * @param mixed $relations Associative array: table's foreign name, "hasMany", "belongsTo" - * @access public * @return void */ - function GetActiveRecordsClass( + public function GetActiveRecordsClass( $class, $table,$whereOrderBy=false,$bindarr=false, $primkeyArr=false, $extra=array(), $relations=array()) Modified: trunk/lib/WikiDB/backend/ADODB.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiDB/backend/ADODB.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -1207,10 +1207,8 @@ * * Calls can be nested. The tables won't be unlocked until * _unlock_database() is called as many times as _lock_database(). - * - * @access protected */ - function lock($tables, $write_lock = true) + protected function lock($tables, $write_lock = true) { $this->_dbh->StartTrans(); if ($this->_lock_count++ == 0) { @@ -1230,14 +1228,12 @@ /** * Release a write lock on the tables in the SQL database. * - * @access protected - * * @param $force boolean Unlock even if not every call to lock() has been matched * by a call to unlock(). * * @see _lock_database */ - function unlock($tables = false, $force = false) + protected function unlock($tables = false, $force = false) { if ($this->_lock_count == 0) { $this->_current_lock = false; Modified: trunk/lib/WikiDB/backend/PDO.php =================================================================== --- trunk/lib/WikiDB/backend/PDO.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiDB/backend/PDO.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -1164,10 +1164,8 @@ * * Calls can be nested. The tables won't be unlocked until * _unlock_database() is called as many times as _lock_database(). - * - * @access protected */ - function lock($tables, $write_lock = true) + protected function lock($tables, $write_lock = true) { if ($this->_lock_count++ == 0) { $this->_current_lock = $tables; @@ -1191,14 +1189,12 @@ /** * Release a write lock on the tables in the SQL database. * - * @access protected - * * @param $force boolean Unlock even if not every call to lock() has been matched * by a call to unlock(). * * @see _lock_database */ - function unlock($tables = false, $force = false) + protected function unlock($tables = false, $force = false) { if ($this->_lock_count == 0) { $this->_current_lock = false; Modified: trunk/lib/WikiDB/backend/PearDB.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiDB/backend/PearDB.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -1005,10 +1005,8 @@ * * Calls can be nested. The tables won't be unlocked until * _unlock_database() is called as many times as _lock_database(). - * - * @access protected */ - function lock($tables = false, $write_lock = true) + protected function lock($tables = false, $write_lock = true) { if ($this->_lock_count++ == 0) $this->_lock_tables($write_lock); @@ -1025,14 +1023,12 @@ /** * Release a write lock on the tables in the SQL database. * - * @access protected - * * @param $force boolean Unlock even if not every call to lock() has been matched * by a call to unlock(). * * @see _lock_database */ - function unlock($tables = false, $force = false) + protected function unlock($tables = false, $force = false) { if ($this->_lock_count == 0) return; @@ -1073,11 +1069,9 @@ /** * Callback for PEAR (DB) errors. * - * @access protected - * * @param A PEAR_error object. */ - function _pear_error_callback($error) + protected function _pear_error_callback($error) { if ($this->_is_false_error($error)) return; @@ -1095,10 +1089,9 @@ * return any data. (So when a "LOCK" command doesn't return any data, * DB reports it as an error, when in fact, it's not.) * - * @access private * @return bool True iff error is not really an error. */ - function _is_false_error($error) + private function _is_false_error($error) { if ($error->getCode() != DB_ERROR) return false; @@ -1148,9 +1141,8 @@ * errors and notices. This is an error callback (for use with * ErrorManager which will filter out those spurious messages.) * @see _is_false_error, ErrorManager - * @access private */ - function _pear_notice_filter($err) + private function _pear_notice_filter($err) { return ($err->isNotice() && preg_match('|DB[/\\\\]common.php$|', $err->errfile) Modified: trunk/lib/WikiDB/backend/dbaBase.php =================================================================== --- trunk/lib/WikiDB/backend/dbaBase.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiDB/backend/dbaBase.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -398,12 +398,10 @@ } /** - * @access public - * * @return array of all linkrelations * Faster than the dumb WikiDB method. */ - function list_relations($also_attributes = false, + public function list_relations($also_attributes = false, $only_attributes = false, $sorted = true) { Modified: trunk/lib/WikiDB/backend/dumb/AllRevisionsIter.php =================================================================== --- trunk/lib/WikiDB/backend/dumb/AllRevisionsIter.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiDB/backend/dumb/AllRevisionsIter.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -12,11 +12,10 @@ /** * Constructor. * - * @access protected * @param $backend object A WikiDB_backend. * @param $pagename string Page whose revisions to get. */ - function WikiDB_backend_dumb_AllRevisionsIter(&$backend, $pagename) + protected function WikiDB_backend_dumb_AllRevisionsIter(&$backend, $pagename) { $this->_backend = &$backend; $this->_pagename = $pagename; Modified: trunk/lib/WikiDB/backend/file.php =================================================================== --- trunk/lib/WikiDB/backend/file.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiDB/backend/file.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -399,10 +399,8 @@ /** * Rename all files for this page - * - * @access protected Via WikiDB */ - function rename_page($pagename, $to) + protected function rename_page($pagename, $to) { $version = _getLatestVersion($pagename); foreach ($this->_dir_names as $type => $path) { @@ -581,8 +579,6 @@ * Pages should be returned in alphabetical order if that is * feasable. * - * @access protected - * * @param $include_defaulted boolean * If set, even pages with no content will be returned * --- but still only if they have at least one revision (not @@ -594,7 +590,7 @@ * * @return object A WikiDB_backend_iterator. */ - function get_all_pages($include_empty = false, $sortby = '', $limit = '', $exclude = '') + protected function get_all_pages($include_empty = false, $sortby = '', $limit = '', $exclude = '') { require_once 'lib/PageList.php'; $this->_loadLatestVersions(); Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiDB/backend.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -329,8 +329,6 @@ * Pages should be returned in alphabetical order if that is * feasable. * - * @access protected - * * @param bool $include_defaulted * If set, even pages with no content will be returned * --- but still only if they have at least one revision (not @@ -345,7 +343,7 @@ * @param string $exclude * @return object A WikiDB_backend_iterator. */ - function get_all_pages($include_defaulted, $orderby = false, $limit = '', $exclude = '') + protected function get_all_pages($include_defaulted, $orderby = false, $limit = '', $exclude = '') { trigger_error("virtual", E_USER_ERROR); } @@ -356,8 +354,6 @@ * Pages should be returned in alphabetical order if that is * feasible. * - * @access protected - * * @param object $search object A TextSearchQuery object describing the parsed query string, * with efficient methods for SQL and PCRE match. * @@ -372,7 +368,7 @@ * * @see WikiDB::titleSearch */ - function text_search($search, $fulltext = false, $sortby = '', + protected function text_search($search, $fulltext = false, $sortby = '', $limit = '', $exclude = '') { // This method implements a simple linear search @@ -390,7 +386,6 @@ /** * - * @access protected * @param object $pages A TextSearchQuery object. * @param object $linkvalue A TextSearchQuery object for the link values * (linkto, relation or backlinks or attribute values). @@ -400,7 +395,7 @@ * @return object A WikiDB_backend_iterator. * @see WikiDB::linkSearch */ - function link_search($pages, $linkvalue, $linktype, $relation = false, $options = array()) + protected function link_search($pages, $linkvalue, $linktype, $relation = false, $options = array()) { include_once 'lib/WikiDB/backend/dumb/LinkSearchIter.php'; $pageiter = $this->text_search($pages); @@ -413,12 +408,11 @@ * Find the pages with the highest hit counts. The pages should * be returned in reverse order by hit count. * - * @access protected * @param int $limit No more than this many pages * @param string $sortby * @return object A WikiDB_backend_iterator. */ - function most_popular($limit, $sortby = '-hits') + protected function most_popular($limit, $sortby = '-hits') { // This is method fetches all pages, then // sorts them by hit count. @@ -434,13 +428,12 @@ /** * Find recent changes. * - * @access protected * @param object $params hash See WikiDB::mostRecent for a description * of parameters which can be included in this hash. * @return object A WikiDB_backend_iterator. * @see WikiDB::mostRecent */ - function most_recent($params) + protected function most_recent($params) { // This method is very inefficient and searches through // all pages for the most recent changes. Modified: trunk/lib/WikiDB.php =================================================================== --- trunk/lib/WikiDB.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiDB.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -47,8 +47,6 @@ * arguments to determine the proper subclass of WikiDB to * instantiate, and then it instantiates it. * - * @access public - * * @param hash $dbparams Database configuration parameters. * Some pertinent parameters are: * <dl> @@ -98,7 +96,7 @@ * * @return WikiDB A WikiDB object. **/ - function open($dbparams) + public function open($dbparams) { $dbtype = $dbparams{'dbtype'}; include_once("lib/WikiDB/$dbtype.php"); @@ -110,10 +108,9 @@ /** * Constructor. * - * @access private * @see open() */ - function WikiDB(&$backend, $dbparams) + private function WikiDB(&$backend, $dbparams) { $this->_backend =& $backend; // don't do the following with the auth_dsn! @@ -142,10 +139,8 @@ * Closing a WikiDB invalidates all <tt>WikiDB_Page</tt>s, * <tt>WikiDB_PageRevision</tt>s and <tt>WikiDB_PageIterator</tt>s * which have been obtained from it. - * - * @access public */ - function close() + public function close() { $this->_backend->close(); $this->_cache->close(); @@ -157,11 +152,10 @@ * A {@link WikiDB} consists of the (infinite) set of all possible pages, * therefore this method never fails. * - * @access public * @param string $pagename Which page to get. * @return WikiDB_Page The requested WikiDB_Page. */ - function getPage($pagename) + public function getPage($pagename) { static $error_displayed = false; $pagename = (string)$pagename; @@ -195,12 +189,11 @@ * however isWikiPage may be implemented in a more efficient * manner in certain back-ends. * - * @access public * @param string $pagename string Which page to check. * @return boolean True if the page actually exists with * non-default contents in the WikiDataBase. */ - function isWikiPage($pagename) + public function isWikiPage($pagename) { $page = $this->getPage($pagename); return ($page and $page->exists()); @@ -214,12 +207,11 @@ * * Note: purgePage() effectively destroys all revisions of the page from the WikiDB. * - * @access public * @param string $pagename Name of page to delete. * @see purgePage * @return mixed */ - function deletePage($pagename) + public function deletePage($pagename) { if (!empty($this->readonly)) { trigger_error("readonly database", E_USER_WARNING); @@ -252,11 +244,10 @@ /** * Completely remove the page from the WikiDB, without undo possibility. - * @access public * @param string $pagename Name of page to delete. * @see deletePage */ - function purgePage($pagename) + public function purgePage($pagename) { if (!empty($this->readonly)) { trigger_error("readonly database", E_USER_WARNING); @@ -272,8 +263,6 @@ * * Gets the set of all pages with non-default contents. * - * @access public - * * @param bool $include_empty Optional. Normally pages whose most * recent revision has empty content are considered to be * non-existant. Unless $include_defaulted is set to true, those @@ -287,7 +276,7 @@ * @return WikiDB_PageIterator A WikiDB_PageIterator which contains all pages * in the WikiDB which have non-default contents. */ - function getAllPages($include_empty = false, $sortby = '', $limit = '', $exclude = '') + public function getAllPages($include_empty = false, $sortby = '', $limit = '', $exclude = '') { $result = $this->_backend->get_all_pages($include_empty, $sortby, $limit, $exclude); @@ -299,15 +288,13 @@ } /** - * @access public - * * @param boolean $include_empty If true include also empty pages * @param string $exclude: comma-separated list of pagenames. * TBD: array of pagenames * @return integer * */ - function numPages($include_empty = false, $exclude = '') + public function numPages($include_empty = false, $exclude = '') { if (method_exists($this->_backend, 'numPages')) // FIXME: currently are all args ignored. @@ -331,7 +318,6 @@ * practical to do so. * TODO: Sort by ranking. Only postgresql with tsearch2 can do ranking so far. * - * @access public * @param TextSearchQuery $search A TextSearchQuery object * @param string $sortby Optional. "+-column,+-column2". * If false the result is faster in natural order. @@ -341,7 +327,7 @@ * @return WikiDB_PageIterator A WikiDB_PageIterator containing the matching pages. * @see TextSearchQuery */ - function titleSearch($search, $sortby = 'pagename', $limit = '', $exclude = '') + public function titleSearch($search, $sortby = 'pagename', $limit = '', $exclude = '') { $result = $this->_backend->text_search($search, false, $sortby, $limit, $exclude); $options = array('exclude' => $exclude, @@ -361,8 +347,6 @@ * practical to do so. * TODO: Sort by ranking. Only postgresql with tsearch2 can do ranking so far. * - * @access public - * * @param TextSearchQuery $search A TextSearchQuery object. * @param string $sortby Optional. "+-column,+-column2". * If false the result is faster in natural order. @@ -372,7 +356,7 @@ * @return WikiDB_PageIterator A WikiDB_PageIterator containing the matching pages. * @see TextSearchQuery */ - function fullSearch($search, $sortby = 'pagename', $limit = '', $exclude = '') + public function fullSearch($search, $sortby = 'pagename', $limit = '', $exclude = '') { $result = $this->_backend->text_search($search, true, $sortby, $limit, $exclude); return new WikiDB_PageIterator($this, $result, @@ -387,8 +371,6 @@ * * Pages are returned in reverse order by hit count. * - * @access public - * * @param int $limit The maximum number of pages to return. * Set $limit to zero to return all pages. If $limit < 0, pages will * be sorted in decreasing order of popularity. @@ -398,7 +380,7 @@ * @return WikiDB_PageIterator A WikiDB_PageIterator containing the matching * pages. */ - function mostPopular($limit = 20, $sortby = '-hits') + public function mostPopular($limit = 20, $sortby = '-hits') { $result = $this->_backend->most_popular($limit, $sortby); return new WikiDB_PageIterator($this, $result); @@ -409,8 +391,6 @@ * * Revisions are returned in reverse order by creation time. * - * @access public - * * @param array $params This hash is used to specify various optional * parameters: * <dl> @@ -433,15 +413,13 @@ * @return WikiDB_PageRevisionIterator A WikiDB_PageRevisionIterator * containing the matching revisions. */ - function mostRecent($params = array()) + public function mostRecent($params = array()) { $result = $this->_backend->most_recent($params); return new WikiDB_PageRevisionIterator($this, $result); } /** - * @access public - * * @param string $exclude_from * @param string $exclude * @param string $sortby Optional. "+-column,+-column2". @@ -451,7 +429,7 @@ * @return Iterator A generic iterator containing rows of * (duplicate) pagename, wantedfrom. */ - function wantedPages($exclude_from = '', $exclude = '', $sortby = '', $limit = '') + public function wantedPages($exclude_from = '', $exclude = '', $sortby = '', $limit = '') { return $this->_backend->wanted_pages($exclude_from, $exclude, $sortby, $limit); } @@ -460,8 +438,6 @@ * Generic interface to the link table. Esp. useful to search for rdf triples as in * SemanticSearch and ListRelations. * - * @access public - * * @param object $pages A TextSearchQuery object. * @param object $search A TextSearchQuery object. * @param string $linktype One of "linkto", "linkfrom", "relation", "attribute". @@ -482,7 +458,7 @@ * @return Iterator A generic iterator containing links to pages or values. * hash of "pagename", "linkname", "linkvalue. */ - function linkSearch($pages, $search, $linktype, $relation = false) + public function linkSearch($pages, $search, $linktype, $relation = false) { return $this->_backend->link_search($pages, $search, $linktype, $relation); } @@ -491,13 +467,12 @@ * Return a simple list of all defined relations (and attributes), mainly * for the SemanticSearch autocompletion. * - * @access public * @param bool $also_attributes * @param bool $only_attributes * @param bool $sorted * @return array of strings */ - function listRelations($also_attributes = false, $only_attributes = false, $sorted = true) + public function listRelations($also_attributes = false, $only_attributes = false, $sorted = true) { if (method_exists($this->_backend, "list_relations")) return $this->_backend->list_relations($also_attributes, $only_attributes, $sorted); @@ -525,13 +500,12 @@ /** * Call the appropriate backend method. * - * @access public * @param string $from Page to rename * @param string $to New name * @param boolean $updateWikiLinks If the text in all pages should be replaced. * @return boolean true or false */ - function renamePage($from, $to, $updateWikiLinks = false) + public function renamePage($from, $to, $updateWikiLinks = false) { if (!empty($this->readonly)) { trigger_error("readonly database", E_USER_WARNING); @@ -647,8 +621,6 @@ * NOTE: this is currently implemented in a hackish and * not very efficient manner. * - * @access public - * * @param string $key Which meta data to get. * Some reserved meta-data keys are: * <dl> @@ -658,7 +630,7 @@ * @return scalar The requested value, or false if the requested data * is not set. */ - function get($key) + public function get($key) { if (!$key || $key[0] == '%') return false; @@ -682,12 +654,11 @@ * not very efficient manner. * * @see get - * @access public * * @param string $key Meta-data key to set. * @param string $newval New value. */ - function set($key, $newval) + public function set($key, $newval) { if (!empty($this->readonly)) { trigger_error("readonly database", E_USER_WARNING); @@ -795,11 +766,9 @@ /** * Get the name of the wiki page. * - * @access public - * * @return string The page name. */ - function getName() + public function getName() { return $this->_pagename; } @@ -821,12 +790,10 @@ * Deletes the specified revision of the page. * It is a fatal error to attempt to delete the current revision. * - * @access public - * * @param integer $version Which revision to delete. (You can also * use a WikiDB_PageRevision object here.) */ - function deleteRevision($version) + public function deleteRevision($version) { if ($this->_wikidb->readonly) { trigger_error("readonly database", E_USER_WARNING); @@ -932,8 +899,6 @@ /** * Create a new revision of a {@link WikiDB_Page}. * - * @access public - * * @param int $version Version number for new revision. * To ensure proper serialization of edits, $version must be * exactly one higher than the current latest version. @@ -950,7 +915,7 @@ * @return WikiDB_PageRevision Returns the new WikiDB_PageRevision object. If * $version was incorrect, returns false */ - function createRevision($version, &$content, $metadata, $links) + public function createRevision($version, &$content, $metadata, $links) { if ($this->_wikidb->readonly) { trigger_error("readonly database", E_USER_WARNING); @@ -1107,11 +1072,10 @@ /** * Get the most recent revision of a page. * - * @access public * @param bool $need_content * @return WikiDB_PageRevision The current WikiDB_PageRevision object. */ - function getCurrentRevision($need_content = true) + public function getCurrentRevision($need_content = true) { $backend = &$this->_wikidb->_backend; $cache = &$this->_wikidb->_cache; @@ -1135,15 +1099,13 @@ /** * Get a specific revision of a WikiDB_Page. * - * @access public - * * @param int $version Which revision to get. * @param bool $need_content * @return WikiDB_PageRevision The requested WikiDB_PageRevision object, or * false if the requested revision does not exist in the {@link WikiDB}. * Note that version zero of any page always exists. */ - function getRevision($version, $need_content = true) + public function getRevision($version, $need_content = true) { $cache = &$this->_wikidb->_cache; $pagename = &$this->_pagename; @@ -1167,8 +1129,6 @@ * This method find the most recent revision before a specified * version. * - * @access public - * * @param bool|int $version Find most recent revision before this version. * You can also use a WikiDB_PageRevision object to specify the $version. * @@ -1179,7 +1139,7 @@ * unless $version is greater than zero, a revision (perhaps version zero, * the default revision) will always be found. */ - function getRevisionBefore($version = false, $need_content = true) + public function getRevisionBefore($version = false, $need_content = true) { $backend = &$this->_wikidb->_backend; $pagename = &$this->_pagename; @@ -1221,8 +1181,6 @@ * as 'linkrelation' key as pagename. See WikiDB_PageIterator::next * if (isset($next['linkrelation'])) * - * @access public - * * @param bool $reversed Which links to find: true for backlinks (default). * @param bool $include_empty * @param string $sortby @@ -1233,7 +1191,7 @@ * @return WikiDB_PageIterator A WikiDB_PageIterator containing * all matching pages. */ - function getLinks($reversed = true, $include_empty = false, $sortby = '', + public function getLinks($reversed = true, $include_empty = false, $sortby = '', $limit = '', $exclude = '', $want_relations = false) { $backend = &$this->_wikidb->_backend; @@ -1318,8 +1276,6 @@ /** * Access WikiDB_Page non version-specific meta-data. * - * @access public - * * @param string $key Which meta data to get. * Some reserved meta-data keys are: * <dl> @@ -1341,7 +1297,7 @@ * @return scalar The requested value, or false if the requested data * is not set. */ - function get($key) + public function get($key) { $cache = &$this->_wikidb->_cache; $backend = &$this->_wikidb->_backend; @@ -1381,12 +1337,11 @@ * Set page meta-data. * * @see get - * @access public * * @param string $key Meta-data key to set. * @param string $newval New value. */ - function set($key, $newval) + public function set($key, $newval) { $cache = &$this->_wikidb->_cache; $backend = &$this->_wikidb->_backend; @@ -1436,10 +1391,8 @@ * * Note that this method may be implemented in more efficient ways * in certain backends. - * - * @access public */ - function increaseHitCount() + public function increaseHitCount() { if ($this->_wikidb->readonly) { trigger_error("readonly database", E_USER_NOTICE); @@ -1458,11 +1411,9 @@ * * This is really only for debugging. * - * @access public - * * @return string Printable representation of the WikiDB_Page. */ - function asString() + public function asString() { ob_start(); printf("[%s:%s\n", get_class($this), $this->getName()); @@ -1474,13 +1425,12 @@ } /** - * @access private * @param int|object $version_or_pagerevision * Takes either the version number (and int) or a WikiDB_PageRevision * object. * @return integer The version number. */ - function _coerce_to_version($version_or_pagerevision) + private function _coerce_to_version($version_or_pagerevision) { if (method_exists($version_or_pagerevision, "getContent")) $version = $version_or_pagerevision->getVersion(); @@ -1578,11 +1528,9 @@ /** * Get the WikiDB_Page which this revision belongs to. * - * @access public - * * @return WikiDB_Page The WikiDB_Page which this revision belongs to. */ - function getPage() + public function getPage() { return new WikiDB_Page($this->_wikidb, $this->_pagename); } @@ -1590,11 +1538,9 @@ /** * Get the version number of this revision. * - * @access public - * * @return integer The version number of this revision. */ - function getVersion() + public function getVersion() { return $this->_version; } @@ -1609,11 +1555,9 @@ * Describe [ThisPage] here. * </pre> * - * @access public - * * @return boolean Returns true if the page has default content. */ - function hasDefaultContents() + public function hasDefaultContents() { $data = &$this->_data; if (!isset($data['%content'])) return true; @@ -1624,12 +1568,10 @@ /** * Get the content as an array of lines. * - * @access public - * * @return array An array of lines. * The lines should contain no trailing white space. */ - function getContent() + public function getContent() { return explode("\n", $this->getPackedContent()); } @@ -1637,11 +1579,9 @@ /** * Get the pagename of the revision. * - * @access public - * * @return string pagename. */ - function getPageName() + public function getPageName() { return $this->_pagename; } @@ -1654,11 +1594,9 @@ /** * Determine whether revision is the latest. * - * @access public - * * @return boolean True iff the revision is the latest (most recent) one. */ - function isCurrent() + public function isCurrent() { if (!isset($this->_iscurrent)) { $page = $this->getPage(); @@ -1736,12 +1674,10 @@ /** * Get the content as a string. * - * @access public - * * @return string The page content. * Lines are separated by new-lines. */ - function getPackedContent() + public function getPackedContent() { $data = &$this->_data; @@ -1815,9 +1751,6 @@ /** * Get meta-data for this revision. * - * - * @access public - * * @param string $key Which meta-data to access. * * Some reserved revision meta-data keys are: @@ -1854,7 +1787,7 @@ * @return string The requested value, or false if the requested value * is not defined. */ - function get($key) + public function get($key) { if (!$key || $key[0] == '%') return false; @@ -1882,11 +1815,9 @@ * * This is really only for debugging. * - * @access public - * * @return string Printable representation of the WikiDB_Page. */ - function asString() + public function asString() { ob_start(); printf("[%s:%d\n", get_class($this), $this->get('version')); @@ -1927,11 +1858,9 @@ /** * Get next WikiDB_Page in sequence. * - * @access public - * * @return WikiDB_Page The next WikiDB_Page in the sequence. */ - function next() + public function next() { if (!($next = $this->_iter->next())) { return false; @@ -1978,10 +1907,8 @@ * (I.e. if you iterate through all the pages in the sequence, * you do not need to call free() --- you only need to call it * if you stop before the end of the iterator is reached.) - * - * @access public */ - function free() + public function free() { // $this->_iter->free(); } @@ -2074,12 +2001,10 @@ /** * Get next WikiDB_PageRevision in sequence. * - * @access public - * * @return WikiDB_PageRevision * The next WikiDB_PageRevision in the sequence. */ - function next() + public function next() { if (!($next = $this->_revisions->next())) return false; @@ -2121,10 +2046,8 @@ * (I.e. if you iterate through all the revisions in the sequence, * you do not need to call free() --- you only need to call it * if you stop before the end of the iterator is reached.) - * - * @access public */ - function free() + public function free() { $this->_revisions->free(); } Modified: trunk/lib/WikiGroup.php =================================================================== --- trunk/lib/WikiGroup.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiGroup.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -531,9 +531,8 @@ * @param object $group_page WikiDB_Page object for the group's page * @param bool $strict * @return boolean True if user is a member, else false. - * @access private */ - function _inGroupPage($group_page, $strict = false) + private function _inGroupPage($group_page, $strict = false) { $group_revision = $group_page->getCurrentRevision(); if ($group_revision->hasDefaultContents()) { Modified: trunk/lib/WikiPluginCached.php =================================================================== --- trunk/lib/WikiPluginCached.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiPluginCached.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -69,12 +69,11 @@ * @param array $argarray all parameters (including those set to * default values) of the plugin call to be * prepared - * @access private * @return array(id,url) * * TODO: check if args is needed at all (on lost cache) */ - function genUrl($cache, $argarray) + private function genUrl($cache, $argarray) { global $request; //$cacheparams = $GLOBALS['CacheParams']; @@ -125,7 +124,6 @@ * Have a close look on the arguments and required return values, * however. </b> * - * @access protected * @param WikiDB $dbi database abstraction class * @param string $argstr plugin arguments in the call from PhpWiki * @param Request $request @@ -136,7 +134,7 @@ * @see #getImage * @see #getMap */ - function run($dbi, $argstr, &$request, $basepage) + protected function run($dbi, $argstr, &$request, $basepage) { $cache = $this->newCache(); //$cacheparams = $GLOBALS['CacheParams']; @@ -262,7 +260,6 @@ * Sets the type of the plugin to html, image or map * production * - * @access protected * @return int determines the plugin to produce either html, * an image or an image map; uses on of the * following predefined values @@ -273,7 +270,7 @@ * <li>PLUGIN_CACHED_MAP</li> * </ul> */ - function getPluginType() + protected function getPluginType() { return PLUGIN_CACHED_IMG_ONDEMAND; } @@ -284,7 +281,6 @@ * <code>getPluginType</code> is set to * PLUGIN_CACHED_IMG_INLINE or PLUGIN_CACHED_IMG_ONDEMAND. * - * @access protected pure virtual * @param WikiDB $dbi database abstraction class * @param array $argarray complete (!) arguments to produce * image. It is not necessary to call @@ -293,7 +289,7 @@ * @return mixed imagehandle image handle if successful * false if an error occured */ - function getImage($dbi, $argarray, $request) + protected function getImage($dbi, $argarray, $request) { trigger_error('WikiPluginCached::getImage: pure virtual function in file ' . __FILE__ . ' line ' . __LINE__, E_USER_ERROR); @@ -308,7 +304,6 @@ * sufficient, the expire time is ignored and removing * is determined by the last "touch" of the entry. * - * @access protected virtual * @param WikiDB $dbi database abstraction class * @param array $argarray complete (!) arguments. It is * not necessary to call @@ -317,7 +312,7 @@ * @return string format: '+seconds' * '0' never expires */ - function getExpire($dbi, $argarray, $request) + protected function getExpire($dbi, $argarray, $request) { return '0'; // persist forever } @@ -326,7 +321,6 @@ * Decides the image type of an image output. * Always used unless plugin type is PLUGIN_CACHED_HTML. * - * @access protected virtual * @param WikiDB $dbi database abstraction class * @param array $argarray complete (!) arguments. It is * not necessary to call @@ -334,7 +328,7 @@ * @param Request $request * @return string 'png', 'jpeg' or 'gif' */ - function getImageType(&$dbi, $argarray, &$request) + protected function getImageType(&$dbi, $argarray, &$request) { if (in_array($argarray['imgtype'], preg_split('/\s*:\s*/', PLUGIN_CACHED_IMGTYPES))) return $argarray['imgtype']; @@ -346,7 +340,6 @@ * Produces the alt text for an image. * <code> &l... [truncated message content] |
From: <var...@us...> - 2014-07-17 14:32:16
|
Revision: 8975 http://sourceforge.net/p/phpwiki/code/8975 Author: vargenau Date: 2014-07-17 14:32:09 +0000 (Thu, 17 Jul 2014) Log Message: ----------- Use public when needed Modified Paths: -------------- trunk/lib/ErrorManager.php trunk/lib/FileFinder.php trunk/lib/WikiDB/backend/PearDB.php trunk/lib/WikiDB.php Modified: trunk/lib/ErrorManager.php =================================================================== --- trunk/lib/ErrorManager.php 2014-07-17 14:14:29 UTC (rev 8974) +++ trunk/lib/ErrorManager.php 2014-07-17 14:32:09 UTC (rev 8975) @@ -49,7 +49,7 @@ * * As this is a singleton class, you should never call this. */ - private function ErrorManager() + public function ErrorManager() { $this->_handlers = array(); $this->_fatal_handler = false; Modified: trunk/lib/FileFinder.php =================================================================== --- trunk/lib/FileFinder.php 2014-07-17 14:14:29 UTC (rev 8974) +++ trunk/lib/FileFinder.php 2014-07-17 14:32:09 UTC (rev 8975) @@ -226,7 +226,7 @@ * * @return string path_separator. */ - private function _get_ini_separator() + public function _get_ini_separator() { return isWindows() ? ';' : ':'; // return preg_match('/^Windows/', php_uname()) @@ -258,7 +258,7 @@ * * @param $dir string Directory to add. */ - private function _append_to_include_path($dir) + public function _append_to_include_path($dir) { $dir = $this->slashifyPath($dir); if (!in_array($dir, $this->_path)) { @@ -286,7 +286,7 @@ * * @param $dir string Directory to add. */ - private function _prepend_to_include_path($dir) + public function _prepend_to_include_path($dir) { $dir = $this->slashifyPath($dir); // remove duplicates Modified: trunk/lib/WikiDB/backend/PearDB.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB.php 2014-07-17 14:14:29 UTC (rev 8974) +++ trunk/lib/WikiDB/backend/PearDB.php 2014-07-17 14:32:09 UTC (rev 8975) @@ -1006,7 +1006,7 @@ * Calls can be nested. The tables won't be unlocked until * _unlock_database() is called as many times as _lock_database(). */ - protected function lock($tables = false, $write_lock = true) + public function lock($tables = false, $write_lock = true) { if ($this->_lock_count++ == 0) $this->_lock_tables($write_lock); @@ -1028,7 +1028,7 @@ * * @see _lock_database */ - protected function unlock($tables = false, $force = false) + public function unlock($tables = false, $force = false) { if ($this->_lock_count == 0) return; Modified: trunk/lib/WikiDB.php =================================================================== --- trunk/lib/WikiDB.php 2014-07-17 14:14:29 UTC (rev 8974) +++ trunk/lib/WikiDB.php 2014-07-17 14:32:09 UTC (rev 8975) @@ -110,7 +110,7 @@ * * @see open() */ - private function WikiDB(&$backend, $dbparams) + public function WikiDB(&$backend, $dbparams) { $this->_backend =& $backend; // don't do the following with the auth_dsn! This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-07-17 16:12:39
|
Revision: 8982 http://sourceforge.net/p/phpwiki/code/8982 Author: vargenau Date: 2014-07-17 16:12:36 +0000 (Thu, 17 Jul 2014) Log Message: ----------- Use public when needed Modified Paths: -------------- trunk/lib/DbSession/ADODB.php trunk/lib/DbSession/PDO.php trunk/lib/WikiDB/backend/ADODB.php trunk/lib/WikiDB/backend/PDO.php trunk/lib/WikiDB/backend/file.php Modified: trunk/lib/DbSession/ADODB.php =================================================================== --- trunk/lib/DbSession/ADODB.php 2014-07-17 15:47:03 UTC (rev 8981) +++ trunk/lib/DbSession/ADODB.php 2014-07-17 16:12:36 UTC (rev 8982) @@ -86,7 +86,7 @@ * @return boolean true just a variable to notify PHP that everything * is good. */ - private function open($save_path, $session_name) + public function open($save_path, $session_name) { //$this->log("_open($save_path, $session_name)"); return true; @@ -100,7 +100,7 @@ * @return boolean true just a variable to notify PHP that everything * is good. */ - private function close() + public function close() { //$this->log("_close()"); return true; @@ -112,7 +112,7 @@ * @param string $id an id of current session * @return string */ - private function read($id) + public function read($id) { //$this->log("_read($id)"); $dbh = $this->_connect(); @@ -150,7 +150,7 @@ * @return boolean true if data saved successfully and false * otherwise. */ - private function write($id, $sess_data) + public function write($id, $sess_data) { if (defined("WIKI_XMLRPC") or defined("WIKI_SOAP")) return false; @@ -199,7 +199,7 @@ * @param string $id * @return boolean true */ - private function destroy($id) + public function destroy($id) { $dbh = $this->_connect(); $table = $this->_table; @@ -217,7 +217,7 @@ * @param int $maxlifetime session's time to live. * @return boolean true */ - private function gc($maxlifetime) + public function gc($maxlifetime) { $dbh = $this->_connect(); $table = $this->_table; Modified: trunk/lib/DbSession/PDO.php =================================================================== --- trunk/lib/DbSession/PDO.php 2014-07-17 15:47:03 UTC (rev 8981) +++ trunk/lib/DbSession/PDO.php 2014-07-17 16:12:36 UTC (rev 8982) @@ -64,7 +64,7 @@ * @return boolean true just a variable to notify PHP that everything * is good. */ - private function open($save_path, $session_name) + public function open($save_path, $session_name) { //$this->log("_open($save_path, $session_name)"); return true; @@ -78,7 +78,7 @@ * @return boolean true just a variable to notify PHP that everything * is good. */ - private function close() + public function close() { //$this->log("_close()"); return true; @@ -90,7 +90,7 @@ * @param string $id an id of current session * @return string */ - private function read($id) + public function read($id) { //$this->log("_read($id)"); $dbh = $this->_connect(); @@ -133,7 +133,7 @@ * @return boolean true if data saved successfully and false * otherwise. */ - private function write($id, $sess_data) + public function write($id, $sess_data) { if (defined("WIKI_XMLRPC") or defined("WIKI_SOAP")) return false; @@ -196,7 +196,7 @@ * @param string $id * @return boolean true */ - private function destroy($id) + public function destroy($id) { $table = $this->_table; $dbh = $this->_connect(); @@ -213,7 +213,7 @@ * @param int $maxlifetime session's time to live. * @return boolean true */ - private function gc($maxlifetime) + public function gc($maxlifetime) { $table = $this->_table; $threshold = time() - $maxlifetime; Modified: trunk/lib/WikiDB/backend/ADODB.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB.php 2014-07-17 15:47:03 UTC (rev 8981) +++ trunk/lib/WikiDB/backend/ADODB.php 2014-07-17 16:12:36 UTC (rev 8982) @@ -1208,7 +1208,7 @@ * Calls can be nested. The tables won't be unlocked until * _unlock_database() is called as many times as _lock_database(). */ - protected function lock($tables, $write_lock = true) + public function lock($tables, $write_lock = true) { $this->_dbh->StartTrans(); if ($this->_lock_count++ == 0) { @@ -1233,7 +1233,7 @@ * * @see _lock_database */ - protected function unlock($tables = false, $force = false) + public function unlock($tables = false, $force = false) { if ($this->_lock_count == 0) { $this->_current_lock = false; Modified: trunk/lib/WikiDB/backend/PDO.php =================================================================== --- trunk/lib/WikiDB/backend/PDO.php 2014-07-17 15:47:03 UTC (rev 8981) +++ trunk/lib/WikiDB/backend/PDO.php 2014-07-17 16:12:36 UTC (rev 8982) @@ -1165,7 +1165,7 @@ * Calls can be nested. The tables won't be unlocked until * _unlock_database() is called as many times as _lock_database(). */ - protected function lock($tables, $write_lock = true) + public function lock($tables, $write_lock = true) { if ($this->_lock_count++ == 0) { $this->_current_lock = $tables; @@ -1194,7 +1194,7 @@ * * @see _lock_database */ - protected function unlock($tables = false, $force = false) + public function unlock($tables = false, $force = false) { if ($this->_lock_count == 0) { $this->_current_lock = false; Modified: trunk/lib/WikiDB/backend/file.php =================================================================== --- trunk/lib/WikiDB/backend/file.php 2014-07-17 15:47:03 UTC (rev 8981) +++ trunk/lib/WikiDB/backend/file.php 2014-07-17 16:12:36 UTC (rev 8982) @@ -400,7 +400,7 @@ /** * Rename all files for this page */ - protected function rename_page($pagename, $to) + public function rename_page($pagename, $to) { $version = _getLatestVersion($pagename); foreach ($this->_dir_names as $type => $path) { @@ -590,7 +590,7 @@ * * @return object A WikiDB_backend_iterator. */ - protected function get_all_pages($include_empty = false, $sortby = '', $limit = '', $exclude = '') + public function get_all_pages($include_empty = false, $sortby = '', $limit = '', $exclude = '') { require_once 'lib/PageList.php'; $this->_loadLatestVersions(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-07-17 16:52:53
|
Revision: 8983 http://sourceforge.net/p/phpwiki/code/8983 Author: vargenau Date: 2014-07-17 16:52:49 +0000 (Thu, 17 Jul 2014) Log Message: ----------- Use __construct Modified Paths: -------------- trunk/lib/AccessLog.php trunk/lib/BlockParser.php trunk/lib/DbSession.php trunk/lib/ErrorManager.php trunk/lib/FileFinder.php trunk/lib/InlineParser.php trunk/lib/PageType.php trunk/lib/Request.php trunk/lib/WikiCallback.php trunk/lib/WikiDB/backend/ADODB_mssql.php trunk/lib/WikiDB/backend/ADODB_mssqlnative.php trunk/lib/WikiDB/backend/ADODB_mysql.php trunk/lib/WikiDB/backend/ADODB_oci8po.php trunk/lib/WikiDB/backend/ADODB_postgres7.php trunk/lib/WikiDB/backend/ADODB_sqlite.php trunk/lib/WikiDB/backend/PearDB_mysql.php trunk/lib/WikiDB/backend/PearDB_oci8.php trunk/lib/WikiDB/backend/dumb/AllRevisionsIter.php trunk/lib/WikiDB/cvs.php trunk/lib/WikiDB/file.php trunk/lib/WikiDB/flatfile.php trunk/lib/WikiDB.php trunk/lib/WikiGroup.php trunk/lib/WikiTheme.php trunk/lib/WikiUser.php trunk/lib/difflib.php trunk/lib/plugin/RecentChanges.php trunk/lib/stdlib.php Modified: trunk/lib/AccessLog.php =================================================================== --- trunk/lib/AccessLog.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/AccessLog.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -218,8 +218,6 @@ class Request_AccessLogEntry { /** - * Constructor. - * * The log entry will be automatically appended to the log file or * SQL table when the current request terminates. * @@ -234,9 +232,8 @@ * $log_entry->push($request); * </pre> * - * */ - function Request_AccessLogEntry(&$accesslog) + function __construct(&$accesslog) { $this->_accesslog = $accesslog; $this->logfile = $accesslog->logfile; Modified: trunk/lib/BlockParser.php =================================================================== --- trunk/lib/BlockParser.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/BlockParser.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -74,14 +74,13 @@ */ class AnchoredRegexpSet { - /** Constructor - * + /** * @param $regexps array A list of regular expressions. The * regular expressions should not include any sub-pattern groups * "(...)". (Anonymous groups, like "(?:...)", as well as * look-ahead and look-behind assertions are fine.) */ - function AnchoredRegexpSet($regexps) + function __construct($regexps) { $this->_regexps = $regexps; $this->_re = "/((" . join(")|(", $regexps) . "))/Ax"; Modified: trunk/lib/DbSession.php =================================================================== --- trunk/lib/DbSession.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/DbSession.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -15,8 +15,6 @@ class DbSession { /** - * Constructor - * * @param mixed $dbh * DB handle, or WikiDB object (from which the DB handle will * be extracted. @@ -25,7 +23,7 @@ * @return bool|DbSession * Name of SQL table containing session data. */ - function DbSession(&$dbh, $table = 'session') + function __construct(&$dbh, $table = 'session') { // Check for existing DbSession handler $db_type = $dbh->getParam('dbtype'); Modified: trunk/lib/ErrorManager.php =================================================================== --- trunk/lib/ErrorManager.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/ErrorManager.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -45,11 +45,9 @@ class ErrorManager { /** - * Constructor. - * * As this is a singleton class, you should never call this. */ - public function ErrorManager() + function __construct() { $this->_handlers = array(); $this->_fatal_handler = false; @@ -415,13 +413,12 @@ public $errline; /** - * Construct a new PhpError. * @param int $errno * @param string $errstr * @param string $errfile * @param int $errline */ - function PhpError($errno, $errstr, $errfile, $errline) + function __construct($errno, $errstr, $errfile, $errline) { $this->errno = $errno; $this->errstr = $errstr; @@ -571,15 +568,14 @@ class PhpWikiError extends PhpError { /** - * Construct a new PhpError. * @param int $errno * @param string $errstr * @param string $errfile * @param int $errline */ - function PhpWikiError($errno, $errstr, $errfile, $errline) + function __construct($errno, $errstr, $errfile, $errline) { - $this->PhpError($errno, $errstr, $errfile, $errline); + parent::__construct($errno, $errstr, $errfile, $errline); } function _getDetail() Modified: trunk/lib/FileFinder.php =================================================================== --- trunk/lib/FileFinder.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/FileFinder.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -16,11 +16,9 @@ public $_pathsep, $_path; /** - * Constructor. - * * @param $path array A list of directories in which to search for files. */ - function FileFinder($path = array()) + function __construct($path = array()) { $this->_pathsep = $this->_get_syspath_separator(); if (!isset($this->_path) and $path === false) @@ -361,15 +359,13 @@ extends FileFinder { /** - * Constructor. - * * @param $path array Where to look for PEAR library code. * A good set of defaults is provided, so you can probably leave * this parameter blank. */ - function PearFileFinder($path = array()) + function __construct($path = array()) { - $this->FileFinder(array_merge( + parent::__construct(array_merge( $path, array('/usr/share/php', '/usr/lib/php', @@ -395,10 +391,7 @@ class LocalizedFileFinder extends FileFinder { - /** - * Constructor. - */ - function LocalizedFileFinder() + function __construct() { $this->_pathsep = $this->_get_syspath_separator(); $include_path = $this->_get_include_path(); @@ -433,10 +426,7 @@ class LocalizedButtonFinder extends FileFinder { - /** - * Constructor. - */ - function LocalizedButtonFinder() + function __construct() { global $WikiTheme; $this->_pathsep = $this->_get_syspath_separator(); Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/InlineParser.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -79,14 +79,13 @@ */ class RegexpSet { - /** Constructor - * + /** * @param array $regexps A list of regular expressions. The * regular expressions should not include any sub-pattern groups * "(...)". (Anonymous groups, like "(?:...)", as well as * look-ahead and look-behind assertions are okay.) */ - function RegexpSet($regexps) + function __construct($regexps) { assert($regexps); $this->_regexps = array_unique($regexps); Modified: trunk/lib/PageType.php =================================================================== --- trunk/lib/PageType.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/PageType.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -26,15 +26,14 @@ */ class TransformedText extends CacheableMarkup { - /** Constructor. - * + /** * @param WikiDB_Page $page * @param string $text The packed page revision content. * @param array $meta The version meta-data. * @param string $type_override For markup of page using a different * pagetype than that specified in its version meta-data. */ - function TransformedText($page, $text, $meta, $type_override = '') + function __construct($page, $text, $meta, $type_override = '') { $pagetype = false; if ($type_override) @@ -42,8 +41,8 @@ elseif (isset($meta['pagetype'])) $pagetype = $meta['pagetype']; $this->_type = PageType::GetPageType($pagetype); - $this->CacheableMarkup($this->_type->transform($page, $text, $meta), - $page->getName()); + parent::__construct($this->_type->transform($page, $text, $meta), + $page->getName()); } function getType() @@ -362,12 +361,11 @@ */ class PageFormatter { - /** Constructor. - * + /** * @param WikiDB_Page $page * @param hash $meta Version meta-data. */ - function PageFormatter(&$page, $meta) + function __construct(&$page, $meta) { $this->_page = $page; $this->_meta = $meta; Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/Request.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -1044,8 +1044,6 @@ class Request_AccessLogEntry { /** - * Constructor. - * * The log entry will be automatically appended to the log file or * SQL table when the current request terminates. * @@ -1060,9 +1058,8 @@ * $log_entry->push($request); * </pre> * - * */ - function Request_AccessLogEntry(&$accesslog) + function __construct(&$accesslog) { $this->_accesslog = $accesslog; $this->logfile = $accesslog->logfile; Modified: trunk/lib/WikiCallback.php =================================================================== --- trunk/lib/WikiCallback.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/WikiCallback.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -80,11 +80,9 @@ extends WikiCallback { /** - * Constructor - * * @param $functionName string Name of global function to call. */ - public function WikiFunctionCb($functionName) + public function __construct($functionName) { $this->functionName = $functionName; } @@ -107,12 +105,10 @@ extends WikiCallback { /** - * Constructor - * * @param $object object Object on which to invoke method. * @param $methodName string Name of method to call. */ - public function WikiMethodCb(&$object, $methodName) + function __construct(&$object, $methodName) { $this->object = &$object; $this->methodName = $methodName; @@ -137,13 +133,11 @@ extends WikiCallback { /** - * Constructor - * * @param $args string Argument declarations * @param $code string Function body * @see create_function(). */ - public function WikiAnonymousCb($args, $code) + function __construct($args, $code) { $this->function = create_function($args, $code); } Modified: trunk/lib/WikiDB/backend/ADODB_mssql.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_mssql.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/WikiDB/backend/ADODB_mssql.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -9,16 +9,13 @@ class WikiDB_backend_ADODB_mssql extends WikiDB_backend_ADODB { - /** - * Constructor. - */ - function WikiDB_backend_ADODB_mssql($dbparams) + function __construct($dbparams) { // Lowercase Assoc arrays define('ADODB_ASSOC_CASE', 0); // Backend constructor - $this->WikiDB_backend_ADODB($dbparams); + parent::__construct($dbparams); // Empty strings in MSSQL? NULLS? $this->_expressions['notempty'] = "NOT LIKE ''"; Modified: trunk/lib/WikiDB/backend/ADODB_mssqlnative.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_mssqlnative.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/WikiDB/backend/ADODB_mssqlnative.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -8,16 +8,13 @@ class WikiDB_backend_ADODB_mssqlnative extends WikiDB_backend_ADODB { - /** - * Constructor. - */ - function WikiDB_backend_ADODB_mssqlnative($dbparams) + function __construct($dbparams) { // Lowercase Assoc arrays define('ADODB_ASSOC_CASE', 0); // Backend constructor - $this->WikiDB_backend_ADODB($dbparams); + parent::__construct($dbparams); // Empty strings in MSSQL? NULLS? $this->_expressions['notempty'] = "NOT LIKE ''"; Modified: trunk/lib/WikiDB/backend/ADODB_mysql.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_mysql.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/WikiDB/backend/ADODB_mysql.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -29,12 +29,9 @@ class WikiDB_backend_ADODB_mysql extends WikiDB_backend_ADODB { - /** - * Constructor. - */ - function WikiDB_backend_ADODB_mysql($dbparams) + function __construct($dbparams) { - $this->WikiDB_backend_ADODB($dbparams); + parent::__construct($dbparams); if (!$this->_dbh->_connectionID) return; $this->_serverinfo = $this->_dbh->ServerInfo(); Modified: trunk/lib/WikiDB/backend/ADODB_oci8po.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_oci8po.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/WikiDB/backend/ADODB_oci8po.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -12,16 +12,13 @@ { public $_prefix; - /** - * Constructor. - */ - function WikiDB_backend_ADODB_oci8po($dbparams) + function __construct($dbparams) { // Lowercase Assoc arrays define('ADODB_ASSOC_CASE', 0); // Backend constructor - $this->WikiDB_backend_ADODB($dbparams); + parent::__construct($dbparams); // Empty strings are NULLS in Oracle $this->_expressions['notempty'] = "IS NOT NULL"; Modified: trunk/lib/WikiDB/backend/ADODB_postgres7.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_postgres7.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/WikiDB/backend/ADODB_postgres7.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -17,12 +17,9 @@ class WikiDB_backend_ADODB_postgres7 extends WikiDB_backend_ADODB { - /** - * Constructor. - */ - function WikiDB_backend_ADODB_postgres7($dbparams) + function __construct($dbparams) { - $this->WikiDB_backend_ADODB($dbparams); + parent::__construct($dbparams); if (!$this->_dbh->_connectionID) return; $this->_serverinfo = $this->_dbh->ServerInfo(); Modified: trunk/lib/WikiDB/backend/ADODB_sqlite.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_sqlite.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/WikiDB/backend/ADODB_sqlite.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -11,10 +11,7 @@ class WikiDB_backend_ADODB_sqlite extends WikiDB_backend_ADODB { - /** - * Constructor. - */ - function WikiDB_backend_ADODB_sqlite($dbparams) + function __construct($dbparams) { $parsed = parseDSN($dbparams['dsn']); if (!file_exists($parsed['database'])) { Modified: trunk/lib/WikiDB/backend/PearDB_mysql.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_mysql.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/WikiDB/backend/PearDB_mysql.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -9,12 +9,9 @@ class WikiDB_backend_PearDB_mysql extends WikiDB_backend_PearDB { - /** - * Constructor. - */ - function WikiDB_backend_PearDB_mysql($dbparams) + function __construct($dbparams) { - $this->WikiDB_backend_PearDB($dbparams); + parent::__construct($dbparams); if (DB::isError($this->_dbh)) return; //$this->_serverinfo = $this->_dbh->ServerInfo(); $row = $this->_dbh->GetOne("SELECT version()"); Modified: trunk/lib/WikiDB/backend/PearDB_oci8.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_oci8.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/WikiDB/backend/PearDB_oci8.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -10,13 +10,10 @@ class WikiDB_backend_PearDB_oci8 extends WikiDB_backend_PearDB_pgsql { - /** - * Constructor - */ - function WikiDB_backend_PearDB_oci8($dbparams) + function __construct($dbparams) { // Backend constructor - $this->WikiDB_backend_PearDB($dbparams); + parent::__construct($dbparams); if (DB::isError($this->_dbh)) return; // Empty strings are NULLS Modified: trunk/lib/WikiDB/backend/dumb/AllRevisionsIter.php =================================================================== --- trunk/lib/WikiDB/backend/dumb/AllRevisionsIter.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/WikiDB/backend/dumb/AllRevisionsIter.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -10,12 +10,10 @@ extends WikiDB_backend_iterator { /** - * Constructor. - * * @param $backend object A WikiDB_backend. * @param $pagename string Page whose revisions to get. */ - public function WikiDB_backend_dumb_AllRevisionsIter(&$backend, $pagename) + function __construct(&$backend, $pagename) { $this->_backend = &$backend; $this->_pagename = $pagename; Modified: trunk/lib/WikiDB/cvs.php =================================================================== --- trunk/lib/WikiDB/cvs.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/WikiDB/cvs.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -17,10 +17,7 @@ { public $_backend; - /** - * Constructor requires the DB parameters. - */ - function WikiDB_cvs($dbparams) + function __construct($dbparams) { if (loadPhpExtension('cvsclient')) $this->_backend = new WikiDB_backend_cvsclient($dbparams); Modified: trunk/lib/WikiDB/file.php =================================================================== --- trunk/lib/WikiDB/file.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/WikiDB/file.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -31,10 +31,7 @@ */ class WikiDB_file extends WikiDB { - /** - * Constructor requires the DB parameters. - */ - function WikiDB_file($dbparams) + function __construct($dbparams) { $backend = new WikiDB_backend_file($dbparams); $this->WikiDB($backend, $dbparams); Modified: trunk/lib/WikiDB/flatfile.php =================================================================== --- trunk/lib/WikiDB/flatfile.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/WikiDB/flatfile.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -30,10 +30,7 @@ */ class WikiDB_flatfile extends WikiDB { - /** - * Constructor requires the DB parameters. - */ - function WikiDB_flatfile($dbparams) + function __construct($dbparams) { $backend = new WikiDB_backend_flatfile($dbparams); $backend->_wikidb =& $this; Modified: trunk/lib/WikiDB.php =================================================================== --- trunk/lib/WikiDB.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/WikiDB.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -106,11 +106,9 @@ } /** - * Constructor. - * * @see open() */ - public function WikiDB(&$backend, $dbparams) + function __construct(&$backend, $dbparams) { $this->_backend =& $backend; // don't do the following with the auth_dsn! Modified: trunk/lib/WikiGroup.php =================================================================== --- trunk/lib/WikiGroup.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/WikiGroup.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -422,11 +422,7 @@ */ class GroupNone extends WikiGroup { - - /** - * Constructor - */ - function GroupNone() + function __construct() { return; } @@ -482,13 +478,10 @@ */ class GroupWikiPage extends WikiGroup { - /** - * Constructor - * * Initializes the three superclass instance variables */ - function GroupWikiPage() + function __construct() { //$this->request = &$GLOBALS['request']; $this->username = $this->_getUserName(); @@ -624,10 +617,7 @@ public $_is_member, $_group_members, $_user_groups; - /** - * Constructor - */ - function GroupDb() + function __construct() { global $DBAuthParams, $DBParams; //$this->request = &$GLOBALS['request']; @@ -854,11 +844,7 @@ */ class GroupFile extends WikiGroup { - - /** - * Constructor - */ - function GroupFile() + function __construct() { //$this->request = &$GLOBALS['request']; $this->username = $this->_getUserName(); @@ -970,11 +956,7 @@ */ class GroupLdap extends WikiGroup { - - /** - * Constructor - */ - function GroupLdap() + function __construct() { //$this->request = &$GLOBALS['request']; $this->username = $this->_getUserName(); Modified: trunk/lib/WikiTheme.php =================================================================== --- trunk/lib/WikiTheme.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/WikiTheme.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -1680,14 +1680,13 @@ */ class Button extends HtmlElement { - /** Constructor - * + /** * @param string $text The text for the button. * @param string $url The url (href) for the button. * @param string $class The CSS class for the button. * @param array $options Additional attributes for the <input> tag. */ - function Button($text, $url, $class = '', $options = array()) + function __construct($text, $url, $class = '', $options = array()) { global $request; $this->_init('a', array('href' => $url)); @@ -1714,17 +1713,16 @@ */ class ImageButton extends Button { - /** Constructor - * + /** * @param $text string The text for the button. * @param $url string The url (href) for the button. * @param $class string The CSS class for the button. * @param $img_url string URL for button's image. * @param $img_attr array Additional attributes for the <img> tag. */ - function ImageButton($text, $url, $class, $img_url, $img_attr = array()) + function __construct($text, $url, $class, $img_url, $img_attr = array()) { - $this->__construct('a', array('href' => $url)); + parent::__construct('a', array('href' => $url)); if ($class) $this->setAttr('class', $class); // Google honors this @@ -1747,8 +1745,7 @@ */ class SubmitButton extends HtmlElement { - /** Constructor - * + /** * @param $text string The text for the button. * @param $name string The name of the form field. * @param $class string The CSS class for the button. @@ -1756,8 +1753,7 @@ */ function SubmitButton($text, $name = '', $class = '', $options = array()) { - $this->__construct('input', array('type' => 'submit', - 'value' => $text)); + parent::__construct('input', array('type' => 'submit', 'value' => $text)); if ($name) $this->setAttr('name', $name); if ($class) @@ -1775,17 +1771,16 @@ */ class SubmitImageButton extends SubmitButton { - /** Constructor - * + /** * @param $text string The text for the button. * @param $name string The name of the form field. * @param $class string The CSS class for the button. * @param $img_url string URL for button's image. * @param $img_attr array Additional attributes for the <img> tag. */ - function SubmitImageButton($text, $name = '', $class = '', $img_url, $img_attr = array()) + function __construct($text, $name = '', $class = '', $img_url, $img_attr = array()) { - $this->__construct('input', array('type' => 'image', + parent::__construct('input', array('type' => 'image', 'src' => $img_url, 'alt' => $text)); if ($name) Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/WikiUser.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -61,9 +61,6 @@ } } -/** - * - */ class WikiUser { public $_userid = false; @@ -72,15 +69,13 @@ public $_authmethod = '', $_authhow = ''; /** - * Constructor. - * * Populates the instance variables and calls $this->_ok() * to ensure that the parameters are valid. * @param Request $request * @param mixed $userid String of username or WikiUser object. * @param int|bool $authlevel Authorization level. */ - function WikiUser(&$request, $userid = false, $authlevel = false) + function __construct(&$request, $userid = false, $authlevel = false) { $this->_request =& $request; $this->_dbi =& $this->_request->getDbh(); Modified: trunk/lib/difflib.php =================================================================== --- trunk/lib/difflib.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/difflib.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -508,14 +508,13 @@ public $edits; /** - * Constructor. * Computes diff between sequences of strings. * * @param $from_lines array An array of strings. * (Typically these are lines from a file.) * @param $to_lines array An array of strings. */ - function Diff($from_lines, $to_lines) + function __construct($from_lines, $to_lines) { $eng = new _DiffEngine; $this->edits = $eng->diff($from_lines, $to_lines); @@ -648,8 +647,6 @@ extends Diff { /** - * Constructor. - * * Computes diff between sequences of strings. * * This can be used to compute things like @@ -670,8 +667,8 @@ * @param $mapped_to_lines array This array should * have the same number of elements as $to_lines. */ - function MappedDiff($from_lines, $to_lines, - $mapped_from_lines, $mapped_to_lines) + function __construct($from_lines, $to_lines, + $mapped_from_lines, $mapped_to_lines) { assert(sizeof($from_lines) == sizeof($mapped_from_lines)); Modified: trunk/lib/plugin/RecentChanges.php =================================================================== --- trunk/lib/plugin/RecentChanges.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/plugin/RecentChanges.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -1088,13 +1088,12 @@ */ class NonDeletedRevisionIterator extends WikiDB_PageRevisionIterator { - /** Constructor - * + /** * @param $revisions object a WikiDB_PageRevisionIterator. * @param bool $check_current_revision * @return void */ - function NonDeletedRevisionIterator($revisions, $check_current_revision = true) + function __construct($revisions, $check_current_revision = true) { $this->_revisions = $revisions; $this->_check_current_revision = $check_current_revision; @@ -1124,11 +1123,10 @@ */ class NewPageRevisionIterator extends WikiDB_PageRevisionIterator { - /** Constructor - * + /** * @param $revisions object a WikiDB_PageRevisionIterator. */ - function NewPageRevisionIterator($revisions) + function __construct($revisions) { $this->_revisions = $revisions; } @@ -1455,9 +1453,9 @@ class OptionsButtonBars extends HtmlElement { - function OptionsButtonBars($plugin_args) + function __construct($plugin_args) { - $this->__construct('fieldset', array('class' => 'wiki-rc-action')); + parent::__construct('fieldset', array('class' => 'wiki-rc-action')); // Add ShowHideFolder button $icon = $GLOBALS['WikiTheme']->_findData('images/folderArrowOpen.png'); Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2014-07-17 16:12:36 UTC (rev 8982) +++ trunk/lib/stdlib.php 2014-07-17 16:52:49 UTC (rev 8983) @@ -812,8 +812,7 @@ */ public $anchor; - /** Constructor - * + /** * @param mixed $name Page name. * WikiDB_Page, WikiDB_PageRevision, or string. * This can be a relative subpage name (like '/SubPage'), @@ -824,7 +823,7 @@ * * @param mixed $anchor For links to anchors in page. */ - function WikiPageName($name, $basename = false, $anchor = false) + function __construct($name, $basename = false, $anchor = false) { if (is_string($name)) { $this->shortName = $name; @@ -1724,14 +1723,13 @@ */ class Alert { - /** Constructor - * + /** * @param mixed $head Header ("title") for alert box. * @param mixed $body The text in the alert box. * @param array $buttons An array mapping button labels to URLs. * The default is a single "Okay" button pointing to $request->getURLtoSelf(). */ - function Alert($head, $body, $buttons = array()) + function __construct($head, $body, $buttons = array()) { if (is_array($body)) { $html = HTML::ol(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-07-17 16:58:57
|
Revision: 8984 http://sourceforge.net/p/phpwiki/code/8984 Author: vargenau Date: 2014-07-17 16:58:49 +0000 (Thu, 17 Jul 2014) Log Message: ----------- Use __construct Modified Paths: -------------- trunk/lib/ErrorManager.php trunk/lib/WikiDB/SQL.php Modified: trunk/lib/ErrorManager.php =================================================================== --- trunk/lib/ErrorManager.php 2014-07-17 16:52:49 UTC (rev 8983) +++ trunk/lib/ErrorManager.php 2014-07-17 16:58:49 UTC (rev 8984) @@ -593,11 +593,10 @@ */ class PhpErrorOnce extends PhpError { - - function PhpErrorOnce($errno, $errstr, $errfile, $errline) + function __construct($errno, $errstr, $errfile, $errline) { $this->_count = 1; - $this->PhpError($errno, $errstr, $errfile, $errline); + parent::__construct($errno, $errstr, $errfile, $errline); } function _sameError($error) Modified: trunk/lib/WikiDB/SQL.php =================================================================== --- trunk/lib/WikiDB/SQL.php 2014-07-17 16:52:49 UTC (rev 8983) +++ trunk/lib/WikiDB/SQL.php 2014-07-17 16:58:49 UTC (rev 8984) @@ -9,7 +9,7 @@ */ class WikiDB_SQL extends WikiDB { - function WikiDB_SQL($dbparams) + function __construct($dbparams) { $backend = 'PearDB'; if (is_array($dbparams['dsn'])) @@ -25,7 +25,7 @@ $backend_class = "WikiDB_backend_PearDB_" . $backend; $backend = new $backend_class($dbparams); if (DB::isError($backend->_dbh)) return; - $this->WikiDB($backend, $dbparams); + parent::__construct($backend, $dbparams); } function view_dsn($dsn = false) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |