|
 |
|
 |
07-06-2005, 10:53 AM
|
#1 (permalink)
|
|
mike
Join Date: Jan 2005
Location: Ottawa, ON
Posts: 79
|
Downloading files with PHP
I'm in the process of contemplating a switch from Perl to PHP for this project we're working on. Its a document producer tool for our website - we need to host a bunch of documents in our database and when documents are uploaded in the producer tool, they automatically display on the website. I'm kind of the lead programmer on this project (OK - the only programmer) and I have a good idea how to go about doing it, but I think it would be easier to maintain down the road if I use a language with much better OO support (php). OO in Perl is weird, and I'm not going to lie and say I know how to design procedural systems well - I dont.
So my question about PHP is: how would I go about downloading files over the Internet? In Perl we used the wget() series of utilities and I'm wondering what the equivalent is in PHP4 or 5 (preferably at least PHP-4.3.xxx). I need a way to pass an HTTP or FTP URL such as http://random.website.org/path/file.pdf and have this function download the file to where I tell it, such as /var/docs/only_writable_directory/company and report back results to me.
Thanks 
|
|
|
07-06-2005, 01:52 PM
|
#3 (permalink)
|
|
Jack of all trades
Join Date: Feb 2005
Location: Los Angeles
Posts: 596
|
PHP 4's object support isn't any better than perl's just superficially easier to use. If you're definitely going to use php make sure you go with php5. Also, if you use php as the display layer, there's no reason you have to discontinue using perl for your data gatthering needs. The database and file system can act as the glue between the languages in your application.
__________________
Stop intellectual property from infringing on me
|
|
|
07-06-2005, 04:07 PM
|
#4 (permalink)
|
|
mike
Join Date: Jan 2005
Location: Ottawa, ON
Posts: 79
|
After more reading I agree about the object support in PHP4 - bleh. I'd definately install PHP5, I'd just have to be really careful, I dont want to be the IT guy who screws up the webserver
Its now a tossup between PHP5 and Java Servlets - I like the type safety of Java but I like the easy configuration of PHP. I'm laying out the design solution now then I'll pick a language based on how much OO I'll actually need.
One more question - if anyone knows, how is the support for polymorphism in PHP5?
|
|
|
07-06-2005, 04:29 PM
|
#5 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,446
|
PHP5 has a lot more OO support than PHP4, but it is still not a strongly typed language. Wouldn't this mean that polymorphism isn't really anything to consider with PHP?
And as for the java servlet thing, .. I think PHP is by far a more efficient tool to develop, deploy, and maintain web applications with. ( especially if you come from a perl background ) .. Just opinion though =)
__________________
Mike
|
|
|
07-08-2005, 10:50 AM
|
#6 (permalink)
|
|
Jack of all trades
Join Date: Feb 2005
Location: Los Angeles
Posts: 596
|
Actually if you're looking for a language with the power of perl but good object features, you should check out Ruby. In Ruby everything even strings are objects. Also many people are saying good things about the web framework for Ruby called Ruby on Rails.
__________________
Stop intellectual property from infringing on me
|
|
|
07-08-2005, 11:00 AM
|
#7 (permalink)
|
|
Newbie
Join Date: Jun 2002
Location: Denmark
Posts: 1,694
|
Man, It's been ages since I last used Ruby... It kinda reminds me of ADA.
|
|
|
07-08-2005, 11:03 AM
|
#8 (permalink)
|
|
Jack of all trades
Join Date: Feb 2005
Location: Los Angeles
Posts: 596
|
Quote:
|
It kinda reminds me of ADA.
|
Cool and top secret?
__________________
Stop intellectual property from infringing on me
|
|
|
07-08-2005, 11:23 AM
|
#9 (permalink)
|
|
mike
Join Date: Jan 2005
Location: Ottawa, ON
Posts: 79
|
Quote:
|
Originally Posted by teknomage1
Actually if you're looking for a language with the power of perl but good object features, you should check out Ruby. In Ruby everything even strings are objects. Also many people are saying good things about the web framework for Ruby called Ruby on Rails.
|
I want something that people can understand after I leave. If I had it my way I would just write my CGI's in C++ and download some Apache mods to keep the binary cached in the server.
Anyways this projects out the window for a while, some jerk rooted our server and deleted our website 
|
|
|
07-08-2005, 11:25 AM
|
#10 (permalink)
|
|
Newbie
Join Date: Jun 2002
Location: Denmark
Posts: 1,694
|
Nah, rather that everything is it's own object, only difference is that in the ADA object style, everything has it's own semaphore.
|
|
|
07-08-2005, 11:31 AM
|
#11 (permalink)
|
|
Newbie
Join Date: Jun 2002
Location: Denmark
Posts: 1,694
|
Quote:
|
If I had it my way I would just write my CGI's in C++ and download some Apache mods to keep the binary cached in the server.
|
If you like, I have some cool routines written in C, which fetches any POST or GET value and gathers it in a 2Dvector like structure.
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -8. The time now is 11:22 PM.
|
Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
|
 |
|