Some themes add a copyright notice using a technique also seen in hack scripts. They take the PHP code, and the base64 encode it, and gzip it.
One of the big problems with PHP is the include statement. You can include a file. You can define that file at runtime, and alter it during runtime.
Here's a way to cache data on the client side, via javascript. This was tested on Firefox 3.6.3 on Ubuntu.
The idea is to convert your data into Javascript, and then load it with the SCRIPT tag. You then use the Expires HTTP header to tell the client how long to cache the data. Finally, you use some Javascript code to display the data.
Here is something I can't understand The CodeIgniter Loader class.
It's just weird. When you load a class, it's instantiated and made an attribute of the $this object. That has a real "Javascript" feel to it.
Beyond that, I think class loaders sometimes obfuscate where the included files reside. That might seem okay, or even "cool", but I find it annoying.
The old Slaptech framework had the old PHP includes problem, where one cannot to include() a file relative to the current file.
This small alteration to the PHPList code will produce better line breaks.
sendemaillib.php:
$text = preg_replace("/<\/p\s*?>/i","<\/p>\n\n",$text); I was messing around with some textual analysis, trying to figure out how to do a "related articles" feature in Drupal.
A few years back, method chaining got to be all the rage, and now it's common.
This was ripped from a patch I made to ZenCart to deal with malicious uploads. It was stripped from a class, and it should probably be worked into pretty much any uploader class.
HPHP Initial Comment
HipHop what you need to know
HPHP appears to be a significant product: a PHP compiler that compiles down to native binaries, saving time and CPU. It produces a monolithic, multithreaded binary.
A nice side effect could be that sites using HPHP would be a harder to hack. For one, you could never upload and execute a PHP script, because PHP is not running on the server.
HipHop leverages a simple fact of PHP-life: most of your code doesn't change. Even in a project with ongoing bugfixes, only a small number of changes are deployed. So, once the app's done and ready to be run full-time, it should really become a compiled application. HipHop is the compiler.
How many times has this wheel been reinvented? According to Google searches, not enough - because I couldn't find a good one. Over the years, I've definitely build this wheel a few times, so, here goes again. This is a lot better than the stock nl2br() function.
The attached code and test files show it off, and only a description follows.
Rlib is a report writing engine that takes report specifications in an XML language. It emits reports in several formats including HTML and PDF.
I stumbled across RLIB while figuring out how to implement some MS Access report writing features in PHP. MSA users will know what writing a report is, but PHP coders probably don't, so I'll explain.
A couple years back, I used a technique to simplify code that iterates over an array and displays it as a table.
The Glassfish server includes a Ruby and Rails implementation.
There's a Java Python that's well established.
Iterators are one of my favorite language features or design pattern. They're a feature that, when done correctly, basically vanishes.