The way Eric Gach does blogging.
Archive for November, 2009
SiTech_Plugins
Nov 30th
Well, I’m finally doing it. I’m rewriting my voodoo code that makes reloadable modules or plugins in PHP. I’ve always toyed with the idea of rewriting my original work for PHP_Modules and making it work with classes; now the time has come. I have started work with my SiTech library to make SiTech_Plugins. It will be the same concept of PHP_Modules, but not only will it work with functions, it will now work with classes. This is something that was never really possible before because when PHP_Modules was written, it was written for PHP 4.
I haven’t gotten very far yet with code, but the theory of it is to create a base class with a __call() method. That’s basically all the base class will consist of. When a plugin is loaded, the class read from the plugin file will be created to extend this base class. From there, all methods found within the class will be stored as lambda functions inside a special class variable. This then makes it easy to reload code, by recreating the lambda function when the code is reloaded. Therefore, the class itself never needs to be redefined, it just needs all the functions reloaded. So, in theory this is entirely possible with PHP 5 and the use of the magic __call() method for classes.
Some of you may wonder why I don’t use runkit from PECL. While it would make things a ton easier, I wanted more of a code solution that might work for everyone without extra requirements. I might look into creating it to work both ways though. I can imagine runkit would be a lot cleaner method of doing such voodoo, but I’m also unsure if runkit will even compile with 5.3. I’ll have to do some research into that and find out for sure. Of course, there will be more to come as I make progress even if its good or bad progress.
Happy Thanksgiving!
Nov 26th
Happy Thanksgiving everyone! Just thought I’d post a quick note to say I hope everyone is getting lots of yummy food today! I’ll post more over the weekend of what I’ve been up to lately.
Life & Updates
Nov 10th
Well, its been a bit since my last post and I think its time for another update. I’m still looking for a job, haven’t had any luck finding much yet. Might have a part time job lined up until something else works out though, so that’s good
On the other hand, I’ve had some time to work on dev.php-oop.net So far its been mainly backend work, so there’s not a lot more to show for it, but I’ve taken some time to implement a new password hashing using crypt and blowfish. I’m also trying to work on the password reset form to make it work better. Currently it just resets the password, but I want it to e-mail the user, then the user must click a link before the password is actually reset.
On the other hand, my jogging is going well. I’m not keeping up with it as good as I would like, but I have managed to go as far as 3 miles in one time. I also went this past Sunday and jogged with my friend, we both ran to see how fast we could do a mile and half. I managed to run it in 12 minutes and 51 seconds! I just hope I can keep doing it and keep running further. I would like to participate in a marathon sometime soon as well. I’m also, starting this week, lifting weights with the weight set I just got moved in. I’m hoping between that and running, I can make up for the last few years of my life that I just haven’t tried anything to get into shape. Hopefully I’m making up for lost time at this point