valiant : Do you know under what conditions the G2EmbedDiscoveryUtilities::getG2EmbedPathByG2Uri autodiscovery will definitely fail (eg different sub-domains, ...) ? I would like to provide a guide to the users of Drupal's gallery.module (and other integrations) as to what will not work and so when manual config will be required.
One of the gallery.module users reported the following errors:
Error 111: 'Connection refused' - fsockopen(): unable to connect to x.x.x:80 in /var/www/html/drupal_directory/modules/gallery/G2EmbedDiscoveryUtilities.class on line 164.
Thanks for the excellent code -- it makes the integration so much easier.
Posts: 1378
Kiz,
We test for both starting with G2EmbedDiscoveryUtilities::getG2EmbedPathByG2Uri then followed by G2EmbedDiscoveryUtilities::getG2EmbedPathByG2UriEmbedUriAndLocation.
The first will fail on a shared hosting (clustered) environment because the IP addresses could be different, the later will fail on certain apache virtual directories setups and subdomains.
Between both you should get a pretty good coverage..
I am just about to setup a common API forum for these type of questions on the GalleryEmbedded site..
Wordpress Gallery2 Plug-in Downloads, Documentation & Support Gallery Embedded Community Site
Posts: 32509
maybe we should then have a 3rd method which calls first the ByG2Uri and then if that fails the other one. at least we should have code snippets how it is usually used.
Posts: 32
I don't have anything to add as a fix, but just wanted to say that in my testing I've seen getG2EmbedPathByG2Uri fail on Powweb's servers. I think it has something to do with what Ozgreg is saying. I attributed the failure to the way Powweb has their servers setup for load balancing, eg. the machine that serves up the page isn't necessarily the machine the script resides on.
Posts: 1378
I seen the getG2EmbedPathByG2Uri fail before which is why we went back to having both.. The combined api to cover both would be a great approach.
I have opened up a new forum on the GalleryEmbedded community site to handle API queries and about to link it to a mailing group as well so you can reply / post / see posts by email..
http://galleryembedded.com/forums/index.php?f=38
Wordpress Gallery2 Plug-in Downloads, Documentation & Support Gallery Embedded Community Site