Here’s a nice way of adding a calendar graphic to your website – use the background= attribute of html to fool the eye!
Category Archives: PHP
Savant : GettingStarted
Savant is another PHP templating engine. Here’s the getting started guide, with a nice Model-View example.
PHP best practices
These guidelines are probably worth a read no matter what your favourite language is. Many are PHP specific but I’m going to digest some of the more appetizing ones. (you can tell it’s almost lunchtime can’t you?)
Dangers of SQLite Ignorance
Aaron doesn’t explicitly list the dangers but I can guess that they include overwriting db files. I haven’t looked at SQLite yet however, it’s on the TODO list! ![]()
OK, I read the comments, it’s no more dangerous than having text files lying around, although as the file has to be writeable by the webserver that guarantees certain responsibilites when using them!
Perl and PHP Stuff
Via delicious this morning I have two titbits for your consumption!
Movable Type Ported to PHP – Apparently they’ve done what appears to be a nearly complete port of MT from Perl (bless it) to PHP. This port appears to include support for all current MT tags, it relies on Justin Vincent’s ezSQL DB library and Smarty templates, and even supports a plug-in API.
Why PHP still stinks – from a Perl coder’s perspective.
Compress Me!
This technique is an old one. Feed your content through the PHP output buffer using the gzip handler, then at the end flush it out to the browser.
Even if the text doesn’t compress well, just using the output buffer results in slightly less network traffic as the data is sent in one big blob. I have to investigate if the HTTP headers are affected yet but it seems to be working fine.
Zend in the clowns? – a history of PHP
Zend in the clowns? is a lengthly article about the history of PHP. *phew*
PHP 4.3.8 is Out! Oh, and 5.0 is too!
It’s official and everyone and their mum has the news. I’ll let SitePoint PHP Blog provide the summary!
PHP Scalability and Performance
Much more interesting than the previous one is this roundup of various blog posts and articles on PHP performance issues including a link to John’s post today. A must read for all the tips contained within!
Turck MMCache Vs PHP Accelerator
After running MMCache for a day I have mixed feelings about it.
Our site felt faster when I browsed it but when I examined the logs the results were disappointing. Hourly adviews were almost all down by up to a 25% but mostly by 10%, but for an hour or two exceeded the previous day’s ones. By the end of the day, adviews were down by almost 10% in total.
I benchmarked both applications this morning using Siege.
MMCache performed marginally better in all tests, but only by a few percent.
MMCache caused a few problems for us, mainly because it reintroduced a limitation of PHP3. In PHP3 a class or function couldn’t be defined twice, but that’s changed in PHP4. I had to go around editing php files yesterday changing include/require to include_once/require_once which fixed 99.99% of the problems.
I may try it again next week but for now, it’s back to PHP Accelerator.
Out of curiosity I attempted the same benchmark without using any cache/optimizer. I stopped it halfway through when the load average of the box hit 40. Oops.
Related links: The Joy of Turck MMCache | TikiBoosting | which php compiler cache is stable? | PHP caching and optimization