Using classes in command-line php3
| From: | Donald Undeen | Date: | Fri, 11 Aug 2000 16:23:16 +0000 |
| Subject: | Using classes in command-line php3 | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-11352@lists.php.net to get a copy of this message | ||
Hi there all,
I'm writing an emailing script that needs to run from the command line,
activatedby a cron job.
The server I'm using is still on php3.
My script works fine when I run it from a browser, but when I try to run
it command line,
at the first class instance it comes to, it says:
Fatal error: Function call to a non-function (student) in
functions.php3 on line 51
(I removed the html markup for legibility)
That line is:
$student = new student($student[ID]);
it's the first place where it comes across a class.
I even made a tiny script, test.php
<?
class stuff{
function stuff($shit){
echo "$shit\n\n";
}
}
$stuff = new stuff("hey!");
?>
and I get the same error, though it runs fine command-line.
I haven't seen this issue addressed in any of the mailng list, on
php.net, or phpbuilder, so maybe someone out there know how to get this
to work.
my last resort is to bug the hosting company to upgrade( i know it works
in php4), since they don't know me from adam.
Anyone know a workaround for this? I've tried using lynx from the
commandline, but I get timeout errors, since the job takes a while.
(which is the whole reason for needing to do it nightly, instead of when
the user clicks "send").
thanks in advance
Don undeen
dundee@gator.net