peknet :: an eddy in the bit stream         
about peknet


peknet is Peter E Karman musing on technology, politics, religion, books, beer and frequent references to my beautiful sons.

navigate

credits

Brighter Planet's 350 Challenge

Blog Directory for Saint Paul, MN

Powered by Swish-e

Valid CSS!

proud member of the
Open Source Community

© 2005 peknet dot com

syndicate this site

POST with multiple values per key

Dumb. And bad.

PHP requires that you change your HTML to indicate that an input value in a form expects multiple values. That means, your HTML needs to know what your server-side architecture is coded in.

Dumb. And bad.

Example:
<input name="foo" value="123" /> <input name="foo" value="456" />


That code above won't work in a POST to a .php script because one of the values for 'foo' will be dropped. Instead, you have to code your html like:
<input name="foo[]" value="123" /> <input name="foo[]" value="456" />


with that extra little [] bracket pair. That's just Wrong. And bad. My HTML shouldn't care what the server side language is. HTTP is HTTP. HTML is HTML. It's agnostic. Unless your scripting language is broken. Like PHP is.

File under projects/php Wed Jul 15 16:56:58 CT 2009

Unicode

PHP lacks proper and complete Unicode support.

Come on people!

File under projects/php Thu Jun 18 21:25:30 CT 2009

Closures

PHP lacks closures. That is, they are new in 5.3.

As with namespaces, PHP is Way Late to the Game.

File under projects/php Thu Jun 18 21:23:47 CT 2009

PHP ORMs

Object-relational mappers are a nice way of simplifying data store interactions, by abstracting the data model into a OO class structure. Or put another way, don't write SQL, write code that is storage agnostic.
my $thing = Thing->new( id => 123 )->load; $thing->foo('bar'); $thing->save; # # the above is mock code # representing something like: # BEGIN TRANSACTION; UPDATE table things SET foo = 'bar' WHERE ID = 123; END TRANSACTION;


I've used a couple of different Perl ORMs over the last four years with great joy: DBIx::Class and (mostly) Rose::DB::Object. Now I'm looking for a suitable PHP project for my toolbelt.

Wikipedia has a good starting list.

Some contenders include:
Xyster
Looks nice but depends on Zend Framework so a bit heavy. Handles cascading actions on related objects.
Doctrine
The most popular (or at least most-mentioned). It has its own special query language (DQL), which is a philosophical turn-off. Isn't SQL+PHP good enough? But I see the DQL is optional.
Rocks PHP Library
Ambitious. The docs make it seem a little like the Rose framework in its goals: an ORM, a Form manager, a web framework. There's a DB abstraction layer that claims to support many different db flavors. It seems pretty young though.
Propel
Mature. But it uses this external XML definition file which just seems crazy. Again, isn't SQL+PHP enough?
DABL
Based on Propel but simpler. No external XML file (+1). Uses same PDO db abstraction layer as Propel.
LightORM
I was initially hopeful about this one but it appears abandoned.
DataMapper
My co-worker turned me on to this one (thanks Sean!). I really like the looks of it so far and will be spending some quality time testing it out.

File under projects/php Thu Jun 18 20:18:09 CT 2009

PHP now has namespaces...using a backslash?

PHP finally has namespaces. Always playing catch-up as a programming language. But using the backslash as a name delimiter? WTF.

File under projects/php Sat Apr 11 10:00:27 CT 2009


Past entries: 2004 . 2005 . 2006 . 2007 . 2008 . 2009 . 2010 .