View Full Version : ASP ecommerce site to PHP
ecnarongi
06-15-2004, 05:09 PM
SOB!!!! :mad:
My merchant gave me a component to connect to their gateway but it is a dll. And in order to use the dll I have to register it on the server. BUT my host doesn't allow this and from the emails I sent to numerous other host no one does. So I either get a new merchant (flush $400) or a new host (my contract is up this month) and learn a new language.
I am not completely new I know C, Perl and UNIX and I have dabbled in PHP before. BUT, this is insane since this site has taking me a long time to code in ASP (maybe not as long as I think doing it part time plus making all graphics and going through about 3 layout designs already).
I am basically announcing my conversion to the Dark Side. And I need a little assurance that this will not take more than a weekend to convert 20K lines of code :D
Spookster
06-15-2004, 11:52 PM
If you know C and Perl then learning PHP should not be difficult. PHP closely resembles a cross between C++ and Java so your C knowledge will carry through to that. There is a little Perl-ish type code as well.
Converting a large ASP site to PHP in one weekend can be possible assuming you have a team of developers and a large supply of caffeine and sugar. :) 20k lines of code is not really all that much, of course my opinion on that is biased since I work with software that contains a few million lines of C code.
The easiest way to convert an application from one language to another is just go through the software and write out the logic and then apply that logic to the next language. Basically write out a bunch of pseudo code in plain english then insert in the code for the particular language you want.
carl_mcdade
06-16-2004, 07:53 AM
I have used this ASP2PHP (http://asp2php.naken.cc/news.php) on a couple of large forum scripts written in ASP. It works gangbusters. It's no perfect but the trouble shooting takes a lot less time than the row for row translation of ASP to PHP. Depending on the size ofthe app you can be up and going in a week. The week is because you will have to decompile that dll and translate that VB to PHP code also.
I make contributions to this guy also. He has saved my butt a dozen times in the last year that I have been going from ASP to PHP.
If you want to start from scratch you can use a helper program like PHPmaker (http://www.hkvstore.com/phpmaker/) which I recommend over making a large purchase of Dreamweaver MX or any of the Interakt products. PHPmakers code is not beautiful but it is customizable without having to know anything about the API, unlike DWMX which writes overly verbose MM code and the IDE controls too much of what happens.
I'd recommend recoding it by hand.
- 20K lines realy isn't that much;
- if you recode it (first extracting the logic and then rewrite it in PHP like spookster indicated, not the line by line translation) then the codinglogic will probably be cleaner and tighter then your current code;
- if written quite some ASP and PHP code, and PHP has some realy nice function that ASP lacks. Support for mailing, image creation, hashing, using arrays, composing output by concatinating it to a string, db-interaction etc etc is far better in PHP then in ASP.
So the recoding probably woun't take a weekend, but if possible, i'd use this opportunity to maybe revise some features and use the PHP goodies that will come available to you.
ecnarongi
06-16-2004, 05:06 PM
thanks fellas,
I have a friend who went to PHP from ASP like 3 weeks ago and he is doing some amazing things. But I also have a friend who is C#ing it in ASP.net and he is going nuts, it might just be the new exciting language thing that is motivating these guys.
Spookster I know both C++ and Java (I used to teach both) so I guess I won't have a problem, and that is a good thing. :D
I am dyslexic but my site is Nucking Futs, and when I run into a problem I will consult you guys. Too bad this weekend is going to be beautiful in NYC, and I might get torn away from covering all I can in PHP :p
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.