 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Havard Eide's Blog: SplObjectStorage
by Chris Cornutt July 23, 2008 @ 08:47:44
Havard Eide has a recent post to his blog that looks at a part of the Standard PHP Library (SPL) that can be used with objects to store them for later use - SplObjectStorage.
In this post I will look at SplObjectStorage: a container that allows to store objects uniquely without the need to compare them one by one.
He lets the code to most of the talking, showing how to do the standard operations for a data store - adding objects (both unique and the same), updating objects in the store, checking to see if an object is already added and removing an object from storage.
voice your opinion now!
splobjectstorage add unique update check data storage object remove
Evert Pot's Blog: PHP Arrays vs. Objects
by Chris Cornutt August 17, 2007 @ 10:27:00
Wanting to test out a new way of doing things, Evert Pot decided to write up some tests using a Value Object style of data storage versus just in arrays:
In a lot of cases arrays are used in PHP to store object-like information, like the results of a database query. I do this a lot too, but I kind of want to change things around to make use of VO's. I feel this makes a lot more sense, since most of the application I build are heavy OOP anyway, and I get all the added OOP benefits, like type-hinting, inheritance.. well, you know the deal.
In his tests he creates an array of data, a value block of three "properties", looped 1000 times) and a block of three actual properties on an object. Between each, he's using the XDebug memory usage functions to check to see which uses less resources.
Overall, there's really not that much of a difference between using either of them. So, basically, it's up to you which storage method is the simplest for you to use.
voice your opinion now!
array object memoery usage property storage method array object memoery usage property storage method
Application Development Trends: New LAMP Layer FileMaker API for PHP?
by Chris Cornutt August 02, 2006 @ 06:42:26
According to this new article from Application Development Trends today, a collaboration has been formed between FileMaker users familiar with PHP and Zend to create a new kind of API to the FileMaker system.
FileMaker's senior product manager Kevin Nathanson says that FileMaker is addressing two audiences with the API beta: existing users of the company's database software, and PHP developers looking for simpler database software than DBMSs such as MySQL.
In fact, developers have been interested in connecting this everyman database software with the popular embedded scripting language for some time, and FileMaker's PHP API has a predecessor: FX.php, an independently developed, open-source PHP class designed to pull data from FileMaker Pro using the XML output by Server Advanced for FileMaker 7 or the Web Companion for FileMaker 5 and 6.
Developers are reminded that the library is still in a beta format and that constant work is being done to enhance its functionality. You can get complete information about the library here.
voice your opinion now!
filemaker api storage simple backend zend filemaker api storage simple backend zend
Sara Goleman's Blog: What the heck is TSRMLS_CC anyway?
by Chris Cornutt June 02, 2006 @ 05:56:55
Sara Goleman, a definite specialist in the internals of PHP, has posted This new item on her blog today with details on a construct that's a bit mysterious, but pervasive in the code - TSRMLS_CC.
Those who know what this is typically answer questions from those who don't with "Don't worry about what it is, just use it here here here and here. And if the compiler says you're missing a tsrm_ls, put it there too..." This isn't laziness on the part of the person answering the question (okay, maybe it is a little bit), it's just that the engine goes so far out of its way to simplify what this magic values does, that there's no profit in a new extension developer knowing the mechanics of it. The information is like a cow's opinion, it doesn't matter, it's Moo.
Since I love to listen to myself rattle on about pointless topics (and I havn't blogged much this month), I thought I'd cover this topic and see if anyone manages to stay awake through it.
In the remainder of the post, she breaks it down into its components and explains what each means. At its base level, it helps manage the differences between code using the "Zend Thread Safety" functionality and the code that's not. To illustrate the point, she provides two examples - one with globals and one with "non-global globals". Of course, this functionality isn't any good if you can't get to the constructs you need, so she includes an example macro to accomplish just that.
voice your opinion now!
php source tsrmls_cc thread resource zend local storage php source tsrmls_cc thread resource zend local storage
|
Community Events
Don't see your event here? Let us know!
|