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.
This is one of those problems that has been solved, but, it's been solved in incomplete ways so many times that these not-too-useful answers outnumber the useful answers, totally messing up web searches. This consequently seeds the idea that this is an intractable problem! Even at stackoverflow, they say it's really tough.
This is the opposite of so-called "collective intelligence". It's collective stupidity.
Here's a snippet of PHP code that displays a block if a node has a specific term. You set up the block to display based on the result of PHP code.
WOW! I never thought ZenCart and it's parent, OSCommerce, could ever be redeemed. These are great products with really unpleasant code. Hacking these apps is a nightmare.
Now, someone's come along with a big replacement to ZenCart called ZenMagick. I just skimmed over it, and the code is much better. The product attaches to ZenCart and exposes and OO API to the underlying database.
traditional PHP or ASP One day, I wish I can write this in PHP
while( $filename = $files->next() )
{
[ $a, $b, $c, $d ] = getimageinfo($filename);
$sizes[] = [ $filename, $a, $b ];
}
Attached are two scripts that contain code for two styles of iterator. One is the traditional Iterator, and the other is what I'll call an IterObj.
A few years back, there was a trend in the PHP community to make alternative templating languages that ran inside PHP.
This page will describe the difference between GET and POST, and the typical uses for each.