filter拡張モジュールは必要か?

そうですよねぇ。。。
個人的な意見はhttp://www.doyouphp.jp/tips/tips_filter.shtmlの最後にも書いてますが、通常のvalidatorとして使うことはそう多くないと思います。たとえば、メールアドレスのvalidatorでマッチングさせるパターンを替えたい場合、そう簡単ではない(コードを書き直して再build)からです。使うとしても、php.iniの設定であるfilter.defaultやfilter.default_flagsの方ではないかと思っています。まあ、こちらもすでに関数化やライブラリ化をしていることがほとんどと思いますが。
にしても、Filter以外にもuploadprogressとか「PECLにするメリットや意図」が見えないモジュールが増えてきた気がします。PHP本家のコア開発者はどういう方向に向かってるんでしょうか?
Hardened PHP Projectで有名なStefan Esserは、自分のブログ「PHP Security Blog」にて、Filterエクステンションの有効性について疑問を投げかけています。
Microsoft Junction
リンクの作成は、次のような感じです。*nixと指定が逆なことに注意。
Windows 2000 and higher supports directory symbolic links, where a directory serves as a symbolic link to another directory on the computer.
C:\temp>junction test d:\home\shimooka
Junction v1.04 - Windows junction creator and reparse point viewer
Copyright (C) 2000-2005 Mark Russinovich
Systems Internals - http://www.sysinternals.com
Created: C:\temp\test
Targetted at: d:\home\shimooka
C:\temp>dir test* /ad
ドライブ C のボリューム ラベルは Win2K です
ボリューム シリアル番号は AC99-4A67 です
C:\temp のディレクトリ
2006/12/27 13:29 <JUNCTION> test
0 個のファイル 0 バイト
1 個のディレクトリ 1,211,977,728 バイトの空き領域
C:\temp>cd test
C:\temp\test>dir *.gif /w
ドライブ C のボリューム ラベルは Win2K です
ボリューム シリアル番号は AC99-4A67 です
C:\temp\test のディレクトリ
member_point_shopping_d.gif
1 個のファイル 1,963 バイト
0 個のディレクトリ 14,227,918,848 バイトの空き領域
C:\temp\test>便利なのは便利ですが、エクスプローラから見ると本当のフォルダと区別が付きません。間違ってフォルダ側を消す人続出の予感。。。
XML_Feed_Parser 1.0.0リリース

今まではPEAR::XML_RSSでしたが、今後はこれでしょうかね?RSS0.9x/RSS1.x/RSS2.0/Atomに対応しているようです。
ということで、http://www.doyouphp.jp/sample/sample_xml_pear_rss.shtmlを元ネタに(RSS1.0/2.0だけですが)ざっと試してみました。以下コードです(手抜きだ。。。)。
XML_Feed_Parser is a parser for (the various) RSS and Atom format XML feeds. It attempts to provide a somewhat unified API while still allowing access to the full details of each feed type.
<?php
require_once 'XML/Feed/Parser.php';
?>
<?php
function buildFeedList($url) {
$source = file_get_contents($url);
try {
$feed = new XML_Feed_Parser($source);
} catch (Exception $e) {
die($e->getMessage());
}
$version = $feed ->version();
printf(
'<h1><a href="%s">%s</a>のヘッドライン</h1>',
$feed->link,
mb_convert_encoding($feed->title, mb_internal_encoding(), 'auto')
);
echo '<ul>';
foreach ($feed as $entry) {
switch ($version) {
case 'RSS 1.0':
$dt = date('Y/m/d H:i',$entry->date);
break;
case 'RSS 2.0':
$dt = date('Y/m/d H:i', $entry->pubDate);
break;
default:
$dt = 'no data';
}
printf(
'<li>[%s] <a href="%s" title="%s">%s</a></li>',
$dt,
$entry->link,
mb_convert_encoding($entry->title, mb_internal_encoding(), 'auto'),
mb_convert_encoding($entry->title, mb_internal_encoding(), 'auto')
);
}
echo '</ul>';
echo '<hr/>';
}
buildFeedList('http://d.hatena.ne.jp/shimooka/rss');
buildFeedList('http://www.phppro.jp/news/rss.php');$entry(XML_Feed_Parser_xxxxElementクラス)に各feedのマッピング情報を持っているようなので、日付とかは同じAPIで取り出したいなぁ。使い方がマズイのかな。。。
PLAYSTATION 3(60GB)
なにげにAmazonで「在庫あり」だ。でも、PS2を買い換えたいな。。。

- 出版社/メーカー: ソニー・コンピュータエンタテインメント
- 発売日: 2006/11/11
- メディア: Video Game
- クリック: 408回
- この商品を含むブログ (436件) を見る