Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
PHP関数を使用してそのようなことを行うためのばかげた長いコード(約50行)を見つけたので、もっと良い方法があるに違いないと思いました。
その後、いくつかの検索の後、unix の「find」および「tail」機能について知りました。
$lines = `find . -name "error_log" -exec tail '{}' +`;
ただし、サーバーがダウンしているためテストできませんが、これは機能しますか?
編集:期待どおりに動作しています。
OK、サーバーが復旧しました。問題なく動作しています。recursiveiterator などは必要ありません。