Re: [PEPr] Call for votes on Web Services::Services_IP2Country

From: Date: Thu, 20 Aug 2009 19:20:50 +0000
Subject: Re: [PEPr] Call for votes on Web Services::Services_IP2Country
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-52704@lists.php.net to get a copy of this message
Samuel ROZE - D-Sites a écrit :
1. the service URL (http://i2c.mes-stats.fr/get?ip=) seems to be provided/hosted by you, am I right ? do you think it will be something "durable", I mean will you host the service as long as you can ? It would be too bad if the service was down 3 monthes later;
It is. It'll be online for years because it is used by "Mes-Stats", my project which will be my business. ;-)
Ok, let's hope ! ;)
2. your package layout should be something like: docs/
     |_ README
     |_ LICENSE
examples/
     |_ uses.php
tests/ Services/
     |_ IP2Country.php
     |_ IP2Country/
         |_ Exception.php
         |_ Transport.php (some Services_IP2Country_Transport interface or abstract class)
         |_ Transport/
             |_ HTTP.php (class Services_IP2Country_Transport_HTTP)
             |_ SOAP.php (class Services_IP2Country_Transport_SOAP)
package.xml
For you, this package is an "I2C" package. But no. Of course, there's I2C "adapter" because it's my own project, and Services_IP2Country was created for its BUT it allows new adapters for another IP-to-Country service.
huh ? and how is this related to my layout remark ? I'm not sure what you mean but the layout above is still valid and recommended, even if you write "drivers" for various similar services that would be then another "Drivers" subdirectory in the Services/IP2Country/ directory. Transports should be URL agnostic. eg.: Services/IP2Country/Drivers/Foo.php Services/IP2Country/Drivers/Bar.php etc.. Furthermore as Mike pointed, I'm not sure it's a good idea to provide many transports for the same driver, that's just makes more code to maintain and more potential bugs to fix. You could just drop the "Transports" directory and make your drivers have a sendRequest() method.
(Currently you have all the code in the same directory and there is no package.xml.);
In fact, I want to make this file when (and if) the package is released. Because, you will send me feedback and i'll change my library ;-)
That's not a good approach, people like me that want to review your package, want to try code examples, and sometimes install the package with: $ pear install package.xml Please next time provide a package.xml at proposal time. pfm then can help when you make changes: http://pear.php.net/package/PEAR_PackageFileManager -- David

« previous php.pear.dev (#52704) next »