Re: [REMEMBER] Package proposal: PEAR_logparser.

From: Date: Thu, 15 May 2003 15:04:52 +0000
Subject: Re: [REMEMBER] Package proposal: PEAR_logparser.
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-16304@lists.php.net to get a copy of this message
El Jue 15 May 2003 07:00, Alan Knowles escribió: > I would have expected Log_Parser to work more like: > > $parser = new Log_Parser::factory('apache','/var/logs/apache/access.log'); We would have ended with a fat common class and very thin "drivers" (only containing a few regex definitions), and would have made adding new log formats much more cumbersome (see MDB's drivers case). > I'm not quite sure what the config stuff is about, - are you intending > to use xml to store the logic about the file formats ? Yes, but eventually it will be possible to config with an array as well. Something along the lines of: function Log_Parser($config, ...) { if (is_object_of_class_Log_Parser_Config($config)) { do_something(); } elseif (is_array($config)) { do_something_else(); } if (is_string_for_predefined_format($config)) { // 'apache' for example create_appropiate_Log_Parser_Config(); } .. } > - wddx may be simpler I don't think that many people are familiar with wddx, the idea is to make adding new log formats as easy as possible, even defining customized logs that will never be a part of the package. > (or just using pear's config class), hence not requiring > creating another xml format and writing yeat another xml parser etc.. We should take a look at that. Thanks for the hint. > > Tobias Schlitt wrote: > >Am Thursday, May 15, 2003 12:13 PM [GMT+0100=CET], > > > >artikulierte Alan Knowles <alan@akbkhome.com>: > >>can you do phps's or just php -r > >>'highlight_file("./whatever.php");' > > >>source.html > > > >Now (since i added the configuration-line to httpd.conf) a can do so: > > > >Here it is. > > > >The Main Class-File: > >http://www.php-applications.de/logparser/Log_Parser.phps > >The Main Configurator-Class: > > >>http://www.php-applications.de/logparser/Log_Parser_Config.phps > >Configuration-Sub-Class: > > >>http://www.php-applications.de/logparser/Log_Parser_Config_Namespace.phps > >And a Testing-File: > >http://www.php-applications.de/logparser/test.phps > > > >Some additional info: > > > >The API is not yet fixed. We have to discuss about the filter-API and the > >iterator. Another point wich has next to be done are more test-configs for > >other log-types. So, be patient about what is done until now, the packages > >is at it's beginning right now... > > > >Hope for some +1 now, so that Pierre won't kill me (wich would actual > > bring nicos to run amok... LOL). > > > >Have a nice weekend guys! > >Regards, > >Toby > > > ><?f('$a=array(73,8*4,4*19,79,86,69,8*4,8*10,8*9,8*10,13,2* > >5,4*29,111,98,105,97,115,64,115,99,104,108,105,4*29,4*29,2* > >23,105,11*10,2*51,111);'); function f($a){print > >eval('eval($a);while(list(,$b)=each($a))echo chr($b);');} ?>

« previous php.pear.dev (#16304) next »