<?php # $CVSHeader$ # Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. # All Rights Reserved. See copyright.txt for details and a complete list of authors. # Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. error_reporting(E_ALL); require_once 'irclib.php'; echo '$Id: split_logs.php,v 1.3.4.1 2005/01/01 00:12:42 damosoft Exp $', "\n"; if ($argc < 2) { echo "\nUsage: {$argv[0]} filespec[s]\n\nExamples:\n\n{$argv[0]} tikiwiki.irc\n{$argv[0]} tikiwiki.irc php.irc\n{$argv[0]} /home/me/irclogs/tikiwiki.irc\n{$argv[0]} /home/me/irclogs\n"; exit; } for ($i = 1; $i < $argc; ++$i) { IRC_Log_Parser::splitFiles($argv[$i]); } echo "Done.\n";
/** * \static */ function splitFiles($f) { if (is_dir($f)) { $dh = opendir($f); while ($f2 = readdir($dh)) { if ($f2 == '.' || $f2 == '..') { continue; } if (is_dir($f2)) { IRC_Log_Parser::splitFiles($f . '/' . $f2); continue; } } closedir($dh); return true; } if (!is_readable($f)) { printf("Can't read '%s'\n", $f); return true; } printf("Reading '%s'\n", $f); return IRC_Log_Parser::splitFile($f); }