10 posts tagged “pear”
Frequently, I check out code from CVS and I want to know who worked on it before. For example currently I am porting a PEAR package to PHP5 and would like to change the license in the process.
In order to do this, I need the consent of all people who have been involved.
The command to the rescue is "cvs rlog <module>", season it with a little bit of grep, sed, sort and uniq (Thanks, helly!) and it works easily:
cvs rlog pear/Net_DNS | grep -e 'date:.*author:.*' | sed 's,.*author:\([^;]*\).*,\1,' | sort | uniq
Wee - rapidly approaching the 1.0, I kicked out a the 0.7.0 release of HTTP_Session2 (tag) today.
What's new you ask?
- Memcache support
- Many fixes in the containers
- Documentation fixes
To upgrade:
To install:pear upgrade HTTP_Session2
Make sure your PEAR is semi up to date. :-)pear install HTTP_Session2
Here are some updates from my personal PHP-world from January of 2008.
Writing tests
Tests are hip, tests are cool. Lately everyone does it. So I looked at phpUnit and phpt. So far phpt wins for simplicity, though I am sure phpUnit has its use cases as well (and there is this awesome tool called phpUndercontrol puts all your tests, docs and CruiseControl into shiny graphs). But for now I am sticking to phpt to cover some packages with tests. For a dead-simple entry to the phpt-world, check this: http://qa.php.net/write-test.php
For starters I will write a test with phpt for Net_CheckIP2; and see how that works out.
I can haz article
I got published in this month's php|architect. Woohoo! I wrote an article about RoundCube (which by theway is the coolest webmail on the planet). Thanks again to Steph Fox from php|architect for the opportunity and her über-patience, ... and for correcting my name online.
(Surprisingly someone managed to put an Umlaut (ä) into my name but still screwed up on Till vs. Tim.)
RoundCube
In other RoundCube-related news - no, RoundCube is not dead. Development struggled a bit last year since the project's future seemed not so bright for a while but we made it past that and current
ly work on merging my devel-vnext back branch into trunk. The steps are to apply patchsets from trunk; rc1 to rc2 and then rc2 to current trunk. What a load of work. Argh. :O I hope I can write up another post (as a status report) on Monday.
Writing documentation
Documentation is just as sexy as tests are. At least that's another trend. And that's good because some of PHP seems to move away from a PHP-script-kiddy-image to more thoroughly well-tested and well-documented applications (or packages for that matter). I also managed to write some docs for HTTP_Session2. Woohoo! Thanks to everyone who helped out.
Which reminds me that I need to roll a new release of HTTP_Session2 as well and include Thorsten Roehr's awesome additions. (Sorry for not getting to it earlier!) Also speaking of HTTP_Session2. I am currently using it to handle sessions on a small cluster (three servers) and we handle 4Mbit/s on average. It's working pretty well!
Along with HTTP_Session2 the Contact_Vcard_* packages are due for a new alpha.
Services_Plazes
During plazecamp (early January, 2008), I wrote an API wrapper for the plazes.com-REST-api. It's called Services_Plazes and a PEAR-style package and soon to be proposed (once I get those sexy docs and tests done). And someone's using it already.
That's all, kidz.
After I posted my File_S3 proposal on Wednesday all hell broke loose yesterday. In the process it turned out that the code I originally used to build this class is obviously by Caesar D. Rodas (who also commented on my blog entry) and got pretty upset - I can understand.
Follow the discussion:
- http://www.nabble.com/-PEPr--Proposal-for-File-System%3A%3AS3-tf4949599.html
- http://www.nabble.com/-PEPr--Comment-on-File-System%3A%3AS3-tf4953679.html
Last night I managed to get in touch with my project manager at that time, at that company and he strongly believed they (the company) owned all IP on the code and he was even more surprised when I told him about the mess it had gotten myself in. Of course this also blows for them, since they obviously got ripped off in the process.
As always - there is a lot to learn from open source, the number one lesson is, "If you don't have a clean track record of code, don't use it!". Though this is sometimes not as black and white as one would like.
Two thoughts of the moment:
- a search engine for code and fuzzy checksums
- I see why certain companies like CLAs
- ... and a third: I need coffee!
UPDATE, 2007/12/07 8:00 AM: Make sure to check the comments, James and Adam offer valuable advice!
For a couple weeks now we kept on saying that we need a checklist of what we need on a server in order to make the site run - now since we setup the neato bonito cluster last week the checklist all of the sudden had a higher priority and I took an hour or so to create that last night.
In the process I used a nifty code snippet by Adam Harvey, to do my PEAR package checking and basically added a loop through get_loaded_extensions() and a shell_exec('cd /foo && svn info') to make it complete. Now season the script with with some CSS, and you have your very own phpChecklist and got yourself some piece of mind.
All this code snippeting and code snippet formatting in VOX is not as trivial as I would like - so anyway, I am sure you get an impression of what I mean.
Just added my File_S3 proposal to PEPR.
Check it out, give it a wirllllll - gimme feedback:
http://pear.php.net/pepr/pepr-proposal-show.php?id=519
So basically what this package allows you to do is, you can open/write/delete files and directories (aka buckets) directly into Amazon S3 referencing it by paths like s3://my_fancy_bucket/file.
And thanks to Darshan from easybib who pretty much sponsors my time on anything pear-related right now.
This morning I rolled another release of HTTP_Session2 and uploaded it to PEAR. So what can you use HTTP_Session2 for and what's new in this release?
The usage question was pretty simple for me, at my current one and only gig we run four web servers behind a loadbalancer and since I'm not a fan of NFS shared storage and writing to it I decided that we could utilize our database powerhouses to store our session data. The other option is what commonly in the cluster-loadbalancing-context is referred to as stickyness, which means that a user is kept on one server during the session, but this adds more load on the loadbalancer itself and it defeats the scalability and hot-failover thing for me.
So this is where HTTP_Session2 comes in and saves the day - I must add, that it's a pretty easy drop-in replacement for regular session calls and works like a charm.
HTTP_Session2 currently supports PostgreSQL and MySQL(i). Except for the garbage collection, which is (oddly) very database specific, others backends should work as well, but we had no time to test that yet.
What's new in 0.6.0?
- We decided to remove the MDB and Creole containers
We felt no one was using either one since MDB is very old and almost everyone is using either DB or its successor MDB2. And for Creole - no idea. I toyed with it briefly at my last job but didn't really fall i love with it. So if you are a Creole user and happen to be using HTTP_Session2, I'll revert and you can maintain it. ;-) - Added the new MDB2 container
- Fixed smaller bugs and lots of CS
- Change stability to beta.
- Develop a PDO or Doctrine container to move to PHP5 completely.
- A File container/driver to for example store sessions on NFS without getting rid of HTTP_Session2 calls. ;-)
If you deployed HTTP_Session2 as well, I'd like to hear from you. Contact me at till-at-php-dot-net, or comment. I am pretty sure that in terms of stability it's more than beta code since I use it myself and we sometimes push 4+ mbit of traffic on the site, but all feedback is welcome.
Just read an email that the Zend Framework got a PEAR Channel server.
You can check out this "project" here:
http://code.google.com/p/zend/
This is what makes opensource so worthwhile. Since Zend refused to set one up, the community is helping itself.
PEAR for the win!
So I am finally picking up work on my Services_ProjectHoneyPot proposal again. Primarily cleaning up the last code and rolling a package file so people can try it out and then get the voting process going - already! It's been idle far too long.
In the process I also need to check my Net_CheckIP2 code into CVS. Somehow I was really hoping PEAR moved faster on Subversion so I could technically skip on its CVS.
I've only been involved in PEAR for a really short period of time. But one of the things I can say already about PEAR is, that there are really great people contributing to the project and I am very glad I get to know many of them and they allow me to dip into their experience and wisdom. A very helpful bunch indeed.
One of the people from PEAR, who I did chat the most with in the last months was Bertrand Gugger aka toggg. He had been helping me - mentoring so to speak - to settle in on PEAR. And we shared stories about Berlin and whatever else there was.
Though we briefly exchanged hello's last night, I just learned that he died this night from a hearth attack.
Rest in peace, you will be missed. :-(
Update: