Page 1 of 1

Learning PHP (for developer with Perl background)

Posted: Wed Oct 16, 2002 11:38 am
by IlyaM
Hi,

It looks like I'm going to switch from Perl to PHP for a couple of upcoming projects. So I have to learn PHP rather quickly :) . I guess learning PHP syntax should be no brainer and should not take too much time but libraries are everything. To be the most effective one should know tools.

So I have a couple questions on commonly used PHP libraries:
  1. Database interface. Is there any standart or semi-standart libraries for database access like Perl's DBI?
  2. Templating. Is there anything like Perl's HTML::Template and similar templating modules?
  3. Is there any libraries for OO persistance similar to Perl's modules described at http://poop.sourceforge.net/?
  4. How does people test PHP code? Is there any testing frameworks for PHP like Perl's Test::Harness, Test::More and friends?
  5. Anything else you think PHP newbie like me should know?
And some other questions not-related to libraries:
  1. Can anybody point me to online docs related to secure programming practices for web programs specific to PHP.
  2. What PHP community web sites are worth to visit in order to learn more?

Posted: Wed Oct 16, 2002 2:28 pm
by llimllib
I'll answer what I can:

1. Pear::DB (pear.php.net), metabase (phpclasses.org), adodb, and PHPLib are a few database abstraction classes; PHP also has very simple to use db-specific query functions. A speed comparison can be found here.

2. The smarty template engine (smarty.php.net) is the most frequently used php template engine, and the most developed, but there are many others.

3. Not to my knowledge. [but it's nice to know there's a poop.sourceforge.net]

4. I know of no test frameworks by experience, but google came up with http://phpunit.sourceforge.net/.

5. not having CPAN will bother you at first, but once you start writing code and you see how quickly you can get things done, your pain should lessen.

1a. phpadvisory.net. Also, there are no known (I'm fairly certain) exploits for PHP right now in version 4.2.3 and above; just make sure that you sanitize user input before inserting it anywhere.

2a. the whole phpdeveloper's network: they're listed across the top. Use Phuse (use.devnetwork.net) to search for answers to questions. And post here, we'll help if we can.

Good luck.

Posted: Wed Oct 16, 2002 3:40 pm
by rev
http://www.php.net/ is the best resource I have come across to date regarding PHP.

Posted: Wed Oct 16, 2002 3:47 pm
by llimllib
yeah; good calll - I should have mentioned that. PHP has the best manual of any programming language I've ever used. type php.net/function_name for reference on any function_name.