Find Jobs
Hire Freelancers

Convert Perl script to PHP 5.3.x

$500-2500 USD

В роботі
Опублікований over 12 years ago

$500-2500 USD

Оплачується при отриманні
We require an existing, functioning Perl script to be converted/translated to PHP. What the Perl script does: Responds to web requests, queries a MySQL database, does some processing of fetched rows, returns the result(s) in XML. Although it's just a single script, readable and fairly well-commented, it is *very* long (about 37,000 lines). Our requirements in a nutshell: 1. Translate to PHP (5.3.x). 2. Option to return results in JSON/XML/PHP Array. 3. Allow PHP script to function as a stand-alone script (as Perl script is now), or as an included class that can be called from within another PHP script. (We run certain PHP scripts as always-running daemons at the command-line -- we would like to include this new PHP module in them for better performance and bypass Apache overhead.) 4. Optimize script for better performance. (Read under Detailed Requirements for more information.) ## Deliverables As requested by some bidders, here is the actual Perl script to be translated. As you may note from the source, the script performs two main functions: 1. Receives a street address (123 Main Street, City, State) and returns a latitude, longitude pair. (geocoding) 2. Receives a latitude/longitude pair (35,-110) and returns a street address. Here are examples of how it's used via web interface: Returning XML [login to view URL] [login to view URL] Returning JSON [login to view URL] [login to view URL] As I mentioned, I want the new PHP version to be usable both as a standalone PHP script/web-service, as well as a class I can load into other PHP scripts and call upon it that way (therefore a little modularity will be required). The PHP version should be organized to be more readable/maintainable by me (since I'm a proficient PHP developer, but not at all a Perl guy). To satisfy my requirement for standalone PHP script (accepting HTTP and command-line requests) as well as "include" behaviour, I would imagine a two parts: (1) A common PHP class file that can be included in other scripts that simply returns native PHP data structure (array); (2) A PHP "wrapper" that includes the above class and accepts incoming command-line (arguments) or HTTP requests (GET), parses/filters/validates the request, and returns JSON/XML. I'm happy to to address specific questions/answers/details as they come up during development. * * *This broadcast message was sent to all bidders on Monday Aug 8, 2011 6:14:21 PM: A number of bidders have asked about the structure of the MySQL database that the Perl script (and future PHP script) queries. I've uploaded all MySQL table definitions to the project (saved with the Perl script) to help you in estimating your time. ----------------------------------------------- ADDITIONAL NOTES ON PHP IMPLEMENTATION OF PERL SCRIPT API ----------------------------------------------- As mentioned earlier, I want the same functionality as the Perl script now provides. Currently, the Perl script can accept single or multiple (batch) requests and will return results accordingly. However, the current implementation API is kind of dumb in some ways. Therefore, I would like the request/response API format updated: ------- ll: latitude longitude pair (lat/lng -> street address) sa: street address (street address -> lat/lng) fmt: Format ("json" or "xml" -- json is default) v: Verbosity of response ("1" = brief, "2" = verbose (as Perl script now returns), 1 is default) ------- --- FORMATS --- 1. GEOCODING - Get latitude/longitude from street address(es) SINGLE QUERY: [login to view URL] Somerset St E, Ottawa, ON&fmt=json&v=1 Response: {"perf":{"elapsed":0.003},"data":{"289 Somerset St E, Ottawa, ON":{"lat":"45.423733","lng":"-75.676333"},"2 New St, New York, NY":{"lat":"40.707507","sta":"-74.011255"}}} (See [login to view URL] for original implementation.) BATCH (multiple - street addresses separated by pipe (|) charcter): [login to view URL] Somerset St E, Ottawa, ON|2 New St, New York, NY&fmt=json&v=1 Response: {"perf":{"elapsed":0.003},"data":{"289 Somerset St E, Ottawa, ON":{"lat":"45.423733","lng":"-75.676333"},"2 New St, New York, NY":{"lat":"40.707507","sta":"-74.011255"}}} 2. REVERSE-GECODING - Get street address from latitude/longitude pair(s) SINGLE QUERY: [login to view URL] -75.676333&fmt=json&v=1 Response: {"perf":{"elapsed":0.003},"data":{"45.423733 -75.676333":{"stn":"289","sta":"Somerset St E","city":"Ottawa","prov":"ON","postal":"K1N6W1",cnt":"Canada"}}} BATCH (multiple - lat/lng pairs separated by pipe (|) charcter): [login to view URL] -75.676333|40.707507 -74.011255&fmt=json&v=1 Response: {"perf":{"elapsed":0.003},"data":{"45.423733 -75.676333":{"stn":"289","sta":"Somerset St E","city":"Ottawa","prov":"ON","postal":"K1N6W1",cnt":"Canada"},"40.707507+-74.011255":{"stn":"2","sta":"New St","city":"New York","prov":"NY","postal":"10005","cnt":"USA"}}} -- METHODS --- The above examples use GET, but the PHP script should allow for requests as GET, POST(1), STDIN arguments (when called from command-line), and/or native PHP array(2). Responses are JSON (default) or XML. 1. POST: When submitting a very large batch requests that exceeds GET's safe limit ([login to view URL]), the request may be sent as POST instead. 2. PHP array: When included as a class in another script, the expected request format is a native PHP array (lat/lng pairs or street addresses as elements), although this can be discussed later. (To be clear, the standalone script is basically the class(es) with a wrapper that validates/parses input and based on request format (JSON/XML) returns that. Whereas, the class itself likely just returns a native PHP array. --- CONFIGURATION --- In the future, I may want to customize the return variable names (e.g., "country" instead of "cnt") without having to dig deep into the code. Therefore, I would ask in the implementation that the response variable names be exposed, say, in a configuration header of the script/class that I can change. Modularity and readability will be greatly appreciated. --- DATABASE, PERFORMANCE --- During project, the developer will have full MySQL privileges to a development instance of the database. This will allow the developer to alter table schemas and/or indices in order to improve database performance. A bonus will be awarded for high-performance, memory-efficiency, etc. --- IMPORTANT NOTE --- NOTE: Currently, the Perl script does not explicitly indicate a USA or Canada ("cut") value in its response. This is REQUIRED of the PHP script. Also, someones, the Perl script omits the state/province. Every response that is in Canada or the USA REQUIRES state/province. Please be sure to note this during development. Thanks. * * *This broadcast message was sent to all bidders on Tuesday Aug 9, 2011 1:10:30 PM: There have been a few additional questions, for which I've added "Additional Notes" under the "Detailed Requirements" section of the Project Description. Hope this helps with your estimates and bids. I will be choosing a bid within the next two days.
ID проекту: 3490377

Про проект

15 пропозицій(-ї)
Дистанційний проект
Активність 13 yrs ago

Хочете заробити?

Переваги подання заявок на Freelancer

Вкажіть свій бюджет та терміни
Отримайте гроші за свою роботу
Опишіть свою пропозицію
Реєстрація та подання заявок у проекти є безкоштовними
Доручений:
Аватарка користувача
See private message.
$531,25 USD за 65 дні(-в)
5,0 (88 відгуки(-ів))
6,6
6,6
15 фрілансерів(-и) готові виконати цю роботу у середньому за $1 580 USD
Аватарка користувача
See private message.
$1 105 USD за 65 дні(-в)
4,9 (70 відгуки(-ів))
7,6
7,6
Аватарка користувача
See private message.
$2 125 USD за 65 дні(-в)
4,9 (214 відгуки(-ів))
7,3
7,3
Аватарка користувача
See private message.
$1 062,50 USD за 65 дні(-в)
5,0 (70 відгуки(-ів))
6,0
6,0
Аватарка користувача
See private message.
$1 700 USD за 65 дні(-в)
3,3 (24 відгуки(-ів))
5,3
5,3
Аватарка користувача
See private message.
$1 700 USD за 65 дні(-в)
4,9 (12 відгуки(-ів))
4,9
4,9
Аватарка користувача
See private message.
$1 700 USD за 65 дні(-в)
4,2 (12 відгуки(-ів))
4,6
4,6
Аватарка користувача
See private message.
$1 581 USD за 65 дні(-в)
4,9 (5 відгуки(-ів))
3,7
3,7
Аватарка користувача
See private message.
$2 125 USD за 65 дні(-в)
2,8 (16 відгуки(-ів))
3,9
3,9
Аватарка користувача
See private message.
$850 USD за 65 дні(-в)
4,9 (5 відгуки(-ів))
3,2
3,2
Аватарка користувача
See private message.
$1 062,50 USD за 65 дні(-в)
3,0 (1 відгук)
2,8
2,8
Аватарка користувача
See private message.
$1 700 USD за 65 дні(-в)
0,0 (0 відгуки(-ів))
0,0
0,0
Аватарка користувача
See private message.
$2 040 USD за 65 дні(-в)
0,0 (1 відгук)
0,0
0,0
Аватарка користувача
See private message.
$2 125 USD за 65 дні(-в)
0,0 (7 відгуки(-ів))
0,0
0,0
Аватарка користувача
See private message.
$2 125 USD за 65 дні(-в)
0,0 (2 відгуки(-ів))
0,0
0,0
Аватарка користувача
See private message.
$1 020 USD за 65 дні(-в)
0,0 (0 відгуки(-ів))
0,0
0,0

Про клієнта

Прапор CANADA
Canada
5,0
3
Спосіб оплати верифіковано
На сайті з квіт. 7, 2011

Верифікація клієнта

Дякуємо! Ми надіслали на вашу електронну пошту посилання для отримання безкоштовного кредиту.
Під час надсилання електронного листа сталася помилка. Будь ласка, спробуйте ще раз.
Зареєстрованих користувачів Загальна кількість опублікованих робіт
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Завантажуємо для перегляду
Дозвіл на визначення геолокації надано.
Ваш сеанс входу закінчився, і сеанс було закрито. Будь ласка, увійдіть знову.