Re: Re: RFC Postal Routing Package - example

From: Date: Wed, 22 Dec 2004 10:53:38 +0000
Subject: Re: Re: RFC Postal Routing Package - example
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-35222@lists.php.net to get a copy of this message
Hi Matt, Matt K wrote:
*/home/daniel/public_html/postrouting/classes/ParcelRoute.php* on line *59)*
dammit - thanks :)
I've only had a very quick look at the code. But is this going to be tied to sqllite, or will you be using DB or similar abstraction?
It will be tied to sqlite - it is also php5 only. This because the package also handles the import of the data - this are (for germany) ~1 400 000 rows in several tables. I will also provide the shelscript for table creation and the import. Because the loose typing of SQLite the import script doesn't have to take care of column datatypes. SQLite also easily supports creating an entire database and copying it over the production version (updates 4x/year in germany). This is important as I think it will not make any sense to try to update the rows. So each new version shipped by DeutschePost creates a new database which is copied over the old one.
Any chance of more 'human-readable' names for the _pathXn() methods? OK, they're private, but it'd help people writing drivers for other countries to keep straight exactly what they're doing.
Basically those methods will always be country (shipping company) specific. I think in the end only the public methods (resolve(), getResult(),...) will be declared by the API. Everything else depends on the driver. I took the _path.. approach because Deutsche Post provides a 2 page flowchart which describes how to start and what to do if you get 2 results, etc.. So this resolve process is basically the implementation of the flowchart. So it's possible to find an address, find out that this address is archived (old), take the new address and start again. I'm sure computer scientists have a smart word for this kind of flow control :) Long story short - the whole resolve path looks totally different in other countries. So no common approach will be possible inside the driver.
Be very careful to escape user input before feeding it to the DB - I'm not familiar enough with sqllite to know if it provides prepare() and placeholders. If it does, that's the way to go, if not DB::quote() would help.
I used sqlites native escape functions IIRR - but I'll review it.
Can I use this to just enter the post code and retrieve the available address info (town, street and range of house numbers, ...)?
You mean roundtrip? (decoding) Yeah - has to be done - shouldn't take more than 30 minutes :) Thanks again. -- Daniel Khan Technische Leitung Geschäftsführender Gesellschafter Ventigo Werbung . IT . Marketing GmbH Kornstrasse 10 4060 Leonding T. +43 (0) 732 37 09 60 | F. +43 (0) 732 37 09 60 10 http://www.ventigo.com | office@ventigo.com

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