[dev] [cvs] commit: ansel/lib api.php

Chuck Hagenbuch chuck at horde.org
Mon Jul 3 12:25:19 PDT 2006


Quoting Michael Rubinsky <mike at theupstairsroom.com>:

> OK.  What confused me, in  _ansel_saveImage, the $gallery_id parameter
> is, I now see, assumed to be the gallery id (datatree_id) *unless* the
> gallery doesn't exist yet.  Then, it is passed to Ansel::createGallery
> which uses it as the gallery_name (share name) to use when creating
> the gallery.

Ah. I agree that's confusing.

> My thought is that we should remove the code from _ansel_saveImage
> that creates the gallery if it does not exist and return a PEAR_Error,
> in other words, require a valid gallery_id when saving an image...and
> now that there is a _ansel_addGallery() in the api, we really aren't
> losing any functionality.  I don't believe IMP allows you to create a
> gallery when importing image attachments, but I'm not sure about any
> other apps yet...

The counterargument is that RPC calls are inherently slow or  
inconvenient or resource intensive or etc. It's often a goal to  
minimize them - instead of calling lots of little remote methods, one  
big remote method, while not terribly elegant, is generally better.

On the other hand it's not like we're requiring one call to create the  
image and another to save it; presumably gallery creation won't be as  
frequent as image saving.

As best I can tell with grep, the images/saveImage call is only used  
in IMP, and there's no use of the gallery creation option there, so if  
no one else speaks up in favor of it, I'm okay with removing it.

-chuck

-- 
"we are plastered to the windshield of the bus that is time." - Chris


More information about the dev mailing list