2013年2月27日水曜日

pukiwiki-1.4.7_notb.tar.gzをphp5.4.12で動作させる

index.phpのerror_repotingをコメントアウトして入れ替える

lib/func.php
hex2binの修正、コメントアウトでもいいんでないか?
if(! function_exists('hex2bin')){
function hex2bin($hex_string)
{
// preg_match : Avoid warning : pack(): Type H: illegal hex digit ...
// (string) : Always treat as string (not int etc). See BugTrack2/31
return preg_match('/^[0-9a-f]+$/i', $hex_string) ? pack('H*', (string)$hex_string) : $hex_string;
}}


あとは参照渡しにしているところが色々エラーはいてるので治す。
全部見るのがめんどいのでとりあえずまるっと置換したけど、今のところ大丈夫っぽい。
重要なwikiではないのでこれでよしとするw
何かあったらまた対応する。

以下メモ、適当にやったのでよく覚えてない。
こんなのに時間かけていられない。

Deprecated: Assigning the return value of new by reference is deprecated in
532行目辺り
$config = &new Config('AutoLink');
の&を取る

Only variable references should be returned by reference
Only variables should be passed by reference
lib/convert_html.php
$body = & new Body(++$contents_id);
&をとる
$obj = new Paragraph('', $class);
&をとる

& $obj
& new
とにかく&を取る

Call-time pass-by-reference has been removed
plugin/ls2.inc.php 69行目
&をとる


lib/init.phpのなんだっけか