PHP Powered IRC Services?

So. For awhile, I’ve been thinking of doing something. I probably really won’t have the time to do it, but I figure i might as well get it on “paper” and perhaps inspire someone to either join forces with me or do it themselves.

PHP Powered IRC Services.

Hmm. IRC stands for Internet Relay Chat. It’s basically a type of server that users can connect to. Then a user can join channels, which are in layman’s terms, a chat-room.

Well, in order to have ownership of nicknames/accounts and channels, you need to have a set of services to enforce it. For example ChanServ would be incharge of channel ownership and stuff like that while NickServ or AuthServ would be the services incharge of nickname or account ownership.  Read more about it on Wikipedia.

Okay, well. 90% of  the IRC Services software packages is written in some variant of C. C is a very good foundation for this kind of software deployment. But what about PHP? PHP, at least for me, is a lot easier to write in, mostly because of I’ve had many more years of experience in it. But think about it.. if you run it in PHP and use a mySQL database (or something similar) you can very, very, very easily integrate it into a website. Also, PHP doesn’t need to be compiled, just save changes and run it.

So, some caveats. Nonterminating PHP scripts tend to make the HTTP daemon apache freak out and consume a lot of CPU. However, you could use something like httplite, I suppose. Secondly, PHP isn’t the most secure environment and allows for a lot of ‘bad style’ of programming to be done without caring too much.

Also, I’d like to address PHP’s socket extension. In order for this whole thing to work, the PHP script would have to connect via a socket connection to the main server hub in the IRC network and it would have to act like another server. This would require the script to talk to the hub in a SERVER-to-SERVER protocol, rather than a USER-TO-SERVER protocol like regular IRC clients do. This is a protocol that I am not used to, so I’d have to read up on it. Also, PHP socket extension is still in the experimental stages of development.

I know every C programmer and IRC services package developer that is reading this is probably freaking out and pulling their hair out at the mere idea of a PHP powered package, cursing at me in languages they didn’t even know they knew. Well, it’s time to do something new.. if everybody did everything the same way, the world would be a boring place.

And it’s also just to see if it can be done. What’s wrong with experimentation?

Leave a Reply