Re: Yapircl vs PhpSmartIRC - comparison
| From: | Mirco MEEBEY Bauer | Date: | Wed, 18 Dec 2002 21:23:40 +0000 |
| Subject: | Re: Yapircl vs PhpSmartIRC - comparison | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-11746@lists.php.net to get a copy of this message | ||
Geir Torstein Kristiansen wrote:
I believe that constructive discussion with real technical arguments can be made. For example what is the pros & cons of X implementation of feature Z compared to imlementation Y. I would be the first to admit that my design/implementation of feature Z is suboptimal if I can be convinced why another approach is better.If you want to do a constructive discussion, then we can do that. The first email sound like a Marketing Campaign from M$ :)
Im interested in how you plan to handle multiple connections in SmartIRC for example. You mean 2 bots running from 1 script? If you mean that, I will not support that kinda thing, because PHP is already not the best choice for doing much socket and IRC stuff, the main problem is that it doesn't have any thread features, which makes is almost impossible for doing more than one connection with reasonable runtime speed.If you need 2 bots, do 2 seperate scripts using SmartIRC :)
I wrote correct me if I am wrong, which points? I never stated that this was a neutral comparison, far from it. Im not sure what I overlooked here. ok here it comes :)-------------------------
It should be noted that SmartIRC is GPL while Yapircl is licenced under the php license. But I would say from looking at the code that they take a very different approach.Wrong, phpSmartIRCclass _is_ GPL, whats comming in PEAR is SmartIRC, its a modified and new release (PEAR version) of phpSmartIRCclass, and it is LGPL which is allright with PEAR. This was discussed on this mailinglist About the approach you are right, I read already some parts of your code and its completly different approach, but the goal/objective is almost the same.
What Yapircl has that SmartIRC has not:
Normal message queue/Priority message queueSaying that SmartIRC doesn't has this, is wrong: It has a message queue, I am using a sendbuffer for that, but I don't have no real prorities, just: send the message _now_ or put it in queue
Proper message throttling like IRCu, means it can first burst 5 messages then 2 messages each second after that. Throttling can be turned off temporary or permanently with setUseQ()Saying that SmartIRC doesn't has this, is wrong: I call that floodprotection, so the client doesn't get kicked from the server, SmartIRC also has it called senddelay() default is to send 2 messages per second.
YapirlBot class for looping a server list and reconnecting forever with increasing timeouts if connecting is unsuccessfull.This will be included in the first SmartIRC release, in phpSmartIRCclass its not at the moment, its already on the official taskscheduler. See here: http://sourceforge.net/pm/task.php?group_project_id=24683&group_id=60664&func=browse
Details about Yapircl mainloop/timersystem If Yapircl is used to connect to one server only: It will call socket_select() with the time to the next timer expires as the usec argument so it will sit idle until there is either socket activity or the timer should run.same with phpSmartIRCclass
Win32 compatability SmartIRC calls usleep() this will not work on win32 (Yapircl used to do this too)eerrr, it _only_ does use the usleep() _if_ the php build has _no socket_ extension. I also allow running with older fsocks, which is for compatibibly better than Yapircl. Yapircl runs only with socket extension, if the php build doesn't has it, Yapircl cannot be used. About that usleep(), it will _not_ break anything, it will just be ignored without a "sleep" from windows, which results a higher CPU usage, because of running very fast through the loops without "stops" (only when using fsocks). So this is not a Win32 compatability problem. Just a performance thing on windooze, at least it will run on win32 without socket extension, Yapircl not at all.
Correct me if I am wrong on any of these points. I am not familiar with the SmartIRC code.I correct you, like you requested it :) Whats more interessting is the goal of the IRC class, I don't know your, here is mine: An IRC API without knowing the IRC protocol at all, don't read a IRC RFC or whatever. That means no direct IRC calls at all. A good documentation for developers, understanding the easy API. The class can be used for IRC bots, webchats and also for getting IRC statistics and display it on a webpage (the last one I think is not so easy in Yapircl, with SmartIRC its 1 method call) Clean and optimized code with 100% OOP, as much PHP allows me todo... So whats your main goal? Mirco Bauer aka MEEBEY PS: about its good having "competition": "Competition" means both players will try to have all the features and pros of the other player plus more which will end in wrong directions....