This is the best place to keep up to date with developments around the Elgg project.
|
Jan 15th |
Elgg 1.7's APIPosted in development | 6 comments One of the most exciting features of Elgg 1.7 is the reworked entity-retrieving API. The decision to use an array instead of function arguments might seem a bit strange at first, as not many PHP applications use this approach, but it should be familiar to any one who has used a language with named arguments or even JavaScript APIs like jQuery. I know far too much of my development time has been wasted in counting function arguments. How often have you tried to get, for example, the number of blog posts, only to have to find the get_entities() function definition, then count the number of arguments between the 'subtype' and 'count' parameters (remembering to include the defaults if you don't want to change them) just to put in a TRUE? You don't care about the owner_guid, order_by, limit, or offset parameters, so why should you have to think about them? 1.7's API changes that function call from: $entities = get_entities($type = 'object', $subtype = 'blog', $owner_guid = 0, $order_by = '', $limit = 10, $offset = 0, $count = TRUE); to: This part of 1.7 is done and ready to be used by all plugin developers. Like I previously said, though 1.7 introduces this new API, it does not break compatibility with the previous API. All the old get_entities*() functions wrap to the new API and including any previous bugs (container_guid, I'm talking about you). [Edit] One thing I forgot to mention was that these new functions are the beginning of function namespacing in Elgg. Instead of using the namespacing introduced in PHP 5.3 (because we like keeping Elgg running on as many servers as possible), we've decided to begin prefixing functions with elgg_. The biggest implication is that this will eventually allow for easier integration with 3rd party apps. In general 1.7 news, there is one outstanding issue that needs to be resolved before a beta for 1.7 will be released. For those interested, it is ticket #750, a long-standing bug for a security enhancement concerning actions. Once that is complete, a beta of 1.7 will run for a few weeks. Assuming testing goes well, 1.7 final will be released following the beta. Once again, I'd like to thank everyone for their patience and understanding with 1.7's development. The developers and Elgg administrators Dave and I have spoken to each gave overwhelming support on the decision to take a release to solidify core. I am extremely happy with the progress of 1.7, and hope to have a beta for everyone soon. |
Joshua M. 55 days ago
Great! No more pulling up reference.elgg.org just to look up the function definition to change the order of displayed result.
Diego Gallardo 55 days ago
This is great, no more Eclipse help argument functions for me! :)
Filer 55 days ago
Is there any way to backup my 20 or so users on my new network, back up their photos (maybe 100 total) and start new with 1.7 on a fresh install?
Yakiv 55 days ago
Brett, first of all, thank you for making this post. Communication from Elgg central is encouraging. And, though ticket #750 is major, it's comforting to know that this is all you're waiting on for a Beta. We are all hoping for that Beta to come out, even this week still, if possible. And it would be great if you could release the 1.7 stable before the end of this month. Thanks!
Dave H 53 days ago
Great work people!
looking forward to getting my hands on the 1.7 release.
Thanks!
Please note that development support requests will be deleted. If you are looking for Elgg community support, head over to http://community.elgg.org
Bryce Thornton 55 days ago
Very nice! I love being able to pass only the parameters I care about.