Ben Ramsey's Blog: Flickr Namespace and array_multisort() Issues
676865
Ben Ramsey has posted a (quick) new items over on his blog that looks at solving two problems he was having with his blog - the now non-functional Flickr feed and a sorting problem with array_multisort.   I recently upgraded a few things around here (in particular, an upgrade to PHP 5.2), and I noticed two issues that occurred after the upgrade. [...] I easily solved both of these issues.   The correction to the Flickr feed involved changing the namespace information for his request (adding a trailing slash) because the SimpleXML functionality got a bit more particular about the format.   The problem with array_multisort involved adding in a parameter that was implied in previous PHP versions, SORT_STRING, to get his code correctly working.
139742
In this new blog entry, Sebastian Bergmann talks about two bits of functionality that PHP has that bring it a bit closer to a full functional language - array_map and array_reduce.   Just like Python, PHP is not a full-fledged functional language, but it supports some very useful functional idioms such as map and reduce. A blog posting by Scott Moonen on Functional Python prompted me to write this posting on PHP's array_map() and array_reduce() functions that apply callback functions to arrays.   He includes examples of each (in the functional context) showing how you can map callbacks to the array values, one that adds one to each number in the array and the other that combines the values and returns the sum.
396172
Alexey Zakhlestin gave a talk for the PHPThinktank IRC channel recently on the topic of YAML, PHP, and some of the work that he's done combining the two.   It happened a bit of spontaneously, so noone was invited. It was my first try, to make introduction to yaml for php prgrammers, and if there is more interest I will give another talk which will cover more details, this time with proper scheduling :)   You can check out the log of the discussion for his entire talk (covering topics like what YAML is, where to get more information on it, some of its features, and a mention of the Syck library for parsing it).
277396
Lukas Smith has posted his review of a book from Packt Publishing - "PHP Web 2.0 Mashup Projects: Practical PHP Mashups with Google Maps, Flickr, Amazon, YouTube, MSN Search, Yahoo!"   Duane from Pakt asked me if I would be interested in reviewing a few books for them in my blog. I picked "Mashup Projects" from the list of just released books, since I am interesting in the topic and I am actually going to give a presentation at the internal "PHP Day" we are doing at Optaros in November.   He points out the good (good writing style, well-chosen examples) and the bad (a log list of errors and oversights in the code). He also talks about the contents of the book - the different examples and the final more major project. Overall though, he sees it as a good book, one that would be a good introduction to mashups for PHP developers (if you look past the formatting issues).
245227
In previous versions of FlickrFan you could only see today's picture downloads and code updates on the Events page. A feature request came in saying it would be nice to be able to go back in time, and I totally agreed. That's the way it works in version 0.43, released this morning. Details, screen shot.
187091
Blog: The arrival of the Yahoo Photos horde has disrupted the statistical popularity contests on display at the Flickr camera finder site.
381461
Felix Geisendorfer has a great functionality note that CakePHP users might want to check out. It's related to the Set class and how it handles nested arrays.   So far this has been a little dark spot for me in the core and from my previous quick looks at the class I've never been quite able to figure out what it's exact purpose was. Until now all I knew was "well it's probably some fancy array manipulation code that is somewhat obfuscated and undocumented". Oh boy, I wish I had spent more time on this earlier. It's probably one of coolest new features in 1.2 and nobody realizes it.   He starts with a simple example of how the class works with a nested array of user information. Normally, you'd loop through the array and append the values you'd need to another array (like the user's name), but with Set, it's as simple as calling the static "extract" method with the "path" to what you want out of the array. A simple one-line replacement for a (normally) three to four line bit of code.   He gives a few other examples using this same user information, grabbing various results and includes one at the end that is very nice indeed - pulling in an XML document, running it through a simple xmltoArray function and pulling out the titles in a few easy lines.
114906
The results of the latest International PHP Magazine are in and posted today on their site. The question this time was asking developers and visitors alike what they think sucks about PHP.   Choices included "No lexical scoping", "PEAR", and "Worst Configuration System" but one climbed to the top far above the others - "No namespacing". Trailing that at a distant second were two, getting the same number of votes - "No lexical scoping" and "Can't afford a vowel" (hmm, interesting).    Up for this week is a new poll that asks those out there that have used the Symfony framework to cast their votes about what they think is the best feature the project has included. Check it out and cast your vote today...
422149
We turned off share.opml.org yesterday, for good, as far as I know. It was a good idea, but we never got it together to make it the powerhouse I wanted it to be.  Now that Google and Bloglines both have discovery mechanisms for feeds that you might like, based on what you and others like, there would only be a future for SYO if it were a thriving and growing community, and it isn't.  Normally, I'd leave a site like that running indefinitely, but this one needed its own server, and I wanted to cut my server expenses now that my S3 bill is going up, serving some very big JPEGs and generally being the back-end for a community that is growing, the people using FlickrFan. If there's a big demand to bring it back, we can -- but that's going to require cash flow to go with it. At this point, I don't think it's a good investment for me. Still diggin!
614738
Matt Wade has posted a quick item to APress' Inside Open Source blog today mentioning an update to an item he'd previously mentioned - issues with the Zend_Cache module.   One of my complaints was the Zend_Cache did not accept lifetimes on a per object basis, but rather the lifetime was at an application level. I just received notice in my inbox that the issue has been fixed! The change is currently in svn, and should be in the 0.80 preview release. Thanks go to Fabien for the fix.   You can download this latest version of the Framework (0.7.0) from the Zend Framework website.
282970
Over on Dynamically Typed today, there's a new posting from Harry concerning Flickr (the image hosting service) and how they use PHP to enhance this service.
573906
In a new blog entry today, Matthew O'Phinney talks about updates (and refactoring) that he's done to a PEAR package he's developed, File_Fortune.   Over the past few evenings, I've refactored File_Fortune to have it implement Iterator, Countable, and ArrayAccess -- basically allowing it to act like an array for most intents and purposes. As a result, I've eliminated the need for the File_Fortune_Writer package, and greatly simplified the usage.   The package is designed to make an interface between the casual PHP user and the fortune files common on most *nix machines. To illustrate he update, he includes some code that grabs the fortune file, parses it to grab a random one and echoes them out. Also included is the save() method so you can add your own to the list easily.
416221
From the SpinDrop.us blog, there's a new tutorial on combining the power of dynamic HTML and PHP to create an image cropping script for your website.    Years ago when I was working on a photo gallery for davedash.com I got the art of making tumbnails down fairly well. It was automated and didn't allow for specifying how the thumbnail should be made. With dozens of photos (which was a lot back then), when would I find that kind of time.   Flashback to today, for my company... we want users with avatars... but nothing too large. Maybe a nice 80x80 picture. Well the coolest UI I've seen was Apple's Address Book which let you use this slider mechanism to crop a fixed sized image from a larger image.    They create a pretty slick little app, using symfony to handle the framework for the app, some Javascript in the form of Prototype to make the controls, and plenty of CSS/HTML to make it usable. You can check out the demo here.
534932
Blog: Database issues are hampering some upgrades to Adobe Photoshop Lightroom 1.1.
698334
Popular posts from PHPDeveloper.org for the past week:The Bakery: Six New Articles/Tutorials PostedEvert Pot's Blog: PHP: Arrays vs. ObjectsDevArticles: Learning AJAXInternet Super Hero: PHP: mysqli_fetch_all()David Coallier's Blog: PHP Namespaces (Part 1: Basic usage & gotchas)I/O Reader: 15 Cool Things & 12 Things to Dislike About PHPProPHP Podcast: Newscast - August 16, 2007PHPBuilder.com: Dynamic XML with PHPSite News: Popular Posts for the Week of 08.17.2007PRADO Watch Blog: PRADO Watch: Interview With Timani Tunduwani - Why I Moved From CakePHP to PRADO
562776
A different sort of abstraction layer project has been started up and has already seen a few releases - Forage. As mentioned on Rob Young's blog:    Recently I've been working on a search abstraction library for PHP called Forage. The idea is to bring to search what we've had for relational databases for quite a while, abstraction.    On Friday I put up a preview release with three backends; Solr, Xapian and Zend Search Lucene. At the moment it has the bare minimum of features but there will be more soon. In this post I'm going to talk a little about the motivation for the project and then walk through a short example.    He talks about the need for search abstraction (integration and resilience to change) before getting into an example of some code that grabs the data from an RSS feed, passes it in to the Xapian search engine and stores it before looking it over for thier search terms ("yahoo microsoft").   You can download the library if you'd like to try it out for yourself.
124078
I think I've mentioned this before but on Saturday Feb 12th I'll be talking  about the Jakarta FeedParser at CodeCon  in San Francisco.  I published an outline  of the talk on the FeedParser wiki.  I'm hoping to have a 0.5 release done before then and havepotentially another suprise in the works.