PHP

HPHP: HipHop from Facebook

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.

Convert Text to HTML PHP Function

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: report generation engine

Rlib is a report writing engine that takes report specifications in an XML language. It emits reports in several formats including HTML and PDF.

Visit RLIB

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.

Inserting Breaks Into a Stream of Values (turning lists into tables)

A couple years back, I used a technique to simplify code that iterates over an array and displays it as a table.

All Your Applications Are Belong to Us

The Glassfish server includes a Ruby and Rails implementation.

There's a Java Python that's well established.

More on Iterators and Iteration

Iterators are one of my favorite language features or design pattern. They're a feature that, when done correctly, basically vanishes.

Turn URLs into Links Without Affecting Existing Links (and a gripe about collective stupidity)

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.

Drupal PHP Block Visiblity by Taxonomy Term (Category)

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.

ZenMagick - THANK YOU

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.

PHP verus ASP.NET versus LISP, all in PHP

There's more than one way to do the same thing...
traditional PHP or ASP 

PHP list and array....

One day, I wish I can write this in PHP

while( $filename = $files->next() )
{
   [ $a, $b, $c, $d ] = getimageinfo($filename);
   $sizes[] = [ $filename, $a, $b ];
}

An Argument Against the Traditional Iterator

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.

Simple Templating Language in PHP

A few years back, there was a trend in the PHP community to make alternative templating languages that ran inside PHP.

HTML Forms and $_POST, a Simple Templating Script

This page will describe the difference between GET and POST, and the typical uses for each.

Syndicate content