Introductions. Tim McGuire, Dan Cain, Steven Eisenmenger, Brent Stineman, Dan Carnegie, Ken Riley, Mark Roeberg
Thanks to Steven Eisenmenger for organizing the space at Minnesota Public Radio.
Brent Stineman passed around examples of visibone foldouts on Javascript, Regular expressions, and HTML. They looked useful. One quote I noticed on the Javascript one: "Javascript has more kinds of nothing than any other language."
Steven Eisenmenger talked about the decision at Minnesota Public Radio to go with PHP.
Brent Stineman gave a brilliant presentation about user defined session management in PHP
- Brent used PHP with Microsoft SQL Server to help develop forum software at turbine games, the developer of Asheron's Call . Go there to test out the forums. I'm glad I visited because I hadn't yet heard about the November monster corpse change.
- Asheron's Call forums get millions of hits per month and this required an array of load balanced servers. By Default, PHP stores the session information in a text file in the file system and does not make it available to all the servers in the array.
- The solution is to use a database to store session information. To get this to work, he had to overwrite the native PHP functions and rebuild all the session handling functions.
- He didn't find much documentation about this process in books or on the net. There was an bunch of buggy code passed off as an article on PHP builder. According to Brent and many people that posted comments the posted code caused segmentation faults and was unusable. Brent found better info in a sessions article by Tobias on zend.com
- One way to tell PHP that you want to use user defined session handling functions is to alter php.ini
- Altering php.ini will disable the default session handling capabilities of PHP. You don't have to alter php.ini, however. You can simply call the session_set_save_handler () function in your code to tell PHP that you are defining your own session handling.
- The session_set_save_handler has as arguments your list of names for functions that must be recreated in your code.
- Brent used these names:
- pg_session_open
- pg_session_close
- pg_session_read
- pg_session_write
- pg_session_destroy
- pg_session_gc
- PHP still calls these functions in its normal session handling routines. For example, you still use session_register and session_start, but these functions call your user defined functions instead of the normal built in php functions. So pg_session_gc (garbage handling) is still called on the interval you define in php.ini but if you create an empty pg_session_gc function, then there will be no garbage handling at all. Once you leave the default way of handling sessions, all functionality is up to you.
- One hangup Brent had that took his crew a long time to figure out was that pg_session_read() must always return NULL.
- One another problem Brent found is that when they let PHP assign the session_id, they couldn't get rid of the value PHP assigned to the session when it started even though they wanted to use one stored in the database. So they had to write the code to generate their own session id with an md5 hash. This gives the user more power since they can construct the session_id to a composite value and use various parts of this value for different purposes.
- Brent said most of these aren't open to changing over to objects because the mechanism that calls these are "outside of normal run-time" and it would be pretty hard to tell PHP that the functions it is looking for are now methods of an object.
Finally, we had a few words about how to build snapshotting into a Linux system:
Method for taking file system snap shots. It allows incremental snapshots of complete file systems without multiplying the storage space as one would expect. This using rsync and GNU cp on inexpensive (or expensive:) ) Linux/Unix boxes. I haven't had a chance to put it in place, but the concept is cool especially not having to buy a Net Appliance or similar. http://www.mikerubel.org/computers/rsync_snapshots/
Allie says: Another way to do this sort of thing is with rdiff-backup: http://rdiff-backup.stanford.edu/ It keeps a current mirrored copy (with librsync) and diffs for every file. Uses a minimum amount of storage for complete historic recovery and is simple to use.

