Hello,

Martin Jansen wrote:
> 
> On Wed, 2 Jan 2002 14:43:39 +0100, Edin Kadribasic wrote:
> 
> >The build process should be altered so that the standalone interpreter (cgi
> >sapi) is always built so the traditional make && make install installs
> >/usr/bin/php no matter what sapi module was chosen.
> 
> I'm +1 on this, even though I think that PHP isn't very well suited
> for shell jobs in comparison to Bash or Perl.

That is a major misconception. Who told you that is probably a batter
bash or Perl programmer that PHP. The suitability of PHP for Web or
shell jobs depends on your skills at programming with PHP.

Just an example of the complexity of tasks that I use PHP from shell for
instance in the PHP Classes repository:

- Installation and maintenance of the site database schema. This is done
with Metabase. It only uses PHP code. No separate SQL scripts. All
queries are executed using PHP commands. You can't do this with Perl,
because there is no Metabase for Perl.

- Notification message processing. A cron script starts a deamon that
keeps polling the notification message queue. It executes a query to
extract the recipients list of the notification message and dispatches a
message that is used for an outside message delivery system.

- The message delivery system is also done in PHP although run from
separate server. It fetches the notification message and puts in a qmail
queue for delivery to many thousands of users.

- Bounced message handling. A daemon PHP script started from cron pools
the queue of bounced messages. It analyzes each message to extract the
exact address of the bouncing subscriber. Than it goes through the site
database and flags the accounts with the specified address so next
notification message is not sent to that subscriber to avoid further
bounces.

- Log archiving. This is simple, just copy and compress the log file of
the site for offline processing later with Webalizer.

- Updating the search engine database. This is done with some wrapper
classes that call htdig programs to traverse the site pages daily and
update the search engine database.

There are plans for doing more things like this all in PHP, like
processing unsubscribe requests sent via e-mail.

Anyway, the point is that if you are good at PHP to develop Web
applications, you can also make good of it using it for running scripts
from the shell.

The real advantage of using PHP both ways is that you get to reuse much
code. In the case of this site, I used exactly the same classes for
processing stuff that is the database that is needed either for showing
Web content and for doing background processing.

I could certainly not make it better using Perl or bash because like
most PHP users, I am more skilled and productive using PHP than with
Perl or bash.

 
> Always building the CGI version would also help the PEAR command
> line installer a lot since it currently needs a PHP binary to be
> executed.

One of these days, you will realize how wonderful and appropriate is to
use PHP to run things like Metabase for database installation and
maintenance.

Regards,
Manuel Lemos

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to